-
Notifications
You must be signed in to change notification settings - Fork 26
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
indefinite hang on push!
#38
Comments
Ah. I think it happens when two points are within eps() distance from each other. |
Should there be a check that either errors or removes duplicate points with a warning, to prevent the indefinite hang? |
Well spotted! Unfortunately, I don't have time to look into this at the moment. |
I think the preferred behaviour would be an error but with an option to thin. In my case for instance the identity of the points are important (they belong to different genetic lineages) so I'd prefer to get an error then do the thinning manually to be in control, but for most geometric uses I guess automatic thinning is preferable. |
Is there any progress on this issue? I, too, have run into this problem. As @mkborregaard suggested, an error with an option to thin would be great. I would be willing to help, of course, though I'm not sure how the thinning would be implemented. |
Here seems to be a minimal example: julia> tess = DelaunayTessellation();
julia> push!(tess, Point2D(0.9510565162951536, 0.1)) # hangs |
@dlfivefifty : This example probably fails because both coordinates have to be between 1 and 2. |
Ah ok, in that case an |
@mkborregaard : I'm trying out your data and also see that the computations never seem to finish. I have narrowed it down to the function One question: How did you reach the conclusion about |
@dlfivefifty : Good point. This input restriction has been discussed quite a few times :-) I'm actually not sure what the status is. |
@skariel : It seems that mkborregaard's point number 67 cannot be assigned to a triangle in |
I think the method that only takes (1,2)-interval coordinates should be an internal low-level function for connoisseurs and there should be a convenience method automatically rescaling. |
@robertdj I don't remember? But afair I had some identical points, these created errors. |
@mkborregaard : My moment of not having time also lasted a while :-) Regarding this bug I would need to spend quite some time to dig into the internals of both VoronoiDelaunay and GeometricalPredicates, so I cannot make any promises about a resolution. BTW, I agree that it would be a good idea to automatically scale points. I do this in VoronoiCells, but it would make sense to move it to VoronoiDelaunay. |
There is a pull-request that addresses the rescaling issue: #50 |
@robertdj Hello, what the status of this? |
@natschil I had not seen your PR -- sorry! But I'm so out of sync with this package that I don't think it makes sense for me to make decisions about a PR |
I'm investigating the root cause of the error, with no luck so far. Looking at @mkborregaard's point set I can see that after adding the first 66 triangles, the resulting tesselation contains triangles composed of the same vertices (however in a different order). This confuses |
@bchaber not directly related, but I've re-written the package to deal with the issue addressed in #50 (non-convex tesselations), that kind of does rescaling (but I think poorly, there is still a bug somewhere) and also have some fixes caused by co-linear points. I would like to improve the code and document it some more, but in case you are interested, it can be found in https://github.com/natschil/VoronoiDelaunay.jl/blob/tmpbranch/src/tesselation.jl . I've cleaned up some of the old code, so it should be slightly easier to see what is going on. The fix for co-linear points requires my branch of I have yet to make these into pull-requests because I'd like to clean up the code and document it more. However, as it has been sitting on my laptop for the past few months without any progress on my part, I thought it might make sense to share it here. |
Thank you @natschil, I've checked out your forks. They of course work for the data points in the first post. |
Well, that's nice to hear I guess :) Maybe it's an issue with colinear points? I had some problems previously with triangles being added that were degenerate, and GeometricalPredicates.jl didn't return the correct return value. I convinced myself that my "fix" actually fixes the issue, but it is somewhat hacky so it might still fail sometimes. Note that the space of "allowed" points is smaller than [1,2]x[1,2], so I do some rescaling. Basically the point is that instead of square initially, there is a triangle that point should be in. Whenever a point is added I check whether it is in the domain, and then rescale the domain appropriately. I am still not 100% happy with this step, as (a) the rescaling is much more extreme than it needs to be, probably some basic linear algebra bug somewhere and (b) the edges to the three points of the big triangle (treated as "points at infinity") may need to be updated, as I think that rescaling can result in a non-triangle being formed as the points at infinity aren't rescaled like the rest of the mesh. What also needs to be fixed is treatment of duplicate points. This might be straight-forward. |
I have another 5 cents to add: The Deldir package handles the problematic point set. It seems to be because it first sorts the points in a suitable way.
The sorting is performed in the wrapped Fortran code, so I don't know how it actually works. |
I have a weird bug where
push!
hangs indefinitely on a certain data set. I pushed one by one and found that any point added after the first 66 points hangs. Here are the pointsAfter easily adding all the black points, adding any of the red points will cause the session to hang/crash
The text was updated successfully, but these errors were encountered: