newton.usd.get_tetmesh#
- newton.usd.get_tetmesh(prim)[source]#
Load a tetrahedral mesh from a USD prim with the
UsdGeom.TetMeshschema.Reads vertex positions from the
pointsattribute and tetrahedral connectivity fromtetVertexIndices. If a physics material is bound to the prim (viamaterial:binding:physics) and containsyoungsModulus,poissonsRatio, ordensityattributes (under theomniphysics:orphysxDeformableBody:namespaces), those values are read and converted to Lame parameters (k_mu,k_lambda) and density on the returned TetMesh. Material properties are set toNoneif not present.Example
from pxr import Usd import newton import newton.usd usd_stage = Usd.Stage.Open("tetmesh.usda") tetmesh = newton.usd.get_tetmesh(usd_stage.GetPrimAtPath("/MyTetMesh")) # tetmesh.vertices -- np.ndarray, shape (N, 3) # tetmesh.tet_indices -- np.ndarray, flattened (4 per tet)
- Parameters:
prim (Usd.Prim) – The USD prim to load the tetrahedral mesh from.
- Returns:
A
newton.TetMeshwith vertex positions and tet connectivity.- Return type: