dimforge / ncollide

2 and 3-dimensional collision detection library in Rust.
https://ncollide.org
Apache License 2.0
921 stars 105 forks source link

Add a function to easily create a concave polygon from a concave hull #340

Open robinmoussu opened 4 years ago

robinmoussu commented 4 years ago

Fix #338

This is an early POC to show how I am creating a concave polygon from a concave hull.

Remarks regarding this draft:

robinmoussu commented 4 years ago

I tested it a bit more, and unfortunately the triangulation approach I took doesn't works.

image

The hull is the black line, and the orange triangles are the one detected as being inside the hull, using the algorithm in this PR.

As you can see:

So, … I need to restart from scratch. I think we can close this PR unfortunately.

robinmoussu commented 4 years ago

I just noticed that there is maybe a way to solve the issue by using ConstrainedDelaunayTriangulation instead of FloatDelaunayTriangulation and adding all edges of the hull as constrains for the triangulation. I don't know if or when I will have to experiment it, so I'm letting this comment here in case someone (or my future self) is interested.

robinmoussu commented 4 years ago

I just noticed that there is maybe a way to solve the issue by using ConstrainedDelaunayTriangulation instead of FloatDelaunayTriangulation and adding all edges of the hull as constrains for the triangulation. I don't know if or when I will have to experiment it, so I'm letting this comment here in case someone (or my future self) is interested.