-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does sapien support generate mesh with texture of an actor? #53
Comments
I am not sure what you mean by generating. If you mean getting or exporting mesh and texture, there is partial support in the dev branch and you need to build from source. |
Is there now an easier way of exporting a mesh? I plan to adjust the lower and upper limits in the urdf file. Next, I want to export the edited mesh. |
I do not get how limits are related to meshes. They are completely different things and should be handled independently. But if you want to export meshes, you can use external libraries such as trimesh. |
I am having troubling trying to get a reference to the mesh. I was reviewing the camera.py file, and it appeared the mesh just pop up in the scene. To export it, I need a way of referencing it |
You can construct an external mesh object such as trimesh.Mesh from the vertices and faces you read from SAPIEN. You have mentioned you are able to get the vertices, so you should have the things you need. |
I dont have access to the vertices. I was trying to get them through the RenderGeometry class, but there isnt a constructor or a way of making an instance of it. |
I see what you want here. If you load the URDF file into SAPIEN, you can access the render bodies of individual links. And the RenderGeometry will be attached to those render bodies. |
I apologize, but I do not see how I can get the RenderGeometry. In the documentations, I can not find any classes or methods that reference or return an instance of RenderGeometry. I can see that the links of the mesh are of the class KinematicLink, but I do not see how this will help me. Perhaps, I am looking at the wrong individual links. |
KinematicLink inherits the ActorBase class. And here is the method |
However, I still cannot understand your use case. If you can describe what you are trying to achieve more clearly, I may be able to give suggestions. |
I will tryout the linked method tomorrow. We just want to use the partnet dataset from sapien. However, the downloaded meshes are all in a particular state e.g. “closed oven”. We also wanted the mesh of an “opened oven” which required editing the urdf, rerendering, and exporting the mesh. |
I see. In that case, you should note that the vertices of RenderGeometry will always be the same no matter what angles you give it, since SAPIEN uses meshes in the local frame. To get the desired "combined mesh" in the global frame, you need to read the poses of links in SAPIEN, and then apply the corresponding transformations to the the vertices. (You can get the vertices from SAPIEN, or by using some other geometry processing libraries) |
Hi @llamcpp, I am also interested in extracting a mesh for the "open state" of PartNet Mobility objects from SAPIEN. Were you able to figure out how to do that? |
No, I am not that good with coding and did not figure it out. Additionally, the direction of my project changed so downloading the meshes was not needed anymore |
Okay, got it! @fbxiang do you have a pointer to an example of the approach that you described? i.e. apply the corresponding transformations of links to the vertices in a PartNet mesh. In theory this has to happen somewhere in the SAPIEN code to get the final articulated rendering, right? Thank you! |
Here is a use case where the render shapes of a link are converted to to a mesh in world space. |
Thanks, this pointer was super helpful! I ended up just using the function |
@jazcollins I am trying to extract a mesh with appropriate textures that I can save as .obj file after performing random articulations on a shape. Do you know how to go about this? Or does sapien already have a function that saves the mesh from the scene? |
Hi @arnabdeypolimi, The function get_mesh_for_art that I linked above can let you extract the mesh and save it as an .obj file after performing a random articulation. As far as I know the meshes are untextured though, so you may need to figure out to retain that information from the original mesh. |
Hi I'm trying to get mesh with texture after loading urdf object in SAPIEN. I find in docs that we could generate point clouds. Does SAPIEN support generating mesh with textures?
Thanks!
The text was updated successfully, but these errors were encountered: