Computer
Aided
Geometric
531
Design 10 (1993) 531-536
North-Holland COMAID 329
Transforming triangulations polygonal domains
in
Nira Dyn and lfat Goren School of ~~othern~t~~~iSciences. Sackler Faculty 69978. Tel Aviv. Israel
ofExact
Sciences, TeI-Aviv University, Ramat Aviv
Shmuel Rippa Department of Applied Mathematics and Theoretical Physics, Silver Street, Cambridge CB3 9ELt: C’K
Received June 1991 Revised June 1992
Abstract Dyn, N., I. Goren and S. Rippa, Transforming Geometric Design 10 (1993) 531-536.
triangulations
in polygonal domains,
Computer
Aided
In this paper we prove that it is possible to transform every triangulation of a set of points inside a polygonal domain in the plane into every other triangulation of the same set of points using only operations of swapping diagonals in convex quadrilaterals. Keywar&. Triangulations;
transforming
triangulations;
swapping diagonals.
1, Introduction Triangulations of a set of points inside a polygonal domain in the plane are impo~ant in areas such as scattered data interpolation [Schumaker ‘871, finite-element computation [Ho-Le ‘881 and computational geometry [Shamos and Preparata ‘85 1. For many applications, there are natural ways for measuring the quality of triangulations, see e.g. [Barnhill ‘771, [Dyn et al. ‘90 J and [Schumaker ‘871, and in such cases it is possible to suggest criteria for sefecting preferred triangulations from all trianguIations of the given set of points. For example, it could be the case that triangulations consisting of many short edges are preferred to t~angulations with Iong edges. An appropriate triangulation criterion for this case chooses, between any set of alternative trianguIations, the triangulation for which the sum of lengths of all edges is the least. A procedure for improving any “initial” triangulation with respect to a given criterion is to apply to it a sequence of transformations so that the final triangulation is better Correqwndence to: N. Dyn, School of Mathematical University,
Sciences,
Sackler Faculty of Exact Sciences, Tef-Aviv
Ramat Aviv 69978, Tel Aviv, Israel.
0167-8396/93/J
06.00 @ 1993 -
Elsevier Science Publishers
B.V. ~11 rights reserved
!V. Dyn et al. / Transforming
532
(a) Fig. 1. Two triangulations
trlangdarions
(b) of a convex quadrilateral.
with respect to the given criterion than the initial triangulation. A simple transformation was suggested in [Lawson ‘771: consider two adjacent triangles of a given triangulation that form a convex quadrilateral (see Fig. 1 (a) ). By replacing the diagonal of this quadrilateral with the opposite diagonal (as in Fig. 1 (b) ) the triangulation is transformed into another triangulation. An interesting question is Lvhether the suggested transformation is general enough, i.e. if it is possible to transform any initial triangulation into any other triangulation using only operations of swapping diagonals in convex quadrilaterals. Lawson [Lawson ‘721 gave an affirmative answer for the case where the boundary of the polygonal domain .Q is the convex hull of the set of points I/. He constructed a reference triangulation of the convex hull and proved that it is possible to transform every triangulation of the convex hull to the reference triangulation by using only diagonal swap operations. This was extended by Edelsbrunner [Edelsbrunner ‘921 to general polygonal domains. In this paper we extend Lawson’s result to general polygonal domains using a different approach. First we show that it is possible to transform an arbitrary triangulation into a triangulation that contains a given line segment, interior to Q and with endpoints from I/, as an edge. This requires swapping all edges that intersect with the line segment. To transform a triangulation T into a prescribed triangulation T’, we apply a sequence of such transformations. Starting with T co) = T, the ith step transforms the triangulation T Cd that contains the edge eI of T’. The triangulation T(‘-‘) into a triangulation T is transformed into T’ after all edges of T’ are processed.
2. Inserting a line segment into a triangulation by swapping diagonals Let T be a triangulation of a set of points V inside a polygonal region Q and let 1 be a line segment with endpoints A, B E V such that: (a) 1 c n and (b) 1 does not contain any point from Y in its interior. The main result of this section is: Theorem 2.1. T can be transformed into a triangulation that has 1 as an edge by using only operations of swapping diagonals in convex quadrilaterals. Moreover, only diagonals that intersect 1 are swapped during the transformation. Proof. Consider the part of the triangulation T that is intersected by 1 (examples can be found in Figs. 2(a) and (c)). Let el, . . . , e, be the edges of T that intersect with 1 and let ri be the distance between the intersection point of ei with 1 and the point A. We number the edges so that rI, . . . , rv is an increasing sequence. We also denote by vi the endpoint of e, that is to the left of the directed line from il to B. Finally we define the
A’. Dyn et al. / Transforming triangulations
533
(b)
(d) Fig. 2. (a) and (c) Two examples of a part of a triangulation T intersected by the line segment 1 = =. (b) and (d) The corresponding “polygon” PT.,/.
set of points uI,. . . , un, each one corresponding to a set of consecutive the same point. This can be achieved by the following procedure:
vi’s that refer to
Procedure ENDPOINTS j + 1 llj
+
?Jj
for i = 2,. . . , v if Vi # Uj then j-j+1 Uj t
Vi
endif endloop. We note that a given left-endpoint of an edge that intersects with I can have more than one enumeration (e.g. the point 114= 116in Fig. 2 (c) ). The ordered set of vertices (110,UI, *. . , un, u,+ , ) where 110= A and u,,+ 1 = B and I(,+ 1 is connected to ~0, defines a closed multiply connected polygon, denoted by PT,~ (see Figs. 2(b) and (d) ). We also note that every edge UIU,+1, i = 0,. . . , n of P,,l is also an edge of T, and that if (111,. . . , u,) are pairwise distinct points than PT.1 is a closed simply connected polygon (as is Pr., in Fig. 2(b)). Here is an outline of the proof of Theorem 2.1: First we show that the polygon Pr,l always has at least one vertex urn, 1 < m < n with an interior angle smaller than 7~. Next we construct a transformation of T into a triangulation T(l). This transformation involves only swapping diagonals outgoing from u ,,, and intersecting with 1. When n = 1, the transformed triangulation T(l) contains I as an edge. Otherwise the transformation eliminates the vertex urn from PTtIj,,, that is, the polygon PT,~,,, is defined by the ordered set of vertices
tug,...,1(,-1,~,+1,...,U,+1). After repeating the point-elimination transformations lation T(“) in which I is an edge and this completes
n - 1 more times we get a trianguthe proof of the theorem. E
534
N. Dyn et al. / Transforming triangulations
The fact that the polygon Pr,j aiways has at least one point %n, 1 < m 6 n with an interior angle smaller than rr is a consequence of the following lemma: Lemma 2.2. Every closed and simply connected polygon P has at least three interior angles smaller than 71. Proof. Let p 2 3 be the number of vertices of P, let Nit,. . , ap be the interior angIes of P and suppose that li of them are smatler than rr. The sum of all interior angles of P is (p - 2)~ and thus
i= I
o,
which implies that (k - 2)n >, C Cyi. ol,
(u,, w,+ 1, w,, W,_I )
N. Dyn et al. / Transforming
triangulations
335
(a)
Fig. 3. Three steps in the transformation
of triangulation T in (a) into another triangulation that ~3 is eliminated from P,,,, ,.
T”’ in Cd) such
Proof. The closed polygon with vertices (‘W),Wt -.
. - I Wrt Wr+
I1
(the polygon (~g,~t, w~,uI~,w~) of Fig. 3(a)) has, by Lemma 2.2, at least three interior angles smaller than R and thus there is a point u/$, 1 < s 9 r such that LzL’+~w,w,+ 1 < n. Thus the quadrilateral (urn, w,+ 1, w3, w,_~) must be convex since the diagonal u,,,~o~ connects two vertices with interior angies smaller than R (of course ~w,_~u,w,+~ < rr since it is contained in Lt{,_t u~u,+~ which is smatter than 7~). CI Now we show how to transform the triangulation T in r steps into a triangulation T(i) such that the point 11m is eliminated from Pr(,,,,. In each step only diagonals that intersect with I are swapped. Suppose that r > 1 and that the edge umws, outgoing from u,,, and intersecting 1, is a diagonal of the convex quadrilateral (u,, w,+ 1, w3, w,_ 1). By replacing this diagonal with the other diagonal w,_tw,, t we transform T into another triangulation. Every vertex of Pr.f is still a left-endpoint of an edge of the new triangulation that intersects with I, but the number of edges outgoing from u m and intersecting I is reduced by one. After r - 1 such steps we obtain a triangulation that has just one edge outgoing from tfm and intersecting with I, namely the case r = 1. In case r = 1, the. only edge outgoing from II,,, and intersecting I is ~1~~1 and, by Lemma 2.3, the quadrilateral (u,, u,,,+ t, WI, urn__,) is convex. A swap of diagonals replaces this diagonal by the diagonal u,-t u,+ i which does not intersect 1. The resulting triangulation 0’) is such that u, is eliminated from Prctitt_ Figure 3 displays the three edge swaps that are made to transform an initial triangulation T into another triangulation T(I) such that 213 is eliminated from Pr~r,(.
3. Transforming triangulations
of points C’ inside a poI~gona1 domain $2. Then it is possible to transport T into T’ by using only operatia~s of strapping diagonals in convex quadrilaterals.
Theorem 3.1. Let T and T’ be two tria~g~~fationsof a set
536
A’. D_vn et al. / Transforming tnangulations
Proof. Suppose that the edges of T’ are {et, ez, . . . , e.v} Then we consider procedure: Procedure T(O) t
the following
TRANSFOR~M T
fori= ,-‘..., N transform the triangulation T(‘-‘) into a triangulation contains the line segment ei as an edge endloop.
T(j) that
Obviously, triangulation T(l), produced by the TRANSFORM procedure contains el as an edge. Consider now the next step of the procedure, i.e. the insertion of e2 into the triangulation T(l). The line insertion procedure of Section 2 will swap only the edges of T(l) that properly intersect with e2 and thus will leave the edge el intact (et and e2 are edges of T’, therefore they do not intersect at any point other than their endpoints). By induction we conclude that the triangulation T(j), produced by TRANSFORM, contains all the line segments (et, . . . ,ei) as edges. Thus all edges of T’ are also edges of TcN) and, since all triangulations of the same set V inside a polygonal domain have the same number of edges, we finally conclude that T w = T’ and the proof of Theorem 3.1 is completed. 0
References Barnhill, R.E. (1977), Representation and approximation of surfaces, in: Rice, J.R., ed., Mathematical Software III, Academic Press, New York, 68-l 19. Dyn, N., Levin, D. and Rippa, S. ( 1990), Data dependent triangulations for piecewise linear interpolation, IMA J. Numer. Anal. 10, 137-154. Edelsbtunner, H. ( 1992), Private communication. Ho-Le, K. (1988), Finite element mesh generation methods: a review and classification, Computer-Aided Design 20, 27-38. Lawson, C.L. (1972), Transforming triangulations, Discrete Math. 3, 365-372. Lawson, C.L. (1977), Software for Ct interpolation, in: Rice, J.R., ed., Mathematical Software III, Academic Press, New York, 161-194. Schumaker, L.L. (1987), Numerical aspects of spaces of piecewise polynomials on triangulations, in: Mason, J.C. and Cox, M.G., eds., Algorithms for Approximation, Clarendon Press, Oxford, 373-406. Schumaker, L.L. (1987), Triangulation methods, in: Chui, C.K., Schumaker, L.L. and Utreras, FL, eds., Topics in Multivariate .-lppro.rimation, Academic Press, New York, 2 19-232. Shamos, M.I. and Preparata, F.P. (1985), Computational Geometry: An Introduction, Springer, New York.