boostvoronoi.rs icon indicating copy to clipboard operation
boostvoronoi.rs copied to clipboard

Error creating voronoi diagram

Open stijn-ucrowds opened this issue 3 years ago • 2 comments

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 avatar May 10 '22 10:05 stijn-ucrowds

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.

stijn-ucrowds avatar Jun 01 '22 08:06 stijn-ucrowds

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

eadf avatar Oct 31 '23 13:10 eadf