a contribution to triangulation algorithms for simple polygons...on delaunay triangulation, and the...

13
Journal of Computing and Information Technology - CIT 8, 2000, 4, 319–331 319 A Contribution to Triangulation Algorithms for Simple Polygons Marko Lamot 1 , Borut ˇ Zalik 2 1 Hermes Softlab, Ljubljana, Slovenia 2 Borut ˇ Zalik, University of Maribor, Faculty of Electrical Engineering and Computer Sciences, Maribor, Slovenia Decomposing simple polygon into simpler components is one of the basic tasks in computational geometry and its applications. The most important simple polygon de- composition is triangulation. The known algorithms for polygon triangulation can be classified into three groups: algorithms based on diagonal inserting, algorithms based on Delaunay triangulation, and the algorithms using Steiner points. The paper briefly explains the most popular algorithms from each group and summarizes the common features of the groups. After that four algorithms based on diagonals insertion are tested: a recursive diagonal inserting algorithm, an ear cutting algorithm, Kong’s Graham scan algorithm, and Seidel’s randomized incremental algorithm. An analysis con- cerning speed, the quality of the output triangles and the ability to handle holes is done at the end. Keywords: simple polygons, simple polygon triangula- tion, Steiner points, constrained Delaunay triangulation 1. Introduction Polygons are very convenient for computer rep- resentation of the boundary of the objects from the real world. Because polygons can be very complex they can include a few thousand ver- tices, they may be concave and may include nested holes , often there is the need to decom- pose the polygons into simpler components that can be easily and rapidly handled. There are many ideas how to perform this decomposition. Planar polygons can be, for example, decom- posed into triangles, trapezoids or even star- shaped polygons. Computing the triangulation of a polygon is a fundamental algorithm in the computational geometry. It is also the most investigated partitioning method. In computer graphics, polygon triangulation algorithms are widely used for tessellating curved geometries, such as those described by spline. The paper gives a brief summary of existing triangulation techniques and a comparison be- tween them. It is organized into eight sections. The second chapter introduces the fundamen- tal terminology, and in the third chapter diag- onal inserting algorithms are dealt with. The fourth section explains the constrained Delau- nay triangulation. The fifth section describes triangulation techniques that use Steiner points. The sixth section summarizes the common fea- tures of all three groups of polygon triangula- tion algorithms. The seventh section contains the comparison of triangulation methods based on the diagonal insertion. An analysis concern- ing speed, the quality of the output triangles, and the ability to handle holes is done. The last section summarizes the work. 2. Background Every simple polygon P a polygon is simple if its edges cross only in their endpoints — ver- tices with n vertices has a triangulation. The key for proving the existence of the triangula- tion is the fact that every polygon has a diagonal, which exists if the polygon has at least one con- vex vertex. We can conclude that OROU94 : every polygon has at least one strictly convex vertex, every polygon with n 4 vertices has a di- agonal, every polygon P of n vertices may be parti- tioned into triangles by adding the diagonals.

Upload: others

Post on 07-Feb-2021

3 views

Category:

Documents


0 download

