41
Voronoi Diagram – Fortun e’s Algorithm Reporter: GI1 11 號 號號號 Date: 2004/10/28 Reference: Computational Geometry ch7 ISBN: 3-540-65620-0

Voronoi Diagram – Fortune ’ s Algorithm Reporter: GI1 11 號 蔡逸凡 Date: 2004/10/28 Reference: Computational Geometry ch7 ISBN: 3-540-65620-0

Embed Size (px)

Citation preview

Voronoi Diagram – Fortune’s Algorithm

Reporter: GI1 11 號 蔡逸凡Date: 2004/10/28Reference: Computational Geometry ch7 ISBN: 3-540-65620-0

Fortune’s Algorithm (summary)HandleSiteEvent(pi)1. Search T for arc directly ab

ove pi; delete circle events associated with this arc

2. Add arc of pi into T (with two new break points <pi,pj>,<pj,pi>)

3. [DCEL] edge between <pi,pj>

4. Detect circle events where the new arc is the left arc in a triple of consecutive arcs

HandleCircleEvent(pl)1. Delete disappearing arc fro

m T and its associated circle events from Q

2. [DCEL] Center of circle as vertex in V.diagram

3. Check new triples for circle events (only if the circle intersects sweep line and not yet in Q)

4. [DCEL] create edges due to disappearing arc

From the TextbookThese can be ignored if using simplified T

These can be ignored if using simplified T

From the Textbook

Case 1Initially:

Q={p1,p2,p3}

T ={}

D={}

p1

p2

p3

Case 1(cont)

SiteEvent(p1)

Q={p2,p3}

T ={p1}

D={}

Entries in T: the arcs

induced by the sites

Case 1 (Cont)SiteEvent(p2)

Q={p3}

Arc above: p1

T ={p1,p2,p1}

D={e1=<p2,p1>

}

The arcs in T (bottom to

top)

Here two p1 represents different

segments of the arc!

Case 1 (Cont)SiteEvent (p3)Q={}Arc above: p1T ={p1,p2,p1,p3,p1}D={e1,e2=<p1,p3>} Detect circle event:c1:<p2,p1,p3>→ add c1 in Q

Case 1 (Cont)

CircleEvent (c1)Q={}Disappearing arc: p1T ={p1,p2,p1,p3,p1}D={e1,e2,v=<p2,p1,p3>, e3=<p2,p3>}

Case 1 (Cont)

Finally,

Q={}

T ={p1,p2,p3,p1}

D={e1,e2,v,e3}

Case 2Initially:

Q={p1,p2,p3,p4}

T ={}

D={}

Case 2(cont)SiteEvent(p1)

Q={p2,p3,p4}

T ={p1}

D={}

p1

p2

p4

p3

Case 2 (Cont)

SiteEvent(p2)

Q={p3,p4}

Arc above: p1

T ={p1,p2,p1}

D={e1=<p1,p2>}

Case 2 (Cont)

SiteEvent(p3)

Q={p4}

Arc above: p1

T ={p1,p3,p1,p2,p1}

D={e1,e2=<p3,p1>}

Detect circle event:

c1:<p3,p1,p2>

→ add c1 in Q={p4,c1}

Make a note that c1 is due to <p3,p1,p2>

Case 2 (Cont)SiteEvent(p4)

Q={c1}

Arc above: p1

Delete c1 from Q

T ={p1,p3,p1,p4,p1,p2,p1}

D={e1,e2,e3=<p1,p4>}

Detect circle event:

<p3p1p4>c2,<p4p1p2>c3

Case 2 (Cont)

CircleEvent(c2)

Q={c3}

Disappearing arc: p1

T ={p1,p3,p1,p4,p1,p2,p1}

D={e1,e2,e3,v1=<p3p1p4>,

e4=<p3,p4>}

Case 2 (Cont)

CircleEvent(c3)

Q={}

Disappearing arc: p1

T ={p1,p3,p4,p1,p2,p1}

D={e1,e2,e3,v1,e4,v2=<p4p1p2

>, e5=<p4,p2> }

Case 2 (Cont)

Finally,

Q={}

T ={p1,p3,p4,p2,p1}

D={e1,e2,e3,v1,e4,v2,e5}

Case 3

Initially:Q={p1,p2,p3,p4}T ={}

Case 3 (cont)

SiteEvent (p1)Q={p2,p3,p4}T ={p1}

Case 3 (cont)

