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

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

Dec 17, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Overlay of Two Subdivisions The overlay is a new planar subdivision. doubly-connected edge list 1 (DCEL1) (DCEL2)

Overlay of Two Subdivisions

1S

The overlay is a new planar subdivision.

doubly-connectededge list 1 (DCEL1)

2S (DCEL2)

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

The Overlay Problem

Compute a doubly-connected edge list for the new planar subdivision.

Every face be labeled with the labels of the containingfaces from in the input subdivisions.

Half-edge records reusablesince the edge is not intersected by those from the other subdivision.

1S2S

Half-edge records needto be generated

new intersection.

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

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!

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

Line Sweep

newintersection

DCEL1 DCEL2

DCEL for the overlay

Invariant: the part of overlay to left of the sweep line has been computed correctly..

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

At an Event Point

Update the event queue and sweep-line status tree as in thesegment intersection algorithm.

In case the event point is

Vertex adjacent to edges from one subdivision.

No additional work!

Intersection of edges from different subdivisions.

Link the DCE1 and DCE2 at the intersection point.

Handle all possible cases.

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

Three Types of Crossing

Vertex-Edge: an edge from one input subdivision passes through a vertex of another subdivision.

Edge-Edge: two edges from different subdivisions intersect in their interior.

Vertex-Vertex: two vertices from different subdivisions coincide with each other.

The other two casesare no more difficult.

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

Vertex-Edge Update

An edge of one subdivision passes a vertex of another subdivision.

Before:

After:

4 new half-edges

2 old half-edges

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

Operations in the Update

ae

be

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

Operations in the Update (cont’d)

5. Set the Next and Prev pointers of the four new half-edges.

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

Previous and Next Edges

How to find it using the DCE list?

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

Time Cost for Updating Vertex and Half-Edge Records

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.

combined complexityof 2 input subdivisions

complexity of the overlay

every intersection is a vertex of the overlay.

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

Face Update

#face records = 1 + #outer boundary cycles

Easy to extract all boundary cycles from DCEL.

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

Outer Boundary Cycle

How to distinguish an outer boundary cycle from one thatbounds a hole?

v

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

Cycles Bounding the Same Face

(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.

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

Graph Example

C5

C2

C

C7C6

C3

C1

C4

C7C1C

C3

C5

C2

C6

C4

Five facesin total.

Graph G induces the record for every face in DCEL (O(n+k) time).

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

Construction of Graph G

The algorithm checks the segment immediately below the event point.

Make a node for every cycle.

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

Labeling a FaceEvery face in the overlay is labeled with the names of the faces in the old subdivisions that contain the face.

intersection of edges from different subdivisions.

Look up the IncidentFace( ) pointer of the twocorresponding half-edges.

existing vertex of one subdivision.

Know only one generating face – the one fromthe same subdivision.

For each vertex in one subdivision, keep track of its containing face in the other subdivision.

Plane sweep again (or do it in the same sweep).

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

The Overlay Algorithm

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

Running time

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

Boolean Operations

Operations on polygonal regions:

faces labeled (P, C )