How to get object geometry properties in a scene?

I have loaded randomized primitive objects in a scene using replicator API. What I want to do is to be able to get the SDF information of the scene created.

For this, my thought process is to be able to somehow convert the primitive object of type [omni.replicator.core.create.cube or something similar] to a mesh object which is readable by open3D for me to compute SDF.

I have the following questions:

  1. To be able to convert replicator primitive shape to open3D mesh object
  2. If that’s not possible, then a better way to generate shapes in Isaac Sim which can be converted to open3D mesh objects
  3. If conversion is not possible, then a way to obtain SDF information for a given object within isaac sim itself.
    I am trying to achieve all this through Python API.

Any help would be greatly appreciated.

Hi @abalram1 - The Omniverse Kit and Isaac Sim do not currently provide a direct way to convert a primitive object created with the Replicator API to an Open3D mesh object. However, you can use the USD API to export the scene to a .usd or .usda file, which can then be converted to a format that Open3D can read, such as .ply or .obj.

Here’s a basic example of how you might do this:

from pxr import Usd, UsdGeom

# Assuming 'stage' is your UsdStage object
UsdGeom.Mesh.Get(stage, '/path/to/your/mesh').GetMesh().Export("your_mesh.usd")

# Then, you can use a tool like usdcat to convert the .usd file to .ply or .obj
# usdcat -o your_mesh.obj your_mesh.usd

You would then use Open3D to read the .ply or .obj file.

As for obtaining SDF information within Isaac Sim itself, the PhysX extension provides a way to compute SDFs for triangle meshes, which can be used for collision detection. However, this is not directly accessible through the Python API and is used internally for physics simulation.

If you need to compute SDFs for use in your own algorithms, you would likely need to use a separate library or tool that provides this functionality, such as Open3D or PyTorch3D. You would export your scene or mesh as described above, then load it into the other tool to compute the SDF.