Linear Time Triangulation of Special Polygons: Deepit Purkayastha 09CS3013

Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

Linear Time Triangulation of Special polygons

Deepit Purkayastha 09CS3013

Polygon triangulation is the decomposition of a polygonal area (simple polygon) P into a set of triangles that is, finding the set of triangles with pairwise non-intersecting interiors whose union is P. In the strict sense, these triangles may have vertices only at the vertices of P. In a less strict sense, points can be added anywhere on or inside the polygon to serve as vertices of triangles. In addition, the cases of triangulation of a simple polygon and of a polygonal area with polygonal holes are treated separately. Triangulations may be viewed as special cases of planar straight line graphs. When there are no holes or added points, triangulations form maximal outer-planar graphs. Bernard Chazelle showed in 1991 that any simple polygon can be triangulated in linear time, though the proposed algorithm is very complex. Special Cases of polygons exist for which the triangulation can be done in alternative and simpler ways as compared to Chazelle's method.

Triangulating a Convex Polygon

The simplest of such cases being that of a convex polygon. A convex polygon is trivial to triangulate in linear time, by adding diagonals from one vertex to all other vertices.

Triangulating a monotone polygon given by Alain Fournier and Delfin Y. Montuno in 1984
Input. A unimonotone polygon (with respect to the y axis), in the same format as polygons described above. Output. The same polygon, with the list of adjacent vertices in triangles in place. triangulate_monotone(first, last) begin determine start vertex (topmost if the monotone chain is on the right, bottommost if it is on the left). determine number_of_vertices; current = next(start); while number_of_vertices >= 3 do begin if angle(prev(current), current, next(current)) is CONVEX then begin for each of prev(current), current, next(current) do begin insert other two vertices to form triangle; end save = prev(current); remove current from uni-monotone polygon; if current = first then current = next(first) else current = save; decrement number_0f_vertices end else current = next(current) end end Analysis. The initializing steps take at most O(n) time. The unimonotone polygons, as defined above, have at least one vertex besides the topmost and bottommost ones whose internal angle is convex, since the sum of their n-2 internal angles is between (n-3)*pi and (n-2)*pi (see Figure alongside; we consider an angle less than or equal to pi convex). Therefore this vertex will be found in the first test inside the while loop. There cannot be other vertices of the polygon inside the triangle formed by the current vertex and its two adjacent vertices, since this would violate the unimonotone property of the polygon (the y coordinate of such a vertex would have to be between the y coordinates of next(current) and prev(current)). So a triangle of the triangulation can be formed and the current vertex removed from the polygon. This leaves a unimonotone polygon (since we do not remove the topmost or bottommost vertex), and, therefore, by induction we deduce that the algorithm will proceed until only three vertices are left, in which case the angle is necessarily convex, the last triangle will be recorded, and it will terminate. The algorithm backtracks by one vertex only when a vertex is removed, so there are at most O(n) backward steps and O(n) forward steps.

Triangulating reducible polygons (Star shaped polygons form a subclass of these reducible polygons) given by A. A. Schoone and J. van Leuwen in 1980
A simple polygon P is called starshaped when there exists a point t in the interior from which all vertices of P are visible. Given an enumeration of the vertices of a simple n-gon in the order in which they appear on the boundary, it takes only O(n) steps to determine whether the polygon is star shaped and, if so, to find a point t as described . Hence the star-shaped polygons form an "easily recognized" subclass of the simple polygons. This paper also introduced the concept of a reducible segment" and use it to obtain some general algorithmic tools for later constructions. Two different methods for triangulating star-shaped polygons in linear time was given. One of the techniques used can be generalized and allows us to characterize the larger class of "reducible polygons" for which a linear time triangulation algorithm exists as well. Preliminaries: reducible segments Definition. An n-segment p(l), ..., p(n) is said to be reducible when for each triple p(i-1), p(i), p(i+1) for which the interior angle between the connecting linesegments is < 180 degrees (1<i<n) the diagonal p(i-1)p(i+1) can be drawn without creating intersections, while the resulting (n-1)-seqment p(1) , . . . ,p(i-1),p(i+1), . .., p(n) remains reducible within the same sector. The definition of reducibility is fairly straightforward despite its "recursive" form and will be appreciated once it is read as saying that one can "complete" any interior triangle formed by three consecutive vertices along the boundary after the triangle has been cut off. Note that the n-segment of figure 1.a. is reducible and the n-segment of figure 1.b. is not. Given a n-segment p(1) , . . . , p(n) the lower convex hull is defined as the shortest nonintersecting arc C from to p such that, when extended with the rays from p1 and pn across the sector boundaries, the entire set of points is on or on the other side of C when viewed from t. Viewed from t, the lower convex hull is a concave arc connecting p1 to pn through selected vertices of the set. We shall assume that n-segments are always given with the points p(l), . . . ,p(n) stored in a doubly-linked list. Hence we can navigate only with the operations NEXT and PREV (of obvious meaning) and have no random access in the list.

Lemma 1 . Given a reducible nsegment pl, . . . , pn its lower convex hull C can be constructed in O(n) steps, while the area between the original segment and C gets triangulated at the same time. Lemma 2 . Let a1 + a2 < 180 degrees . Assuming the lower convex hulls C1 and C2 of the adjacent segments p(1),....,p(n) and q(1),....q(m) have been formed , the lower convex hull C of the full segment p(1),....,p(n),q(1),....q(m) can be constructed in only O(# points of C1 and C2 not on C) additional steps, while the area between C1, C2 and C gets triangulated at the same time. Theorem A. Let S(1) to S(k) be reducible segments in neighboring sectors with the same tip t and angles a(1) to a(k) such that S(i) is adjacent to S(i+1). (1 <= i < k) and a(1) +.....+ a(k) < 180 degrees. The lower convex hull C of union of S(i) for 1 <= i <= k can be constructed in linear time while the area between C and S(1) to S(k) (with the joining edges) gets triangulated at the same time. Proof : First compute the lower convex hulls (as lists of points) of each of the segments separately. Next combine the segments one after another, using the technique of lemma 2 . After the combined lower convex hull of sectors S(1) to S(i) has been computed, the addition of S(i+1) to it takes a number of steps proportional to the number of points that now get eliminated from the contour. It follows that the total run-time remains linear. The desired triangulation is obtained at no extra charge, as the algorithm proceeds. After this each such segment is recursed on such that the whole 360 degrees is covered in a similar fashion. Finally what we have is a convex polygon remaining . Which is again triangulated in linear time in the remaining number of vertices.

Triangulating thin polygons (might or might not be from the reducible class above)
Definition of Thin Polygon: A Thin Polygon is a Simple Polygon such that for each edge E there exists at-least one another edge F ( = complementary_Edge_Of(E) ) such that the acute angle between the lines corresponding to the line-segments E and F is less than a critical angle theta and the linesegments joining the nearer pair of end points of E and F to form a quadrilateral lies inside the polygon. Also If for any vertex E and F ( = possible_complementary_Edge_Of(E)) The acute angle between the lines corresponding to the line-segments E and F is greater than the critical angle theta and exactly one of the line-segments joining the nearer pair of end points of E and F to form a quadrilateral lies inside the polygon then F is a split edge. Lemma: Let E be an edge and let F = complementary_Edge_Of(E) . Then complementary_Edge_Of(NEXT(E)) = F or PREV(F) and complementary_Edge_Of(PREV(E)) = F or NEXT(F) provided none of them is a split edge. Any one of the above is equivalent to the other so , To Prove: complementary_Edge_Of(NEXT(E)) = F or PREV(F) Proof:(by contradiction) Assume, complementary_Edge_Of(NEXT(E)) != F and != PREV(F) => Either no complementary edge exists then it would not be a thin polygon or acute angle between edge (F and PREV(F) )and complementary_Edge_Of(NEXT(E)) is greater than theta => both of PREV(F) or F are split edges. => A Contradiction Algorithm: 1) Select any edge . 2) Find the set of edges S such that for E belongs to S complementary_Edge_Of(E) = NEXT(E) or PREV(E). 3) Select an unconsidered edge E of S and get the common vertex of E and complementary_Edge_Of(E) 4) Join the other vertex of selected E and that of F to form new edge of triangulation . 5) Consider new E =NEXT(E) 6) Test F or PREV(F) for complementary property If not PREV(F) is a split edge and goto 7 else goto 3 7) Return triangulated thin polygon Time Complexity: The time complexity mentioned in the above table is justified by the lemma. Thus O(n) time complexity is evident. O(n)

O(1) O(n) O(1)

References:
1) Triangulating a Star-shaped Polygon, A. A. Schoone and J. van Leuwen, 1980 2) Triangulating Simple Polygons and Equivalent Problems, Alain Fournier and Delfin Y. Montuno, 1984

You might also like