Voxel resolution of convex hull on mesh


I would like to know how to change the value of the voxel resolution parameter for the convex decomposition of an imported mesh in python code. I can do it manually when I launch my simulation app in a non-headless way, but I would like to set it directly in my python script and I can’t seem to figure it out… That way I can obtain a more precise point cloud from my simulated Lidar.

(Don’t know if this forum is the right place to ask that question)
Thank you!

Hello! you can directly use the USD attribute API with the param name: physxConvexDecompositionCollision:voxelResolution.
prim.CreateAttribute(attribute_name, Sdf.ValueTypeNames.Int, 50000)

For any USD attribute, you can always hover over it in the properties pane to see its attribute name and type.

It is recommended to use the usd schema API to get/set attributes whenever available though:

from pxr import PhysxSchema

cvx_prim = PhysxSchema.PhysxConvexDecompositionCollisionAPI.Apply(prim)
1 Like

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