Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect Voronoi Diagram for simple test case #146

Closed
kgoodrick-uu opened this issue Jul 12, 2024 · 2 comments · Fixed by #147
Closed

Incorrect Voronoi Diagram for simple test case #146

kgoodrick-uu opened this issue Jul 12, 2024 · 2 comments · Fixed by #147

Comments

@kgoodrick-uu
Copy link

kgoodrick-uu commented Jul 12, 2024

For a certain array of 5 points the Voronoi diagram "misses" a point. I have reproduced this on observable.

image

I originally reported this as a bug in Vega-Lite vega/vega-lite#9388 and then Vega vega/vega#3941, but after more digging I believe the bug is coming from this library.

@Fil
Copy link
Member

Fil commented Jul 12, 2024

Thanks! I can confirm that this bug comes from the jittering we use to solve collinear points:

const p = jitter(points[2 * i], points[2 * i + 1], r);

Solved by increasing the factor 1e-8 to 1e-7. However, this in turn breaks another test. I found a sweet spot value at 1.5e-8 that makes all the tests happy, but it's clearly not a great solution (see #147).

@Fil
Copy link
Member

Fil commented Jul 12, 2024

solved by #147

@Fil Fil closed this as completed in #147 Jul 14, 2024
@Fil Fil closed this as completed in c1f5b52 Jul 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants