The usd_export.py module#
Summary#
Convert an arbitrary string to a valid USD prim name. |
|
Return |
|
Convert raw tessellation data to USD mesh arrays. |
|
Export a design’s tessellation to a USD stage file. |
Description#
Provides USD export utilities for PyAnsys Geometry.
Module detail#
- ansys.geometry.core.plotting.usd_export.sanitize_usd_name(name: str) str#
Convert an arbitrary string to a valid USD prim name.
USD prim names must match
[A-Za-z_][A-Za-z0-9_]*.
- ansys.geometry.core.plotting.usd_export.unique_name(name: str, existing: set[str]) str#
Return
nameor a de-duplicated variant if it already exists inexisting.
- ansys.geometry.core.plotting.usd_export.raw_tess_to_usd_mesh_data(raw_tess: dict) tuple[list[tuple[float, float, float]], list[int], list[int]]#
Convert raw tessellation data to USD mesh arrays.
- Parameters:
- raw_tess
dict Raw tessellation as returned by
Body.get_raw_tessellation(). Keys are face/edge IDs; values are dicts with"vertices"(flat float list),"faces"(VTK connectivity[3, i, j, k, ...]), and"is_edge"(bool).
- raw_tess
- Returns:
tupleA 3-tuple of
(points, face_vertex_counts, face_vertex_indices):points: list of(x, y, z)float tuples.face_vertex_counts: list of ints (all 3 for triangulated meshes).face_vertex_indices: flat list of vertex indices.
- ansys.geometry.core.plotting.usd_export.export_design_to_usd(design: ansys.geometry.core.designer.design.Design, path: pathlib.Path, tess_options: TessellationOptions | None = None) None#
Export a design’s tessellation to a USD stage file.
- Parameters:
- design
Design The design to export.
- path
Path Output file path. Must end with
.usda,.usdc,.usdz, or.usd.- tess_options
TessellationOptions|None, default:None Tessellation quality options.
Noneuses the server default.
- design