gazebosim / gazebosim/sdformat

Consider adding `assert_convex` to mesh specification

Open
#1,384 2 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
C++
Stars
216
Forks
125
Avg merge
1d 14h
Merged PRs (30d)
14

Description

## Desired behavior

The `//mesh/@optimization` attribute is being added in https://github.com/gazebosim/sdformat/pull/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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.