Almost collinear points break the Voronoi
Fil opened this issue · comments
See demo at https://observablehq.com/d/b31c2945b6082f94
I'm creating these test points with a linear formula, so it's just rounding errors that make the points "almost collinear". But the consequence is that Delaunator finds triangles — which could OK except that d3-delaunay then fails when it computes the Voronoi (rounding errors in the circumcenters I suspect).
I'm not sure if this should be dealt with upstream or here. I managed to fix it by changing the test on minRadius from minRadius === Infinity
to minRadius < 1e30
, so that the second chance of #64 (jittering) kicks in. It might be the solution, but then it breaks the Delaunator tests.
I just discovered Mike’s Delaunay test cases and added mine here https://observablehq.com/d/3b5e1aedf2aca63e
Fixed by 2ee9847