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

Add mesh simplification attribute to <mesh> #1380

Closed
wants to merge 2 commits into from
Closed

Conversation

iche033
Copy link
Contributor

@iche033 iche033 commented Mar 13, 2024

🎉 New feature

Implemented proposal in #68

Summary

Adds a new optional attribute called simplification to the <mesh> sdf element. This allows users specify a method for simplifying the mesh, e.g.

<collision name="my_collision">
  <geometry>
    <mesh simplification="convex_decomposition">
      <uri>path_to_complex_mesh</uri>
    </mesh>
  </geometry>
</collision>

Also updated the Mesh DOM class to include this new attribute.

Checklist

  • Signed all commits for DCO
  • Added tests
  • Added example and/or tutorial
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • Consider updating Python bindings (if the library has them)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers

Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining Signed-off-by messages.

@iche033 iche033 requested review from azeey and scpeters as code owners March 13, 2024 01:29
@github-actions github-actions bot added the 🎵 harmonic Gazebo Harmonic label Mar 13, 2024
Copy link

codecov bot commented Mar 13, 2024

Codecov Report

Attention: Patch coverage is 90.00000% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 92.42%. Comparing base (ff9b3ad) to head (64d7c97).
Report is 1 commits behind head on sdf14.

Files Patch % Lines
src/Mesh.cc 90.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##            sdf14    #1380      +/-   ##
==========================================
- Coverage   92.42%   92.42%   -0.01%     
==========================================
  Files         134      134              
  Lines       17751    17771      +20     
==========================================
+ Hits        16406    16424      +18     
- Misses       1345     1347       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

src/Mesh.cc Outdated
@@ -30,6 +30,9 @@ using namespace sdf;
// Private data class
class sdf::Mesh::Implementation
{
/// \brief Mesh simplification method
public: std::string simplification;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe use a enum here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added enum in 64d7c97


<attribute name="simplification" type="string" default="" required="0">
<description>
Set whether to simplify the mesh using one of the specified methods. Values include: "convex_hull", "convex_decomposition". Default value is an empty string which means no mesh simplification.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could it make sense to add a sentence, a link or a reference to what these methods mean?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

expanded this to include description for the values. 64d7c97

@@ -1,5 +1,12 @@
<element name="mesh" required="0">
<description>Mesh shape</description>

<attribute name="simplification" type="string" default="" required="0">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm trying to decide if simplification is the right name for this attribute.

Alternatives (which might not be better):

  • //mesh/@transformation
  • //mesh/@convexity

with candidate values:

  • use_convex_hull
  • use_convex_decomposition

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think transformation is generic and would be another good candidate. So we don't limit this to just creating convex meshes

@iche033
Copy link
Contributor Author

iche033 commented Mar 14, 2024

replaced by #1382 -> main

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🎵 harmonic Gazebo Harmonic
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants