-
Notifications
You must be signed in to change notification settings - Fork 40
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
[WIP] O(nlog n) time algorithm for computing a visibility polygon #62
Conversation
FYI: I think this works/is complete now, but I should write some proper tests to make sure I didn't make any mistakes. I also fixed the show/read instances for LineSegment along the way. |
I have a visibility polygon implementation that uses the SSSP tree. I'll hammer it into shape and submit a PR. Then we can add a QC property that the two algorithms always give the same result.
I saw, love it. Good Read/Show instances are worth their weight in gold. |
I pushed a merge commit so remember to pull before making any new changes. |
Fixing some weird degeneracy issues (like the one shown above) lead me down some wild goose chase into computing intersections between points and segments, and points and halflines. In particular, I realized that in 2D we can test if a point lies on a linesegment by using only 3 ccw tests. I'm guessing that that will be more robust (and potentially faster) than the generic onSegment test we were using so far. I'm hoping that this may also fix some of the issues users reported that were using Doubles as their numeric type. |
Is this PR done? Done enough to be merged? |
Seems there is still some bug that I need to fix before we merge this. |
What bugs? Anything I can help with? There are so many goodies in this PR that I would like to see merged. |
I finally had some time to make some progress on this. Seems like its mostly doing the right thing now. I'm hoping to actually wrap this up tomorrow so that we can also release 0.12 soon :) |
- moved partion3 to Data.List.Util, since we use it in more places now - moved the point in Polygon stuff into its own module under Algorithms
many details still missing, moreover some types of the functions don't match up yet, but at least the main skeleton is there already.