eadf / boostvoronoi.rs

Boost voronoi ported to rust
https://crates.io/crates/boostvoronoi
Boost Software License 1.0
9 stars 1 forks source link

Error creating voronoi diagram #4

Open stijn-ucrowds opened 2 years ago

stijn-ucrowds commented 2 years ago

While generating a voronoi diagram I get the error Err value: InternalError("activate_circle_event could not find node by key 10") I managed to reduce the crashing input from 272,000 line segments to just 6

50 9270 100 9280
100 9280 4060 9880
220 8290 250 8290
250 8290 270 8300
2730 5630 42700 5920
3240 8740 5210 9040

The data format is a line segment on each line with x1, y1, x2, y2. I've been trying to debug it, but I'm not too familiar with the internals of voronoi diagram creation so I have been unable to solve it. Would be very nice if you could look at it.

stijn-ucrowds commented 2 years ago

I found that the issue is with the unique_endpoints calculation in lazy_circle_formation.rs in the pps function. Commenting out that addition (the block of code is new compared with the original boost) restores the loop behaviour to exactly how Boost has it.

eadf commented 11 months ago

Thank you for your input. Yes, i will have to investigate this further, i thought i could be clever and avoid calculating the circle event position occurring between two linked line segments, because the position is already known. As a workaround i will try to find some time to disable my "improvement"

regards /Ead