Presentation is loading. Please wait.

Presentation is loading. Please wait.

UNC Chapel Hill M. C. Lin Delaunay Triangulations Reading: Chapter 9 of the Textbook Driving Applications –Height Interpolation –Constrained Triangulation.

Similar presentations


Presentation on theme: "UNC Chapel Hill M. C. Lin Delaunay Triangulations Reading: Chapter 9 of the Textbook Driving Applications –Height Interpolation –Constrained Triangulation."— Presentation transcript:

1 UNC Chapel Hill M. C. Lin Delaunay Triangulations Reading: Chapter 9 of the Textbook Driving Applications –Height Interpolation –Constrained Triangulation

2 UNC Chapel Hill M. C. Lin Height Interpolation A terrain is a 2D surface in 3D space with a special property: every vertical line intersects it in a point. That is, it is the graph of a function f: A  R 2  R that assigns a height f(p) to every point p in the domain. Problem: From the height of the sample points we somehow have to approximate the height at the other points in the domain.  Triangles with small angles are undesirable. So, rank the triangulations by their smallest angles.

3 UNC Chapel Hill M. C. Lin Triangulations of Planar Point Sets Let P := {p 1, p 2, …, p n } be a set of points in the plane. A triangulation of P is the maximal planar subdivision S whose vertex set is P, s.t. no edge connecting 2 vertices can be added to S without destroying its planarity. Let P be a set of n points in the plane, not all collinear, and let k denote the number of points in P that lie on the boundary of the convex hull of P. Then any triangulation of P has 2n-2-k triangles and 3n-3-k edges.

4 UNC Chapel Hill M. C. Lin Basic Properties Let C be a circle, l a line intersecting C in points a and b, and p, q, r, and s points lying on the same side of l. Suppose that p and q lie on C, that r lies inside C, and that s lies outside C, then  arb >  apb =  aqb >  asb An edge is illegal if we can locally increase the smallest angle by flipping that edge. q l a b C p r s

5 UNC Chapel Hill M. C. Lin Basic Properties Let T be a triangulation with an illegal edge e, and T’ be a triangulation obtained from T by flipping e. Then A(T’) > A(T), where A(.) stands for the smallest angle. Let edge p i p j be incident to triangles p i p j p k and p i p j p l, and let C be the circle through p i, p j, p k and p l. The edge is illegal if and only if the point p l lies in the interior of C. Furthermore, if the four points form a convex quadrilateral and do not lie on a common circle, then exactly one of p i p j and p k p l is an illegal edge.

6 UNC Chapel Hill M. C. Lin Legal Triangulation A legal triangulation is a triangulation that do not contain any illegal edge. Any angle-optimal triangulation is legal. We can compute legal triangulation by simply flip illegal edges till all edges are legal, given a triangulation. (see next) –there are only finite number of triangulations and every iteration the smallest angle increases. So, it works, but too slow!

7 UNC Chapel Hill M. C. Lin LegalTriangulation(T) Input: Some triangulation T of a point set P. Output: A legal triangulation T. 1. while T contains an illegal edge p i p j 2. do (* Flip p i p j *) 3. Let p i p j p k and p i p j p l be the two triangles adjacent to p i p j 4. Remove p i p j from T, and add p k p l instead 5. return T

8 UNC Chapel Hill M. C. Lin Voronoi Diagram & Dual Graph The Voronoi diagram of P, Vor(P), is the subdivision of the plane into n regions, one for each site in P, s.t. the region of a site p  P contains all points in the plane for which p is the closest site. The region of a site p is called the Voronoi cell of p, denoted by V(p). The dual graph of Vor(P), G, has a node for every Voronoi cell (or every site). G has an arc between 2 nodes if the corresponding cells share an edge.

9 UNC Chapel Hill M. C. Lin Delaunay Graph & Triangulation Delaunay graph of P, DG(p) is the straight-line embedding of G, where the node corresponding to the Voronoi cell V(p) is the point p, and the arc connecting the nodes of V(p) is the segment pq. If P is in general position (i.e. no 4 points lie on a circle), then all vertices of the Voronoi diagram have degree three, and consequently all bounded faces of DG(p) are triangles. In this case, DG(p) is the Delaunay triangulation of P and unique.

10 UNC Chapel Hill M. C. Lin Basic Properties of Delaunay Triangulations Let P be a set of points in the plane. –3 points are vertices of the same face of the DG(P) iff the circle thru them contains no point of P in interior. –2 points form an edge of DG(P) iff there is a closed disc C that contains them on its boundary and doesn’t contain any other point. Let P be a set of points in the plane, and let T be a triangulation of P. Then T is a Delaunay triangulation of P, iff the circumcircle of any triangulation of T doesn’t contain a point of P in its interior.

11 UNC Chapel Hill M. C. Lin Basic Properties of Delaunay Triangulations Let P be a set of points in the plane. A triangulation T of P is legal if and only if T is a Delaunay triangulation of P. Let P be a set of points in the plane. Any angle-optimal triangulation of P is a Delaunay triangulation of P. Any Delaunay triangulation of P maximizes the minimum angle over all triangulations of P.

12 UNC Chapel Hill M. C. Lin Computing Delaunay Triangulation Use Voronoi diagram to get Delaunay Triangulation. Use Randomized Incremental Construction: –Start with a big triangle that contains all the points. The vertices of this big triangle should not lie in any circle defined by 3 points in P. –Add one point p r at a time, then add edges from p r to the vertices of the existing triangle. –There are 2 cases to consider: p r lies in the interior of a triangle p r falls on an edge (need to make sure new edges are legal by flipping edges if necessary).

13 UNC Chapel Hill M. C. Lin DelaunayTriangulation(P) Input: A set P of n points in the plane Output: A Delaunay triangulation of P 1. Let p -1, p -2 & p -3 be 3 point s.t. P is contained in triangle p -1 p -2 p -3 2. Initialize T as triangulation consisting of a single triangle p -1 p -2 p -3 3. Compute a random permutation p 1, …, p n of P 4. for r  1 to n 5. do (* Insert p r into T : *) 6. Find a triangle p i p j p k  T containing p r 7. if p r lies in the interior of the triangle p i p j p k 8. then Add edges from p r to 3 vertices of p i p j p k and split it 9. LegalizeEdge( p r, p i p j, T ) 10. LegalizeEdge( p r, p j p k, T ) 11. LegalizeEdge( p r, p k p i, T )

14 UNC Chapel Hill M. C. Lin DelaunayTriangulation(P) 12. else (* p r lies on an edge of p i p j p k, say the edge p i p j *) 13. Add edges from p r to p k and to the third vertex of other triangle that is incident to p i p j, thereby splitting 2 triangles incident to p i p j into 4 tri’s 14. LegalizeEdge( p r, p i p l, T ) 15. LegalizeEdge( p r, p l p j, T ) 16. LegalizeEdge( p r, p j p k, T ) 17. LegalizeEdge( p r, p k p i, T ) 18. Discard p -1, p -2 and p -3 with all their incident edges from T 19. return T

15 UNC Chapel Hill M. C. Lin LegalizeEdge(p r, p i p j, T) 1. (* The point being inserted is p r, and p i p j is the edge of T that may need to be flipped *) 2. if p i p j is illegal 3. then Let p i p j p k be triangle adjacent to p r p i p j along p i p j 4. (* Flip p i p j *) Replace p i p j with p r p k 5. LegalizeEdge( p r, p i p k, T ) 6. LegalizeEdge( p r, p k p j, T )

16 UNC Chapel Hill M. C. Lin Find Triangle Containing P r While we build the Delaunay triangulation, we also build a point location structure D. The leaves of D correspond to the triangles of current triangulation T. We maintain cross pointers between the leaves and the triangulation. The internal nodes of D correspond to triangles that were in triangulation at some earlier stage, but have been destroyed. We initialize D as a DAG with a single leaf node that corresponds to the big triangle. For the rest, see the pictorial example.

17 UNC Chapel Hill M. C. Lin How to Pick a Big Triangle Let M be the maximum value of any coordinate of a point in P. Then, the triangle has the vertices at ( 3M, 0), (0, 3M ), and (- 3M, - 3M ). Then, handle the cases where the edge that P r lies on has one vertex with a negative index.

18 UNC Chapel Hill M. C. Lin Algorithm Analysis The Delaunay triangulation of a set of n points in the plane can be computed in O(n log n) expected time, using O(n) expected storage –see the proof in 9.4 (similar to previous analysis for randomized algorithms)


Download ppt "UNC Chapel Hill M. C. Lin Delaunay Triangulations Reading: Chapter 9 of the Textbook Driving Applications –Height Interpolation –Constrained Triangulation."

Similar presentations


Ads by Google