-
Notifications
You must be signed in to change notification settings - Fork 15
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
Infinite loop in Voronoi::closeCells #4
Comments
Set of points that caused the issue for me |
I had this before as well, and it was because of the Lloyd Relaxation that I did, which rearranges the points a bit. The calculation that did that ended up using decimals instead of integers for the points, which ended up causing the same problems. If you are doing a similar thing, make sure that the coordinates of the points are both integer numbers when they enter the voronoi calculation. |
Well, I'll try it this afternoon and come back to you in few hours! |
@eaterofpies You're right, using |
I'm not entirely sure what caused the infinite loop. I just tried to create a 400x200 image with about 1000 random cells in it and it got stuck.
The infinite loop appears to happen when the cell nearly closes then for some reason expands to going round the corners of the full image so it never closes.
Looking at the code the equalsWithEpsilon etc functions don't actually use self::EPSILON they use 1e-9 instead.
replacing 1e-9 with self::EPSILON seems to prevent the infinite loop though I don't understand the code well enough to know if this is the correct fix for the issue.
The text was updated successfully, but these errors were encountered: