A Delaunay Re Nement Algorithm for Quality 2-Dimensional Mesh
Total Page:16
File Type:pdf, Size:1020Kb
A Delaunay Re nement Algorithm for Quality 2-Dimensional Mesh Generation Jim Rupp ert NASA Ames Research Center Abstract We present a simple new algorithm for triangulating p olygons and planar straightline graphs. It provides \shap e" and \size" guarantees: All triangles have a b ounded asp ect ratio. The numb er of triangles is within a constant factor of optimal. Such \quality" triangulations are desirable as meshes for the nite element metho d, in which the running time generally increases with the numb er of triangles, and where the convergence and stabilitymay be hurt byvery skinny triangles. The technique we use|successive re nement of a Delaunay triangulation|extends a mesh generation technique of Chew by allowing triangles of varying sizes. Compared with previous quadtree-based algorithms for quality mesh generation, the Delaunay re nement approachismuch simpler and generally pro- duces meshes with fewer triangles. We also discuss an implementation of the algorithm and evaluate its p erformance on a variety of inputs. NASA Ames Research Center, M/S T045-1, Mo ett Field, CA 94035-1000. The author is an employee of the Computer Sciences Corp oration. Work funded by NASA contract NAS 2-12961. This pap er will app ear in Journal of Algorithms, 1994. Muchof this work was completed while the author was a student in the Computer Science Division at the University of California at Berkeley, supp orted by funds from NSF PYI Grant CCR-90-58840. A p ortion of this work was done while the author was at Hewlett-Packard Lab oratories, Palo Alto, CA. E-mail: rupp [email protected]. 1 1 Intro duction Many applications in computational geometry, graphics, solid mo deling, nu- merical simulation and other areas require complicated geometric ob jects to b e decomp osed into simpler pieces for further pro cessing. For instance, in the nite element metho d, a planar domain is divided into a mesh of elements, typically triangles or quadrilaterals. Di erential equations repre- senting some physical prop erty such as heat distribution or air ow are then approximated using functions that are piecewise p olynomial within each ele- ment. The running times of these algorithms generally dep end on the size of the decomp osition the numb er of elements, hence we seek decomp ositions of small size. Furthermore, in many applications, the numerical stability and convergence are a ected by the shapes of the elements; excessively \long and skinny" elements can lead to undesirable b ehavior. In this pap er we fo cus on the decomp osition of 2-dimensional ob jects such as p olygons into triangles. We will refer to this problem b oth as mesh generation and triangulation; it is also called unstructured grid generation. A triangulation must b e a simplicial complex, that is, the intersection of anytwo triangles is either a common edge, a common vertex, or the empty set. Quality mesh generation describ es techniques that o er a guarantee on some measure of shap e, such as all triangles non-obtuse, or all with b ounded asp ect ratio. The aspect ratio of a triangle is the length of the longest edge divided by the length of the shortest altitude. A fairly general measure of triangle shap e is the minimum angle , since this gives a b ound of 2 on 1 2 maximum angle and guarantees an asp ect ratio b etween j j and j j.We sin sin allow triangulations to contain Steiner points|vertices of the mesh that are not vertices of the input|b ecause in general they are necessary for achieving shap e b ounds see Figure 1, for example. A mesh satisfying a certain shap e b ound is said to b e size-optimal if the numb er of triangles is within a constant factor of the minimum numb er p ossible in any triangulation of the given input that meets the same shap e b ound. The rst algorithm to give a shap e guarantee was due to Baker, Grosse and Ra erty [1]. They gave a technique for pro ducing a non-obtuse trian- gulation of p olygons, in which all angles are at most 90 . In addition, the smallest angle is at least 13 . Of course, this is only p ossible if all angles in the input are at least 13 . Together, these b ounds guarantee an asp ect ratio of at most 4:6. The algorithm places a uniform square grid over the p olygon, 2 (a) Typical input PSLG and bounding box. (b) Typical triangulation without added Steiner points. Some small angles are unavoidable. (c) Uniform mesh with minimum (d) Output of Delaunay refinement angle 22.5 degrees. algorithm with minimum angle 20 degrees. Figure 1: Sample input planar straightline graph PSLG, and several triangula- tions of it. 3 with grid spacing determined by the smallest feature present in the p olygon. Roughly sp eaking, the smal lest feature is determined either by the pair of closest vertices, or by the closest vertex-edge pair, where the edge do es not contain the vertex. Since the smallest feature determines the mesh density throughout the p olygon, the numb er of triangles can b e very large. Bern, Eppstein and Gilb ert gave the rst mesh generation algorithm with b oth shap e and size guarantees [3]. They showhow to triangulate p olygons so that every triangle has asp ect ratio at most 5. In addition, their analysis shows that the mesh is size-optimal. One of the key ideas in the algorithm is to replace the uniform grid of [1] with a quadtree, which is a recursive sub division into squares of varying sizes. This yields large triangles in ar- eas of large features. By keeping the quadtree balanced, asp ect ratios are b ounded in the output. Melissaratos and Souvaine give some extensions to the quadtree algorithm [12]. Mitchell and Vavasis show an extension of the quadtree technique to 3D [14 ]. They give an algorithm that uses octrees to pro duce size-optimal, b ounded asp ect ratio triangulations of p olyhedra. All the ab ove techniques use grids or quadtrees. A quite di erent tech- nique for quality mesh generation is Delaunay re nement, so-called b ecause a Delaunay triangulation is maintained, and some criterion is used to succes- sively pick new p oints to add to it. Chew [5] presented a Delaunay re nement algorithm that triangulates a given p olygon into a mesh in which all angles are b etween 30 and 120 . The algorithm pro duces uniform meshes, meaning that all triangles are roughly the same size. The output mesh is size-optimal to within a constant factor amongst all uniform meshes. However, there are inputs for which a uniform mesh has many more triangles than are necessary, see Figure 1c, for instance. In this pap er, we extend Chew's work by giving an algorithm to triangu- late planar straightline graphs PSLGs such that all triangles in the output have angles b etween and 2 . Here is a parameter that can b e cho- sen b etween 0 and 20 . The triangles will vary in size, and the mesh will b e size optimal to within a constant factor that dep ends on . PSLGs in- clude p olygons, p olygons with holes, and complexes ob jects made of multiple p olygons; dangling edges and isolated vertices are also allowed, as shown in Figure 1a. Theoretically sp eaking, our algorithm essentially matches the PSLG al- gorithms of [12] and [3]mo di ed as mentioned in [2], but it is distinguished from them in a number of ways: 1 The Delaunay re nement approachis 4 fundamentally di erent from the quadtree techniques. 2 It is much simpler. With fewer sp ecial case constructions, it is easier to implement. 3 It gener- ally pro duces fewer triangles in practice. 4 It is \parameterized": the user can ask for the \b est" mesh with a given numb er of triangles. In this way, the algorithm takes advantage of the inherent mesh size/shap e tradeo . 5 The output mesh has no favored orientation. In contrast, grid or quadtree based meshes pro duce many mesh edges aligned with the co ordinate axes. Such alignmentmay a ect subsequent computation. 6 Delaunay re nement can b e mo di ed to generate a mesh unique to the input, indep endent of the ori- entation of the input. This assumes careful handling of degeneracies, and elimination of the b ounding b ox, as describ ed in Section 5. A few words ab out the input to the algorithm: The input can b e any planar straightline graph PSLG, with dangling edges and isolated p oints allowed see Figure 1a. As shown in the gure, the algorithm will tri- angulate a larger region, out to an enclosing b ox. To get a triangulation of a particular region, say the interior of a p olygon, exterior triangles can b e removed. To maintain the size optimality guarantee in this case, the algorithm must b e mo di ed slightly, as discussed in Section 5. Though the algorithm is based on the Delaunay triangulation, the con- strained Delaunay triangulation [11 ],[4], mightbeaworthwhile alternative. We discuss this brie y in Section 5, and Chew discusses its use in a related mesh generation algorithm [6]. The remainder of this pap er is organized as follows. In the next section we present the algorithm. Then we show that it halts and outputs a valid triangulation satisfying the minimum angle b ound.