-
Notifications
You must be signed in to change notification settings - Fork 1
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
does not produce convex hull #3
Comments
I guess it should matter for users of this crate as this means the function doesn't compute a (complete) Delaunay triangulation. I stumbled across a set of 3 points for which use rtriangulate::{TriangulationPoint, triangulate};
fn main() {
let points = [
TriangulationPoint::new( 4., 11.),
TriangulationPoint::new( 6., 10.),
TriangulationPoint::new(10., 8.)
];
// Do the triangulation.
let triangles = triangulate(&points).unwrap();
println!("{:?}", triangles); // Empty :-(
} |
@moritzbeck: These three points are collinear, so they can't form a triangle. What would be your expected output there? |
D'oh, you're right. I should have checked that. My use case is the following: I want to compute the Euclidean minimum spanning tree of a set of points. So for my use case I'd like the output to contain the degenerated triangle with those three vertices. Having said that, the triangulation remains empty if I change the first point from (4, 11) to (4, 12) or even (4, 12.9). |
The Delaunay triangulation should produce a triangulation with a convex hull.
To fix it you would need to check if some of the triangles that have a point of the supertriangle need to have an edge flipped, before removing them from the triangulation.
Don't know if it matters to you, but just leaving it here in case someone wants to use this implementation and needs a convex hull.
The text was updated successfully, but these errors were encountered: