Skip to content
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

Degenerate triangle generated by triangulation #118

Open
Liburia opened this issue Oct 31, 2024 · 0 comments
Open

Degenerate triangle generated by triangulation #118

Liburia opened this issue Oct 31, 2024 · 0 comments

Comments

@Liburia
Copy link

Liburia commented Oct 31, 2024

Example code:

let dt = DelaunayTriangulation::bulk_load(vec![
    Point2::new(-0.4583333333333335, 0.0035353982507333875),
    Point2::new(-0.44401041666666685, 0.09000381880347848),
    Point2::new(-0.4296875000000002, 0.17647223935622358),
    Point2::new(-0.4153645833333336, 0.26294065990896864),
    Point2::new(-0.40104166666666696, 0.34940908046171376),
    Point2::new(-0.34375, 0.4242340611633537),
    Point2::new(-0.2864583333333335, 0.48354314550173816),
    Point2::new(-0.22916666666666696, 0.5220359027883882),
    Point2::new(-0.171875, 0.5605286600750382),
    Point2::new(-0.11458333333333348, 0.5743482879175245),
    Point2::new(-0.05729166666666696, 0.5864208547026089),
])
.unwrap();
let tri = dt.inner_faces().nth(4).unwrap();
dbg!(tri.vertices().map(|v| v.position()));
dbg!(tri.area());

Output:

[src/main.rs:119:5] tri.vertices().map(|v| v.position()) = [
    Point2 {
        x: -0.4153645833333336,
        y: 0.26294065990896864,
    },
    Point2 {
        x: -0.40104166666666696,
        y: 0.34940908046171376,
    },
    Point2 {
        x: -0.4296875000000002,
        y: 0.17647223935622358,
    },
]
[src/main.rs:120:5] tri.area() = 3.2526065174565133e-19

example

The yellow line is the triangle that is made from the 3 vertices (they lie on the same line)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant