dimforge / parry

2D and 3D collision-detection library for Rust.
https://parry.rs
Apache License 2.0
557 stars 97 forks source link

Add MassProperties computation for triangle meshes #16

Closed sebcrozet closed 1 year ago

sebcrozet commented 3 years ago

We should add an automatic computation of triangle-mesh mass properties. This would implicitly assume that the TriMesh is manifold and have consistent winding.

That paper suggests that this should be fairly easy to implement, based on the existing code that computes ConvexPolyhedron mass properties.

metric-space commented 2 years ago

@sebcrozet would it be fair to say you've already implemented this?

wlinna commented 1 year ago

I use parry for processing arbitrary (i.e. I can't change the input itself) BIM models, and there's no guarantee that each mesh in a model will be manifold or have consistent winding. I hope these "automatic computations" will stay opt-in, i.e. only computed when set_flags is called with specific flag(s).

sebcrozet commented 1 year ago

@metric-space Yes, it’s implemented now, this issue can be closed. @wlinna There is no automatic calculation of the mass properties when the mesh is built. It needs to be calculated by calling trimesh.mass_properties() explicitly.