Open robinmoussu opened 4 years ago
I tested it a bit more, and unfortunately the triangulation approach I took doesn't works.
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.
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.
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.
Fix #338
This is an early POC to show how I am creating a concave polygon from a concave hull.
Remarks regarding this draft:
cargo run --example concave
.cargo check
works frombuild/ncollide2d
, but not from the root directory.gnuplot
as a dev-dependency, but it's just there to display how the concave polygon is created, and what points are tested. If this patch is ever merged, I am not sure it should be kept. I didn't check if anything was already used to display graphics on the screen.concave.rs
) serve as unit test. If this PR is merged it should be transformed into a proper unit test. I did it this way to be able to display the polygon, and show that it works.f32
/f64
unfortunately this must be visible in the public API ofnew_concave_polygon
. I am not happy about this.