![Page 1: Fortune’s Algorithm formisha/Spring20/11a.pdf · Overview of the Algorithm Goal: Given a set of points (sites), the goal is to use a ... we advance the sweep-line. ... Half-Edge](https://reader034.vdocuments.mx/reader034/viewer/2022050212/5f5e2c71f5c79a5e0e142d6b/html5/thumbnails/1.jpg)
Fortune’s Algorithm for
Computing the Voronoi Diagram
![Page 2: Fortune’s Algorithm formisha/Spring20/11a.pdf · Overview of the Algorithm Goal: Given a set of points (sites), the goal is to use a ... we advance the sweep-line. ... Half-Edge](https://reader034.vdocuments.mx/reader034/viewer/2022050212/5f5e2c71f5c79a5e0e142d6b/html5/thumbnails/2.jpg)
Outline
• Math Review
• Overview of the Algorithm
• Implementation
![Page 3: Fortune’s Algorithm formisha/Spring20/11a.pdf · Overview of the Algorithm Goal: Given a set of points (sites), the goal is to use a ... we advance the sweep-line. ... Half-Edge](https://reader034.vdocuments.mx/reader034/viewer/2022050212/5f5e2c71f5c79a5e0e142d6b/html5/thumbnails/3.jpg)
Math Review
Circumcircles:
Q: Given three points in 2D, how do we
compute the center (and radius) of the
circumcircle?
![Page 4: Fortune’s Algorithm formisha/Spring20/11a.pdf · Overview of the Algorithm Goal: Given a set of points (sites), the goal is to use a ... we advance the sweep-line. ... Half-Edge](https://reader034.vdocuments.mx/reader034/viewer/2022050212/5f5e2c71f5c79a5e0e142d6b/html5/thumbnails/4.jpg)
Math Review
Circumcircles:
Q: Given three points in 2D, how do we
compute the center (and radius) of the
circumcircle?
![Page 5: Fortune’s Algorithm formisha/Spring20/11a.pdf · Overview of the Algorithm Goal: Given a set of points (sites), the goal is to use a ... we advance the sweep-line. ... Half-Edge](https://reader034.vdocuments.mx/reader034/viewer/2022050212/5f5e2c71f5c79a5e0e142d6b/html5/thumbnails/5.jpg)
Math Review
Circumcircles:
A: Pick two of the points and draw the
perpendicular bisector.
The bisector must pass
through the center of
the circumcircle.
![Page 6: Fortune’s Algorithm formisha/Spring20/11a.pdf · Overview of the Algorithm Goal: Given a set of points (sites), the goal is to use a ... we advance the sweep-line. ... Half-Edge](https://reader034.vdocuments.mx/reader034/viewer/2022050212/5f5e2c71f5c79a5e0e142d6b/html5/thumbnails/6.jpg)
Math Review
Circumcircles:
A: Pick another two of the points and draw
the perpendicular bisector.
This bisector must also
pass through the center
of the circumcircle.
![Page 7: Fortune’s Algorithm formisha/Spring20/11a.pdf · Overview of the Algorithm Goal: Given a set of points (sites), the goal is to use a ... we advance the sweep-line. ... Half-Edge](https://reader034.vdocuments.mx/reader034/viewer/2022050212/5f5e2c71f5c79a5e0e142d6b/html5/thumbnails/7.jpg)
Math Review
Circumcircles:
A: Pick another two of the points and draw
the perpendicular bisector.
This bisector must also
pass through the center
of the circumcircle.
⇒ The intersection of
the bisectors is the
center.
![Page 8: Fortune’s Algorithm formisha/Spring20/11a.pdf · Overview of the Algorithm Goal: Given a set of points (sites), the goal is to use a ... we advance the sweep-line. ... Half-Edge](https://reader034.vdocuments.mx/reader034/viewer/2022050212/5f5e2c71f5c79a5e0e142d6b/html5/thumbnails/8.jpg)
Outline
• Math Review
• Overview of the Algorithm
• Implementation
![Page 9: Fortune’s Algorithm formisha/Spring20/11a.pdf · Overview of the Algorithm Goal: Given a set of points (sites), the goal is to use a ... we advance the sweep-line. ... Half-Edge](https://reader034.vdocuments.mx/reader034/viewer/2022050212/5f5e2c71f5c79a5e0e142d6b/html5/thumbnails/9.jpg)
Overview of the Algorithm
Goal:
Given a set of points (sites), the goal is to use a
sweep-line algorithm to construct the Voronoi
diagram.
![Page 10: Fortune’s Algorithm formisha/Spring20/11a.pdf · Overview of the Algorithm Goal: Given a set of points (sites), the goal is to use a ... we advance the sweep-line. ... Half-Edge](https://reader034.vdocuments.mx/reader034/viewer/2022050212/5f5e2c71f5c79a5e0e142d6b/html5/thumbnails/10.jpg)
Overview of the Algorithm
Challenge:
Regions that have already been swept may be
closer to sites that are in front of the sweep line, so
we cannot know how the Voronoi Diagram looks
there.
![Page 11: Fortune’s Algorithm formisha/Spring20/11a.pdf · Overview of the Algorithm Goal: Given a set of points (sites), the goal is to use a ... we advance the sweep-line. ... Half-Edge](https://reader034.vdocuments.mx/reader034/viewer/2022050212/5f5e2c71f5c79a5e0e142d6b/html5/thumbnails/11.jpg)
Overview of the Algorithm
Suppose that: The sweep-line is at position 𝑦 = 𝑦𝑙 We’ve seen a site at position 𝑠 = 𝑥𝑠, 𝑦𝑠 , with 𝑦𝑠 < 𝑦𝑙
The set of points 𝑝 = 𝑥, 𝑦 closer to the site than to
the sweep-line satisfies:
𝑝 − 𝑠 2 ≤ 𝑦 − 𝑦𝑙2
⇕𝑥 − 𝑥𝑠
2 + 𝑦 − 𝑦𝑠2 ≤ 𝑦 − 𝑦𝑙
2
⇕
𝑦 ≤𝑥2 − 2𝑥 ⋅ 𝑥𝑠 + 𝑥𝑠
2 + 𝑦𝑠2 − 𝑦𝑙
2
2𝑦𝑠 − 2𝑦𝑙
![Page 12: Fortune’s Algorithm formisha/Spring20/11a.pdf · Overview of the Algorithm Goal: Given a set of points (sites), the goal is to use a ... we advance the sweep-line. ... Half-Edge](https://reader034.vdocuments.mx/reader034/viewer/2022050212/5f5e2c71f5c79a5e0e142d6b/html5/thumbnails/12.jpg)
Overview of the Algorithm
Given a sweep-line 𝑦 = 𝑦𝑙 and site 𝑠 = 𝑥𝑠, 𝑦𝑠 , the
set of points 𝑝 = 𝑥, 𝑦 closer to the site than to the
sweep-line 𝑦 = 𝑦𝑙 satisfies:
𝑦 ≤𝑥2 − 2𝑥 ⋅ 𝑥𝑠 + 𝑥𝑠
2 + 𝑦𝑠2 − 𝑦𝑙
2
2𝑦𝑠 − 2𝑦𝑙
This is the equation of a
parabola that expands as
we advance the sweep-line.
![Page 13: Fortune’s Algorithm formisha/Spring20/11a.pdf · Overview of the Algorithm Goal: Given a set of points (sites), the goal is to use a ... we advance the sweep-line. ... Half-Edge](https://reader034.vdocuments.mx/reader034/viewer/2022050212/5f5e2c71f5c79a5e0e142d6b/html5/thumbnails/13.jpg)
Overview of the Algorithm
𝑦 ≤𝑥2 − 2𝑥 ⋅ 𝑥𝑠 + 𝑥𝑠
2 + 𝑦𝑠2 − 𝑦𝑙
2
2𝑦𝑠 − 2𝑦𝑙
Points on the parabola are equidistant to the site
and the sweep-line.
![Page 14: Fortune’s Algorithm formisha/Spring20/11a.pdf · Overview of the Algorithm Goal: Given a set of points (sites), the goal is to use a ... we advance the sweep-line. ... Half-Edge](https://reader034.vdocuments.mx/reader034/viewer/2022050212/5f5e2c71f5c79a5e0e142d6b/html5/thumbnails/14.jpg)
Overview of the Algorithm
𝑦 ≤𝑥2 − 2𝑥 ⋅ 𝑥𝑠 + 𝑥𝑠
2 + 𝑦𝑠2 − 𝑦𝑙
2
2𝑦𝑠 − 2𝑦𝑙
Points on the parabola are equidistant to the site
and the sweep-line.
![Page 15: Fortune’s Algorithm formisha/Spring20/11a.pdf · Overview of the Algorithm Goal: Given a set of points (sites), the goal is to use a ... we advance the sweep-line. ... Half-Edge](https://reader034.vdocuments.mx/reader034/viewer/2022050212/5f5e2c71f5c79a5e0e142d6b/html5/thumbnails/15.jpg)
Overview of the Algorithm
𝑦 ≤𝑥2 − 2𝑥 ⋅ 𝑥𝑠 + 𝑥𝑠
2 + 𝑦𝑠2 − 𝑦𝑙
2
2𝑦𝑠 − 2𝑦𝑙
Points on the parabola are equidistant to the site
and the sweep-line.
![Page 16: Fortune’s Algorithm formisha/Spring20/11a.pdf · Overview of the Algorithm Goal: Given a set of points (sites), the goal is to use a ... we advance the sweep-line. ... Half-Edge](https://reader034.vdocuments.mx/reader034/viewer/2022050212/5f5e2c71f5c79a5e0e142d6b/html5/thumbnails/16.jpg)
Overview of the Algorithm
𝑦 ≤𝑥2 − 2𝑥 ⋅ 𝑥𝑠 + 𝑥𝑠
2 + 𝑦𝑠2 − 𝑦𝑙
2
2𝑦𝑠 − 2𝑦𝑙
Points on the intersection of two such parabolas are
equidistant to the two sites.
⇒ They could be on the Voronoi Diagram.
![Page 17: Fortune’s Algorithm formisha/Spring20/11a.pdf · Overview of the Algorithm Goal: Given a set of points (sites), the goal is to use a ... we advance the sweep-line. ... Half-Edge](https://reader034.vdocuments.mx/reader034/viewer/2022050212/5f5e2c71f5c79a5e0e142d6b/html5/thumbnails/17.jpg)
Overview of the Algorithm
When advancing the sweep-line, we can associate
a parabola with each seen site. We know we can
finalize the Voronoi Diagram behind these
parabolas (the beach-line).
![Page 18: Fortune’s Algorithm formisha/Spring20/11a.pdf · Overview of the Algorithm Goal: Given a set of points (sites), the goal is to use a ... we advance the sweep-line. ... Half-Edge](https://reader034.vdocuments.mx/reader034/viewer/2022050212/5f5e2c71f5c79a5e0e142d6b/html5/thumbnails/18.jpg)
Overview of the Algorithm
When advancing the sweep-line, we can associate
a parabola with each seen site. We know we can
finalize the Voronoi Diagram behind these
parabolas (the beach-line).
Fortune’s Algorithm tracks the
beach-line as it evolves until it
has passed through all of the
event points.
![Page 19: Fortune’s Algorithm formisha/Spring20/11a.pdf · Overview of the Algorithm Goal: Given a set of points (sites), the goal is to use a ... we advance the sweep-line. ... Half-Edge](https://reader034.vdocuments.mx/reader034/viewer/2022050212/5f5e2c71f5c79a5e0e142d6b/html5/thumbnails/19.jpg)
Overview of the Algorithm
As the sweep-line advances, the beach-line evolves
in one of two ways: Discrete:
The topology of the beach-front changes
Continuous:
The geometry of an individual arc changes
We only need to track
the discrete events.
![Page 20: Fortune’s Algorithm formisha/Spring20/11a.pdf · Overview of the Algorithm Goal: Given a set of points (sites), the goal is to use a ... we advance the sweep-line. ... Half-Edge](https://reader034.vdocuments.mx/reader034/viewer/2022050212/5f5e2c71f5c79a5e0e142d6b/html5/thumbnails/20.jpg)
Overview of the Algorithm
What are the events that change the topology of the
beach-line?
![Page 21: Fortune’s Algorithm formisha/Spring20/11a.pdf · Overview of the Algorithm Goal: Given a set of points (sites), the goal is to use a ... we advance the sweep-line. ... Half-Edge](https://reader034.vdocuments.mx/reader034/viewer/2022050212/5f5e2c71f5c79a5e0e142d6b/html5/thumbnails/21.jpg)
Overview of the Algorithm
What are the events that change the topology of the
beach-line? The sweep-line passes across a site
⇒ A new parabola is introduced, splitting
an old parabola in two
![Page 22: Fortune’s Algorithm formisha/Spring20/11a.pdf · Overview of the Algorithm Goal: Given a set of points (sites), the goal is to use a ... we advance the sweep-line. ... Half-Edge](https://reader034.vdocuments.mx/reader034/viewer/2022050212/5f5e2c71f5c79a5e0e142d6b/html5/thumbnails/22.jpg)
Overview of the Algorithm
What are the events that change the topology of the
beach-line? The sweep-line passes across a site
⇒ A new parabola is introduced, splitting
an old parabola in two
An arc is born
![Page 23: Fortune’s Algorithm formisha/Spring20/11a.pdf · Overview of the Algorithm Goal: Given a set of points (sites), the goal is to use a ... we advance the sweep-line. ... Half-Edge](https://reader034.vdocuments.mx/reader034/viewer/2022050212/5f5e2c71f5c79a5e0e142d6b/html5/thumbnails/23.jpg)
Overview of the Algorithm
What are the events that change the topology of the
beach-line? The sweep-line passes across a site
⇒ A new parabola is introduced, splitting
an old parabola in two
An arc is born
![Page 24: Fortune’s Algorithm formisha/Spring20/11a.pdf · Overview of the Algorithm Goal: Given a set of points (sites), the goal is to use a ... we advance the sweep-line. ... Half-Edge](https://reader034.vdocuments.mx/reader034/viewer/2022050212/5f5e2c71f5c79a5e0e142d6b/html5/thumbnails/24.jpg)
Overview of the Algorithm
What are the events that change the topology of the
beach-line? The sweep-line passes across a site
⇒ A new parabola is introduced, splitting
an old parabola in two
An arc is born
![Page 25: Fortune’s Algorithm formisha/Spring20/11a.pdf · Overview of the Algorithm Goal: Given a set of points (sites), the goal is to use a ... we advance the sweep-line. ... Half-Edge](https://reader034.vdocuments.mx/reader034/viewer/2022050212/5f5e2c71f5c79a5e0e142d6b/html5/thumbnails/25.jpg)
Overview of the Algorithm
What are the events that change the topology of the
beach-line? The sweep-line passes across a site
⇒ A new parabola is introduced, splitting
an old parabola in two
An arc is born
![Page 26: Fortune’s Algorithm formisha/Spring20/11a.pdf · Overview of the Algorithm Goal: Given a set of points (sites), the goal is to use a ... we advance the sweep-line. ... Half-Edge](https://reader034.vdocuments.mx/reader034/viewer/2022050212/5f5e2c71f5c79a5e0e142d6b/html5/thumbnails/26.jpg)
Overview of the Algorithm
What are the events that change the topology of the
beach-line? The sweep-line passes across a site
⇒ A new parabola is introduced, splitting
an old parabola in two
This corresponds to a new face
in the Voronoi Diagram.
An arc is born
![Page 27: Fortune’s Algorithm formisha/Spring20/11a.pdf · Overview of the Algorithm Goal: Given a set of points (sites), the goal is to use a ... we advance the sweep-line. ... Half-Edge](https://reader034.vdocuments.mx/reader034/viewer/2022050212/5f5e2c71f5c79a5e0e142d6b/html5/thumbnails/27.jpg)
Overview of the Algorithm
What are the events that change the topology of the
beach-line? The sweep-line passes across a site
⇒ A new parabola is introduced, splitting
an old parabola in two
This corresponds to a new face
in the Voronoi Diagram.
This occurs when the sweep-
line passes through the site.
An arc is born
![Page 28: Fortune’s Algorithm formisha/Spring20/11a.pdf · Overview of the Algorithm Goal: Given a set of points (sites), the goal is to use a ... we advance the sweep-line. ... Half-Edge](https://reader034.vdocuments.mx/reader034/viewer/2022050212/5f5e2c71f5c79a5e0e142d6b/html5/thumbnails/28.jpg)
Overview of the Algorithm
What are the events that change the topology of the
beach-line? One parabolic arc overtakes another
⇒ A parabolic arc is removed
![Page 29: Fortune’s Algorithm formisha/Spring20/11a.pdf · Overview of the Algorithm Goal: Given a set of points (sites), the goal is to use a ... we advance the sweep-line. ... Half-Edge](https://reader034.vdocuments.mx/reader034/viewer/2022050212/5f5e2c71f5c79a5e0e142d6b/html5/thumbnails/29.jpg)
Overview of the Algorithm
What are the events that change the topology of the
beach-line? One parabolic arc overtakes another
⇒ A parabolic arc is removed
![Page 30: Fortune’s Algorithm formisha/Spring20/11a.pdf · Overview of the Algorithm Goal: Given a set of points (sites), the goal is to use a ... we advance the sweep-line. ... Half-Edge](https://reader034.vdocuments.mx/reader034/viewer/2022050212/5f5e2c71f5c79a5e0e142d6b/html5/thumbnails/30.jpg)
Overview of the Algorithm
What are the events that change the topology of the
beach-line? One parabolic arc overtakes another
⇒ A parabolic arc is removed
![Page 31: Fortune’s Algorithm formisha/Spring20/11a.pdf · Overview of the Algorithm Goal: Given a set of points (sites), the goal is to use a ... we advance the sweep-line. ... Half-Edge](https://reader034.vdocuments.mx/reader034/viewer/2022050212/5f5e2c71f5c79a5e0e142d6b/html5/thumbnails/31.jpg)
Overview of the Algorithm
What are the events that change the topology of the
beach-line? One parabolic arc overtakes another
⇒ A parabolic arc is removed
An arc is removed
![Page 32: Fortune’s Algorithm formisha/Spring20/11a.pdf · Overview of the Algorithm Goal: Given a set of points (sites), the goal is to use a ... we advance the sweep-line. ... Half-Edge](https://reader034.vdocuments.mx/reader034/viewer/2022050212/5f5e2c71f5c79a5e0e142d6b/html5/thumbnails/32.jpg)
Overview of the Algorithm
What are the events that change the topology of the
beach-line? One parabolic arc overtakes another
⇒ A parabolic arc is removed
An arc is removed
![Page 33: Fortune’s Algorithm formisha/Spring20/11a.pdf · Overview of the Algorithm Goal: Given a set of points (sites), the goal is to use a ... we advance the sweep-line. ... Half-Edge](https://reader034.vdocuments.mx/reader034/viewer/2022050212/5f5e2c71f5c79a5e0e142d6b/html5/thumbnails/33.jpg)
Overview of the Algorithm
An arc is removed
What are the events that change the topology of the
beach-line? One parabolic arc overtakes another
⇒ A parabolic arc is removed
This corresponds to a new vertex
in the Voronoi Diagram.
![Page 34: Fortune’s Algorithm formisha/Spring20/11a.pdf · Overview of the Algorithm Goal: Given a set of points (sites), the goal is to use a ... we advance the sweep-line. ... Half-Edge](https://reader034.vdocuments.mx/reader034/viewer/2022050212/5f5e2c71f5c79a5e0e142d6b/html5/thumbnails/34.jpg)
Overview of the Algorithm
An arc is removed
What are the events that change the topology of the
beach-line? One parabolic arc overtakes another
⇒ A parabolic arc is removed
This corresponds to a new vertex
in the Voronoi Diagram.
This occurs when the sweep-line
crosses the top of the circumcircle
through the three sites
![Page 35: Fortune’s Algorithm formisha/Spring20/11a.pdf · Overview of the Algorithm Goal: Given a set of points (sites), the goal is to use a ... we advance the sweep-line. ... Half-Edge](https://reader034.vdocuments.mx/reader034/viewer/2022050212/5f5e2c71f5c79a5e0e142d6b/html5/thumbnails/35.jpg)
Outline of the Algorithm
• Create the faces of Voronoi diagrams (sites)
• Initialize the event-list of arc insertions/deletions
with the sites
• Initialize an empty beach-line
• Iterate through the event list If the next event is an insertion:
» …
If the next event is a deletion:
» …
• Compute the Delaunay Triangulation
![Page 36: Fortune’s Algorithm formisha/Spring20/11a.pdf · Overview of the Algorithm Goal: Given a set of points (sites), the goal is to use a ... we advance the sweep-line. ... Half-Edge](https://reader034.vdocuments.mx/reader034/viewer/2022050212/5f5e2c71f5c79a5e0e142d6b/html5/thumbnails/36.jpg)
Outline of the Algorithm
Insertion: Add an arc to the beach-line, splitting an old arc in two
![Page 37: Fortune’s Algorithm formisha/Spring20/11a.pdf · Overview of the Algorithm Goal: Given a set of points (sites), the goal is to use a ... we advance the sweep-line. ... Half-Edge](https://reader034.vdocuments.mx/reader034/viewer/2022050212/5f5e2c71f5c79a5e0e142d6b/html5/thumbnails/37.jpg)
Outline of the Algorithm
Insertion: Add an arc to the beach-line, splitting an old arc in two
Add a Voronoi edge to the diagram
![Page 38: Fortune’s Algorithm formisha/Spring20/11a.pdf · Overview of the Algorithm Goal: Given a set of points (sites), the goal is to use a ... we advance the sweep-line. ... Half-Edge](https://reader034.vdocuments.mx/reader034/viewer/2022050212/5f5e2c71f5c79a5e0e142d6b/html5/thumbnails/38.jpg)
Outline of the Algorithm
Insertion: Add an arc to the beach-line, splitting an old arc in two
Add a Voronoi edge to the diagram
Check for potential deletion events with neighbors of
the new arc and add to the event-list
![Page 39: Fortune’s Algorithm formisha/Spring20/11a.pdf · Overview of the Algorithm Goal: Given a set of points (sites), the goal is to use a ... we advance the sweep-line. ... Half-Edge](https://reader034.vdocuments.mx/reader034/viewer/2022050212/5f5e2c71f5c79a5e0e142d6b/html5/thumbnails/39.jpg)
Outline of the Algorithm
Deletion: Check if the deletion event is valid
If the circumcenter is behind the beach-line, that means
there is some other site closer to the circumcenter than
the original three sites that generated it.
![Page 40: Fortune’s Algorithm formisha/Spring20/11a.pdf · Overview of the Algorithm Goal: Given a set of points (sites), the goal is to use a ... we advance the sweep-line. ... Half-Edge](https://reader034.vdocuments.mx/reader034/viewer/2022050212/5f5e2c71f5c79a5e0e142d6b/html5/thumbnails/40.jpg)
Outline of the Algorithm
Deletion (if active): Remove an arc from the beach-line
![Page 41: Fortune’s Algorithm formisha/Spring20/11a.pdf · Overview of the Algorithm Goal: Given a set of points (sites), the goal is to use a ... we advance the sweep-line. ... Half-Edge](https://reader034.vdocuments.mx/reader034/viewer/2022050212/5f5e2c71f5c79a5e0e142d6b/html5/thumbnails/41.jpg)
Outline of the Algorithm
Deletion (if active): Remove an arc from the beach-line
Add a Voronoi vertex and edge into the diagram
![Page 42: Fortune’s Algorithm formisha/Spring20/11a.pdf · Overview of the Algorithm Goal: Given a set of points (sites), the goal is to use a ... we advance the sweep-line. ... Half-Edge](https://reader034.vdocuments.mx/reader034/viewer/2022050212/5f5e2c71f5c79a5e0e142d6b/html5/thumbnails/42.jpg)
Outline of the Algorithm
Deletion (if active): Remove an arc from the beach-line
Add a Voronoi vertex and edge into the diagram
Check for potential deletion events with new neighbors
of the arc and add to the event-list
![Page 43: Fortune’s Algorithm formisha/Spring20/11a.pdf · Overview of the Algorithm Goal: Given a set of points (sites), the goal is to use a ... we advance the sweep-line. ... Half-Edge](https://reader034.vdocuments.mx/reader034/viewer/2022050212/5f5e2c71f5c79a5e0e142d6b/html5/thumbnails/43.jpg)
Outline of the Algorithm
Computing the Delaunay Triangulation: Using duality, connect sites if the associated Voronoi
faces share an edge.
![Page 44: Fortune’s Algorithm formisha/Spring20/11a.pdf · Overview of the Algorithm Goal: Given a set of points (sites), the goal is to use a ... we advance the sweep-line. ... Half-Edge](https://reader034.vdocuments.mx/reader034/viewer/2022050212/5f5e2c71f5c79a5e0e142d6b/html5/thumbnails/44.jpg)
Outline
• Math Review
• Overview of the Algorithm
• Implementation
Half-edge data structure
Event-list representation
Beach-line representation
Handling the events
![Page 45: Fortune’s Algorithm formisha/Spring20/11a.pdf · Overview of the Algorithm Goal: Given a set of points (sites), the goal is to use a ... we advance the sweep-line. ... Half-Edge](https://reader034.vdocuments.mx/reader034/viewer/2022050212/5f5e2c71f5c79a5e0e142d6b/html5/thumbnails/45.jpg)
Half-Edge Data Structure
Recall: Vertex Entry:
» Vertex data
» Outgoing half-edge
Face Entry:
» Face data
» Incident half-edge
Half-Edge Entry:
» Half-edge data
» Previous/next half-edges
» Opposite half-edge
» Starting vertex
» Incident face
𝑣1 𝑣3
𝑣4 𝑣5
𝑣2
𝑓1
𝑓3
𝑓2
𝑓5𝑓4
𝑒1𝑒2
𝑒3
𝑒4𝑒5 𝑒6
![Page 46: Fortune’s Algorithm formisha/Spring20/11a.pdf · Overview of the Algorithm Goal: Given a set of points (sites), the goal is to use a ... we advance the sweep-line. ... Half-Edge](https://reader034.vdocuments.mx/reader034/viewer/2022050212/5f5e2c71f5c79a5e0e142d6b/html5/thumbnails/46.jpg)
Half-Edge Data Structure
Useful to have a generic (template) class for
half-edge data-structures and then instantiate
with content type. Vertices will store data of type VData,
Half-Edges will store data of type HEData,
Faces will store data of type FData.
![Page 47: Fortune’s Algorithm formisha/Spring20/11a.pdf · Overview of the Algorithm Goal: Given a set of points (sites), the goal is to use a ... we advance the sweep-line. ... Half-Edge](https://reader034.vdocuments.mx/reader034/viewer/2022050212/5f5e2c71f5c79a5e0e142d6b/html5/thumbnails/47.jpg)
Half-Edge Data Structure
Pre-declare the objects since they will
reference each other.
template< typename VData , typename HEData , typename FData >struct HalfEdge{
struct V; // The vertex
struct HE; // The half-edge
struct F; // The face
![Page 48: Fortune’s Algorithm formisha/Spring20/11a.pdf · Overview of the Algorithm Goal: Given a set of points (sites), the goal is to use a ... we advance the sweep-line. ... Half-Edge](https://reader034.vdocuments.mx/reader034/viewer/2022050212/5f5e2c71f5c79a5e0e142d6b/html5/thumbnails/48.jpg)
Half-Edge Data Structure
Declaring functions acting on vertices, half-
edges, and faces
typedef std::function< void ( V * ) > VFunctor;
typedef std::function< void ( const V * ) > ConstVFunctor;
typedef std::function< void ( HE * ) > HEFunctor;
typedef std::function< void ( const HE * ) > ConstHEFunctor;
typedef std::function< void ( F * ) > FFunctor;
typedef std::function< void ( const F * ) > ConstFFunctor;
![Page 49: Fortune’s Algorithm formisha/Spring20/11a.pdf · Overview of the Algorithm Goal: Given a set of points (sites), the goal is to use a ... we advance the sweep-line. ... Half-Edge](https://reader034.vdocuments.mx/reader034/viewer/2022050212/5f5e2c71f5c79a5e0e142d6b/html5/thumbnails/49.jpg)
Half-Edge Data Structure
Declaring the vertex structure
struct V
{
HE *halfEdge;
VData data;
V( VData d=VData() );
void processHalfEdges( HEFunctor f );
void processHalfEdges( ConstHEFunctor f ) const;
void processFaces( FFunctor f );
void processFaces( ConstFFunctor f ) const;
};
![Page 50: Fortune’s Algorithm formisha/Spring20/11a.pdf · Overview of the Algorithm Goal: Given a set of points (sites), the goal is to use a ... we advance the sweep-line. ... Half-Edge](https://reader034.vdocuments.mx/reader034/viewer/2022050212/5f5e2c71f5c79a5e0e142d6b/html5/thumbnails/50.jpg)
Half-Edge Data Structure
Declaring the half-edge structure
struct HE
{
HE *opposite , *previous , *next;
V *startVertex;
F *face;
HEData data;
HE( HEData d=HEData() );
};
![Page 51: Fortune’s Algorithm formisha/Spring20/11a.pdf · Overview of the Algorithm Goal: Given a set of points (sites), the goal is to use a ... we advance the sweep-line. ... Half-Edge](https://reader034.vdocuments.mx/reader034/viewer/2022050212/5f5e2c71f5c79a5e0e142d6b/html5/thumbnails/51.jpg)
Half-Edge Data Structure
Declaring the face structure
struct F
{
HE *halfEdge;
FData data;
F( FData d=FData() );
void processHalfEdges( HEFunctor f );
void processHalfEdges( ConstHEFunctor f ) const;
void processVertices ( VFunctor f );
void processVertices ( ConstVFunctor f ) const;
};
![Page 52: Fortune’s Algorithm formisha/Spring20/11a.pdf · Overview of the Algorithm Goal: Given a set of points (sites), the goal is to use a ... we advance the sweep-line. ... Half-Edge](https://reader034.vdocuments.mx/reader034/viewer/2022050212/5f5e2c71f5c79a5e0e142d6b/html5/thumbnails/52.jpg)
Half-Edge Data Structure
Defining the vertex constructor
template< typename VData , typename HEData , typename FData >
HalfEdge< VData , HEData , FData >::V::V( VData d )
:data(d) , halfEdge(NULL) { }
![Page 53: Fortune’s Algorithm formisha/Spring20/11a.pdf · Overview of the Algorithm Goal: Given a set of points (sites), the goal is to use a ... we advance the sweep-line. ... Half-Edge](https://reader034.vdocuments.mx/reader034/viewer/2022050212/5f5e2c71f5c79a5e0e142d6b/html5/thumbnails/53.jpg)
Half-Edge Data Structure
Defining the vertex neighboring edge processor
template< typename VData , typename HEData , typename FData >
void HalfEdge< VData , HEData , FData >::V::processHalfEdges
( HalfEdge< VData , HEData , FData >::HEFunctor f )
{
for( HE *he=halfEdge ; he ; he=he->opposite->next )
{
f( he );if( he->opposite->next==halfEdge ) break;
}
}
![Page 54: Fortune’s Algorithm formisha/Spring20/11a.pdf · Overview of the Algorithm Goal: Given a set of points (sites), the goal is to use a ... we advance the sweep-line. ... Half-Edge](https://reader034.vdocuments.mx/reader034/viewer/2022050212/5f5e2c71f5c79a5e0e142d6b/html5/thumbnails/54.jpg)
Half-Edge Data Structure
Defining the vertex neighboring face processor
template< typename VData , typename HEData , typename FData >
void HalfEdge< VData , HEData , FData >::V::processFaces
( HalfEdge< VData , HEData , FData >::FFunctor f )
{
processHalfEdges( [](HE *he ){ return f( he->face ); } );
}
![Page 55: Fortune’s Algorithm formisha/Spring20/11a.pdf · Overview of the Algorithm Goal: Given a set of points (sites), the goal is to use a ... we advance the sweep-line. ... Half-Edge](https://reader034.vdocuments.mx/reader034/viewer/2022050212/5f5e2c71f5c79a5e0e142d6b/html5/thumbnails/55.jpg)
Half-Edge Data Structure
Defining the half-edge constructor
template< typename VData , typename HEData , typename FData >
HalfEdge< VData , HEData , FData >::HE::HE( HEData d )
:data(d) ,opposite(NULL) , previous(NULL) , next(NULL) ,startVertex(NULL) ,face(NULL) { }
![Page 56: Fortune’s Algorithm formisha/Spring20/11a.pdf · Overview of the Algorithm Goal: Given a set of points (sites), the goal is to use a ... we advance the sweep-line. ... Half-Edge](https://reader034.vdocuments.mx/reader034/viewer/2022050212/5f5e2c71f5c79a5e0e142d6b/html5/thumbnails/56.jpg)
Half-Edge Data Structure
Defining the face constructor
template< typename VData , typename HEData , typename FData >
HalfEdge< VData , HEData , FData >::F::F( FData d )
:data(d) ,halfEdge(NULL) { }
![Page 57: Fortune’s Algorithm formisha/Spring20/11a.pdf · Overview of the Algorithm Goal: Given a set of points (sites), the goal is to use a ... we advance the sweep-line. ... Half-Edge](https://reader034.vdocuments.mx/reader034/viewer/2022050212/5f5e2c71f5c79a5e0e142d6b/html5/thumbnails/57.jpg)
Half-Edge Data Structure
Declaring vertex/edge/face data:
Vertices should track the position of the
circumcenter and its radius
Half-edges don’t need to track anything
Faces should track the associated site and its
index within the list of sites (for computing the
Delaunay Triangulation)
struct VData{ Geometry::Point2d vertex ; double radius; };
struct HEData{ };
struct FData{ Geometry::Point2i site ; int index; };
![Page 58: Fortune’s Algorithm formisha/Spring20/11a.pdf · Overview of the Algorithm Goal: Given a set of points (sites), the goal is to use a ... we advance the sweep-line. ... Half-Edge](https://reader034.vdocuments.mx/reader034/viewer/2022050212/5f5e2c71f5c79a5e0e142d6b/html5/thumbnails/58.jpg)
Half-Edge Data Structure
For simplicity of notation, typedef half-edge
elements to something concise.
typedef typename HalfEdge< VData , HEData , FData >::V Vertex;
typedef typename HalfEdge< VData , HEData , FData >::HE HalfEdge;
typedef typename HalfEdge< VData , HEData , FData >::F Face;
![Page 59: Fortune’s Algorithm formisha/Spring20/11a.pdf · Overview of the Algorithm Goal: Given a set of points (sites), the goal is to use a ... we advance the sweep-line. ... Half-Edge](https://reader034.vdocuments.mx/reader034/viewer/2022050212/5f5e2c71f5c79a5e0e142d6b/html5/thumbnails/59.jpg)
Outline
• Math Review
• Overview of the Algorithm
• Implementation
Half-edge data structure
Event-list representation
Beach-line representation
Handling the events
![Page 60: Fortune’s Algorithm formisha/Spring20/11a.pdf · Overview of the Algorithm Goal: Given a set of points (sites), the goal is to use a ... we advance the sweep-line. ... Half-Edge](https://reader034.vdocuments.mx/reader034/viewer/2022050212/5f5e2c71f5c79a5e0e142d6b/html5/thumbnails/60.jpg)
Event-List Representation
Challenges:
1. The event list is dynamic, with deletion events
introduced while sweeping
2. The event list must support two different types of
events – insertions and deletions
![Page 61: Fortune’s Algorithm formisha/Spring20/11a.pdf · Overview of the Algorithm Goal: Given a set of points (sites), the goal is to use a ... we advance the sweep-line. ... Half-Edge](https://reader034.vdocuments.mx/reader034/viewer/2022050212/5f5e2c71f5c79a5e0e142d6b/html5/thumbnails/61.jpg)
Event-List Representation
Approach:1. Use a balanced binary tree (e.g. std::set) to
represent the event-list
2. Have each event know its own type
![Page 62: Fortune’s Algorithm formisha/Spring20/11a.pdf · Overview of the Algorithm Goal: Given a set of points (sites), the goal is to use a ... we advance the sweep-line. ... Half-Edge](https://reader034.vdocuments.mx/reader034/viewer/2022050212/5f5e2c71f5c79a5e0e142d6b/html5/thumbnails/62.jpg)
Event-List Representation
An EventList object is a balanced binary tree
containing Event objects
struct Event;
typedef std::function< bool ( const Event & , const Event & ) > EventComparator;
struct EventList : public std::set< Event , EventComparator >
{
...
};
![Page 63: Fortune’s Algorithm formisha/Spring20/11a.pdf · Overview of the Algorithm Goal: Given a set of points (sites), the goal is to use a ... we advance the sweep-line. ... Half-Edge](https://reader034.vdocuments.mx/reader034/viewer/2022050212/5f5e2c71f5c79a5e0e142d6b/html5/thumbnails/63.jpg)
Event-List Representation
An Event object is either an Insertion or
Deletion object
struct Event
{
struct Insertion { ... };
struct Deletion { ... }
enum Type { INSERTION , DELETION };
Type type;
union { Insertion insertion ; Deletion deletion; }
static bool Compare( const Event &e1 , const Event &e2 );
};
![Page 64: Fortune’s Algorithm formisha/Spring20/11a.pdf · Overview of the Algorithm Goal: Given a set of points (sites), the goal is to use a ... we advance the sweep-line. ... Half-Edge](https://reader034.vdocuments.mx/reader034/viewer/2022050212/5f5e2c71f5c79a5e0e142d6b/html5/thumbnails/64.jpg)
Event-List Representation
An Insertion object corresponds to a Voronoi
face
struct Event
{
struct Insertion
{
Face *face;
double eventTime( void ) const;
};
};
![Page 65: Fortune’s Algorithm formisha/Spring20/11a.pdf · Overview of the Algorithm Goal: Given a set of points (sites), the goal is to use a ... we advance the sweep-line. ... Half-Edge](https://reader034.vdocuments.mx/reader034/viewer/2022050212/5f5e2c71f5c79a5e0e142d6b/html5/thumbnails/65.jpg)
Event-List Representation
A Deletion object corresponds to a circumcircle
of three sites (i.e. Voronoi faces)
struct Event
{
struct Deletion
{
Face *face1 , *face2 , *face3;
Geometry::Point2d center( void ) const;
double radius( void ) const;
double eventTime( void ) const;
};
};
![Page 66: Fortune’s Algorithm formisha/Spring20/11a.pdf · Overview of the Algorithm Goal: Given a set of points (sites), the goal is to use a ... we advance the sweep-line. ... Half-Edge](https://reader034.vdocuments.mx/reader034/viewer/2022050212/5f5e2c71f5c79a5e0e142d6b/html5/thumbnails/66.jpg)
Event-List Representation
An Insertion event happens when the sweep-
line passes through the site
double Event::Insertion::eventTime( void ) const
{
return face->data.site[1];
}
![Page 67: Fortune’s Algorithm formisha/Spring20/11a.pdf · Overview of the Algorithm Goal: Given a set of points (sites), the goal is to use a ... we advance the sweep-line. ... Half-Edge](https://reader034.vdocuments.mx/reader034/viewer/2022050212/5f5e2c71f5c79a5e0e142d6b/html5/thumbnails/67.jpg)
Event-List Representation
A Deletion event happens when the sweep-line
passes through the top of the circumcircle
double Event::Deletion::eventTime( void ) const
{
return center()[1] + radius();
}
![Page 68: Fortune’s Algorithm formisha/Spring20/11a.pdf · Overview of the Algorithm Goal: Given a set of points (sites), the goal is to use a ... we advance the sweep-line. ... Half-Edge](https://reader034.vdocuments.mx/reader034/viewer/2022050212/5f5e2c71f5c79a5e0e142d6b/html5/thumbnails/68.jpg)
Event-List Representation
Events can be ordered by their event-time
bool Event::Compare( const Event &e1 , const Event &e2 )
{
double t1 , t2;
if( e1.type==INSERTION ) t1 = e1.insertion.eventTime();
else t1 = e1.deletion.eventTime();
if( e2.type==INSERTION ) t2 = e2.insertion.eventTime();
else t2 = e2.deletion.eventTime();
return t1 < t2;
}
![Page 69: Fortune’s Algorithm formisha/Spring20/11a.pdf · Overview of the Algorithm Goal: Given a set of points (sites), the goal is to use a ... we advance the sweep-line. ... Half-Edge](https://reader034.vdocuments.mx/reader034/viewer/2022050212/5f5e2c71f5c79a5e0e142d6b/html5/thumbnails/69.jpg)
Outline
• Math Review
• Overview of the Algorithm
• Implementation
Half-edge data structure
Event-list representation
Beach-line representation
Handling the events
![Page 70: Fortune’s Algorithm formisha/Spring20/11a.pdf · Overview of the Algorithm Goal: Given a set of points (sites), the goal is to use a ... we advance the sweep-line. ... Half-Edge](https://reader034.vdocuments.mx/reader034/viewer/2022050212/5f5e2c71f5c79a5e0e142d6b/html5/thumbnails/70.jpg)
Beach-Line Representation
One way to represent a beach-line is by the
end-points of the parabolic arcs:
struct EndPoint
{
static double SweepLineHeight;
Face *leftFace , *rightFace;
HalfEdge *left , *right;
double x( void ) const;
};
![Page 71: Fortune’s Algorithm formisha/Spring20/11a.pdf · Overview of the Algorithm Goal: Given a set of points (sites), the goal is to use a ... we advance the sweep-line. ... Half-Edge](https://reader034.vdocuments.mx/reader034/viewer/2022050212/5f5e2c71f5c79a5e0e142d6b/html5/thumbnails/71.jpg)
Beach-Line Representation
To compute the 𝑥-coordinate of the end-point,
need to construct parabolic fronts for the left
and right sites and see where they intersect
double EndPoint::x( void ) const
{
…
}
![Page 72: Fortune’s Algorithm formisha/Spring20/11a.pdf · Overview of the Algorithm Goal: Given a set of points (sites), the goal is to use a ... we advance the sweep-line. ... Half-Edge](https://reader034.vdocuments.mx/reader034/viewer/2022050212/5f5e2c71f5c79a5e0e142d6b/html5/thumbnails/72.jpg)
Beach-Line Representation
To compute the 𝑥-coordinate of the end-point,
need to construct parabolic fronts for the left
and right sites and see where they intersect
double EndPoint::x( void ) const
{
…
}
Note:
The left/right face could be NULL if it
bounds left/right-most arc in the beach-line
Warning:
The two parabolas will intersect at two
points. Need to choose the right one
![Page 73: Fortune’s Algorithm formisha/Spring20/11a.pdf · Overview of the Algorithm Goal: Given a set of points (sites), the goal is to use a ... we advance the sweep-line. ... Half-Edge](https://reader034.vdocuments.mx/reader034/viewer/2022050212/5f5e2c71f5c79a5e0e142d6b/html5/thumbnails/73.jpg)
Beach-Line Representation
When an Insertion event occurs we will want
to query the beach line using the 𝑥-position of
the site. (The end-points of the arc will not be
known at the time.)
struct XPosition
{
double x;
};
![Page 74: Fortune’s Algorithm formisha/Spring20/11a.pdf · Overview of the Algorithm Goal: Given a set of points (sites), the goal is to use a ... we advance the sweep-line. ... Half-Edge](https://reader034.vdocuments.mx/reader034/viewer/2022050212/5f5e2c71f5c79a5e0e142d6b/html5/thumbnails/74.jpg)
Beach-Line Representation
As with the Event object, a beach-line element
object will be either an EndPoint or a Position
struct BLElement
{
struct EndPoint{ …. };
struct XPosition{ … };
enum Type{ END_POINT , POSITION };
Type type;
union { EndPoint endPoint ; Position position; }
static bool Compare( const BLElement &e1 , const BLElement &e2 );
};
![Page 75: Fortune’s Algorithm formisha/Spring20/11a.pdf · Overview of the Algorithm Goal: Given a set of points (sites), the goal is to use a ... we advance the sweep-line. ... Half-Edge](https://reader034.vdocuments.mx/reader034/viewer/2022050212/5f5e2c71f5c79a5e0e142d6b/html5/thumbnails/75.jpg)
Beach-Line Representation
BLElements can be ordered by their positions
bool BLElement::Compare( const BLElement &e1 , const BLElement &e2 )
{
double t1 , t2;
if( e1.type==END_POINT ) t1 = e1.endPoint.x();
else t1 = e1.position.x;
if( e2.type==END_POINT ) t2 = e2.endPoint.x();
else t2 = e2.position.x;
return t1 < t2;
}
![Page 76: Fortune’s Algorithm formisha/Spring20/11a.pdf · Overview of the Algorithm Goal: Given a set of points (sites), the goal is to use a ... we advance the sweep-line. ... Half-Edge](https://reader034.vdocuments.mx/reader034/viewer/2022050212/5f5e2c71f5c79a5e0e142d6b/html5/thumbnails/76.jpg)
Beach-Line Representation
The beach-line itself can be represented as a
balanced binary tree of BLElements
typedef std::function< bool ( const BLElement & , const BLElement & ) > BLElementComparator;
struct BeachLine : public std::set< BLElement , BLElementComparator >
{
bool sanityCheck( void ) const;
bool isActive( Geometry::Point2d p ) const;
};
![Page 77: Fortune’s Algorithm formisha/Spring20/11a.pdf · Overview of the Algorithm Goal: Given a set of points (sites), the goal is to use a ... we advance the sweep-line. ... Half-Edge](https://reader034.vdocuments.mx/reader034/viewer/2022050212/5f5e2c71f5c79a5e0e142d6b/html5/thumbnails/77.jpg)
Beach-Line Representation
Confirm that the beach line is consistent
bool BeachLine::sanityCheck( void ) const
{
for( auto iter=begin() ; iter!=end() ; iter++ )
{
auto next = std::next( iter );
if( iter!=end() )
if( iter->endPoint.rightFace!=next->endPoint.leftFace ) return false;
…
}
}
![Page 78: Fortune’s Algorithm formisha/Spring20/11a.pdf · Overview of the Algorithm Goal: Given a set of points (sites), the goal is to use a ... we advance the sweep-line. ... Half-Edge](https://reader034.vdocuments.mx/reader034/viewer/2022050212/5f5e2c71f5c79a5e0e142d6b/html5/thumbnails/78.jpg)
Beach-Line Representation
A 2D point is not active, if its 𝑦-coordinate is
less than the height of the parabolic arc over its
𝑥-coordinatebool BeachLine::isActive( Geometry::Point2d p ) const
{
BLElement e;
e.type = POSITION;
e.position.x = p[0];
auto upperIter = upper_bound( e );
auto lowerIter = std::prev( upperIter );
…
}
![Page 79: Fortune’s Algorithm formisha/Spring20/11a.pdf · Overview of the Algorithm Goal: Given a set of points (sites), the goal is to use a ... we advance the sweep-line. ... Half-Edge](https://reader034.vdocuments.mx/reader034/viewer/2022050212/5f5e2c71f5c79a5e0e142d6b/html5/thumbnails/79.jpg)
Outline
• Math Review
• Overview of the Algorithm
• Implementation
Half-edge data structure
Event-list representation
Beach-line representation
Handling the events
![Page 80: Fortune’s Algorithm formisha/Spring20/11a.pdf · Overview of the Algorithm Goal: Given a set of points (sites), the goal is to use a ... we advance the sweep-line. ... Half-Edge](https://reader034.vdocuments.mx/reader034/viewer/2022050212/5f5e2c71f5c79a5e0e142d6b/html5/thumbnails/80.jpg)
Handling the Events
Insertion (first event):
Create two EndPoint objects and add them into
the BeachLine object
»The left one should have a left NULL face and
the right one should have a right NULL face
![Page 81: Fortune’s Algorithm formisha/Spring20/11a.pdf · Overview of the Algorithm Goal: Given a set of points (sites), the goal is to use a ... we advance the sweep-line. ... Half-Edge](https://reader034.vdocuments.mx/reader034/viewer/2022050212/5f5e2c71f5c79a5e0e142d6b/html5/thumbnails/81.jpg)
Handling the Events
Insertion (subsequent event):
Find the arc that will be split
»Use std::set::upper_bound
![Page 82: Fortune’s Algorithm formisha/Spring20/11a.pdf · Overview of the Algorithm Goal: Given a set of points (sites), the goal is to use a ... we advance the sweep-line. ... Half-Edge](https://reader034.vdocuments.mx/reader034/viewer/2022050212/5f5e2c71f5c79a5e0e142d6b/html5/thumbnails/82.jpg)
Handling the Events
Insertion (subsequent event):
Find the arc that will be split
»Use std::set::upper_bound
Create the left and right EndPoint objects and add
them into the beach-line
leftright
![Page 83: Fortune’s Algorithm formisha/Spring20/11a.pdf · Overview of the Algorithm Goal: Given a set of points (sites), the goal is to use a ... we advance the sweep-line. ... Half-Edge](https://reader034.vdocuments.mx/reader034/viewer/2022050212/5f5e2c71f5c79a5e0e142d6b/html5/thumbnails/83.jpg)
Handling the Events
Insertion (subsequent event):
Add a Voronoi edge to the diagram
»Create the half-edge and its opposite
»Make them point to each other
»Set the incident faces
»Set the half-edges of the left and right EndPoints
leftright
![Page 84: Fortune’s Algorithm formisha/Spring20/11a.pdf · Overview of the Algorithm Goal: Given a set of points (sites), the goal is to use a ... we advance the sweep-line. ... Half-Edge](https://reader034.vdocuments.mx/reader034/viewer/2022050212/5f5e2c71f5c79a5e0e142d6b/html5/thumbnails/84.jpg)
Handling the Events
Insertion (subsequent event):
Try creating a Deletion using the right end-point
of the inserted arc and its right neighbor
![Page 85: Fortune’s Algorithm formisha/Spring20/11a.pdf · Overview of the Algorithm Goal: Given a set of points (sites), the goal is to use a ... we advance the sweep-line. ... Half-Edge](https://reader034.vdocuments.mx/reader034/viewer/2022050212/5f5e2c71f5c79a5e0e142d6b/html5/thumbnails/85.jpg)
Handling the Events
Insertion (subsequent event):
Try creating a Deletion using the right end-point
of the inserted arc and its right neighbor
Try creating a Deletion using the left end-point of
the inserted arc and its left neighbor
![Page 86: Fortune’s Algorithm formisha/Spring20/11a.pdf · Overview of the Algorithm Goal: Given a set of points (sites), the goal is to use a ... we advance the sweep-line. ... Half-Edge](https://reader034.vdocuments.mx/reader034/viewer/2022050212/5f5e2c71f5c79a5e0e142d6b/html5/thumbnails/86.jpg)
Handling the Events
Deletion:
Check if the circumcenter was just ahead of the
beach-line
![Page 87: Fortune’s Algorithm formisha/Spring20/11a.pdf · Overview of the Algorithm Goal: Given a set of points (sites), the goal is to use a ... we advance the sweep-line. ... Half-Edge](https://reader034.vdocuments.mx/reader034/viewer/2022050212/5f5e2c71f5c79a5e0e142d6b/html5/thumbnails/87.jpg)
Handling the Events
Deletion:
Use the three sites to compute the three
EndPoints that meet at the circumcenter
»Remove the two already in the beach-line and
insert the third
![Page 88: Fortune’s Algorithm formisha/Spring20/11a.pdf · Overview of the Algorithm Goal: Given a set of points (sites), the goal is to use a ... we advance the sweep-line. ... Half-Edge](https://reader034.vdocuments.mx/reader034/viewer/2022050212/5f5e2c71f5c79a5e0e142d6b/html5/thumbnails/88.jpg)
Handling the Events
Deletion:
Add a Voronoi vertex and edge into the diagram
»Create the new Voronoi vertex, v
»Create the half-edge and its opposite, new.leftand new.right
»Link up everything
v
![Page 89: Fortune’s Algorithm formisha/Spring20/11a.pdf · Overview of the Algorithm Goal: Given a set of points (sites), the goal is to use a ... we advance the sweep-line. ... Half-Edge](https://reader034.vdocuments.mx/reader034/viewer/2022050212/5f5e2c71f5c79a5e0e142d6b/html5/thumbnails/89.jpg)
Handling the Events
Deletion:
»Link up everythingrightleft
new
v
![Page 90: Fortune’s Algorithm formisha/Spring20/11a.pdf · Overview of the Algorithm Goal: Given a set of points (sites), the goal is to use a ... we advance the sweep-line. ... Half-Edge](https://reader034.vdocuments.mx/reader034/viewer/2022050212/5f5e2c71f5c79a5e0e142d6b/html5/thumbnails/90.jpg)
Handling the Events
Deletion:
»Link up everything
– Two half-edges are associated
with the old left end-point
– Two half-edges are associated
with the old right end-point
– Two half-edges are associated
with the new end-point
*A half-edge is left/right of an end-point if its associated face defines
the left/right arc at the end-point.
v
![Page 91: Fortune’s Algorithm formisha/Spring20/11a.pdf · Overview of the Algorithm Goal: Given a set of points (sites), the goal is to use a ... we advance the sweep-line. ... Half-Edge](https://reader034.vdocuments.mx/reader034/viewer/2022050212/5f5e2c71f5c79a5e0e142d6b/html5/thumbnails/91.jpg)
Handling the Events
Deletion:
»Link up everything– right.right->startVertex=v
– left.right->startVertex=v
– new.left->startVertex=v
*A half-edge is left/right of an end-point if its associated face defines
the left/right arc at the end-point.
v
![Page 92: Fortune’s Algorithm formisha/Spring20/11a.pdf · Overview of the Algorithm Goal: Given a set of points (sites), the goal is to use a ... we advance the sweep-line. ... Half-Edge](https://reader034.vdocuments.mx/reader034/viewer/2022050212/5f5e2c71f5c79a5e0e142d6b/html5/thumbnails/92.jpg)
Handling the Events
Deletion:
»Link up everything– v->startVertex=new.left
*A half-edge is left/right of an end-point if its associated face defines
the left/right arc at the end-point.
v
![Page 93: Fortune’s Algorithm formisha/Spring20/11a.pdf · Overview of the Algorithm Goal: Given a set of points (sites), the goal is to use a ... we advance the sweep-line. ... Half-Edge](https://reader034.vdocuments.mx/reader034/viewer/2022050212/5f5e2c71f5c79a5e0e142d6b/html5/thumbnails/93.jpg)
Handling the Events
Deletion:
»Link up everything– new.left->opposite=new.right
– new.right->opposite=new.left
– new.left->prev=left.left
– left.left->next=new.left
– new.right->next=right.right
– right.right->prev=new.right
– right.left->next=left.right
– left.right->next=right.left
*A half-edge is left/right of an end-point if its associated face defines
the left/right arc at the end-point.
![Page 94: Fortune’s Algorithm formisha/Spring20/11a.pdf · Overview of the Algorithm Goal: Given a set of points (sites), the goal is to use a ... we advance the sweep-line. ... Half-Edge](https://reader034.vdocuments.mx/reader034/viewer/2022050212/5f5e2c71f5c79a5e0e142d6b/html5/thumbnails/94.jpg)
Outline of the Algorithm
Deletion (if active):
Try creating a Deletion using the new end-
point and its right neighbor
![Page 95: Fortune’s Algorithm formisha/Spring20/11a.pdf · Overview of the Algorithm Goal: Given a set of points (sites), the goal is to use a ... we advance the sweep-line. ... Half-Edge](https://reader034.vdocuments.mx/reader034/viewer/2022050212/5f5e2c71f5c79a5e0e142d6b/html5/thumbnails/95.jpg)
Outline of the Algorithm
Deletion (if active):
Try creating a Deletion using the new end-
point and its right neighbor
Try creating a Deletion using the new end-
point and its left neighbor
![Page 96: Fortune’s Algorithm formisha/Spring20/11a.pdf · Overview of the Algorithm Goal: Given a set of points (sites), the goal is to use a ... we advance the sweep-line. ... Half-Edge](https://reader034.vdocuments.mx/reader034/viewer/2022050212/5f5e2c71f5c79a5e0e142d6b/html5/thumbnails/96.jpg)
Outline of the Algorithm
Warnings:
As with the triangulation code, you need to be
careful about whether you want to be just
above or just below the sweep-line as you
update the beach-line.
Unlike the triangulation code, it’s hard to get by
with integer arithmetic because deletion events
can happen at irrational heights.