-
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
Connect Holes discussion #48
Comments
That sounds like a useful suggestion. There should be a fairly simple O(n log n) time sweepline algorithm to do something like that: Assume for ease of exposition that the direction in which we want to connect is horizontal and "leftwards"
we will essentially want to shoot a ray from that point to the left and see what edge we hit (which might be another hole). We use a sweep line algorithm to compute those edges:
Steps 1 and 4 are linear time. Steps 2 and 3 are O(n log n) as we have n events (vertices of the polygon), each taking O(log n) time per piece. I think I already implemented something along these lines in the algorithm for constructing the planar subdivision. Since we need more or less the same there (see e.g. Chapter 2 of "the yellow book" (Computational Geometry, Applications & Practice). edit: forgot to add: making the shortest cuts (in that given direction) should probably be possible by extending the above algorithm. if we dont' want to add new vertices we can just select a subset of the triangulation edges. (but given a direction there may not a solution using only existing vertices of course) |
CGAL has an implementation of connect holes that cut straight up from each hole to the nearest wall.
I'd like to add something like:
Those functions connect the maximum extreme point (given by the vector) of each hole in a straight line. The extra data
p
is lost, though, since cutting adds new nodes rather than just new edges.Are there other algorithms for cutting out holes? Perhaps a faster algorithm if the polygon has been triangulated? Is there an efficient way of making the shortest cuts possible? Is there an efficient way of cutting out holes without adding new nodes?
The text was updated successfully, but these errors were encountered: