Øyvind Hjelle and Morten Dæhlen
Triangulations and Applications
Figures algorithms and some equations as an
aid to oral exam.
November 27, 2007
Springer
Berlin Heidelberg NewYork
Hong Kong London
Milan Paris Tokyo
Contents
1 Delaunay Triangulations and Voronoi Diagrams . . . . . . . . . . . 1
2 Algorithms for Delaunay Triangulation . . . . . . . . . . . . . . . . . . . . 9
3 Data Dependent Triangulations . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
4 Constrained Delaunay Triangulation . . . . . . . . . . . . . . . . . . . . . . . 29
5 Delaunay Refinement Mesh Generation . . . . . . . . . . . . . . . . . . . . 35
6 Least Squares Approximation of Scattered Data . . . . . . . . . . . 47
6.1 Approximation over Triangulations of Subsets of Data . . . . . . . 49
6.2 Existence and Uniqueness . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
6.3 Sparsity and Symmetry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
6.4 Penalized Least Squares . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
6.5 Smoothing Terms for Penalized Least Squares . . . . . . . . . . . . . . 54
6.6 Approximation over General Triangulations . . . . . . . . . . . . . . . . . 58
6.7 Weighted Least Squares . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
6.8 Constrained Least Squares . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
6.9 Approximation over Binary Triangulations . . . . . . . . . . . . . . . . . . 62
6.10 Numerical Examples for Binary Triangulations . . . . . . . . . . . . . . 63
References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
List of Algorithms
1.1 Circumcircle test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 LOP, Local Optimization Procedure . . . . . . . . . . . . . . . . . . . . . . . . 1
2.1 Simple Delaunay triangulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.2 Radial Sweep . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.3 recSwapDelaunay(Edge ei) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
3.1 LOP for data dependent triangulations . . . . . . . . . . . . . . . . . . . . . . 19
3.2 Simulated annealing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
4.1 Eliminate um,with αm < π, from Qec,L . . . . . . . . . . . . . . . . . . . . . . 29
4.2 Include ec as an edge in a triangulation . . . . . . . . . . . . . . . . . . . . . 29
4.3 recSwapDelaunayConstr(Edge ei) . . . . . . . . . . . . . . . . . . . . . . . . . 29
5.1 Delaunay refinement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
6.1 General multilevel scheme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
1
Delaunay Triangulations and Voronoi Diagrams
Algorithm 1.1 Circumcircle test
1. if (cos α < 0 and cos β < 0)
2. return FALSE // swap the edge
3. if (cos α > 0 and cos β > 0)
4. return TRUE
5. if (cos α sin β + sin α cos β < 0)
6. return FALSE // swap the edge
7. else
8. return TRUE
Algorithm 1.2 LOP, Local Optimization Procedure
1. Make an arbitrary legal triangulation ∆ of a point set P .
2. if ∆ is locally optimal,
stop.
3. Let ei be an interior edge of ∆ which is not locally optimal.
4. Swap ei to ei, thus transforming ∆ to ∆ .
5. Let ∆ := ∆ .
6. goto 2.
(a) (b)
α α
Fig. 1.1. Two triangulations of the same point set that satisfy the MaxMin angle
criterion. The triangulation in (a) is a Delaunay triangulation.
∆a ∆b
a
α1 b
αa 2
α2
αb
1
Fig. 1.2. A neutral case for the MaxMin angle criterion. Only ∆a satisfy the Min-
Max criterion. The triangulation ∆b is optimal with respect to the MaxMin angle
criterion.
pi
Fig. 1.3. The Voronoi region of a point pi in the plane.
Fig. 1.4. The Voronoi diagram of a set of points in the plane.
Fig. 1.5. The straight line dual of the Voronoi diagram which yields a Delaunay
triangulation.
(a) p4 (b) p4
p3 p3
p1 p1
p2 p2
Fig. 1.6. Almost cocircular points p1, p2, p3 and p4 left, and cocircular points
right. In the cocircular case there are two possible solutions when constructing the
Delaunay triangulation.
Fig. 1.7. A Voronoi diagram and its straight-line dual, the Delaunay triangulation,
with some of the circumcircles.
p1 p2
V ( p1) V ( p2 )
v
V ( p3 )
C(t1,2,3 ) p4
p3
Fig. 1.8. The circimcircle C(t1,2,3) of a triangle in a Delaunay triangulation and
the Voronoi regions of p1, p2 and p3. A point p4 inside C(t1,2,3) is not in agreement
with the definition of a Voronoi diagram.
(a) p4 b’+ c’ (b) p4
p’+q’ bp q’ b+p
p1 p3 p1 p’ c’ p3
b’
q c+q
c
p2
p2
Fig. 1.9. Illustration for the proof of Lemma ??.
αα γ
β
2α
Fig. 1.10. Inscribed angles α on the same arc are equal, and γ < α < β.
(a) (b)
p4
V ( p4 ) ev ,∞
v v
V ( p3 )
( )p1
V ( p2) C t1,2,4 p3
p2 p3
Fig. 1.11. Illustration for the proof of Lemma ??.
Fig. 1.12. Example showing that choosing the diagonal with the minimum length
violates the circle criterion.
p4
v3 β v4
p3
p1
v2 α v1
p2
Fig. 1.13. Illustration for circumcircle test based on interior angles.
(a) (b) q
a a
C C
δp p
b b
c c
Fig. 1.14. Illustration for the proof of Theorem ??.
Fig. 1.15. Voronoi diagram of a point set P on the left, and Voronoi diagram of a
subset Pe ⊂ P on the right.
r
p
q
s
Fig. 1.16. Illustration for the proof of Theorem ??.
2
Algorithms for Delaunay Triangulation
Algorithm 2.1 Simple Delaunay triangulation
1. Compute conv(P ).
2. Apply Algorithm ?? to the vertices of conv(P ) to find an initial triangulation ∆ .
3. Apply Algorithm ?? to insert points of P , that are interior to conv(P ), into ∆ .
This gives a new triangulation ∆ after all points have been inserted.
4. Apply the LOP repeatedly on the edges of ∆ until no edge-swap occurs, and
thus obtain a triangulation ∆∗ which has all of its edges locally optimal.
Algorithm 2.2 Radial Sweep
1. Choose a point p near the centroid of P and connect p by radiating edges to all
other points of P , Figure 2.1(a).
2. Sort and order the points {P \p} by orientation and distance from p and connect
the ordered sequence by edges as in Figure 2.1(b). The result from this step is
a triangulation with a star-shaped domain as seen from p. Triangles may be
degenerate since points may have identical orientation relative to p.
3. Form a triangle for each triple of points (pi−1, pi, pi+1) on the boundary of the
triangulation. If the edge between pi−1 and pi+1 is outside the existing boundary,
include the triangle in the triangulation and update the boundary. Repeat this
step until no more triangles can be added. The resulting triangulation has a
convex boundary and all points are included in the triangulation, Figure 2.1(c).
4. Apply the LOP repeatedly to the edges until no edge-swap occurs, to obtain a
Delaunay triangulation, Figure 2.1(d).
10 2 Algorithms for Delaunay Triangulation
Algorithm 2.3 recSwapDelaunay(Edge ei)
1. if (circumcircleTest(ei ) == OK) // Algorithm 1.1 in Section ??
2. return
3. swapEdge(ei) // the swapped edge ei is incident with p
4. recSwapDelaunay(ei,1 ) // call this procedure recursively
5. recSwapDelaunay(ei,2 ) // call this procedure recursively
P00 = P
P01 P11
P02 P12 P22 P32
P03 P13 P23 P33 P43 P53 P63 P73
∆30 ∆31 ∆32 ∆33 ∆43 ∆35 ∆63 ∆73
∆20 ∆21 ∆22 ∆23
∆01 ∆11
∆00 = ∆(P )
(a) (b)
p (d)
(c)
Fig. 2.1. The Radial Sweep algorithm.
bp
α
ta,b,c tb,a,p
eb
c β
C(ta,b,c) β<α
a
Fig. 2.2. Circle growing from the base line eb to find a point p to form a new
triangle with eb.
(a) (b)
p
(c) (d)
p
Fig. 2.3. Influence polygons Qp in (a) and (c) when p is inserted interior and exterior
to an existing triangulation. Delaunay triangulations after p has been inserted are
shown in (b) and (d).
(a) (b)
p p
(c) (d)
p p
(e)
p
Fig. 2.4. Swapping procedure when inserting a point p into a Delaunay triangula-
tion. From (b) to the final triangulation in (e), each picture shows the triangulation
after one new edge has been swapped.
(a) (b) e1,1
p e1 e1,3 e' e1,2
e3 1
p e1,4
e3
e2 e2
Fig. 2.5. Starting the recursive swapping procedure.
c
ei,1 b
x
ei,3
p ei' ei,2
C'
ei,4
C
a
Fig. 2.6. Illustration for Lemma ??.
(a) (b) ti
C C´ ei
C C´
p
e'
ti i
p
Fig. 2.7. (a): The initial edges are Delaunay. (b): Edges that are swapped to p are
Delaunay.
25 O(N 2 )
20
15
10 O(N log N )
5 O(N )
0 12345
-5
Fig. 2.8. The curves y = x, y = x log x and y = x2 from bottom to top for
illustrating the difference between run-time order of O(N ), O(N log N ) and O(N 2).
(a) 1 (b) (c)
2
3
4
5
6
7
8
10 9
Fig. 2.9. Illustration of a worst case example for incremental Delaunay triangulation
algoritms.
(a) eu (b)
p
pR
pL eb
Fig. 2.10. Merging two Delaunay triangulations in the divide-and-conquer algo-
rithm.
3
Data Dependent Triangulations
Algorithm 3.1 LOP for data dependent triangulations
1. Make an arbitrary legal triangulation ∆ of a point set P .
2. if ∆ is locally optimal, that is, if (??) holds for all interior edges in ∆,
stop.
3. Let ei be an interior edge of ∆ which is not locally optimal.
4. Swap ei to ei, transforming ∆ to ∆ .
5. Let ∆ := ∆ .
6. goto 2.
0.2
0.1
0
0.6 0.8 1
y 0.2 0.4 x
0.2
00
Fig. 3.1. Test function F1(x, y) = (tanh (9y − 9x) + 1) /9.
Algorithm 3.2 Simulated annealing
1. do k = 1, . . . , ntemps
2. tk = rkt0, 0 < r < 1, e.g., r = 0.95
3. do l = 1, . . . , nlimit
4. while the number of “good swaps” ≤ glimit
5. let ∆ be the current triangulation; choose a random edge ei in ∆
6. if ei is swappable
7. let ∆ be the result of swapping ei and let d = Cp(∆ ) − Cp(∆)
be the corresponding change of the global cost function (??).
8. if d < 0, i.e., if the global cost decreases
9. swap ei (“good swap”)
10. else
11. choose a random number θ, 0 ≤ θ ≤ 1
12. if θ ≤ e−d/tk
13. swap ei (“bad swap”)
14. endif
15. endif
(a) (b)
Fig. 3.2. Delaunay triangulation of grid data and level curves.
Fig. 3.3. Triangulation optimized with the LOP algorithm using ABN criterion and
l1 norm.
ei1 ei2
tk ei
ei4 tl ei3
Fig. 3.4. Edges that must be checked when considering swapping the edge ei.
n(1) n(2)
p1 = ( x1, y1, z1) θ p2 = ( x2, y2, z2 )
Q1(x,y) t1 ei t2 Q2(x,y)
n = (nx,ny ) ( x2, y2 )
( x1, y1)
Fig. 3.5. Geometric embedding information used when considering edge-swap of
an edge ei in a convex quadrilateral defined by two triangles t1 and t2. Q1(x, y)
and Q2(x, y) are the equations of the planes defined by t1 and t2. The dashed lines
display the projection of the quadrilateral in the (x, y) -plane. n = (nx, ny) is a unit
vector orthogonal to the projection of ei in the (x, y)-plane.
Q1(x,y) ei Q2(x,y)
L1 L2
y v(1) γ Qh
x
v(2)
Fig. 3.6. The SCO data dependent swapping criterion.
(a) (b)
e1 e2 e1 e2'
(c)
e1' e2'
Fig. 3.7. A “bad swap” of e2 followed by a swap of e1 which reduces the clobal
cost.
1
0.8
0.6
0.4
0.2
0 200 400 k 600 800 1000
Fig. 3.8. Probability of making bad swaps in Step 12 of Algorithm 3.2.
(a) (b)
Fig. 3.9. Triangulation optimized with the simulated annealing algorithm using
ABN criterion and l1 norm.
Fig. 3.10. 1108 points measured from an interior detail of a car.
Fig. 3.11. Delaunay triangulation of the points in Figure 3.10, and level curves.
Fig. 3.12. Data dependent triangulation from LOP algorithm, SCO criterion and
l1 norm.
Fig. 3.13. Data dependent triangulation from the simulated annealing algorithm,
SCO criterion and l1 norm.
4
Constrained Delaunay Triangulation
Algorithm 4.1 Eliminate um,with αm < π, from Qec,L
1. while (r ≥ 1)
2. Let (um, ws) be a diagonal in a convex quadrilateral (um, ws−1, ws, ws+1).
3. Swap (um, ws) to (ws−1, ws+1)
4. r ← r − 1
Algorithm 4.2 Include ec as an edge in a triangulation
1. while (n >= 1)
2. Find a point um, 1 ≤ m ≤ n where αm < π
3. Apply Algorithm 4.1 to um
4. n ← n − 1
5. Qec,L ← (pa, u1, . . . , um−1, um+1, . . . , un, pb)
Algorithm 4.3 recSwapDelaunayConstr(Edge ei)
1. if (ei ∈ Ec)
2. return
3. if (circumcircleTest(ei ) == true) // Algorithm 1.1 in Section ??
4. return
5. swapEdge(ei) // the swapped edge ei is incident with p
6. recSwapDelaunay(ei,1 ) // call this procedure recursively
7. recSwapDelaunay(ei,2 )
// call this procedure recursively
(a) (b)
(c) (d)
Fig. 4.1. (a): A planar straight-line graph G(P, Ec). (b): Conventional Delaunay tri-
angulation of the point set P . (c): Constrained Delaunay triangulation of G(P, Ec).
(d): Illustration of the modified circle criterion for constrained Delaunay triangula-
tion.
(a) (b) p2
θ1
e
e' p1 e'
p3 θ2
θ2
p4
Fig. 4.2. The triangulation in (a) with e as an edge is a conventional Delaunay
triangulation. The triangulation in (b) is a constrained Delaunay triangulation due
to the constrained edge e .
(a) ec pb
pa
Qec ,L
(b)
pa ec pb
Q ec ,R
Fig. 4.3. (a) The influence region of a constrained edge ec that is inserted into an
existing triangulation. (b) the influence polygons Qec,L and Qec,R of ec.
p'
p
eb t
Y
Fig. 4.4. The growing circle reaches a point p first, but p is separated from eb by
a constrained edge and cannot form a triangle with eb.
Q ec ,L
(a)
ec
Q ec ,R
(b)
(c)
(d)
Fig. 4.5. Retriangulation of the influence region of a constrained edge ec. (a) to
(c) show how new triangles are constructed when retriangulating the left influence
polygon Qec,L. The growing circles (dotted) are shown when they have reached a
point where a new triangle can be formed with the base line. In (d) the constrained
Delaunay triangulation of the whole influence region is shown.
u2 u4 Qec ,L u6
α2 α4 u5 α6
(a) u1 α5
α1 u3 α3 ec
pb
pa Qec ,R
u5
(b) u1 u3 u4 α5
α1 α3 α4
pa
u2 α2 ec pb
(c)
pa u1
α1 ec pb
Fig. 4.6. Illustration for edge insertion and swapping. (b) shows the situation when
the point u1 has been isolated from the influence polygon Qec,L, and (c) shows the
situation when the last edge is swapped and takes on the role as the constrained
edge ec.
w0 = um−1 um w = ur+1 m+1
αm
ec
w1 w2 ... wr
Fig. 4.7. Illustration for Lemma ??.
(a) (b)
p
ec ec
Fig. 4.8. (a): The influence polygon Qp of a point p in a CDT ∆(P, ec) is shown
with bold edges. (b): The updated CDT ∆(P ∪ p, ec).
5
Delaunay Refinement Mesh Generation
Algorithm 5.1 Delaunay refinement
1. Make the initial CDT of the PSLG.
Remove triangles outside the triangulation domain.
2. while skinny triangles remain // (controls termination)
3. while any segment s is encroached upon
4. SplitSegment(s)
5. Let t be a skinny triangle and v the circumcenter of t.
6. if v encroaches upon any segments s1, s2, . . . , sk // “look-ahead”
7. for i = 1, . . . , k
8. SplitSegment(si)
9. goto 3
10. else
11. KillTriangle(t)
12. goto 5
36 5 Delaunay Refinement Mesh Generation
Case 1. (KillTriangle) v is inserted at the circumcenter of a skinny trian-
gle t.
The parent node p is chosen to be one of the two endpoints of the shortest
edge of t. (Figure 5.9).
Case 2. (SplitSegment) v is a node inserted at the midpoint of a segment s
that is encroached upon by a node p.
Thus p lies inside the diametral circle of s. If more than one node encroaches
upon s, assume without loss of generality that p is the closest node to v
that encroaches upon s. The shortest edge connected to v, which defines the
insertion radius rv, has p as the other endpoint unless p is not yet inserted and
thus rejected. This follows from the Delaunay property. Four possible roles of
p must be considered under SplitSegment.
Case 2a. p is an input node, or p is a node inserted in a segment not
incident to s. (Figure 5.10(a))
Case 2b. p is at the circumcenter of a skinny triangle and thus re-
jected since it encroaches upon s. (Figure 5.10(b), and Step 6–8 of Al-
gorithm 5.1.)
Case 2c. p is a node on a segment s incident to s that makes an angle
45◦ ≤ α < 90◦ with s. (Figure 5.10(c))
Case 2d. As Case 2c with α ≤ 45◦. (Figure 5.10(d))
5 Delaunay Refinement Mesh Generation 37
A sample input Constrained De- One encroached A second en-
planar straight line segment has been croached segment
graph (PSLG). launay trian- bisected. has been bisected.
gulation of the
PSLG. Encroached
segments are bold.
A third encroached The last en- The skinny trian- This cirumcenter
subsegment has croached subseg- gle’s cirumcenter is encroaches upon
been bisected. ment has been inserted. Find an- a segment, and is
bisected and a other skinny trian- therefore rejected.
skinny triangle is gle.
found.
Although the ver- The encroached A circumcenter The triangle’s cir-
tex was rejected, segment is split, is successfully cumcenter is re-
the segment it en- and the skinny inserted, creating jected since it en-
croached upon is triangle that led another skinny croaches upon a
still marked for bi- to its bisection is triangle. segment.
section. eliminated.
The encroached The skinny triangle This time, its cir- The final mesh
segment will be was not eliminated. cumcenter is in-
bisected. Try to insert its cir- serted successfully. with no interior
cumcenter again. Only one skinny
triangle is left. angle smaller than
arcsin 1 ≈ 20.7◦.
2B
√Fig. 5.1. The Delaunay refinement algorithm step-by-step with upper bound B =
2 on the circumradius-to-shortest-edge ratio. Illustration and most figure texts
from Shewchuk [1].
α 10
min 9
8
α 7
min 6
r 5
r/l 4 5 10 15 20 25 30 35 40 45 50 55 60
3 α
2 min
1
0
l
Fig. 5.2. Relationship between circumradius-to-shortest-edge ratio r/l and the min-
imum angle αmin of a triangle: r/l = 1/(2 sin αmin).
(a) (b)
v
tt
(c) (d)
vt v
Fig. 5.3. (a): A skinny triangle t in a Delaunay triangulation. (b): t’s circumcircle.
(c): The Voronoi diagram and the circumcenter of t positioned at a Voronoi point.
(d): Updated Delaunay triangulation after insertion of a node at t’s circumcenter.
Fig. 5.4. Spatial graded mesh uppermost, and a uniform mesh below. Illustration
from Shewchuk [1].
(a) (b) (c)
Fig. 5.5. Recursive bisection of a segment that is encroached upon. (a): Two nodes
encroach upon the segment initially. (b): After splitting the segment at its midpoint,
it is still encroached upon by a node. (c): After the second bisection there is no
encroachment.
s' p
2
s2
s1' ×
α
q
s1 ×
Fig. 5.6. Recursive bisection of incident segments that never terminates when α ≤
45◦ .
C(t)
t C(s')
p
v
s'
s
Fig. 5.7. Illustration for Lemma ??.
Fig. 5.8. Illustration of local feature size lf s() at some points relative to a planar
straight line graph. An arbitrary point in the plane marked with × has local feature
size equal to the radius of the circle drawn with center at ×.
rv
t
v
l
p
Fig. 5.9. Case 1 where v is inserted at the center of a skinny triangle t. The parent
node p is chosen as one of the endpoints of the shortest edge of t.
(a) (b)
t l ≥ rg
Input PSLG g
p p
rv rp
v
rv v
(c) s’
p ss
l rv (d) s’
aα p
β
l rv
v aα β
v
ss
(e) t l ≥ rg
g
p
rp
rv v
s
Fig. 5.10. Different roles of a parent node p which encroaches upon a segment s.
(a): p is on the input PSLG.
(b): p is at the circumcenter of a skinny triangle (and rejected).
(c) and (d): p is on a segment s incident with s with α ≥ 45◦ and α < 45◦
respectively. The filled bullet • at p indicates the position of p which defines the
lower bounds on the insertion radius rv in each case of Lemma ??.
(e): illustrates the same case as (b), but with p in a position which defines the lower
bound on rv.