pygfx.utils.load.load_mesh

pygfx.utils.load.load_mesh(path, remote_ok=False)

Load mesh(es) from a file.

This function requires the trimesh library.

Parameters:
  • path (str) – The location where the mesh or scene is stored. Can be a local file path or a URL.

  • remote_ok (bool) – Whether to allow loading meshes from URLs. Default is False.

Returns:

meshes – A list of pygfx.Meshes.

Return type:

list

See also

load_scene

Loads the entire scene (lights, graph, etc.) from a file.

Examples

Show STL File via gfx.show

Show STL File via gfx.show

PBR Rendering 1

PBR Rendering 1

Lightmap

Lightmap

Ambient occlusion

Ambient occlusion

Sponza Scene

Sponza Scene