The glb_mesh.py module#
Summary#
Convert polygon faces to triangles using fan triangulation. |
|
Collect mesh prims from a USD stage. |
|
Convert one USD mesh prim into GLTF mesh/node entries. |
Description#
Mesh geometry conversion helpers for GLB export.
Module detail#
- glb_mesh.triangulate_faces(indices: list[int], counts: list[int]) list[int]#
Convert polygon faces to triangles using fan triangulation.
- glb_mesh.iter_usd_mesh_prims(stage: Any) list[Any]#
Collect mesh prims from a USD stage.
- Parameters:
- stage
Any The USD stage to traverse for mesh prims.
- stage
- Returns:
list[Any]A list of USD mesh prims found in the stage.
- glb_mesh.convert_mesh_prim_to_gltf(prim: Any, gltf: Any, scene: Any, builder: ansys.tools.visualization_interface.backends.usd.web.glb_builder.GLBBuilder, texture_cache: dict[tuple[str, str, str], int], image_cache: dict[str, int], sampler_cache: dict[tuple[int, int], int]) None#
Convert one USD mesh prim into GLTF mesh/node entries.
- Parameters:
- prim
Any The USD mesh prim to convert.
- gltf
Any The GLTF object to which the mesh will be added.
- scene
Any The GLTF scene to which the mesh node will be added.
- builder
GLBBuilder The GLBBuilder instance used for constructing the GLTF.
- texture_cache
dict[tuple[str,str,str],int] A cache mapping texture identifiers to GLTF texture indices.
- image_cache
dict[str,int] A cache mapping image file paths to GLTF image indices.
- sampler_cache
dict[tuple[int,int],int] A cache mapping sampler settings to GLTF sampler indices.
- prim