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

Consider adding assert_convex to mesh specification #1384

Open
scpeters opened this issue Mar 21, 2024 · 0 comments
Open

Consider adding assert_convex to mesh specification #1384

scpeters opened this issue Mar 21, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@scpeters
Copy link
Member

Desired behavior

The //mesh/@optimization attribute is being added in #1382 with recognition for 3 values of the attribute:

  • "" (empty string): no mesh optimization is done
  • convex_hull: use the convex hull of the specified mesh
  • convex_decomposition: decompose the mesh into convex sub-meshes (using parameters from //mesh/convex_decomposition)

It could also be useful for a user to specify assert_convex when they believe a mesh is convex and that an error should be raised if it is found to not be convex. Verifying this would require code from gz-common (or similar) to get the mesh data for analysis, so it couldn't be added directly to sdformat, but it could be useful for some users.

There is a use case for wanting to specify both assert_convex and convex_hull (a user may want to use the convex_hull optimization with a mesh known to be convex since it may consolidate triangle faces into larger polygon faces), so I would suggest a new attribute //mesh/@assert_convex.

Alternatives considered

Instead of a new attribute, the assert_convex behavior could be specified in //mesh/@optimization.

Also, I've mentioned this as a potential use case, but I'm not sure how much user demand there actually is. The convex_hull option may be adequate, combined with a CLI tool in another repository for evaluating how close to convex a given mesh is.

Implementation suggestion

Additional context

Thanks to @SeanCurtis-TRI for suggesting the assert_convex name and discussing this potential use case.

@scpeters scpeters added the enhancement New feature or request label Mar 21, 2024
@azeey azeey moved this from Inbox to To do in Core development Apr 24, 2024
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
Status: To do
Development

No branches or pull requests

1 participant