dimforge / parry

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

Create trimesh from non-convex 2D polygons #59

Closed EmbersArc closed 2 years ago

EmbersArc commented 2 years ago

I'd like to be able to create a TriMesh from non-convex 2D polygons.

I have a PR ready implementing the ear-clipping algorithm. Once we have this, we can think about adding the Hertel-Mehlhorn algorithm that combines the triangles into convex polygons again, to give a good convex decomposition.

The reason for this is that, at least in my experiments, the VHACD algorithm is orders of magnitude slower than this method.