TRANSCRIPT

  • Journal of Computing and Information Technology - CIT 8, 2000, 4, 319–331 319

    A Contribution to TriangulationAlgorithms for Simple Polygons

    Marko Lamot1, Borut Žalik21Hermes Softlab, Ljubljana, Slovenia2Borut Žalik, University of Maribor, Faculty of Electrical Engineering and Computer Sciences, Maribor, Slovenia

    Decomposing simple polygon into simpler componentsis one of the basic tasks in computational geometry andits applications. The most important simple polygon de-composition is triangulation. The known algorithms forpolygon triangulation can be classified into three groups:algorithms based on diagonal inserting, algorithms basedon Delaunay triangulation, and the algorithms usingSteiner points. The paper briefly explains the mostpopular algorithms from each group and summarizesthe common features of the groups. After that fouralgorithms based on diagonals insertion are tested: arecursive diagonal inserting algorithm, an ear cuttingalgorithm, Kong’s Graham scan algorithm, and Seidel’srandomized incremental algorithm. An analysis con-cerning speed, the quality of the output triangles and theability to handle holes is done at the end.

    Keywords: simple polygons, simple polygon triangula-tion, Steiner points, constrained Delaunay triangulation

    1. Introduction

    Polygons are very convenient for computer rep-resentation of the boundary of the objects fromthe real world. Because polygons can be verycomplex �they can include a few thousand ver-tices, they may be concave and may includenested holes�, often there is the need to decom-pose the polygons into simpler components thatcan be easily and rapidly handled. There aremany ideas how to perform this decomposition.Planar polygons can be, for example, decom-posed into triangles, trapezoids or even star-shaped polygons. Computing the triangulationof a polygon is a fundamental algorithm in thecomputational geometry. It is also the mostinvestigated partitioning method. In computergraphics, polygon triangulation algorithms are

    widely used for tessellating curved geometries,such as those described by spline.

    The paper gives a brief summary of existingtriangulation techniques and a comparison be-tween them. It is organized into eight sections.The second chapter introduces the fundamen-tal terminology, and in the third chapter diag-onal inserting algorithms are dealt with. Thefourth section explains the constrained Delau-nay triangulation. The fifth section describestriangulation techniques that use Steiner points.The sixth section summarizes the common fea-tures of all three groups of polygon triangula-tion algorithms. The seventh section containsthe comparison of triangulation methods basedon the diagonal insertion. An analysis concern-ing speed, the quality of the output triangles,and the ability to handle holes is done. The lastsection summarizes the work.

    2. Background

    Every simple polygon P �a polygon is simple ifits edges cross only in their endpoints — ver-tices� with n vertices has a triangulation. Thekey for proving the existence of the triangula-tion is the fact that every polygon has a diagonal,which exists if the polygon has at least one con-vex vertex. We can conclude that �OROU94�:

    � every polygon has at least one strictly convexvertex,

    � every polygon with n � 4 vertices has a di-agonal,

    � every polygon P of n vertices may be parti-tioned into triangles by adding the diagonals.

  • 320 A Contribution to Triangulation Algorithms for Simple Polygons

    Fig. 1. a� Low quality triangulation; b� High quality triangulation; c� Triangulation with Steiner’s Points.

    There is a large number of different ways howto triangulate a given polygon. What all thesepossibilities have in common is that the numberof diagonals is n � 3 and the number of the tri-angles being generated is n� 2. For details andproofs see �OROU94�.

    Following the fact of existence of the diagonal, abasic triangulation algorithmcan be constructedas follows:

    Find a diagonal, cut the polygon into twopieces, and recurs each.

    Finding diagonals is a simple task, which is re-peated until all diagonals of the polygon aredetermined. This can be described as follows:

    For every edge e of the polygon not inci-dent to either end of the potential diagonals, check if e intersects s. As soon as anintersection is detected, it is known thats is not a diagonal. If no polygon edgeintersects s, then s is a diagonal.

    A rough analysis shows that such algorithmtakes O�n4� time. Namely there are

    �n2

    ��

    O�n2� diagonal candidates. Testing each ofthem with all polygon edges costs O�n� time.Repeating this O�n3� process for each of then � 3 diagonals gives us an algorithm with atmost O�n4� running time. Such a direct ap-proach is, of course, too inefficient and thereforemany authors proposed much faster triangula-tion algorithms.

    There are different possibilities how to triangu-late a given polygon �see Fig. 1�. For someapplications it is essential that the minimum in-terior angle of a triangle of the computed tri-angulation is as large as possible which definesquality. How the algorithms triangulated a sim-ple polygon depended on the technique used bythe algorithm. In Figure 1a for example, the

    triangulation can be considered as a low qual-ity, because there are a lot of sliver triangles.The algorithms based on Delaunay triangula-tion ensure better triangulation �Figure 1b�. Thequality can be significantly improved by usingso-called Steiner’s points �Figure 1c�.

    3. Polygon triangulation algorithms basedon diagonal inserting

    History of the polygon triangulation algorithmsbegan in 1911 �LENN11�. In that year Lennesproposed the “algorithm” which worked by re-cursively inserting diagonals between pairs ofvertices of P and ran in O�n2�. At that timemathematicians were interested in constructiveproofs of existence of triangulation for simplepolygons. Since then, this type of algorithmreappeared in many papers and books. Induc-tive proof for the existence of triangulation wasproposed by Meisters �MEIS75�. He proposedan ear searching method and then cutting themoff. Vertex vi of simple polygon P is a principalvertex if no other vertex of P lies in the interiorof the triangle vi�1, vi, vi�1 or in the interiorof the diagonal vi�1, vi�1. A principal vertexvi of simple polygon P is an ear if the diago-nal vi�1, vi�1 lies entirely in P. We say thattwo ears vi, vj are non-overlapping if interior�vi�1� vi� vi�1� � �vj�1� vj� vj�1� � 0 �see Figure2�.

    Fig. 2. Triangle v1v2v3 is an ear of polygon.

  • A Contribution to Triangulation Algorithms for Simple Polygons 321

    Meisters proved the next theorem �MEIS75�:

    Except for triangles, every simple poly-gon P has at least two non-overlappingears.

    A direct implementation of this idea leads to acomplexity of O�n3�. But in 1990 it was dis-covered that prune and search technique findsan ear in the linear time �GIND93�. It is basedon the following observation:

    A good subpolygon P1 of a simple poly-gon P is a subpolygon whose boundarydiffers from that of P in one edge at themost.

    The basic observation here is that a good sub-polygon P1 has at least one proper ear. Strategyis as follows:

    Split the polygon P of n vertices into twosubpolygons in O�n� time such that oneof these subpolygons is a good subpoly-gon with at most bn�2c�1 vertices. Eachsubpolygon is then solved recursively.

    The worst case running time of the algorithm isT�n� � cn�T�bn�2c�1�, where c is a constant.This recurrence has solutionT�n� � O�n�. Thatleads to implementation of Meisters’s algorithmwith the complexity of O�n2�.

    Garey, Johnson, Preparata and Tarjan proposeda divide— and—conquer algorithmwhich firstbrokeO�n2� time complexity �1978� �GARE78�.Algorithm runs in O�n logn� time. Their ap-proach includes two steps: the first one de-composes simple polygon into monotone sub-polygons in O�n logn�. The second step tri-angulates these monotone sub-polygons, whichcan be done in a linear time. A different divide— and — conquer approach by Chazelle also

    achieves O�n logn� running time �CHAZ82�.Very complicated data structures are used inTarjan and Van Wyk’s algorithm running inO�n log log n� time �TARJ89�. However, Kirk-patrik introduced an algorithm with the sametime complexity but with simple data structures�KIRK90�.

    Next improvement of speed was gained by algo-rithms with time complexity O�n log �n�. Suchalgorithms were not just faster but also sim-pler to implement. They all have in commona randomized �“Las Vegas”� approach. Thebest known algorithm was suggested by Seidel�SEID91�. His algorithm runs in practice almostin linear time for the majority simple polygons.The algorithm has three steps:

    � trapezoidal decomposition of the polygon,

    � determination of monotone polygon’s chains,and finally,

    � the triangulation of these monotone poly-gon’s chains.

    The efficiency of Seidel’s algorithm is achievedby very efficient trapezoidal decomposition,which works in two steps:

    � first a random permutation of edges is deter-mined, and

    � these edges are inserted incrementally intotrapezoidal decomposition.

    With two corresponding structures containingcurrent decomposition and search structure pre-sented algorithm runs in O�n log �n� time.

    Researches also searched for classes of poly-gons that can be triangulated in a linear time.They determined that monotone polygons �Fig.

    Fig. 3. Star polygons �a�, edge visible polygons �b� and monotone polygons �c� can be triangulated in linear time.

  • 322 A Contribution to Triangulation Algorithms for Simple Polygons

    3c�, star-shaped polygons �each point in thepolygon can be connected to star point p thatno edge of polygon boundary is intersected��Fig. 3a�, spiral polygons, L-convex polygons,edge visible polygons �each point in the poly-gon can be connected to one point of edge e thatno edge of polygon boundary is intersected��Fig. 3b�, intersection-free polygons and palm-shaped polygons could be triangulated in lineartime

    Some researches designed adaptive algorithmsthat run fast in many situations. Hertel andMehlhorn described a sweep-line based algo-rithm that runs faster if a polygon has fewerconcave vertices �HERT83�. Algorithm’s run-ning time is O�n � r log r� where r denotes thenumber of concave vertices of P.

    Chazelle and Incerpi also presented algorithmwhere time complexity depends on shape of thepolygon �CHAZ84�. They describe a triangula-tion algorithm that runs inO�n log s� timewheres � n. The quantity s measures the sinuosity ofthe polygon representing how many times thepolygon’s boundary alternates between com-plete spirals of opposite orientation. In practice,quantity s is very small or a constant, even forvery winding polygons. Consider the m otion ofa straight line L�vi� vi�1� passing through edgevi, vi�1 where 0 � i � n. Every time L reaches

    the vertical position in a clockwise �counter-clockwise� manner we decrement �increment�a winding counter by one. L is spiraling �anti-spiraling� if the winding counter is never decre-mented �incremented� twice in succession. Anew polygonal chain is restarted only when theprevious chain ceases to be spiraling or anti-spiraling.

    Toussaint proposed in �TOUS91� another adap-tive algorithm which runs in O�n�1� t0��; t0 �n. The quantity t0 measures the shape-comple-xity of the triangulation delivered by the algo-rithm. More precisely, t0 is the number of tri-angles contained in the triangulation that sharezero edges with the input polygon. The algo-rithm runs in O�n2� in the worst case, but forseveral classes of polygons it runs in the lineartime. The algorithm is very simple to imple-ment, because it does not require sorting or theuse of balanced tree structures.

    Kong, Everett and Toussaint algorithm is basedon the Graham scan �KONG90�. The Grahamscan is a fundamental backtracking techniquein computational geometry. It has been shownhow to use the Graham scan for triangulatingsimple polygon in O�kn� time where k � 1 isthe number of concave vertices in P. Althoughthe worst case algorithm’s time complexity isO�n2�, it is easy to be implemented and there-

    Time complexity Author Year Technique/AlgorithmO�n2� Lennes 1911 Recursive diagonal insertionO�n3� Meisters 1975 Ear cuttingO�n2� ElGindy, Everrett, Toussaint 1990 Prune and search

    O�n logn� Garey, Johnson, Preparata, Tarjan 1978 Decomp. into monotone polygonsO�n logn� Chazelle 1982 Divide and conquer

    O�n � r log r� Hertel & Mehlhorn 1983 Sweep — lineO�n log s� Chazelle & Incerpi 1983 —

    O�n�1 � t0�� Toussaint 1988 —O�kn� Kong, Everett, Toussaint 1990 Graham scan

    O�n log log n� Tarjan, Van Wyk 1987 —O�n log log n� Kirkpatrik 1990 —O�n log �n� Clarkson, Tarjan, Van Wyk 1989 Randomized incrementalO�n log �n� Kirkpatrik, Klawe, Tarjan 1990 Using bounded integer coordinatesO�n log �n� Seidel 1990 Randomized incremental

    O�n� Chazelle 1990 —

    Table 1. Algorithms for computing triangulation of simple polygon based on diagonal inserting.

  • A Contribution to Triangulation Algorithms for Simple Polygons 323

    fore it is useful in practice. The algorithmadaptsthe Graham scan as following:

    The vertices of polygon P are scanned inorder starting with v2. At each step thecurrent vertex is tested to determine if itis the top of an ear. If it is not, the currentvertex is advanced, otherwise it is an earand can be cut off. In that case currentvertex is not advanced, except for a spe-cial case where the next vertex followingcut ear is v0.

    Finally, in 1991 Chazelle presented O�n�worst-case algorithm �CHAZ91�. Basic idea is indeterministic algorithm that computes structurecalled visibility map. This structure is a gener-alization of a trapezoidation �horizontal chordstowards both sides of each vertex in a polygonalchain are drawn�. His algorithm mimics mergesort. The polygon of n vertices is partitionedinto chains with n�2 vertices, and these intochains of n�4 vertices, and so on. The visibilitymap of a chain is found by merging the mapsof its subchains. This actually takes O�n logn�time at the most. But Chazelle improves theprocess by dividing it into two phases. Thefirst phase includes computing coarse approx-imations of the visibility maps. This visibilitymaps are coarse enough that merging can be ac-complished in a linear time. The second phaserefines the coarse map into a complete visibilitymap, also in the linear time. A triangulation isthen produced from the trapezoidation definedby the visibility map. The algorithm has a lotof details and therefore it remains open to finda simple and fast algorithm for triangulating apolygon in the linear time. All mentioned algo-rithms are summarized in Table 1.

    4. Polygon triangulation algorithms basedon Delaunay triangulation

    Triangulation of the simple polygons can also beachieved by the well-known Delaunay triangu-lation �FLOR92� on a set of points. Namely, thevertices of a polygon can be considered as indi-vidual input points in the plane. When comput-ing the Delaunay triangulation we have to con-sider that some line segments �edges of poly-gon� must exist at the output. That problem isknown as a constrained Delaunay triangulation�CDT�.

    Let V be a set of points in the plane and Lset of non-intersecting line segments havingtheir extreme vertices at points of V . The pairG � �V� L� defines a constraint graph.

    Two vertices PiPj � V are said to be mutuallyvisible if either segment PiPj does not intersectany constraint segment or PiPj is a subsegmentof a constraint segment of L.

    Now the visibility graph of G is a pair Gv ��Vv� Ev�; Vv � V and Ev � f�Pi� Pj� j Pi� Pj �Vv and Pi� Pj are mutually visible with respectto set Lg �see Fig. 4b�.

    An edge in Ev joins a pair of mutually visiblepoints of V with respect to all straight-line seg-ments belonging to L.

    So, triangulation of V constrained by L is de-fined as a graph T�V; L� � �Vt� Et�; Vt � Vand Et is a maximal subset of Ev � L such thatL � Et, and no two edges of Et intersect, exceptat their endpoints.

    A CDT T�V; L� of set of pointsV with respect toa set of straight-line segments L is a constrained

    Fig. 4. a� Empty circle property; b� Visibility map; c� Constrained Delaunay triangulation.

  • 324 A Contribution to Triangulation Algorithms for Simple Polygons

    triangulation of V in which the circumcircle ofeach triangle t of T does not contain in its in-terior any other vertex P of T which is visiblefrom the three vertices of t �see Fig. 4c�. An-other characterization of CDT is given by theempty circle property: a triangle t in a con-strained triangulation T is a Delaunay triangleif there does not exist any ot her vertex of Tinside the circumcircle of t and visible from allthree vertices of t �see Fig. 4a�. See details in�FLOR92�.

    The Delaunay triangulation of simple polygoncan be generally computed as follows: the firststep computes CDT of edges of simple polygonand the second step removes triangles that arein exterior of simple polygon. The informationthat input is a simple polygon �not just generalconstraint graph� could be useful in step one andtherefore algorithms for building a CDT can besubdivided into two groups:

    � algorithms for computing the CDT when theconstraint graph is a simple polygon,

    � algorithms for computing a CDT for generalconstraint graph.

    4.1. Constrained Delaunay triangulationalgorithms for simple polygons

    Lewis and Robinson described an O�n2� al-gorithm based on divide-and-conquer approachwith internal points of simple polygon �LEWI79�.The boundary polygon is recursively subdividedinto almost equally sized subpolygons that areseparately triangulated together with their inter-nal points. The resulting triangulation is thenoptimized to produce CDT.

    A recursive O�n2� algorithm for CDT basedon visibility approach is described by Floriani�FLOR85�. The algorithm computes the visibil-ity graph of the vertices of the simple polygonQ in O�n2� time and the Voronoi diagram P ofset of its vertices in O�n logn�. The resultingDelaunay triangulation is built by joining eachvertex Q of P to those vertices that are bothvisible from Q and Voronoi neighbors of Q.

    Another O�n logn� algorithm was described byLee and Lin in �FLOR92�. The algorithm isbased on Chazelle’s polygon cutting theorem.Chazelle has shown that for any simple poly-gon P with n vertices, two vertices t1 and t2 of P

    can be found in a linear time such that segmentt1t2 is completely internal to P. Each of thetwo simple subpolygons resulting from the cutof P by t1t2 has at least n�3 vertices. Lee andLin’s algorithm subdivides the given polygon Qinto two subpolygons Ql and Qr and recursivelycomputes the constrained Delaunay triangula-tions Tl and Tr. The resulting triangulation Tof Q is obtained by merging Tl and Tr. Theyalso proposed a similar algorithm for generalconstraint graph which runs in O�n2�.

    4.2. Constrained Delaunay triangulationalgorithms for general constraintgraphs

    Chew describes an O�n logn� algorithm for theCDTbased on the divide-and-conquer approach.The constraint graph G � �V� L� is assumedto be contained in a rectangle, which is subdi-vided into vertical strips �CHEW87�. In eachstrip there is exactly one vertex. The CDT iscomputed for each strip and adjacent strips arerecursively merged together. After last mergewe got the final CDT. The major problemhere ismerging those strips that contain edges, whichcross some strip having no endpoint in it.

    Algorithm for computing CDT, which includespreprocessing on the constraint segments, isproposed by Bossiant �BOIS88�. By prepro-cessing CDT, the problem is transformed intostandard Delaunay problem on a set of points.The idea is to modify the input data by addingpoints lying on the constraint segments in sucha way that resulting Delaunay triangulation isguaranteed to contain such segments. Con-straint segment e is a Delaunay edge if the circlehaving e as diameter does not intersect any otherconstraint segment. If the circle attached to eintersects some other segment, then e is splitinto a finite number of subsegments such thatnone of the circles attached to those segmentsintersect any constraint. When two constraintsegments intersect at an endpoint, one newpointis inserted into both segments. The circumcircleof the triangle defined by the common endpointand by the two new points does not intersect anyother constraint segment. This algorithm takesat most O�n logn� time and generates at mostO�n� additional points.

    For CDT all the above algorithms require thatall points are defined at the beginning of the

  • A Contribution to Triangulation Algorithms for Simple Polygons 325

    triangulation process. An algorithm proposedby Floriani and Puppo �FLOR92� resolves CDTproblemby incrementally updatingCDT as newpoints and constraints are added. The problemof incrementally building of CDT is reduced tothe following three subproblems:

    – computation of an initial triangulation of thedomain,

    – insertion of a point,

    – insertion of a straight-line segment.

    An initial triangulation of the domain can beobtained by different approaches. For example,we can determine a triangle or rectangle �madeof two triangles�, which contain the whole do-main. Then, points and straight-lines are in-crementally inserted. After each insertion weget new CDT which has more elements than theprevious one. After inserting the last point orstraight-line, the bounding triangle is removed.Algorithm runs at most in O�ln2� where n isnumber of points and l the number of straight-line segments in the final CDT.

    Table 2 shows the algorithms for computing tri-angulation of a simple polygon based on Delau-nay triangulation.

    5. Polygon triangulation algorithms byusing Steiner points

    Finally, the algorithms that care also about thequality of triangulation are considered. Thequality is checked regarding the minimum in-terior angle of triangles in the output triangula-tion. Generally, that feature is possible only ifthe use of so-called Steiner points is allowed.

    In that case the number of output triangles is in-creased regarding the minimum number of tri-angles in output triangulation. In other words,we want to provide shape guarantee �minimuminterior angle is as high as possible� with mini-mum triangles in the output triangulation �sizeguarantee�.

    One of such techniques of triangulation pointsand straight-lines is Delaunay refinement tech-nique. Chew presented a Delaunay refinementalgorithm that triangulates a given polygon intoa mesh. In mesh all triangles are between 30�

    and 120�. The algorithm produces a uniformmesh to obtain all triangles of the roughly thesame size �CHEW89�.

    Ruppert extended Chew’s work �RUPP94� bygiving an algorithm such that all triangles in theoutput have angles between π � 2α . Parame-ter α can be chosen between 0� and 20�. Thetriangulation maintained here is a Delaunay tri-angulation set of points which is computed atthe beginning. Vertices for Delaunay triangu-lation are in that case endpoints of segmentsand possible isolated vertices. After comput-ing Delaunay triangulation, vertices are addedfor two reasons: to improve triangle shape, andto ensure that all input segments are presentedin Delaunay triangulation. Two basic opera-tions in the algorithm are splitting a segmentby adding a vertex at its midpoint, and splittinga triangle with a vertex at its circumcenter. Ineach case, the new vertex is added to set of ver-tices. When a segment is split, it is replaced inset of segments by two subsegments. Such algo-rithms runs in O�M2� time, where M is numberof vertices at the output, but in practice are veryfast.

    Time complexity Author Year InputO�n2� Lewis, Robinson 1979 Simple polygon

    O�n logn� Floriani 1985 Simple polygonO�n logn� Lee, Lin 1980 Simple polygon

    O�n2� Lee, Lin 1980 GeneralO�n logn� Chew 1987 GeneralO�n logn� Boissonnat 1988 General

    O�ln2� Floriani, Puppo 1992 General

    Table 2. Triangulation algorithms based on Delaunay triangulation.

  • 326 A Contribution to Triangulation Algorithms for Simple Polygons

    Time complexity Author Year InputO�n logn � k� Bern, Eppstein 1991 General

    O�n logn� Bern, Dobkin 1995 Simple polygonO�n log 2n� Bern, Mitchell 1995 Simple polygon

    O�M2� Chew 1989 Simple polygonO�M2� Ruppert 1994 General

    Table 3. Triangulation algorithms based on using Steiner points.

    Some other algorithms that give shape guaran-tees are available. They are more complicatedto implement and are not based on Delaunaytriangulation. Baker �BAKE88� has given analgorithm to triangulate the interior of a simplepolygon with elements whose angles are be-tween 13� and 90�. The number of trianglesused by their algorithm may be unnecessarilylarge. But they suggested that quadtrees mightimprove the size of the triangulation. Bern,Eppstein and Gilbert �BERN92� followed upthis suggestion, as well as giving a new sizebound. They showed how to triangulate a pla-nar point set or poligonally bounded domainwith triangles of bounded aspect ratio. Trian-gulation has size �number of triangles� withina constant factor of optimal and runs in opti-mal time O�n logn� k� with input of size n andoutput of size k. Bern, Dobkin, and Eppstein�BERN95� showed how to triangulate polygonalregionswith triangles of guaranteed quality. Al-gorithm guarantees, using O�n� triangles, thatthe smallest height �shortest dimension� of a tri-angle in a triangulation of an n-vertex polygon�with holes� is a constant factor of the largestpossible. Using O�n logn� triangles for sim-ple polygons �O�n3�2� for polygons with holes�they guarantee the largest angle is not greaterthan 150�. Such triangulation can be obtainedin O�n logn� time �O�n logn� k� for polygonswith holes�. Another algorithm presented byBern, Mitchell and Ruppert �BEMI95� consid-ers triangulation of n-vertex polygonal regionsso that no angle in the final triangulation mea-sures more than π�2. The number of triangles inthe triangulation is only O�n� and the runningtime is O�n log2 n�. Algorithm also considersholes in polygons. Basic new technique used inthe algorithm is recursive subdivision by disksand consists of two stages: first stage packs thedomain with non-overlapping disks, tangent to

    each other and to sides of the domain. Diskpacking is such that each region not coveredhas at most four sides. The algorithm then addsedges between ce ntres of disks and points oftangency on their boundaries, thereby dividingthe domain into small polygons. Second stagetriangulates the small polygons using Steinerpoints located only interior to the polygons oron the domain boundary.

    Table 3 shows algorithms and their time com-plexities described in this section.

    6. Common features of groups ofalgorithms for polygon triangulation

    In this section, general properties of all threegroups of the algorithms for polygon triangula-tion �algorithms based on diagonal insertion,algorithms based on Delaunay triangulation,and algorithms using Steiner points� are con-sidered. Attributes interesting for comparisonsare �SHEW�:

    � quality of a triangulation,

    � number of output triangles, and

    � the possibility of triangulating polygons withholes.

    Figure 5 shows �extended figure from �RUPP94��how different triangulation is obtained while tri-angulating the same polygon by different algo-rithms:

    � triangulation in Fig. 5a has been generated bySeidel’s randomized incremental algorithmgenerates the output in Fig. 5a �SEID91� �ba-sed on diagonal inserting�,

    � De Floriani and Puppo’s constrained Delau-nay triangulation generated the Fig. 5b�FLOR92� �based onDelaunay triangulation�,

  • A Contribution to Triangulation Algorithms for Simple Polygons 327

    Fig. 5. a� Diagonal inserting �Seidel�; b� Constrained Delaunay triangulation �De Floriani & Puppo�; c� Delaunayrefinement �Ruppert�.

    � Fig. 5c shows the output of Ruppert’s Delau-nay refinement algorithm �RUPP94� �usingSteiner points�.

    It is obvious; the algorithms that use Steinerpoints achieve the best output triangulation.They have built-inmechanismensuring the qual-ity of the output triangulation. However, theyproduced also the larger number of triangles.Delaunay-based algorithms provide the highestquality possible on the original vertices �Fig. 5c�.During the construction of the triangulation,they consider so-called Delaunay empty-circleproperty already mentioned in Section 4. Al-gorithms based on the diagonal insertion do notcare at all about the quality of the triangula-tion and because of this, different outputs areobtained by different algorithms �see section 7where four algorithms from this group are com-pared�. However, Delaunay-based algorithmsand the algorithms based on diagonal insertionalways generate exactly n � 2 triangles. If wewant to obtain the smallest number of trian-gles possible, and we want to be sure about thequality of the triangulation, then one of the al-gorithms based on Delaunay triangulation hasto be used.

    The algorithms based onDelaunay triangulationand those using Steiner points handle polygonswith holes very easily. They triangulate also theholes, but because we know which edges of thepolygon belong to the holes, the triangles insidethe holes can be easily removed. The majorityof algorithms based on diagonal insertion can-not perform the triangulation of polygons con-taining holes. One of the exceptions is Seidel’srandomized incremental algorithm. Originally,it has not being designed to handle polygonswith holes, but it turned out that this extensionis very simple. The solution is described in thenext section.

    Concerning speed of the algorithms it is re-ally difficult to compare them. In each groupthere are the solutions working in O�n logn�time �we do not take into account Chazelle’salgorithm which has not yet been successfullyimplemented�. However, concerning the im-plementation, the algorithms based on diagonalinserting are the easiest to implement.

  • 328 A Contribution to Triangulation Algorithms for Simple Polygons

    7. Comparison of triangulation algorithmsbased on diagonal insertion

    We have already mentioned that the algorithmsbased on diagonal insertion do not use any cri-teria regarding the quality of the generated tri-angulation and therefore they produce also verydifferent results. This is the reason why in thissection some algorithms based on diagonal in-sertion are analyzed.

    The following algorithms have been chosen: arecursive diagonal inserting algorithm �TOUS91�,an ear cutting algorithm �MEIS75�, Kong’s Gra-

    ham scan algorithm �KONG90�, and Seidel’srandomized incremental algorithm �SEID91�.All the algorithms have been implemented inC�� using the same data structures. Figure 6shows howdifferent output is generated by thesefour algorithms.

    We tested the speed of the algorithms on twotypes of polygons: concave polygons and con-vex polygons. We also took convex polygons todetermine how fast the algorithms are on poly-gons where triangulation can be obtained in lin-ear time with the simple algorithm �see table 4,column Actual Running Time�.

    Fig. 6. a� Diagonal inserting; b� Ear cutting; c� Graham scan; d� Randomized incremental.

    Actual running timein ms for 5000 pointsAlgorithm

    Runningtime

    Averageangle Convex Concave

    Holes

    Recursive diagonal inserting O�n2� 3�40� 5523 5671 NoEar cutting O�n3� 2�45� 10285 10325 No

    Kong’s Graham scan O�kn� 4�06� 6970 6950 NoSeidel’s rand. Incremental O�n log�n� 7�94� 330 331 Yes

    Table 4. Comparison of algorithms based on diagonal insertion.

  • A Contribution to Triangulation Algorithms for Simple Polygons 329

    Fig. 7. Speed of algorithms �left — concave polygon; right — convex polygon�.

    Fig. 7 presents the graph showing the runningtime of the considered algorithms. For eachtype of polygons we measured the speed whenpolygons contain from 3 to 2000 vertices �withstep 50�. It is clearly seen that Seidel’s random-ized algorithm is in practice the fastest algo-rithm among all compared algorithms. Seidel’salgorithm is also not sensitive to on the type ofthe input polygon. Other three algorithms areconsiderably slower and their run-time dependson the shape of the input polygon �compare leftand right Fig. 7�.

    As we already said, the algorithms from thisgroup do not contain any mechanism for ensur-ing the quality, and because of different tech-niques used, the algorithms provide differentquality of the output triangles. Table 4 showsthe average minimum interior angle of obtainedtriangles for concave polygonswith 500 vertices�test was repeated 100 times on different poly-gons with 500 vertices�. Again, the Seidel’srandomized incremental algorithm provides thebest result. The reason is that Seidel’s algo-rithms first decompose the input polygon intomonotone polygons followed by partitioning ofpolygons into triangles.

    Only Seidel’s algorithm is capable to solve situ-ations when the polygons containing holes areconsidered �see Table 4, column holes�. This ispossible because Seidel’s randomized algorithmtakes edges randomly on input and builds trape-zoidation. Therefore, we can also add edges ofholes on input. After building such trapezoi-

    dation we only construct monotone polygons,which are lying in the polygons but not in holes.

    As shown from Table 4 the Seidel’s algorithmis the best regarding all other three algorithms.The price for this is more complicated imple-mentation.

    8. Conclusions

    Triangulation of a simple polygon is the fre-quent task in computational geometry and itsapplications �geographic information systems,finite element mesh generation� and today, alarge number of different algorithms are known.These algorithms can be classified into threemajor groups: methods based on diagonal inser-tion, constrained Delaunay approaches, and al-gorithms using Steiner points. All three groupsare considered in the paper and the most pop-ular algorithms are briefly described. We havepointed on the most important characteristics ofeach group regarding the number of output tri-angles, the quality of the triangulation, and thepossibility to handle the algorithms with holes.Because algorithms based on diagonal insertiondo not include any strategy for optimizationtheir output, the resulting triangulations differnoticeably. Because of this we compared fouralgorithms from this group regarding the runtime, the quality of the output triangulation, andthe ability of solving the polygons with holes.We have shown that Seidel’s algorithm is thebest in this category.

  • 330 A Contribution to Triangulation Algorithms for Simple Polygons

    The development of polygon triangulation algo-rithms is still attractive research topic in com-putational geometry. The real challenge isChazelle diagonal inserting algorithm �CHAZ91�.Although theoretically known from 1991, upto now there is no any successful implemen-tation. The new algorithms are still expectedamong the constraint Delaunay triangulation al-gorithms and especially among the algorithmsusing Steiner points.

    9. Acknowledgement

    This work has been carried out within a Valva-sor�ALIS program supported by British Coun-cil �title of the project Computational geometryand its applications in medical visualization�.

    References

    �1� B. BAKER, E. GROSSE, C. RAFFERTY Nonobtusetriangulation of polygons. Discrete and Comp. Ge-ometry, 3 �1988�, 147-168.

    �2� M. BERN, S. MITCHELL, J. RUPPERT Linear-SizeNonobtuse Triangulation of Polygons. DiscreteComput. Geometry, 14 �1995�, 411-428.

    �3� M. BERG, M. KREVELD, M. OVERMARS, O.SCHWARZKOPF, Computational Geometry, Algo-rithms and Application. Springer Verlog, 1997.

    �4� M. BERN, D. EPPSTEIN, J. R. GILBERT, Provablygood mesh generation. Presented at the Proceed-ings of the 31st Annual Symposium on Foundationof Computer Science, �1990�, 231-241.

    �5� M. BERN, D. DOBKIN, D. EPPSTEIN, Triangulatingpolygons without large Angles. Computationl Ge-ometry & Applications, 5 �1995�, 171-192.

    �6� J. D. BOISSONNAT, Shape reconstruction from pla-nar cross sections. Comput. Vision Graphics ImageProcess., 44 �1988�, 1-29.

    �7� B. A. CHAZELLE, Theorem on polygon cutting withapplications. Presented at the Proceedings of the23rd IEEE Symposium on Foundation of ComputerScience, �1982�, Chicago, 339-349.

    �8� B. CHAZELLE, J. INCERPI, Triangulation and shapecomplexity. ACM Transactions on Graphics, 3�1984�, 135-152.

    �9� B. CHAZELLE, Triangulating a simple polygon inlinear time. Discrete Computational Geometry, 6�1991�, 485-524.

    �10� L. P. CHEW, Constrained Delaunay triangulation.Presented at the Proceedings, Third ACM Sympo-sium on Computational Geometry, �1987�, Water-loo, 216-222.

    �11� L. P. CHEW, Guaranteed — quality triangularmeshes. Technical report, No. TR-89-983, CornellUniversity, 1989.

    �12� L. DE FLORIANI, B. FALCIDIENO, C. A. PIENOVI,Delaunay-based representation of surfaces definedover arbitrarily-shaped domains. Comput. VisionGraphics Image Processing. 32 �1985�, 127-140.

    �13� L. DE FLORIANI, E. PUPPO, An On-Line Algorithmfor Constrained Delaunay Triangulation, GraphicalModels and Image Processing, 3 �1992�, 290-300.

    �14� M. R. GAREY, D. S. JOHNSON, F. P. PREPARATA, R.E. TARJAN, Triangulating a simple polygon, Inform.Process., 7 �1978�, 175-180.

    �15� H. ELGINDY, H. EVERETT, G. T. TOUSSAINT, Slicingan ear in linear time. Pattern Recognition Letters,14 �1993�, 719-722.

    �16� S. HERTEL, K. MEHLHORN, Fast triangulation ofsimple polygons. Presented at Proceedings 4th In-ternat. Conf. Theory, �1983� pp. 207-215.

    �17� D. G. KIRKOATRICK, M. M. KLAWE, R. E. TAR-JAN, O�n log log n� polygon triangulation with sim-ple data structures. Presented at ACM Symposiumon Computational Geometry, 6 �1990� pp. 34-43,Berkeley, California.

    �18� X. KONG, H. EVERETT, G. T. TOUSSAINT, The gra-ham scan triangulates simple polygons. PatternRecognition Letters, 11 �1990�, 713-716.

    �19� N. J. LENNES, Theorems on the simple finite polygonand polyhedron. American Journal of Mathematics,33 �1911�, 37-62.

    �20� B. A. LEWIS, J. S. ROBINSO, Triangulating of planarregions with applications. Comput. J., 4 �1979�,324-332.

    �21� G. H. MEISTERS, Polygons have ears. AmericanMathematical Monthly, 82 �1975�, 648-651.

    �22� J. O’ROURKE, Computational Geometry in C. Cam-bridge University Press, 1994.

    �23� J. RUPPERT, A Delaunay Refinemt Algo-rithm for Quality 2-Dimensional Mesh Gen-eration. NASA Arnes Research Center, Sub-mission to Journal of Algorithms, �1994�,http���jit�arc�nasa�gov�nas�abs�html�

    �24� R. SEIDEL, A simple and fast incremental random-ized algorithm for computing trapezoidal decom-positions and for triangulating polygons. Compu-tational Geometry: Theory and Applications, 1�1991�, 51-64.

    �25� J. R. SHEWCHUK, Triangle: Engieering a 2D Qual-ity Mesh Generator and Delaunay Triangulator.Carnegie Mellon University, ftp�cs�cmu�edu�

    �26� R. E. TARJAN, C. J. VAN WYK, An O�n log log n� —time algorithm for a simple polygon triangulationand its evaluation. IEICE Technical report, No.PRU89-41, September 1989.

  • A Contribution to Triangulation Algorithms for Simple Polygons 331

    �27� G. T. TOUSSAINT, Efficient triangulation of simplepolygons. The Visual Computer, 7 �1991�, 280-295.

    Received: October, 2000Accepted: November, 2000

    Contact address:

    Marko LamotHermes Softlab

    Litijska 511000 Ljubljana

    SloveniaTel: �386 61 1865 815;Fax: �386 61 1865 816;

    e-mail: marko�lamot�hermes�si

    Borut ŽalikUniversity of Maribor

    Faculty of Electrical Engineering and Computer SciencesSmetanova 172000 Maribor

    Slovenia

    MARKO LAMOT currently works for at Hermes SoftLab computer com-pany, Ljubljana, Slovenia. He received his BSc in computer engineeringin 1996 from the University of Maribor, Slovenia. Currently he is work-ing on his PhD degree at University of Maribor. His research interestsinclude computational geometry especially triangulating algorithms anduniform grids.

    BORUT ŽALIK is currently an associate professor at the Faculty of Elec-trical Engineering and Computer Science at the University of Maribor,Slovenia. He also has a position of a senior research fellow at De Mont-fort University, U. K. He received his BSc in electrical engineering in1985, MSc and PhD in computer science, both from the University ofMaribor in 1989 and 1993, respectively. His research interests includecomputational geometry, geometric modeling, GIS applications, andmultimedia applications.

    /ColorImageDict > /JPEG2000ColorACSImageDict > /JPEG2000ColorImageDict > /AntiAliasGrayImages false /DownsampleGrayImages true /GrayImageDownsampleType /Bicubic /GrayImageResolution 300 /GrayImageDepth 8 /GrayImageDownsampleThreshold 1.50000 /EncodeGrayImages true /GrayImageFilter /FlateEncode /AutoFilterGrayImages false /GrayImageAutoFilterStrategy /JPEG /GrayACSImageDict > /GrayImageDict > /JPEG2000GrayACSImageDict > /JPEG2000GrayImageDict > /AntiAliasMonoImages false /DownsampleMonoImages true /MonoImageDownsampleType /Bicubic /MonoImageResolution 600 /MonoImageDepth -1 /MonoImageDownsampleThreshold 1.50000 /EncodeMonoImages true /MonoImageFilter /CCITTFaxEncode /MonoImageDict > /AllowPSXObjects false /PDFX1aCheck false /PDFX3Check false /PDFXCompliantPDFOnly false /PDFXNoTrimBoxError true /PDFXTrimBoxToMediaBoxOffset [ 0.00000 0.00000 0.00000 0.00000 ] /PDFXSetBleedBoxToMediaBox true /PDFXBleedBoxToTrimBoxOffset [ 0.00000 0.00000 0.00000 0.00000 ] /PDFXOutputIntentProfile (None) /PDFXOutputCondition () /PDFXRegistryName (http://www.color.org) /PDFXTrapped /Unknown

    /Description >>> setdistillerparams> setpagedevice