How can I get deformable mesh information such as tet_positions or tet_indices?

Hi, I’m working on the deformable object mesh, and I want to extract deformable mesh.

For example, I need to save collision or simulation mesh in the picture as .obj / .STL file format.

I checked this code could returns points and indices info, but the dimensions are not matching.

deform_path = "/World/Cube"
prim = get_current_stage().GetPrimAtPath(deform_path)
deformable_body = PhysxSchema.PhysxDeformableBodyAPI(prim)
collision_mesh = np.array(deformable_body.GetCollisionPointsAttr().Get())

CollisionIndices = deformable_body.GetCollisionIndicesAttr().Get() # (1 X  23252)
CollisionPoints = deformable_body.GetCollisionPointsAttr().Get() # (3 X 1928)

I thinks size of the CollisionIndices must be 1928, but I have no idea why the size is different.

1. Can you explain the relationship between CollisionIndices and CollisionPoints?
2. How can I get tet_position and tet_indices of deformable object mesh? I want to select only exterior point cloud using tri_indices which is calculated from tet_indices.

This is what I made using CollisionPoints, showing thatCollisionPoints` works well.
3

Thank you.

Hello,
collision indices are point indices, 4 for each tetrahedron.
collision points are the actual vertices of the tet mesh, being referenced by the indices. Note that vertices are typically referenced by all adjacent tetrahedra.
We don’t provide a ready made solution to extract the surface from the tet-mesh (PhysX has one in c++), but you can for example build a set of all triangles (going through all tetrahedra, and add all four triangles) to the set (sorting the vertex indices before adding), and if it’s already in the set, remove it instead. This will leave all the surface triangles, and you can then check which vertices are referenced, and remap.
Hope that helps!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.