spade icon indicating copy to clipboard operation
spade copied to clipboard

another edge case for add_constraint_and_split

Open mockersf opened this issue 5 months ago • 0 comments

with f64 precision, with spade 2.12.1

use spade::{ConstrainedDelaunayTriangulation, Point2, Triangulation};

#[test]
fn test() {
    let edges = [
        (
            Point2 {
                x: 15.435077667236328,
                y: 16.331045150756836,
            },
            Point2 {
                x: 20.322175979614258,
                y: 21.218143463134766,
            },
        ),
        (
            Point2 {
                x: 18.69314193725586,
                y: 19.589109420776367,
            },
            Point2 {
                x: 19.507659912109375,
                y: 20.40362548828125,
            },
        ),
        (
            Point2 {
                x: 19.507659912109375,
                y: 21.218143463134766,
            },
            Point2 {
                x: 19.507659912109375,
                y: 20.40362548828125,
            },
        ),
        (
            Point2 {
                x: 17.878625869750977,
                y: 18.774595260620117,
            },
            Point2 {
                x: 19.507659912109375,
                y: 20.40362548828125,
            },
        ),
    ];
    let mut cdt: ConstrainedDelaunayTriangulation<Point2<f64>> =
        ConstrainedDelaunayTriangulation::new();
    for edge in edges {
        let point_a = cdt.insert(edge.0).unwrap();
        let point_b = cdt.insert(edge.1).unwrap();
        cdt.add_constraint_and_split(point_a, point_b, |v| v);
    }
}
thread 'test' panicked at spade/src/cdt.rs:879:17:
assertion `left != right` failed
  left: []
 right: []

mockersf avatar Sep 10 '24 22:09 mockersf