SiteEvent (p2)Q={p3,p4}Arc above: p1T ={p1,p2,p1}D={e1=<p2,p1>}

Case 3 (cont)SiteEvent (p3)Q={p4}Arc above: p1T ={p1,p2,p1,p3,p1}D={e1,e2=<p1,p3>}Circle event <p2,p1,p3>c1Q={p4,c1}

Case 3 (cont)SiteEvent (p4)Q={c1}Arc above:p3; remove c1T ={p1,p2,p1,p3,p4,p3,p1}D={e1,e2,e3=<p3,p4>}Circle event <p1,p3,p4>c2 Q={c2}

Case 3 (cont)

CircleEvent (c2)Q={}Disappearing arc p3T ={p1,p2,p1,p3,p4,p3,p1}D={e1,e2,e3,v1=<p1,p3,p4>,e4=<p1,p4>}Circle event <p2,p1,p4>c3Q={c3}

Case 3 (cont)

CircleEvent (c3)Q={}Disappearing arc p1T ={p1,p2,p1,p4,p3,p1}<p2,p4,p3> circle before sweep lineD={e1,e2,e3,v1,e4,v2=<p2,p1,p4>, e5=<p2,p4>}

Case 3 (cont)

Finally:

D={e1,e2,e3,v1, e4,v2, e5}

Case 4

Initial:

Q={p1,p2,p3,p4}

B={}

D={}

SiteEvent(p1)

Q={p2,p3,p4}

T ={p1}

D={}

Case 4 (Cont)

SiteEvent(p2)

Q={p3,p4}

Arc above: p1

T ={p1,p2,p1}

D={e1=<p2,p1>}

Case 4 (Cont)

SiteEvent(p3)

Q={p4}

Arc above: p1

T ={p1,p2,p1,p3,p1}

D={e1,e2=<p1,p3>}

Detect circle event:

c1:<p2,p1,p3>

→ add c1 in Q

Case 4 (Cont)

CircleEvent(c1)

Q={p4}

Disappearing arc: p1

T ={p1,p2,p1,p3,p1}

D={e1,e2,v1=<p2,p1,p3>,e

3=<p2,p3>}

Case 4 (Cont)

SiteEvent(p4)

Q={}

Arc directly above: p2

T ={p1,p2,p4,p2,p3,p1}

Circle event <p4,p2,p3>c2

D={e1,e2,v1,e3,e4=<p2,p4>

}

P4 is equal distance to p2 & p3

Case 4 (Cont)

CircleEvent(c2)

Q={}

Disappearing arc: p2 T ={p1,p2,p4,p2,p3,p1}D={e1,e2,v1,e3,e4,v2=<p4p2p3>, e5=<p4,p3>}

Case 4 (Cont)

Finally,

D={e1,e2,v1,e3,v2,e3,e4,e

5}

Case 5

SiteEvent(p1)

Q={p2,p3,p4}

T ={p1}

D={}

Case 5 (cont)

SiteEvent(p2)

Q={p3,p4}

Arc above: p1

T ={p1,p2,p1}

D={e1=<p2,p1>}

Case 5 (cont)

SiteEvent(p3)

Q={p4}

Arc above: p1

T ={p1,p3,p1,p2,p1}

D={e1,e2=<p1,p3>}

Detect circle event:

c1:<p3,p1,p2>

→ add c1 in Q

Case 5 (cont)

CircleEvent(c1)

Q={p4}

Disappearing arc: p1

T ={p1,p3,p1,p2,p1}

D={e1,e2,v1=<p3,p1,p2>,e3

=<p3,p2>}

Case 5 (cont)

SiteEvent(p4)

Q={}

Arc above: p2

T ={p1,p3,p2,p4,p2,p1}

D={e1,e2,v1,e3,e4=<p2,p4>}

Detect circle event:

c2:<p3,p2,p4>

→ add c2 in Q

Case 5 (cont)

CircleEvent(c2)

Q={}

Disappearing arc: p2

T ={p1,p3,p2,p4,p2,p1}

D={e1,e2,v1,e3,e4,v2=<p3,p

2,p4>,e5=<p3,p4>}

Case 5 (cont)

Finally,

D={e1,e2,v1,e3,e4,v2, e5}

Questions How do I know which one is the arc above?

Location above How to know which arc is disappearing

Location above?! Link between circle event and arc

Things in T should be arcs (with a corresponding site)

Degeneracy: 4points on a circle Does it matter?