Skip to content
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

Export only the mesh of select bodies #24

Open
zfergus opened this issue Sep 1, 2021 · 0 comments
Open

Export only the mesh of select bodies #24

zfergus opened this issue Sep 1, 2021 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@zfergus
Copy link
Member

zfergus commented Sep 1, 2021

Creating a feature request from an email I received:

We are simulating the bouncing sphere inside of a closed boundary, so we input multiple mesh files (including the mesh of the surrounding boxes, and the mesh of the sphere). Is there a way to only output the mesh file we are interested in? (we only want the output mesh to contain the sphere, not the surrounding constraints).

My reply:

Unfortunately, exporting each input shape individually is not implemented. The reason being that all shapes are concatenated together and simulated as one large shape with disconnected components.

Probably the easiest way for you to implement this feature is as a post-process of the exported OBJ files. I would for each OBJ: load the OBJ, separate the mesh into disconnected components, save the component you want. The order of components should be consistent with the input order of shapes and is consistent throughout the simulation. The "complicated" part is splitting by disconnected components, but luckily libigl has some functions for this or PyMesh has a single function that does exactly this.

Alternatively, I think it would be easy to keep track of which vertices/faces belong to which input shape and modify IPC to export the components individually. If you are comfortable with C++ and want to try adding this feature to IPC it would be welcomed. Otherwise, I think it is worth my time to add this, but I don't know when I will have time to get to it.

This should help me keep track of the feature request.

@zfergus zfergus added the enhancement New feature or request label Sep 1, 2021
@zfergus zfergus self-assigned this Sep 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant