Triangulations and Applications -...

75
Ø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

Transcript of Triangulations and Applications -...

Page 1: Triangulations and Applications - heim.ifi.uio.noheim.ifi.uio.no/oyvindhj/INF-MAT5370/eksamensFigurerEtc.pdf · triangulation. If the edge between pi−1 and pi+1 is outside the existing

Ø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

HongKong London

Milan Paris Tokyo

Page 2: Triangulations and Applications - heim.ifi.uio.noheim.ifi.uio.no/oyvindhj/INF-MAT5370/eksamensFigurerEtc.pdf · triangulation. If the edge between pi−1 and pi+1 is outside the existing
Page 3: Triangulations and Applications - heim.ifi.uio.noheim.ifi.uio.no/oyvindhj/INF-MAT5370/eksamensFigurerEtc.pdf · triangulation. If the edge between pi−1 and pi+1 is outside the existing

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 . . . . . . . . . . . 476.1 Approximation over Triangulations of Subsets of Data . . . . . . . 496.2 Existence and Uniqueness . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 516.3 Sparsity and Symmetry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 526.4 Penalized Least Squares . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 536.5 Smoothing Terms for Penalized Least Squares . . . . . . . . . . . . . . 546.6 Approximation over General Triangulations . . . . . . . . . . . . . . . . . 586.7 Weighted Least Squares . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 606.8 Constrained Least Squares . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 616.9 Approximation over Binary Triangulations . . . . . . . . . . . . . . . . . . 626.10 Numerical Examples for Binary Triangulations . . . . . . . . . . . . . . 63

References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69

Page 4: Triangulations and Applications - heim.ifi.uio.noheim.ifi.uio.no/oyvindhj/INF-MAT5370/eksamensFigurerEtc.pdf · triangulation. If the edge between pi−1 and pi+1 is outside the existing
Page 5: Triangulations and Applications - heim.ifi.uio.noheim.ifi.uio.no/oyvindhj/INF-MAT5370/eksamensFigurerEtc.pdf · triangulation. If the edge between pi−1 and pi+1 is outside the existing

List of Algorithms

1.1 Circumcircle test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.2 LOP, Local Optimization Procedure . . . . . . . . . . . . . . . . . . . . . . . . 12.1 Simple Delaunay triangulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92.2 Radial Sweep . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92.3 recSwapDelaunay(Edge ei) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103.1 LOP for data dependent triangulations . . . . . . . . . . . . . . . . . . . . . . 193.2 Simulated annealing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204.1 Eliminate um,with αm < π, from Qec,L . . . . . . . . . . . . . . . . . . . . . . 294.2 Include ec as an edge in a triangulation . . . . . . . . . . . . . . . . . . . . . 294.3 recSwapDelaunayConstr(Edge ei) . . . . . . . . . . . . . . . . . . . . . . . . . 295.1 Delaunay refinement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 356.1 General multilevel scheme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62

Page 6: Triangulations and Applications - heim.ifi.uio.noheim.ifi.uio.no/oyvindhj/INF-MAT5370/eksamensFigurerEtc.pdf · triangulation. If the edge between pi−1 and pi+1 is outside the existing
Page 7: Triangulations and Applications - heim.ifi.uio.noheim.ifi.uio.no/oyvindhj/INF-MAT5370/eksamensFigurerEtc.pdf · triangulation. If the edge between pi−1 and pi+1 is outside the existing

1

Delaunay Triangulations and Voronoi Diagrams

Algorithm 1.1 Circumcircle test

1. if (cos α < 0 and cos β < 0)2. return FALSE // swap the edge3. if (cos α > 0 and cos β > 0)4. return TRUE5. if (cos α sin β + sin α cos β < 0)6. return FALSE // swap the edge7. 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 e′i, thus transforming ∆ to ∆′.5. Let ∆ := ∆′.6. goto 2.

Page 8: Triangulations and Applications - heim.ifi.uio.noheim.ifi.uio.no/oyvindhj/INF-MAT5370/eksamensFigurerEtc.pdf · triangulation. If the edge between pi−1 and pi+1 is outside the existing

(a) (b)

α α

Fig. 1.1. Two triangulations of the same point set that satisfy the MaxMin anglecriterion. The triangulation in (a) is a Delaunay triangulation.

a

b

1αa

2αb

a∆ b∆

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

Page 9: Triangulations and Applications - heim.ifi.uio.noheim.ifi.uio.no/oyvindhj/INF-MAT5370/eksamensFigurerEtc.pdf · triangulation. If the edge between pi−1 and pi+1 is outside the existing

ip

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.

Page 10: Triangulations and Applications - heim.ifi.uio.noheim.ifi.uio.no/oyvindhj/INF-MAT5370/eksamensFigurerEtc.pdf · triangulation. If the edge between pi−1 and pi+1 is outside the existing

Fig. 1.5. The straight line dual of the Voronoi diagram which yields a Delaunaytriangulation.

p1

p2

p3

p4

p1

p2

p3

p4(a) (b)

Fig. 1.6. Almost cocircular points p1, p2, p3 and p4 left, and cocircular pointsright. In the cocircular case there are two possible solutions when constructing theDelaunay triangulation.

Page 11: Triangulations and Applications - heim.ifi.uio.noheim.ifi.uio.no/oyvindhj/INF-MAT5370/eksamensFigurerEtc.pdf · triangulation. If the edge between pi−1 and pi+1 is outside the existing

Fig. 1.7. A Voronoi diagram and its straight-line dual, the Delaunay triangulation,with some of the circumcircles.

p4

p3

p2

p1

v

)( 3,2,1tC

)( 3pV

)( 2pV)( 1pV

Fig. 1.8. The circimcircle C(t1,2,3) of a triangle in a Delaunay triangulation andthe Voronoi regions of p1, p2 and p3. A point p4 inside C(t1,2,3) is not in agreementwith the definition of a Voronoi diagram.

Page 12: Triangulations and Applications - heim.ifi.uio.noheim.ifi.uio.no/oyvindhj/INF-MAT5370/eksamensFigurerEtc.pdf · triangulation. If the edge between pi−1 and pi+1 is outside the existing

p4

p2

p1

p’+q’

b

c

p

q

b’+ c’

p3

p4

p2

p1

q’p’

b+p

c+q

b’c’ p3

(a) (b)

Fig. 1.9. Illustration for the proof of Lemma ??.

αα

β γ

Fig. 1.10. Inscribed angles α on the same arc are equal, and γ < α < β.

v

p4

p2

p1

p3

∞,ve

( )4,2,1tC

v

p3

(a) (b)

)( 4pV

)( 2pV )( 3pV

Fig. 1.11. Illustration for the proof of Lemma ??.

Page 13: Triangulations and Applications - heim.ifi.uio.noheim.ifi.uio.no/oyvindhj/INF-MAT5370/eksamensFigurerEtc.pdf · triangulation. If the edge between pi−1 and pi+1 is outside the existing

Fig. 1.12. Example showing that choosing the diagonal with the minimum lengthviolates the circle criterion.

α

β

v1v2

v3v4

p1

p2

p3

p4

Fig. 1.13. Illustration for circumcircle test based on interior angles.

p

a

b

c

C

p

a

b

c

(a) (b) q

δ

C

Fig. 1.14. Illustration for the proof of Theorem ??.

Page 14: Triangulations and Applications - heim.ifi.uio.noheim.ifi.uio.no/oyvindhj/INF-MAT5370/eksamensFigurerEtc.pdf · triangulation. If the edge between pi−1 and pi+1 is outside the existing

Fig. 1.15. Voronoi diagram of a point set P on the left, and Voronoi diagram of asubset eP ⊂ P on the right.

qp

s

r

Fig. 1.16. Illustration for the proof of Theorem ??.

Page 15: Triangulations and Applications - heim.ifi.uio.noheim.ifi.uio.no/oyvindhj/INF-MAT5370/eksamensFigurerEtc.pdf · triangulation. If the edge between pi−1 and pi+1 is outside the existing

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 allother points of P , Figure 2.1(a).

2. Sort and order the points P \p by orientation and distance from p and connectthe ordered sequence by edges as in Figure 2.1(b). The result from this step isa triangulation with a star-shaped domain as seen from p. Triangles may bedegenerate 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 thetriangulation. 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 thisstep until no more triangles can be added. The resulting triangulation has aconvex 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 aDelaunay triangulation, Figure 2.1(d).

Page 16: Triangulations and Applications - heim.ifi.uio.noheim.ifi.uio.no/oyvindhj/INF-MAT5370/eksamensFigurerEtc.pdf · triangulation. If the edge between pi−1 and pi+1 is outside the existing

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 e′i is incident with p4. recSwapDelaunay(ei,1) // call this procedure recursively5. recSwapDelaunay(ei,2) // call this procedure recursively

P 00 = P

P 10 P 1

1

P 20 P 2

1 P 22 P 2

3

P 30 P 3

1 P 32 P 3

3 P 34 P 3

5 P 36 P 3

7

∆30 ∆3

1︸ ︷︷ ︸ ∆32 ∆3

3︸ ︷︷ ︸ ∆34 ∆3

5︸ ︷︷ ︸ ∆36 ∆3

7︸ ︷︷ ︸

∆20 ∆2

1︸ ︷︷ ︸ ∆22 ∆2

3︸ ︷︷ ︸

∆10 ∆1

1︸ ︷︷ ︸

∆00 = ∆(P )

Page 17: Triangulations and Applications - heim.ifi.uio.noheim.ifi.uio.no/oyvindhj/INF-MAT5370/eksamensFigurerEtc.pdf · triangulation. If the edge between pi−1 and pi+1 is outside the existing

(a) (b)

(d)(c)

p

Fig. 2.1. The Radial Sweep algorithm.

Page 18: Triangulations and Applications - heim.ifi.uio.noheim.ifi.uio.no/oyvindhj/INF-MAT5370/eksamensFigurerEtc.pdf · triangulation. If the edge between pi−1 and pi+1 is outside the existing

p

ebta,b,c

C(ta,b,c)

c

a

β

tb,a,p

β < α

Fig. 2.2. Circle growing from the base line eb to find a point p to form a newtriangle with eb.

Page 19: Triangulations and Applications - heim.ifi.uio.noheim.ifi.uio.no/oyvindhj/INF-MAT5370/eksamensFigurerEtc.pdf · triangulation. If the edge between pi−1 and pi+1 is outside the existing

(a) (b)

(c) (d)

p

p

Fig. 2.3. Influence polygons Qp in (a) and (c) when p is inserted interior and exteriorto an existing triangulation. Delaunay triangulations after p has been inserted areshown in (b) and (d).

Page 20: Triangulations and Applications - heim.ifi.uio.noheim.ifi.uio.no/oyvindhj/INF-MAT5370/eksamensFigurerEtc.pdf · triangulation. If the edge between pi−1 and pi+1 is outside the existing

p

(a)

p

(b)

p

(c)

p

(d)

p

(e)

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 triangulationafter one new edge has been swapped.

Page 21: Triangulations and Applications - heim.ifi.uio.noheim.ifi.uio.no/oyvindhj/INF-MAT5370/eksamensFigurerEtc.pdf · triangulation. If the edge between pi−1 and pi+1 is outside the existing

p

(a)

e1

e3

e2

p

(b)

e3

e2

'1e

e1,2

e1,1

e1,3

e1,4

Fig. 2.5. Starting the recursive swapping procedure.

p

ei,1

ei,2

'ie

C

a

b

c

C'

xei,3

ei,4

Fig. 2.6. Illustration for Lemma ??.

Page 22: Triangulations and Applications - heim.ifi.uio.noheim.ifi.uio.no/oyvindhj/INF-MAT5370/eksamensFigurerEtc.pdf · triangulation. If the edge between pi−1 and pi+1 is outside the existing

p

C C´

p

C C´

ie

'ie

it

(a) (b)

it

Fig. 2.7. (a): The initial edges are Delaunay. (b): Edges that are swapped to p areDelaunay.

-5

0

5

10

15

20

25

1 2 3 4 5

)log( NNO

)( 2NO

)(NO

Fig. 2.8. The curves y = x, y = x log x and y = x2 from bottom to top forillustrating the difference between run-time order of O(N), O(N log N) and O(N2).

Page 23: Triangulations and Applications - heim.ifi.uio.noheim.ifi.uio.no/oyvindhj/INF-MAT5370/eksamensFigurerEtc.pdf · triangulation. If the edge between pi−1 and pi+1 is outside the existing

(a)

10

1

2

4

3

5

9

8

7

6

(b) (c)

Fig. 2.9. Illustration of a worst case example for incremental Delaunay triangulationalgoritms.

ebpL

eu

pR

p

(a) (b)

Fig. 2.10. Merging two Delaunay triangulations in the divide-and-conquer algo-rithm.

Page 24: Triangulations and Applications - heim.ifi.uio.noheim.ifi.uio.no/oyvindhj/INF-MAT5370/eksamensFigurerEtc.pdf · triangulation. If the edge between pi−1 and pi+1 is outside the existing
Page 25: Triangulations and Applications - heim.ifi.uio.noheim.ifi.uio.no/oyvindhj/INF-MAT5370/eksamensFigurerEtc.pdf · triangulation. If the edge between pi−1 and pi+1 is outside the existing

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 e′i, transforming ∆ to ∆′.5. Let ∆ := ∆′.6. goto 2.

0 0.2 0.40.8 1

x0

0.2

0.6

y

0

0.1

0.2

Fig. 3.1. Test function F1(x, y) = (tanh (9y − 9x) + 1) /9.

Page 26: Triangulations and Applications - heim.ifi.uio.noheim.ifi.uio.no/oyvindhj/INF-MAT5370/eksamensFigurerEtc.pdf · triangulation. If the edge between pi−1 and pi+1 is outside the existing

Algorithm 3.2 Simulated annealing

1. do k = 1, . . . , ntemps2. tk = rkt0, 0 < r < 1, e.g., r = 0.953. do l = 1, . . . , nlimit4. while the number of “good swaps” ≤ glimit5. let ∆ be the current triangulation; choose a random edge ei in ∆6. if ei is swappable7. 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 decreases9. swap ei (“good swap”)

10. else

11. choose a random number θ, 0 ≤ θ ≤ 112. 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.

Page 27: Triangulations and Applications - heim.ifi.uio.noheim.ifi.uio.no/oyvindhj/INF-MAT5370/eksamensFigurerEtc.pdf · triangulation. If the edge between pi−1 and pi+1 is outside the existing

Fig. 3.3. Triangulation optimized with the LOP algorithm using ABN criterion andl1 norm.

ie

1ie 2

ie

3ie4

ie

tk

tl

ie

1ie 2

ie

3ie4

ie

tk

tl

Fig. 3.4. Edges that must be checked when considering swapping the edge ei.

Page 28: Triangulations and Applications - heim.ifi.uio.noheim.ifi.uio.no/oyvindhj/INF-MAT5370/eksamensFigurerEtc.pdf · triangulation. If the edge between pi−1 and pi+1 is outside the existing

ei

θ

n(1)n(2)

t1t2),,( 1111 zyxp =

),,( 2222 zyxp =

),( 11 yx

),( 22 yx),(n yx nn=

Q1(x,y)Q2(x,y)

Fig. 3.5. Geometric embedding information used when considering edge-swap ofan 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 linesdisplay the projection of the quadrilateral in the (x, y) -plane. n = (nx, ny) is a unitvector orthogonal to the projection of ei in the (x, y)-plane.

ei

γv(2)v(1) Qh

L1

Q1(x,y) Q2(x,y)

x

y

L2

Fig. 3.6. The SCO data dependent swapping criterion.

Page 29: Triangulations and Applications - heim.ifi.uio.noheim.ifi.uio.no/oyvindhj/INF-MAT5370/eksamensFigurerEtc.pdf · triangulation. If the edge between pi−1 and pi+1 is outside the existing

e1e2

(a)

(c)

e1

(b)

'2e

'1e

'2e

Fig. 3.7. A “bad swap” of e2 followed by a swap of e1 which reduces the clobalcost.

0

0.2

0.4

0.6

0.8

1

200 400 600 800 1000k

Fig. 3.8. Probability of making bad swaps in Step 12 of Algorithm 3.2.

Page 30: Triangulations and Applications - heim.ifi.uio.noheim.ifi.uio.no/oyvindhj/INF-MAT5370/eksamensFigurerEtc.pdf · triangulation. If the edge between pi−1 and pi+1 is outside the existing

(a) (b)

Fig. 3.9. Triangulation optimized with the simulated annealing algorithm usingABN criterion and l1 norm.

Fig. 3.10. 1108 points measured from an interior detail of a car.

Page 31: Triangulations and Applications - heim.ifi.uio.noheim.ifi.uio.no/oyvindhj/INF-MAT5370/eksamensFigurerEtc.pdf · triangulation. If the edge between pi−1 and pi+1 is outside the existing

Fig. 3.11. Delaunay triangulation of the points in Figure 3.10, and level curves.

Page 32: Triangulations and Applications - heim.ifi.uio.noheim.ifi.uio.no/oyvindhj/INF-MAT5370/eksamensFigurerEtc.pdf · triangulation. If the edge between pi−1 and pi+1 is outside the existing

Fig. 3.12. Data dependent triangulation from LOP algorithm, SCO criterion andl1 norm.

Page 33: Triangulations and Applications - heim.ifi.uio.noheim.ifi.uio.no/oyvindhj/INF-MAT5370/eksamensFigurerEtc.pdf · triangulation. If the edge between pi−1 and pi+1 is outside the existing

Fig. 3.13. Data dependent triangulation from the simulated annealing algorithm,SCO criterion and l1 norm.

Page 34: Triangulations and Applications - heim.ifi.uio.noheim.ifi.uio.no/oyvindhj/INF-MAT5370/eksamensFigurerEtc.pdf · triangulation. If the edge between pi−1 and pi+1 is outside the existing
Page 35: Triangulations and Applications - heim.ifi.uio.noheim.ifi.uio.no/oyvindhj/INF-MAT5370/eksamensFigurerEtc.pdf · triangulation. If the edge between pi−1 and pi+1 is outside the existing

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− 15. 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 e′i is incident with p6. recSwapDelaunay(ei,1) // call this procedure recursively7. recSwapDelaunay(ei,2) // call this procedure recursively

Page 36: Triangulations and Applications - heim.ifi.uio.noheim.ifi.uio.no/oyvindhj/INF-MAT5370/eksamensFigurerEtc.pdf · triangulation. If the edge between pi−1 and pi+1 is outside the existing

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

2θ 2θ'e

e'e

1p

2p

3p

4p

Fig. 4.2. The triangulation in (a) with e as an edge is a conventional Delaunaytriangulation. The triangulation in (b) is a constrained Delaunay triangulation dueto the constrained edge e′.

Page 37: Triangulations and Applications - heim.ifi.uio.noheim.ifi.uio.no/oyvindhj/INF-MAT5370/eksamensFigurerEtc.pdf · triangulation. If the edge between pi−1 and pi+1 is outside the existing

(a)

(b)

LecQ ,

RecQ ,

ec

pa pb

pa pb

ec

Fig. 4.3. (a) The influence region of a constrained edge ec that is inserted into anexisting triangulation. (b) the influence polygons Qec,L and Qec,R of ec.

peb

'p

t

Y

Fig. 4.4. The growing circle reaches a point p′ first, but p′ is separated from eb bya constrained edge and cannot form a triangle with eb.

Page 38: Triangulations and Applications - heim.ifi.uio.noheim.ifi.uio.no/oyvindhj/INF-MAT5370/eksamensFigurerEtc.pdf · triangulation. If the edge between pi−1 and pi+1 is outside the existing

(a)

(b)

(c)

(d)

ec

LecQ ,

RecQ ,

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 influencepolygon Qec,L. The growing circles (dotted) are shown when they have reached apoint where a new triangle can be formed with the base line. In (d) the constrainedDelaunay triangulation of the whole influence region is shown.

Page 39: Triangulations and Applications - heim.ifi.uio.noheim.ifi.uio.no/oyvindhj/INF-MAT5370/eksamensFigurerEtc.pdf · triangulation. If the edge between pi−1 and pi+1 is outside the existing

ec

u1 u3

u2

u5

u4

pa pb

α1

α2

α3α4

α5

ec

u1pa pbα1

LecQ ,

ec

u1

u2 u4

u3

u6

u5

pa pb

α1

α2

α3

α4α5

α6(a)

(b)

(c)

RecQ ,

Fig. 4.6. Illustration for edge insertion and swapping. (b) shows the situation whenthe point u1 has been isolated from the influence polygon Qec,L, and (c) shows thesituation when the last edge is swapped and takes on the role as the constrainededge ec.

Page 40: Triangulations and Applications - heim.ifi.uio.noheim.ifi.uio.no/oyvindhj/INF-MAT5370/eksamensFigurerEtc.pdf · triangulation. If the edge between pi−1 and pi+1 is outside the existing

ec

w1 w2 wr

um

10 −= muw11 ++ = mr uw

...

αm

Fig. 4.7. Illustration for Lemma ??.

ce

(a) (b)

p

ce

Fig. 4.8. (a): The influence polygon Qp of a point p in a CDT ∆(P, ec) is shownwith bold edges. (b): The updated CDT ∆(P ∪ p, ec).

Page 41: Triangulations and Applications - heim.ifi.uio.noheim.ifi.uio.no/oyvindhj/INF-MAT5370/eksamensFigurerEtc.pdf · triangulation. If the edge between pi−1 and pi+1 is outside the existing

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 upon4. 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, . . . , k8. SplitSegment(si)9. goto 3

10. else

11. KillTriangle(t)12. goto 5

Page 42: Triangulations and Applications - heim.ifi.uio.noheim.ifi.uio.no/oyvindhj/INF-MAT5370/eksamensFigurerEtc.pdf · triangulation. If the edge between pi−1 and pi+1 is outside the existing

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 shortestedge of t. (Figure 5.9).

Case 2. (SplitSegment) v is a node inserted at the midpoint of a segment sthat is encroached upon by a node p.Thus p lies inside the diametral circle of s. If more than one node encroachesupon s, assume without loss of generality that p is the closest node to vthat encroaches upon s. The shortest edge connected to v, which defines theinsertion radius rv, has p as the other endpoint unless p is not yet inserted andthus rejected. This follows from the Delaunay property. Four possible roles ofp 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))

Page 43: Triangulations and Applications - heim.ifi.uio.noheim.ifi.uio.no/oyvindhj/INF-MAT5370/eksamensFigurerEtc.pdf · triangulation. If the edge between pi−1 and pi+1 is outside the existing

5 Delaunay Refinement Mesh Generation 37

A sample inputplanar straight linegraph (PSLG).

Constrained De-launay trian-gulation of thePSLG. Encroachedsegments are bold.

One encroachedsegment has beenbisected.

A second en-croached segmenthas been bisected.

A third encroachedsubsegment hasbeen bisected.

The last en-croached subseg-ment has beenbisected and askinny triangle isfound.

The skinny trian-gle’s cirumcenter isinserted. Find an-other skinny trian-gle.

This cirumcenterencroaches upona segment, and istherefore rejected.

Although the ver-tex was rejected,the segment it en-croached upon isstill marked for bi-section.

The encroachedsegment is split,and the skinnytriangle that ledto its bisection iseliminated.

A circumcenteris successfullyinserted, creatinganother skinnytriangle.

The triangle’s cir-cumcenter is re-jected since it en-croaches upon asegment.

The encroachedsegment will bebisected.

The skinny trianglewas not eliminated.Try to insert its cir-cumcenter again.

This time, its cir-cumcenter is in-serted successfully.Only one skinnytriangle is left.

The final meshwith no interiorangle smaller thanarcsin 1

2B≈ 20.7.

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

Page 44: Triangulations and Applications - heim.ifi.uio.noheim.ifi.uio.no/oyvindhj/INF-MAT5370/eksamensFigurerEtc.pdf · triangulation. If the edge between pi−1 and pi+1 is outside the existing

r

l

minα

minα

r/lminα

0

1

2

3

4

5

6

7

8

9

10

5 10 15 20 25 30 35 40 45 50 55 60

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

Page 45: Triangulations and Applications - heim.ifi.uio.noheim.ifi.uio.no/oyvindhj/INF-MAT5370/eksamensFigurerEtc.pdf · triangulation. If the edge between pi−1 and pi+1 is outside the existing

t

v

v

tv

(a) (b)

(c) (d)

t

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.

Page 46: Triangulations and Applications - heim.ifi.uio.noheim.ifi.uio.no/oyvindhj/INF-MAT5370/eksamensFigurerEtc.pdf · triangulation. If the edge between pi−1 and pi+1 is outside the existing

Fig. 5.4. Spatial graded mesh uppermost, and a uniform mesh below. Illustrationfrom Shewchuk [1].

Page 47: Triangulations and Applications - heim.ifi.uio.noheim.ifi.uio.no/oyvindhj/INF-MAT5370/eksamensFigurerEtc.pdf · triangulation. If the edge between pi−1 and pi+1 is outside the existing

(a) (b) (c)

Fig. 5.5. Recursive bisection of a segment that is encroached upon. (a): Two nodesencroach 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 noencroachment.

'

2s'

1s

1s2s

q

×

×

p

α

Fig. 5.6. Recursive bisection of incident segments that never terminates when α ≤45.

Page 48: Triangulations and Applications - heim.ifi.uio.noheim.ifi.uio.no/oyvindhj/INF-MAT5370/eksamensFigurerEtc.pdf · triangulation. If the edge between pi−1 and pi+1 is outside the existing

v

t

s

's

)(tC

p

)'(sC

Fig. 5.7. Illustration for Lemma ??.

Fig. 5.8. Illustration of local feature size lfs() at some points relative to a planarstraight line graph. An arbitrary point in the plane marked with × has local featuresize equal to the radius of the circle drawn with center at ×.

Page 49: Triangulations and Applications - heim.ifi.uio.noheim.ifi.uio.no/oyvindhj/INF-MAT5370/eksamensFigurerEtc.pdf · triangulation. If the edge between pi−1 and pi+1 is outside the existing

tv

rv

lp

Fig. 5.9. Case 1 where v is inserted at the center of a skinny triangle t. The parentnode p is chosen as one of the endpoints of the shortest edge of t.

Page 50: Triangulations and Applications - heim.ifi.uio.noheim.ifi.uio.no/oyvindhj/INF-MAT5370/eksamensFigurerEtc.pdf · triangulation. If the edge between pi−1 and pi+1 is outside the existing

p

t

s

vrv

rp

p

s

v

rv

α β

(c)

l

a

s’

p

s

v

rv

α β

(d)

l

a

s’

p

s

v

rv

(a)Input PSLG

g

p

t

s

vrv

rp

(b)

g

(e)grl ≥

grl ≥

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 thelower 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 lowerbound on rv.

Page 51: Triangulations and Applications - heim.ifi.uio.noheim.ifi.uio.no/oyvindhj/INF-MAT5370/eksamensFigurerEtc.pdf · triangulation. If the edge between pi−1 and pi+1 is outside the existing

Fig. 5.11. Corner-lopping when angles of the input PSLG are less than 60. Illus-tration from Shewchuk [2].

Page 52: Triangulations and Applications - heim.ifi.uio.noheim.ifi.uio.no/oyvindhj/INF-MAT5370/eksamensFigurerEtc.pdf · triangulation. If the edge between pi−1 and pi+1 is outside the existing
Page 53: Triangulations and Applications - heim.ifi.uio.noheim.ifi.uio.no/oyvindhj/INF-MAT5370/eksamensFigurerEtc.pdf · triangulation. If the edge between pi−1 and pi+1 is outside the existing

6

Least Squares Approximation of Scattered

Data

S01(∆) =

f ∈ C0(Ω) : f |ti

∈ Π1, i = 1, . . . , |T |

, (6.1)

(N1(x, y), N2(x, y), . . . , Nn(x, y)) ,

Ni(vj) = δij , j = 1, . . . , n, (6.2)

),( yxNi

iv

Fig. 6.1. A basis function Ni(x, y) for the function space S01(∆) and its (compact)

support Ωi.

f(x, y) =

n∑

i=1

ciNi(x, y), (6.3)

∇g =

(∂g

∂x,∂g

∂y

).

n =

(−

∂g

∂x,−

∂g

∂y, 1

). (6.4)

Page 54: Triangulations and Applications - heim.ifi.uio.noheim.ifi.uio.no/oyvindhj/INF-MAT5370/eksamensFigurerEtc.pdf · triangulation. If the edge between pi−1 and pi+1 is outside the existing

48 6 Least Squares Approximation of Scattered Data

a

c

b

v1v2

g

n'

Fig. 6.2. Triangle patch and normal vector.

n′ = v1 × v2 = (−ηaca − ηbcb − ηccc, −µaca − µbcb − µccc, 2A) (6.5)

ηa = (yb − yc) , ηb = (yc − ya) , ηc = (ya − yb) ,

µa = (xc − xb) , µb = (xa − xc) , µc = (xb − xa) ,

A =1

2((xb − xa) (yc − ya) − (yb − ya) (xc − xa)) . (6.6)

∇g = (ηaca + ηbcb + ηccc, µaca + µbcb + µccc)/2A. (6.7)

∇g =1

2A

(n∑

i=1

ηici,

n∑

i=1

µici

). (6.8)

Page 55: Triangulations and Applications - heim.ifi.uio.noheim.ifi.uio.no/oyvindhj/INF-MAT5370/eksamensFigurerEtc.pdf · triangulation. If the edge between pi−1 and pi+1 is outside the existing

6.1 Approximation over Triangulations of Subsets of Data 49

6.1 Approximation over Triangulations of Subsets of

Data

Fig. 6.3. Triangulation generated from a subset of a given data set.

V = vk = (xk, yk)nk=1 . (6.9)

f(xk, yk) ≈ zk, k = 1, . . . , m.

I(c) =

m∑

k=1

(f(xk, yk) − zk)2. (6.10)

I(c) =m∑

k=1

n∑

j=1

cjNj(xk, yk) − zk

2

= ‖Bc − z‖22 . (6.11)

B =

N1(x1, y1) N2(x1, y1) · · · Nn(x1, y1)N1(x2, y2) N2(x2, y2) · · · Nn(x2, y2)

......

. . ....

N1(xm, ym) N2(xm, ym) · · · Nn(xm, ym)

, (6.12)

||u||2 =(u2

1 + · · · + u2m

)1/2.

Page 56: Triangulations and Applications - heim.ifi.uio.noheim.ifi.uio.no/oyvindhj/INF-MAT5370/eksamensFigurerEtc.pdf · triangulation. If the edge between pi−1 and pi+1 is outside the existing

50 6 Least Squares Approximation of Scattered Data

∂I

∂ci= 2

m∑

k=1

n∑

j=1

cjNj(xk, yk) − zk

Ni(xk, yk) = 0, i = 1, . . . , n

n∑

j=1

m∑

k=1

Ni(xk, yk)Nj(xk, yk)cj =m∑

k=1

Ni(xk, yk)zk, i = 1, . . . , n.

(BT B

)c = BT z, (6.13)

(BTB

)ij

=

m∑

k=1

Ni(xk, yk)Nj(xk, yk)

(BT z

)i=

m∑

k=1

Ni(xk, yk)zk.

Fig. 6.4. Least squares approximation to 4500 scattered data points sampled fromFranke’s test function. The triangulation has approximately 500 nodes. Trianglesare Gouraud-shaded.

f(x, y) =3

4e−

(9x−2)2+(9y−2)2

4 +3

4e−

(9x+1)2

49 − 9y+110 +

1

2e−

(9x−7)2+(9y−3)2

4 −1

5e−(9x−4)2−(9y−7)2 . (6.14)

Page 57: Triangulations and Applications - heim.ifi.uio.noheim.ifi.uio.no/oyvindhj/INF-MAT5370/eksamensFigurerEtc.pdf · triangulation. If the edge between pi−1 and pi+1 is outside the existing

6.2 Existence and Uniqueness 51

6.2 Existence and Uniqueness

B =

(B1

B2

)=

1 0 · · · 00 1 · · · 0...

.... . .

...0 0 · · · 1

N1(xn+1,yn+1) N2(xn+1,yn+1) · · · Nn(xn+1,yn+1)N1(xn+2,yn+2) N2(xn+2,yn+2) · · · Nn(xn+2,yn+2)

......

. . ....

N1(xm,ym) N2(xm,ym) · · · Nn(xm,ym)

.

(6.15)

Page 58: Triangulations and Applications - heim.ifi.uio.noheim.ifi.uio.no/oyvindhj/INF-MAT5370/eksamensFigurerEtc.pdf · triangulation. If the edge between pi−1 and pi+1 is outside the existing

52 6 Least Squares Approximation of Scattered Data

6.3 Sparsity and Symmetry

(BTB

)ij

=

m∑

k=1

Ni(xk, yk)Nj(xk, yk), (6.16)

ivjv

iΩ jΩji ΩΩ I

Fig. 6.5. A possible non-zero off-diagonal element in the system matrix (BT B)ij

corresponds to an edge between the vertices vi and vj in the triangulation. It isnon-zero if one or more data points fall strictly inside Ωi ∩Ωj .

Fig. 6.6. Sparsity pattern of a 500× 500 system matrix BT B for the least squaresproblem.

Page 59: Triangulations and Applications - heim.ifi.uio.noheim.ifi.uio.no/oyvindhj/INF-MAT5370/eksamensFigurerEtc.pdf · triangulation. If the edge between pi−1 and pi+1 is outside the existing

6.4 Penalized Least Squares 53

6.4 Penalized Least Squares

Fig. 6.7. Least squares approximation to 4500 scattered data points sampled fromFranke’s test function. Random noise was added to the z-values of the data pointswhen generating the surface on the right.

J (c) = cT Ec, (6.17)

I(c) =

m∑

k=1

(f(xk, yk) − zk)2 + λJ (c) =

m∑

k=1

(f(xk, yk) − zk)2 + λcT Ec

= ‖Bc − z‖22 + λcT Ec

(BTB + λE

)c = BT z, (6.18)

λd =∥∥BTB

∥∥F

/ ‖E‖F . (6.19)

Page 60: Triangulations and Applications - heim.ifi.uio.noheim.ifi.uio.no/oyvindhj/INF-MAT5370/eksamensFigurerEtc.pdf · triangulation. If the edge between pi−1 and pi+1 is outside the existing

54 6 Least Squares Approximation of Scattered Data

6.5 Smoothing Terms for Penalized Least Squares

∫|∇g|

2=

∫ [(∂g

∂x

)2

+

(∂g

∂y

)2]

(6.20)

and the thin-plate energy

∫ [(∂2g

∂x2

)2

+ 2

(∂2g

∂x∂y

)2

+

(∂2g

∂y2

)2]

(6.21)

Membrane energy functional.

∇gk =

(∂gk

∂x,∂gk

∂y

)=

1

2Ak

(n∑

i=1

ηki ci,

n∑

i=1

µki ci

).

J1(c) =

|T |∑

k=1

Ak |∇gk|2

=

|T |∑

k=1

Ak

[(∂gk

∂x

)2

+

(∂gk

∂y

)2]

=

|T |∑

k=1

1

4Ak

(

n∑

i=1

ηki ci

)2

+

(n∑

i=1

µki ci

)2

=

|T |∑

k=1

1

4Ak

(

n∑

i=1

ηki ci

)

n∑

j=1

ηkj cj

+

(n∑

i=1

µki ci

)

n∑

j=1

µkj cj

=n∑

i=1

n∑

i=j

|T |∑

k=1

(ηk

i ηkj + µk

i µkj

)/4Ak

cicj = cT Ec,

where

Eij =

|T |∑

k=1

(ηki ηk

j + µki µk

j )/4Ak.

The Umbrella-operator.

Mkf =1

nk

l∈∂Ωk

cl − ck.

Mkf =

n∑

l=1

ρkl cl, ρk

l =

−1, l = k1

nk, if (vk, vl) is an edge in ∆

0 otherwise.(6.22)

Page 61: Triangulations and Applications - heim.ifi.uio.noheim.ifi.uio.no/oyvindhj/INF-MAT5370/eksamensFigurerEtc.pdf · triangulation. If the edge between pi−1 and pi+1 is outside the existing

6.5 Smoothing Terms for Penalized Least Squares 55

kc

L

lc

L

L

LL

Fig. 6.8. The umbrella-operator.

vi

111

1 1

22 22

22

22

33

3333

3333

33

Fig. 6.9. Illustration of which triangle vertices that generate non-zero off-diagonalelements in the system matrix together with the vertex vi. The ’1’-vertices generatenon-zeros with vi by the membrane energy and in the basic least squares problem(matrix BT B); the ’1’ and ’2’-vertices generate non-zeros by the thin-plate energyterm; and ’1’, ’2’ and ’3’-vertices generate non-zeros by the umbrella-operator.

J2(c) =

n∑

k=1

(Mkf)2

=

n∑

k=1

[n∑

i=1

ρki ci

]2

=n∑

k=1

[n∑

i=1

ρki ci

]

n∑

j=1

ρkj cj

=n∑

i=1

n∑

j=1

[n∑

k=1

ρki ρk

j

]cicj =

n∑

i=1

n∑

j=1

Eijcicj = cT Ec, (6.23)

where

Eij =n∑

k=1

ρki ρk

j .

Page 62: Triangulations and Applications - heim.ifi.uio.noheim.ifi.uio.no/oyvindhj/INF-MAT5370/eksamensFigurerEtc.pdf · triangulation. If the edge between pi−1 and pi+1 is outside the existing

56 6 Least Squares Approximation of Scattered Data

Mk =1

Wk

l∈∂Ωk

ωklcl − ck,

ρkl =

−1, l = kωkl

Wk, if (vk, vl) is an edge in ∆

0 otherwise.

ek

s

l

rt

t1

t2

g1

g2ken

Fig. 6.10. Stencil for the second order divided difference D2kf used to make the

discrete thin-plate energy measure.

Discrete thin-plate energy functional.

∂gi

∂nek

= (∂gi

∂x,∂gi

∂y) · nek

= ∇gi · nek, i = 1, 2.

Tkf =∂g2

∂nek

−∂g1

∂nek

=

(∂g2

∂x−

∂g1

∂x,∂g2

∂y−

∂g1

∂y

)· nek

= (∇g2 −∇g1) · nek(6.24)

∇g1 =(ηlcl + η1

scs + η1t ct, µlcl + µ1

scs + µ1t ct

)/2Alst,

∇g2 =(ηrcr + η2

t ct + η2scs, µrcr + µ2

t ct + µ2scs

)/2Arts.

(6.25)

nek= (yt − ys, xs − xt)/Lek

, (6.26)

Page 63: Triangulations and Applications - heim.ifi.uio.noheim.ifi.uio.no/oyvindhj/INF-MAT5370/eksamensFigurerEtc.pdf · triangulation. If the edge between pi−1 and pi+1 is outside the existing

6.5 Smoothing Terms for Penalized Least Squares 57

Tkf =∑

i∈ω(ek)

βki ci, (6.27)

where

βkl = −

Lek

2Alstβk

r = −Lek

2Arts

βks =

LekAtlr

2AlstArtsβk

t =Lek

Asrl

2AlstArts.

J3(c) =

|EI |∑

k=1

Lek(Tkf)

2=

|EI |∑

k=1

Lek

[n∑

i=1

βki ci

]2

=

|EI |∑

k=1

Lek

[n∑

i=1

βki ci

]

n∑

j=1

βkj cj

=

n∑

i=1

n∑

j=1

|EI |∑

k=1

Lekβk

i βkj

cicj =

n∑

i=1

n∑

j=1

Eijcicj = cTEc,

where

Eij =

|EI |∑

k=1

Lekβk

i βkj .

Tz(λ) =1

m

m∑

k=1

(fλ(xk, yk) − zk)2

(6.28)

Page 64: Triangulations and Applications - heim.ifi.uio.noheim.ifi.uio.no/oyvindhj/INF-MAT5370/eksamensFigurerEtc.pdf · triangulation. If the edge between pi−1 and pi+1 is outside the existing

58 6 Least Squares Approximation of Scattered Data

Fig. 6.11. Penalized least squares aproximation of a noisy point set.

6.6 Approximation over General Triangulations

Fig. 6.12. Point set for penalized least squares. The shaded region is a domain ofa basis function Ωj that do not cover any data points.

xT(BT B

)x = (Bx)

T(Bx) = ‖Bx‖

22 ≥ 0.

Page 65: Triangulations and Applications - heim.ifi.uio.noheim.ifi.uio.no/oyvindhj/INF-MAT5370/eksamensFigurerEtc.pdf · triangulation. If the edge between pi−1 and pi+1 is outside the existing

6.6 Approximation over General Triangulations 59

cT(BTB + λE

)c = cT

(BTB

)c + λcT Ec = 0, (6.29)

Uniqueness with the membrane energy functional.

J1(c) =

|T |∑

k=1

Ak

[(∂gk

∂x

)2

+

(∂gk

∂y

)2]

= cTEc.

cT (BTB)c = (Bc)T (Bc) = ‖Bc‖22 = 0, (6.30)

Uniqueness with the umbrella-operator.

J2(c) =

n∑

k=1

(Mkf)2 =

n∑

k=1

[1

nk

l∈∂Ωk

cl − ck

]2

.

ck =1

nk

l∈∂Ωk

cl, k = 1, . . . n. (6.31)

ck =1

Wk

l∈∂Ωk

ωklcl, k = 1, . . . n

Uniqueness with the thin-plate energy functional.

J3(c) =

|EI |∑

k=1

(Tkf)2

=

|EI |∑

k=1

[(∇g2 −∇g1) · nek]2

= cT Ec.

Page 66: Triangulations and Applications - heim.ifi.uio.noheim.ifi.uio.no/oyvindhj/INF-MAT5370/eksamensFigurerEtc.pdf · triangulation. If the edge between pi−1 and pi+1 is outside the existing

60 6 Least Squares Approximation of Scattered Data

6.7 Weighted Least Squares

I(c) =

m∑

k=1

wk [f(xk, yk) − zk]2

=

m∑

k=1

wk

n∑

j=1

cjNj(xk, yk) − zk

2

.

∂I

∂ci= 2

m∑

k=1

wk

n∑

j=1

cjNj(xk, yk) − zk

Ni(xk, yk) = 0, i = 1, . . . , n,

n∑

j=1

m∑

k=1

wkNi(xk, yk)Nj(xk, yk)cj =

m∑

k=1

wkNi(xk, yk)zk, i = 1, . . . , n.

(BT B

)c = BT z,

(BTB

)ij

=m∑

k=1

wkNi(xk, yk)Nj(xk, yk), i, j = 1, . . . , n, (6.32a)

(BT z

)i=

m∑

k=1

wkNi(xk, yk)zk, i = 1, . . . , n. (6.32b)

Page 67: Triangulations and Applications - heim.ifi.uio.noheim.ifi.uio.no/oyvindhj/INF-MAT5370/eksamensFigurerEtc.pdf · triangulation. If the edge between pi−1 and pi+1 is outside the existing

6.8 Constrained Least Squares 61

6.8 Constrained Least Squares

Γ = (xr, yr, zr)n+γr=n+1.

f(x, y) =

n+γ∑

j=1

cjNj(x, y).

f(x, y) =

n∑

j=1

cjNj(x, y) +

n+γ∑

r=n+1

zrNr(x, y).

I(c) =

m∑

k=1

n∑

j=1

cjNj(xk, yk) +

n+γ∑

r=n+1

zrNr(xk, yk) − zk

2

.

∂I

∂ci= 2

m∑

k=1

n∑

j=1

cjNj(xk, yk) +

n+γ∑

r=n+1

zrNr(xk, yk) − zk

Ni(xk, yk) = 0,

n∑

j=1

m∑

k=1

Ni(xk, yk)Nj(xk, yk)cj =

m∑

k=1

Ni(xk, yk)

zk −

n+γ∑

r=n+1

zrNr(xk, yk)

,

(BT B

)c = BT z,

where

(BTB

)ij

=m∑

k=1

Ni(xk, yk)Nj(xk, yk), i, j = 1, . . . , n, and

(BT z

)i=

m∑

k=1

Ni(xk, yk)

zk −

n+γ∑

r=n+1

zrNr(xk, yk)

, i = 1, . . . , n.

Page 68: Triangulations and Applications - heim.ifi.uio.noheim.ifi.uio.no/oyvindhj/INF-MAT5370/eksamensFigurerEtc.pdf · triangulation. If the edge between pi−1 and pi+1 is outside the existing

62 6 Least Squares Approximation of Scattered Data

6.9 Approximation over Binary Triangulations

The general multilevel scheme.

Algorithm 6.1 General multilevel scheme

1. for k = 1, 2, 3, . . .2. Find a surface approximation f∆k

.3. if |f∆k

(xi, yi)− zi| < ε, i = 1, . . . , m,stop.

4. else

5. Refine ∆k locally where ε is exceeded to produce ∆k+1,and use f∆k

to make an initial guess for f∆k+1 .

Approximation Scheme for Binary Triangulations.

2

1,3v

1

1,2v

1

0,1v

33,5v

Fig. 6.13. Starting with the triangulation ∆1 and the regular grid Ψ1 on the left,vertex v2

3,1 in Ψ2 is first activated together with its two parents v11,0 and v1

2,1 in Ψ1.The resulting triangulation is ∆2 in the middle. Next, v3

5,3 in Ψ3 is activated togetherwith ancestors belonging to both Ψ1 and Ψ2 to obtain ∆3 on the right.

Ψk =vk

i,j

2k,2k

i,j=0,0.

ck+1ij = fk(xi, yj).

S01(∆1) ⊂ S0

1(∆2) ⊂ · · · ⊂ S01(∆h),

Page 69: Triangulations and Applications - heim.ifi.uio.noheim.ifi.uio.no/oyvindhj/INF-MAT5370/eksamensFigurerEtc.pdf · triangulation. If the edge between pi−1 and pi+1 is outside the existing

6.10 Numerical Examples for Binary Triangulations 63

6.10 Numerical Examples for Binary Triangulations

Approximation of data sampled from Franke’s function

Approximation of noisy data from Franke’s function

Approximation of parametrized 3D scattered data.

Terrain modeling of mountain area.

Page 70: Triangulations and Applications - heim.ifi.uio.noheim.ifi.uio.no/oyvindhj/INF-MAT5370/eksamensFigurerEtc.pdf · triangulation. If the edge between pi−1 and pi+1 is outside the existing

Fig. 6.14. Approximation to Franke’s test function; the resulting binary triangula-tion imposed on the surface.

Page 71: Triangulations and Applications - heim.ifi.uio.noheim.ifi.uio.no/oyvindhj/INF-MAT5370/eksamensFigurerEtc.pdf · triangulation. If the edge between pi−1 and pi+1 is outside the existing

Fig. 6.15. The same binary triangulation as in Figure 6.14, and input data fornumerical examples. The lower left corner corresponds to the nearest corner in Fig-ure 6.14.

Fig. 6.16. Approximation with huge smoothing parameter.

Page 72: Triangulations and Applications - heim.ifi.uio.noheim.ifi.uio.no/oyvindhj/INF-MAT5370/eksamensFigurerEtc.pdf · triangulation. If the edge between pi−1 and pi+1 is outside the existing

Fig. 6.17. Approximation to Franke’s function from a data set with noise.

Fig. 6.18. Approximation of terrain data and the given hypsographic data.

Page 73: Triangulations and Applications - heim.ifi.uio.noheim.ifi.uio.no/oyvindhj/INF-MAT5370/eksamensFigurerEtc.pdf · triangulation. If the edge between pi−1 and pi+1 is outside the existing

Fig. 6.19. Approximation of terrain data, and triangulation imposed on the surface.

Fig. 6.20. Terrain modeling of an area in Jotunheimen, Norway.

Page 74: Triangulations and Applications - heim.ifi.uio.noheim.ifi.uio.no/oyvindhj/INF-MAT5370/eksamensFigurerEtc.pdf · triangulation. If the edge between pi−1 and pi+1 is outside the existing

Fig. 6.21. Approximation of parametrized 3D scattered data.

Page 75: Triangulations and Applications - heim.ifi.uio.noheim.ifi.uio.no/oyvindhj/INF-MAT5370/eksamensFigurerEtc.pdf · triangulation. If the edge between pi−1 and pi+1 is outside the existing

References

1. J. R. Shewchuk. Delaunay Refinement Mesh Generation. PhD thesis, School ofComputer Science, Carnegie Mellon University, Pittsburgh, Pennsylvania, 1997.Available as Technical Report CMU-CS-97-137.

2. J. R. Shewchuk. Delaunay refinement algorithms for triangular mesh generation.Computational Geometry, 22:21–74, 2002.