-
Notifications
You must be signed in to change notification settings - Fork 19
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
For some inputs, polygons covering the entire plot are returned #4
Comments
I am unsure if this is a separate issue or not, but it's also possible to receive glitchy self-intersecting polygons from the library if you try hard enough.
|
Thanks for reporting this. I think that the first bug is exercising a known edge case for Fortune's algorithm that comes up when there are two points with the same y-coordinate that have larger y-coordinate than any other points. I'll figure out a workaround. The second bug is most likely running into some kind of geometric degeneracy caused by some points having the same x or y coordinate, but I'll have to look at it more closely. |
In a pull request to #ctrlcctrlv/interactive-voronoi#1 there is a workaround for both cases. I am not sure, if there are more degeneracies. Would be better, if these two edge cases are fixed in #rust_voronoi though. |
Had some similar issues, for certain set of points the DCEL generated is incorrect, and it happens quite frequently, I randomly generate like 10 sites with certain distance in between to make sure they are sort of evenly distributed, and compute the voronoi and test result, 3 out of 10 times it's generating only 9 faces. |
found the bug regarding my issue, in the extend_edges function at lines 302, 303 in voronoi.rs, the value should not be a fixed '-1000', but a variable number according to your world size, otherwise it's not gonna extend the edge correctly and you will get error result. |
I discovered this while writing a toy program to learn Rust, https://github.com/ctrlcctrlv/interactive-voronoi
For some inputs, strange results are returned, for example:
You can see if I add one more point, the strange polygon that covers the entire screen goes away:
Looks like there's something wrong with the library in these cases. 😞
The text was updated successfully, but these errors were encountered: