1 / 19

Overlay of Two Subdivisions

(DCEL2). Overlay of Two Subdivisions. doubly-connected edge list 1 (DCEL1). The overlay is a new planar subdivision. . The Overlay Problem. Compute a doubly-connected edge list for the new planar subdivision. Every face be labeled with the labels of the containing

trygg
Download Presentation

Overlay of Two Subdivisions

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. (DCEL2) Overlay of Two Subdivisions doubly-connected edge list 1 (DCEL1) The overlay is a new planar subdivision.

  2. The Overlay Problem Compute a doubly-connected edge list for the new planar subdivision. Every face be labeled with the labels of the containing faces the input subdivisions. Half-edge records reusable since the edge is not intersected by those from the other subdivision. new intersection. f (f,g) g Half-edge records need to be generated

  3. The General Approach First, copy the DCE lists of two subdivisions. Transform the result into a valid DCE list for the subdivision overlay. Compute the intersections of edges from different subdivisons. Link together appropriate parts of the two DCE lists. 1. Vertex and half-edge records. 2. Face records. Modify the plane sweep algorithm!

  4. Line Sweep new intersection Invariant: the part of overlay to left of the sweep line has been computed correctly.. DCEL1 DCEL for the overlay DCEL2

  5. Vertex adjacent to edges from one subdivision. Intersection of edges from different subdivisions. At an Event Point Update the event queue and sweep-line status tree as in the segment intersection algorithm. In case the event point is No additional work! Link the DCE1 and DCE2 at the intersection point. Handle all possible cases.

  6. Three Types of Crossing Vertex-Vertex: two vertices from different subdivisions coincide with each other. Vertex-Edge: an edge from one input subdivision passes through a vertex of another subdivision. The other two cases are no more difficult. Edge-Edge: two edges from different subdivisions intersect in their interior.

  7. Vertex-Edge Update An edge of one subdivision passes a vertex of another subdivision. Before: 2 old half-edges After: 4 new half-edges

  8. 2. Shorten half-edge e = (u, w) to e = (u, v). a a 3. Shorten half-edge e = (w, u) to e = (w, v). b b Prev(e )  Prev(e ) Prev(e )  Prev(e ) Next(Prev(e ))  e Next(Prev(e ))  e • Next(e )  Next(e ) • Next(e )  Next(e ) • Prev(Next(e ))  e • Prev(Next(e ))  e b a a b a b a b a b a b a b b a Operations in the Update • Edge e splits into two edges e and e • at intersection v. u v w • Create their twin half-edges with v as the • origin.Update the Twin pointers.

  9. Since e has destination v, we need only set its Next pointer to the next edge on the face it bounds. a This is the first half-edge seen clockwise from e with v as its origin. a Operations in the Update (cont’d) Set the Next and Prev pointers of the four new half-edges. u Set the Next and Prev pointers of the four half-edges (colored red) incident to v from the other subdivision. v w E.g. How to find it using the DCE list?

  10. Locating where e, e appear in the cyclic order around v takes time linear the deg(v). Each of the other operations takes time O(1). Time Cost for Updating Vertex and Half-Edge Records O(m) time where m = # edges (incident on the event point during the sweep). Generalizes over the vertex-vertex and edge-edge cases. Updating vertex and half-edge records does not increase the asymptotic running time of the line segment intersection algorithm. every intersection is a vertex of the overlay. O(n logn + k log n) combined complexity of 2 input subdivisions complexity of the overlay

  11. Face Update For each face f : • OuterComponent(f) • InnerComponents(f) • IncidentFace(e)  f for each bounding half-edge e. • label f as (F, G) where F and G are faces in the two old subdivisions that contain f. #face records = 1 + #outer boundary cycles Easy to extract all boundary cycles from DCEL.

  12. Outer Boundary Cycle How to distinguish an outer boundary cycle from one that bounds a hole? Look at the leftmost vertex v of the cycle with incident edges e and Next(e). Let  be the angle of rotation from e to Next (e). Next(e) v    >   hole boundary e   <   outer boundary

  13. Every boundary cycle corresponds to a node C . i One node C for the imaginary outer boundary cycle of the unbounded face.  (C , C ) is an edge iff i j Cycles Bounding the Same Face Construct an undirected graph G such that (a) one of the corresponding cycles is the boundary of a hole. (b) the other cycle has a half-edge immediately below the lowest vertex of the first cycle.

  14. C C C C C C C C C C C C C C C C   4 2 5 5 3 2 1 4 6 1 3 7 7 6 Graph Example Five faces in total. Graph G induces the record for every face in DCEL (O(n+k)time).

  15. C C C C Construction of Graph G Modify the plane sweep algorithm to construct G. The algorithm checks the segment immediately below the event point. Make a node for every cycle. When the event point v is the lowest vertex bounding a hole C v 1. Locate the edge e below v and the cycle C it is on. e 2. Add an edge (C, C)to G. Maintain a pointer from every half-edge to the node in G representing the cycle it is on.

  16. e e 2 1 Labeling a Face Every face in the overlay is labeled with the names of the faces in the old subdivisions that contain the face. Consider an arbitrary vertex v: g intersection of edges from different subdivisions. (f, g) Look up the IncidentFace( ) pointer of the two corresponding half-edges. f existing vertex of one subdivision. Know only one generating face – the one from the same subdivision. For each vertex in one subdivision, keep track of its containing face in the other subdivision. f Plane sweep again (or do it in the same sweep).

  17. The Overlay Algorithm // total complexity of DCELs is n • MapOverlay(S , S) • Input: two planar subdivisions S and S stored in DCELs. • Ouput: the overlay of S and S in a DCEL D. • 1. Copy the DCELs forS and S into a new DCEL D. • Use plane sweep to compute all intersections between edges from S and S . • While updating the event queue Q and sweep-line status T, do the following: •  Update vertex and edge records in D whenever the event involves • edges from both S and S . Let the corresponding vertex bev. •  Store the half-edge immediately below the event point at v. • 3. Traverse D (using depth-first search) to determine all boundary cycles. • Construct the graph G • for each connected component in G • doCthe unique outer boundary cycle • fthe face bounded by C • create a face record forf • OuterComponent(f) some half-edge of C • InnerComponents(f)  pointers to one half-edge e in each hole • IncidentFace(e)  f for all half-edges bounding the cycle C and holes. • 7. Label each face in the overlay. 1 2 1 2 1 2 // O(n) 1 2 2 1 // O(n log n + k log n) where k is the complexity of the overlay. 1 2 // O(k) // O(k) // O(n log n + k log n)

  18. Running time Theorem: The overlay of two planar subdivisions with total complexity n can be constructed in O(n log n + k log n), where k is the complexity of the overlay.

  19. faces labeled (P, Q), (P, C ) or (Q, C )   faces labeled (P, C )  Boolean Operations Operations on polygonal regions: Q P P Q P – Q P Q n vertices in total faces labeled (P, Q) k complexity of overlay Corollary P Q, P Q, andP – Q can each be computed in time O(n log n + k log n).

More Related