voronoice icon indicating copy to clipboard operation
voronoice copied to clipboard

Weird clipping behaviour with grid-like Voronoi diagram

Open OneEyeMaker opened this issue 2 years ago • 5 comments

I'm trying to build Voronoi diagram from grid-like set of points.

I've two such sets of sites: for first one this implementation works perfectly, but for second one it panics at runtime with message Edge crosses box, intersection must exist. The problem is that sites of these sets differ only by few (floating point) epsilons. And there are no sites outside bounding box.

Links:

Code that I use to create Voronoi diagram:

VoronoiBuilder::default()
        .set_bounding_box(BoundingBox::new(Point {x: 800.0, y: 800.0}, 1600.0, 1600.0))
        .set_sites(points)
        .set_clip_behavior(ClipBehavior::Clip)
        .build()
        .unwrap();

What causes such weird behavior with clipping enabled (for almost identical sets of points)?

OneEyeMaker avatar Jul 08 '22 16:07 OneEyeMaker