Home > database >  How the Bently-Ottomann algorithm determines the order of segments on sweep line
How the Bently-Ottomann algorithm determines the order of segments on sweep line

Time:09-09

As much as I have known, the order within the status is determined by the beginning point of segments initially, and changed when the sweep line meets a corresponding intersection.

Let's see the example below. Let the sweep line sweeps from top to bottom, and event queue sorts events from left to right. When the sweep line touches vertex E, it has swept IGAC. If we use the starting point to represent segments, the order of segments within status is CAIG. Also, the intersections K and L have been detected. Then E joins the status and the order becomes CEAIG because the x-coordinate of E is between C and A.

enter image description here

Here is the problem, at the moment the sweep line meets E, since the left and right of E are C and A, the intersections of M and N won't be detected, hence the two event points of intersection won't join the event queue. According to the image, we can see that the next event is L. The order of C and A would change, but E still lies between C and A. Then F, the segment EF will be removed from status. M and N will never be detected.

I think I have followed the routine of the BO algorithm, but the two intersections cannot be detected in this situation. Please tell me where I'm wrong.

CodePudding user response:

When the sweep line gets to E, it has the line segments AB and IJ on the left and right.

In order to determine where to insert E in the tree, you compare it to the points on those lines that are on the sweep line, directly to the left or right of E. You do not compare it to the original points that caused those lines to get inserted into the tree in the first place.

So the x position of each node in the tree changes as the sweep line moves. This is OK -- that only affects the relative ordering of nodes at intersections, and the ordering is fixed up at intersection events.

  • Related