Medial axis transform and offset curves by Minkowski Pythagorean hodograph curves

Post on 28-Jan-2023

0 views 0 download

transcript

Medial axis transform and offset curves by Minkowski Pythagoreanhodograph curves

Hyeong In Choia,* , Chang Yong Hana, Hwan Pyo Moona, Kyeong Hah Roha, Nam-Sook Weeb,1

aDepartment of Mathematics, Seoul National University, Seoul, 151-742 South KoreabDepartment of Industrial Engineering, Hansung University, Seoul, 136-792 South Korea

Received 1 May 1998; received in revised form 6 July 1998; accepted 13 July 1998

Abstract

We present a new approach to medial axis transform and offset curve computation. Our algorithm is based on the domain decompositionscheme which reduces a complicated domain into a union of simple subdomains each of which is very easy to handle. This domaindecomposition approach gives rise to the decomposition of the corresponding medial axis transform which is regarded as a geometricgraph in the three dimensional Minkowski spaceR2,1. Each simple piece of the domain, called the fundamental domain, corresponds to aspace-like curve inR2,1. Then using the new spline, called the Minkowski Pythagorean hodograph curve which was recently introduced, weapproximate within the desired degree of accuracy the curve part of the medial axis transform with aG1 cubic spline of MinkowskiPythagorean hodograph. This curve has the property of enabling us to write all offset curves as rational curves. Further, this MinkowskiPythagorean hodograph curve representation together with the domain decomposition lemma makes the trimming process essentially trivial.We give a simple procedure to obtain the trimmed offset curves in terms of the radius function of the MPH curve representing the medial axistransform.q 1999 Elsevier Science Limited. All rights reserved.

Keywords:Domain decomposition; Medial axis; Offset curves; Minkowski Pythagorean hodographs

1. Introduction

The offset curve to a given curve in a plane is a locus ofpoints of fixed distance from the given curve. It is a well-known mathematical concept which was studied for a longtime. For instance, the offset curve is a wave front set ingeometric optics. But its importance in application lies inthe fact that it is being used as the CNC machine tool path inthe CAD/CAM. As a result, there was a large body of litera-ture dealing with various aspects of offset curves. (Forexample, one may refer [1–3,8–13,19–27,30–35]). Each,of course, deals with varied topics. But if we are allowed topaint things with a broader brush, the literature can be verycrudely categorized into two large groups. The worksbelonging to first one deal with the local computation ofthe so-called untrimmed offset curve. For this purpose, theprecise representation is an important issue. Although it istrivial to write down the parametric representation of theoffset curve in terms of the data of the given curve, compu-tationally it is not very desirable. For instance, even if the

given curve is a polynomial or rational curve of theparameter, the offset is not in general so. That puts a lotof computational burden when one tries to use theuntrimmed offset curve in practice. For that reason, muchattention was given to the special class of curves whoseoffset curves are polynomial or rational functions of thegiven parameter. Farouki and Sakkalis introduced thefamous Pythagorean hodograph curve which is a polyno-mial curve that has a rational offset curve in [9,14,16].Later, Pottmann [32] generalized the Pythagorean hodo-graph to include the rational curves that have rational offsetcurves. The second group of literature deals with a moreglobal problem, namely, trimming. Trimming is a procedurethat gets rid of unwarranted pieces of the untrimmed curveto form the true offset curve. This kind of problem occursowing to the presence of the cut locus of the given curve,which makes the problem computationally delicate.

In this paper, we deal with the general problem of findingthe offset curve of the boundary of a given domain. Ourapproach differs from the well-known current ones in thatit effectively incorporates the recent work on finding themedial axis through domain decomposition technique [5].It is certainly very well known that one can take advantageof the medial axis of the domain to simplify the trimming

Computer-Aided Design 31 (1999) 59–72

COMPUTER-AIDEDDESIGN

0010-4485/99/$ - see front matterq 1999 Elsevier Science Limited. All rights reserved.PII: S0010-4485(98)00080-3

* Corresponding author. Tel.: 0082 2 888 5676; fax: 0082 2 887 4694.E-mail address:hichoi@math.snu.ac.kr (H.I. Choi)1 Supported in part by B RI, GARC, and KOSEF 981-0104-020-2.

process. However, finding the medial axis was a nontrivialtask. In [5], a new algorithm is presented that effectivelyfinds the medial axis within the free-form boundary. Thebasic philosophy behind the method in [5] is the so-calleddomain decomposition lemma which enables one to breakup a complicated domain into simpler pieces. This idea ofdomain decomposition can be pushed further to generateoffset curves, although the domain decomposition lemmaneeds to be applied in a slightly different manner. Thisnew version, called the domain decomposition lemma foroffset curves, can be also found in our paper [2,7].

As the algorithm for medial axis transform in [5] is anapproximation algorithm, the curve representation of themedial axis transform becomes an important issue. Ingeneral, one can use any reasonable spline to approximatethe medial axis transform. But then, to compute the offsetcurve, one has to approximate it again with another spline-type curve, as the offset curve itself is not in general rational.

A more desirable approach would be to find a formalismthat enables one to write down explicitly the offset curvesonce the medial axis transform is found. Obviously, to beuseful, the offset curves should be represented as rationalcurves.

For this purpose, Moon has recently introduced a newtype of spline curves called the Minkowski Pythagoreanhodograph curves [28,29]. It is similar to the one Faroukiand Sakkalis originally defined. The main difference, whichis also the novelty of his approach, is that it is a polynomialspeed curve in the Minkowski space with respect to theLorentzian inner product. In [28], Moon gave the definitionand settled some basic issues. The merit of the MinkowskiPythagorean hodograph curves is that the offset curvesbecome a rational curve of the original parameter of themedial axis transform. This suits it best to the medial axistransform based approach.

In this paper, we utilize the Minkowski Pythagoreanhodograph curves to represent, within the prescribed errortolerance, the medial axis transform using the cubicMinkowski Pythagorean hodograph curves in theG1-inter-polation scheme. The algebraic problem is fairly straightfor-ward, and we can easily settle the ambiguity issue usuallyassociated with the use of the Pythagorean hodographcurves. This makes an automatic algorithm possible. Asour example shows (described later), it is computationallyeasy to deal with, and the accuracy can be maintained to anydesired degree.

The cubic Minkowski Pythagorean hodograph curvesgive rise to many delicate Lorentzian geometric problem.In our forthcoming paper [6], we will examine very care-fully various related mathematical issues. In particular, thegeometric characterization of cubic Minkowski Pythagor-ean hodograph curves, in the spirit of Farouki and Sakkalis[18], is obtained, and a careful description of the feasibilityset of theG1 interpolation problem is given. This forthcom-ing paper [6] provides the mathematical foundation for theprocedures used in this paper (the reader is referred to [6]).

Moreover, the algorithm presented in this paper can berefined, if one examines the medial axis transform itself asa geometric graph in the three dimensional space. Theinterested reader may refer Refs. [2,3].

2. Domain decomposition technique

2.1. Assumption on the domain

When an industry-oriented offset algorithm is an issue,the domain is often, but not always, assumed to have theboundary consisting of line segments and circular arcs in theCAD literature. (For example, one may refer [20]. Ofcourse, it must be stressed that there are many excellentworks concerning the case we deal with.) The type ofdomain we deal with in this paper is quite general. Firstof all, we allow the boundary of the domain to consist ofgeneral free-form curves. Namely, the boundary curves areassumed to be, in general, rational curves. In fact, we onlyneed the boundary curve to be real-analytic. And we alsoallow the boundary to have corners. Moreover, the domaincan have a finite number of holes, or interior boundarycurves. The precise formulation of the domain assumptionsadopted here coincides with that in [4].

2.2. Offset curves

For a given domainV, the (interior) d -offset curveOd(V)is the locus of points inV whose distance to2V is d , i.e.,

Od�V� � { p [ Vudist�p; 2V� � d} :

The d -offset Od�V� � � ~xd�t�; ~yd�t�� can be written downby a simple well-known formula:

~xd�t� � ~x�t�1 d~y0�t������������������

~x02�t�1 ~y02�t�p ;

~yd�t� � ~y�t�2 d~x0�t������������������

~x02�t�1 ~y02�t�p ;

where� ~x�t�; ~y�t�� represents the boundary curve ofV. Butthis formula only gives the so-calleduntrimmed offsetcurve. The untrimmed offset curve may have self-intersec-tion points, and some part of it should be removed. Thistrimming process is relatively expensive. The procedurewe describe in the following in this paper essentiallymakes the trimming process unnecessary.

Remark. In this paper, we deal only with interior offsetcurves. But the exterior offset curves can be handled in thesame way. If we add a sufficiently large boundary curvewhich contains our domainV, then the exterior ofVbecomes the interior of the new domain.

H.I. Choi et al. / Computer-Aided Design 31 (1999) 59–7260

2.3. Medial axis transform

One of the key tools we use in this paper is the so-calledmedial axis transform. It is certainly a very well-knownmethod. However, its careful mathematical study in theform we need was performed recently by Choi et al. [4].Choi et al. [5] also present an algorithm to approximate themedial axis transform. Here we list some of the basic defini-tions and facts from Refs. [4,5] which are relevant in thispaper.

The medial axisMA (V) of the domainV is the set ofcenters of maximally inscribed disks inV, and themedialaxis transformMAT (V) is the set of pairs of such centersand radii. To be formal,

MA �V� � { p [ VuBr �p� , V; and if Bs�q�, V containsBr �p�; thenBr �p� � Bs�q�} ;

MAT �V� � { �p; r� [ V × RuBr �p� , V; and if Bs�q�, V containsBr �p�; thenBr �p� � Bs�q�} :

HereBr(p) denotes the disk with centerp and radiusr. Wesayp [ MA (V) is a medial axis point (ofV), and similarly(p, r) [ MAT (V) is a medial axis transform point.

These maximal disks are also calledcontact disks, andtheir boundaries are calledcontact circles. When there is nodanger of confusion, the term contactdisk is used inter-changeably with contactcircle. The contact disk touchesthe boundary ofV at some points or along circular arcs,and we call them altogether ascontact components. Thereal analyticity assumption on the boundary curve impliesthat the number of such contact components is finite [4], andthe medial axis points are classified by the number of thecontact components. A pointp in MA (V) is called ann-prong point(n $ 1), if the corresponding contact disk hasncontact components.

According to [4,5] 1-prong points are called the terminalpoints, andn-prong points (n $ 3) are called the bifurcation

or branch points. A 2-prong point is a non-generic 2-prongpoint if its corresponding contact circle, i.e., the boundary ofthe contact disk, is an osculating circle at some contact pointof the boundary curves; otherwise, it is called a generic 2-prong point. In [4], it is proved that there are only finitelymany 1-prong points, non-generic 2-prong points, and bifur-cation points. Further, it is proved in [5] that the set of allgeneric 2-prongs forms a finite collection of analytic curvesin MA (V). In other words, for each generic 2-prongp, thereexists maximal analytic curve inMA (V) containingp suchthat all points on it are generic 2-prongs. We call each ofthese analytic curves anedgeof MA (V). No edge intersectswith itself. And no distinct edge mutually intersects, exceptperhaps at the common end points. Points inMA (V) whichare not generic 2-prongs are the end points of edges, whichare calledverticesof MA (V). So an edge is either

1. a curve connecting two vertices,2. a curve whose both end points coincide at one vertex,

or3. a closed curve.

It is known thatn edges are emanating from ann-prongpoint (therefore, the name ‘‘prong’’). Thus, 1-prongs, corre-sponding to either sharp corners or inscribed osculatingdisks, are end points ofMA (V), andn-prongs (n $ 3) arebifurcation, or branch points ofMA (V). For more details,see [4].

However, in practice, the medical axis transform isapproximately computed by finding only finitely manycontact disks and then by applying some sort of splineapproximation. Thus in this paper, as was used in [5], theterms liken-prongs, edges, vertices, fundamental domain,etc. are used with respect to the disks so far found, and afundamental domain is meant to be the part ofV which isbounded by two nearby contact disks. To put it in thecontext of the medial axis transform, a fundamental domaincorresponds to an edge of the medial axis transform which isrepresented as ageometric graph. By a geometric graph, wemean a graph which is topologically a normal connected

H.I. Choi et al. / Computer-Aided Design 31 (1999) 59–72 61

Fig. 1. The idea of domain decomposition.

graph with a finite number of vertices and edges, where avertex is a point inR3 and an edge is a real analytic curve inR3 connecting vertices.

2.4. Domain decomposition lemma for medial axistransform

The basic philosophy underlying this paper is that nomatter how complicated the domain is, it can be eventuallydecomposed into simple subdomains each of which isvery easy to handle. It is also the philosophy behind [4,5].The following result makes this decomposition approachfeasible:

Domain decomposition lemma. For any fixed medialaxis point p [ MA (V), let Br(p) be the corresponding

contact disk. Suppose A1,…,An are the connected compo-nents ofV\Br(p). DenoteVi � Ai < Br �p� for i � 1;…;n:Then MA �V� � Sn

i�1 MA �Vi� and MAT �V� �Sni�1 MAT �Vi�: Moreover, we haveMA �Vi�> MA �Vj� �

{ p} and MAT �Vi�> MAT �Vj� � { �p; r�} ; for everydistinct i and j.

Fig. 1 shows the domainV and a contact diskBr(p). V1,V2 andV3 are subdomains obtained by deletingBr(p), thusbreaking V into three componentsA1, A2 and A3, thenputting Br(p) back into each of the three componentsA1,A2, and A3. The domain decomposition lemma says thatthe medial axis (transform) ofV is the union of the medialaxis (transform) ofV1, V2, andV3. Therefore, instead ofhandlingV, one can handle each ofV1, V2, andV3 sepa-rately, and then put back the results to get that forV itself.

2.5. Domain decomposition lemma for offset curves

The domain decomposition lemma expounded earlier is auseful tool for the study of medial axis transform. However,it is not enough for the offset curve computation; it needs tobe refined further.

Fig. 2 shows a 4-prong pointp whose contact componentsconsist ofq1, q2, q3 andq4. Among them,q2 andq4 are pointsand q1 and q3 are arcs.A1, A2, A3 and A4 are parts of thedomain defined by the domain decomposition lemmadescribed earlier for the medial axis transform. ThenT1,T2, T3 andT4 are sectors ofBr(p) facing A1, A2, A3, andA4,respectively. Adding each sectorTi to Ai defines a newsubdomainA0i for i � 1;2;3; 4: The remaining parts aresectors facingq1 andq3. This situation is illustrated in Fig.2. Then thed-offset curve is also depicted in Fig. 3. As onecan see in the picture, thed -offset curve consists of the partswhich lie in A0i or in a sector facingq1 or q3. One canformalize this into the following general description:Supposep is ann-prong point ofMA (V), and letA1,…,An

be as defined in the domain decomposition lemma for themedial axis transform. Corresponding toA1,…,An, we haven contact componentsq1,…,qn. Soqi may be a point or anarc in2Br(p). Let Ti be the sector ofBr(p) facingAi andSi thecorresponding arc in2Br(p). SetA0i � Ai < Ti : Now divideOd (Vi) into two components: one is inA0i and the other is inVi \A

0i : Then the segment ofOd(Vi) in Vi \A

0i is the offset of

the complement arc~Si � 2Br �p�\Si of Si, which is justthe part of the circle centered atp of radiusr 2 d lyingin Vi \A

0i (if d $ r, no arc exists). These facts can be

summarized as:

Domain decomposition lemma for offset curves. Withthe definitions for A0i given before,Od(Vi) consists of thefollowing components

1. Od�Vi�> A0i�i � 1;…; n� and2. d-offset of the arcs qi (i � 1,…,n).

H.I. Choi et al. / Computer-Aided Design 31 (1999) 59–7262

Fig. 2. Domain decomposition.

Fig. 3. Domain decomposition for offset curves.

Further, each pair of the components described beforemeets with each other at most one or two end points.

For more mathematical details related to the offset curves,one may refer [2].

3. Minkowski PH curves

A Minkowski Pythagorean Hodographcurve is a newkind of a Pythagorean Hodographcurve recently intro-duced by Hwan Pyo Moon [28,29]. He called a curveg�t� ��x�t�; y�t�; r�t�� in the three dimensional Minkowski spaceR2,1 a Minkowski Pythagorean Hodograph (in short,MPH) curve if there exists a real polynomialr(t) suchthat x0�t�2 1 y0�t�2 2 r 0�t�2 � r�t�2:

MPH curves arise naturally in the representation ofmedial axis transform. Namely, as briefly mentioned inthe introduction, the medial axis transform of a planardomain can be viewed as a union of regular curves inR3.Suppose a piece of the medial axis transform is given byg�t� � �x�t�; y�t�; r�t��; wherep�t� � �x�t�; y�t�� is the medialaxis andr(t) is the corresponding radius atp(t). From thisinformation, one can rewrite the boundary� ~x�t�; ~y�t�� of thedomain by using the following envelope formula [29]:

~x�t� � x�t�1 r�t�2x0�t�r 0�t�^ y�t� ���������������������������x0�t�2 1 y0�t�2 2 r 0�t�2px0�t�2 1 y0�t�2 ;

�1�

~y�t� � y�t�1 r�t�2y0�t�r 0�t�7 x0�t� ���������������������������x0�t�2 1 y0�t�2 2 r 0�t�2px0�t�2 1 y0�t�2

�2�and the (trimmed)d-offset curve� ~xd�t�; ~yd�t�� can be easily

written down as

~xd�t� � x�t�1 �r�t�

2 d�2x0�t�r 0�t�^ y�t� ���������������������������x0�t�2 1 y0�t�2 2 r 0�t�2px0�t�2 1 y0�t�2 ; �3�

~yd�t� � y�t�1 �r�t�

2 d�2y0�t�r 0�t�7 x0�t� ���������������������������x0�t�2 1 y0�t�2 2 r 0�t�2px0�t�2 1 y0�t�2 �4�

for the parametert such thatr(t) $ d . From the formulaegiven before, the boundary and the offset curves are rationalcurves when the quantity inside the square root is a square ofa polynomial. Namely, this is the case, if

x0�t�2 1 y0�t�2 2 r 0�t�2 � r�t�2: �5�This suggests that it is better to regard the curveg�t� �

�x�t�; y�t�; r�t�� as living in the Minkowski spaceR2,1 ratherthan the standard Euclidean spaceR3. This was the motiva-tion for Moon [29] to introduce MPH curves.

The three dimensional Minkowski spaceR2,1 is a threedimensional vector space endowed with a non-degenerateinner product (5) defined by

k~v; ~wl � v1w1 1 v2w2 2 v3w3

for two vectors~v � �v1; v2; v3� and ~w � �w1;w2;w3� in R2,1.The square of the norm of the vector~v � �v1; v2; v3� is givenby u~vu2 � k~v; ~vl � v2

1 1 v22 2 v2

3: Using this inner product,(5) can be written as

kg 0�t�;g 0�t�l � r�t�2:In generalu~vu2 may be negative. Motivated by the special

theory of relativity, we say~v is space-like ifu~vu2 . 0; andlight-like (resp., time-like) if u~vu2 � 0 (resp.,u~vu2 , 0�: A

H.I. Choi et al. / Computer-Aided Design 31 (1999) 59–72 63

Fig. 4. Cubic Bernstein–Be´zier curve inR2,1.

curveg (t) is called space-like ifug 0�t�u2 . 0 for all t. It iseasily seen that the curve representing the medial axis trans-form should be space-like except that it may be allowed tobecome light-like at an inscribed osculating circle with asingle contact point. Therefore, we usually need to deal withspace-like MPH curves, which amounts to requiring thatP(t) never vanishes except perhaps at the one-prong point.

3.1. G1 interpolation by cubic MPH curves

Our basic strategy in dealing with the medial axis trans-form and the offset curves is to approximate the medial axistransform curve of a fundamental domain with the MPHcurves. The medial axis transform representing a fundamen-tal domain is a curve inR2,1. However, as it is not an MPHcurve in general, we have to approximate it with many smallpieces of simpler MPH curves. Our building blocks in thispaper are cubic MPH curves. Fig. 4 shows an example of thecubic Bernstein–Be´zier curve inR2,1, with control pointsP0,P1, P2 andP3. And the vectorsL0

�! � P0P1���!

; L1�! � P1P2

���!and

L2�! � P2P3

���! are called the control polygon legs.

3.2. G1 data

As we have mentioned, our basic approach is based ondomain decomposition technique. Namely, we successivelysubdivide the domain into smaller subdomains by addingcontact disks. We now explain interpolation procedure.Each contact disk added at each step obviously corresponds

to a point inR2,1. But the contact disk gives more informa-tion. Fig. 5 shows one contact disk centered atp��x0; y0� [ R2 with radiusr0. The contact points areq1 andq2. This data (x0, y0, r0) specifies a point inR2,1. Let (a ,b ) bethe unit vector inR2 which bisects the angle from the linesegmentpq2

�! to pq1�! in the direction of the fundamental

domain in question. Letu be the angle which is the halfangle of the portion of the contact circle inside the funda-mental domain in question. It is easy to see that2cosu isthe rate at which the radius increases. Therefore the curverepresenting the medial axis transform inR2,1 must have theslope tanf �2cosu , wheref is the angle between (a , b ,0) and (a , b , 2cosu ).

Thus the direction vector of the medial axis transformat (x0, y0, r0) in the direction of the fundamental domain inquestion is (a , b , 2cosu ). And we modify this vectorto be a unit vector under the Minkowski metric. So thevector

e� 1�������������1 2 cos2 up �a;b;2cosu�

is the tangent data with which we are going to deal in theG1

interpolation procedure.

Remark. In the case whereu � p , the direction vector(a , b , 2cosu) cannot be normalized as the Minkowskinorm of this vector is 0. We consider this exceptional casein the specialized manner which will be discussed later.

H.I. Choi et al. / Computer-Aided Design 31 (1999) 59–7264

Fig. 5. G1 data from a contact disk.

Fig. 6. Fundamental domain.

3.3. Cubic MPH curves

Fig. 6 represents two contact disks centered at (x0, y0) and(x3, y3) with radii r0 and r3 respectively. The fundamentaldomain in question is the portion ofV between the twocontact disks. The dataP0 � �x0; y0; r0� and P3 ��x3; y3; r3� define two points inR2,1, and the vectorse0 ande1 obtained as described earlier give the directions for thecubic spline. Heree1 is chosen to point away from thefundamental domain in question ife0 is chosen to pointinto the fundamental domain. Thus the problem becomesas follows:P0 and P3 are given points, ande0 and e1 aregiven unit vectors with respect to the Lorentzian innerproduct. We are supposed to find two cubic Be´zier controlpoints P1 and P2 in such a way thatP1 � P0 1 xe0;P2 �P3 2 ye1 for positivex andy to make the cubic curve

g�t� � P0�1 2 t�3 1 P13�1 2 t�2t 1 P23�1 2 t�t2 1 P3t3

have the Minkowski Pythagorean hodograph.This cubic MPH curveg (t) is the one to approximate the

portion of the medial axis transform betweenP0 andP3. Thisin turn defines a new domain which is supposed to approx-imate the given fundamental domain. This is illustrated inFig. 7.

As the squared norm of the hodographg 0(t) is of degree 4,we require that there exists a quadratic polynomials�t� �s0�1 2 t�2 1 s12�1 2 t�t 1 s2t2 such that

kg 0�t�; g 0�t�l � 9s�t�2:Let L0

�!; L1�!

; L2�! denote the control polygon legs ofg (t)

as

L0�! � P0P1

���! � xe0; �6�

L2�! � P2P3

���! � ye1; �7�

L1�! � P1P2

���! � d 2 xe0 2 ye1; �8�whered � P0P3

���!. Then the MPH condition is reduced to thefollowing equations:

s20 � k L0

�!; L0�!l; �9�

s0s1 � k L0�!

; L1�!l; �10�

s0s2 1 2s21 � k L0

�!; L2�!l 1 2k L1

�!; L1�!l; �11�

s1s2 � k L1�!

; L2�!l; �12�

s22 � k L2

�!; L2�!l: �13�

From Eqs. (9) and (13), we haves20 � x2

;s22 � y2

: Oneconstraint for the curveg (t) to be a medial axis transformcurve is thatg (t) must always have a space-like hodographexcept perhaps at the 1-prong point at which it becomeslight-like. So s0 and s2 must have the same sign. Thuswe can restrict our discussion only to the case thats0 � xands2� y for positivex, y without loss of generality. In thiscase, Eqs. (10) and (12) are written as

s1 � d0 2 x 2 ay� d1 2 ax2 y

whered0 � ke0;dl;d1 � ke1;dl anda� ke0; e1l:In case a ± 1, we have the relationy� x 1 ��d0 2

d1�=�a 2 1��: Substituting this relation to Eq. (11), we havethe quadratic polynomial equation inx

�2a2 2 a 2 1�x2 1 �3d0 1 d1 2 4ad1�x 1 2�d21 2 udu2� � 0:

�14�Now we have to find the positive roots of this equation.Moreover, the correspondingy should be also positive.Therefore we are also concerned with the quadratic poly-nomial equation iny

�2a2 2 a 2 1�y2 1 �3d1 1 d0 2 4ad0�y 1 2�d20 2 udu2� � 0:

�15�If the constant�d0 2 d1�=�a 2 1� is positive, then the posi-tive root of Eq. (14) gives a pair of positive solutions (x, y).And we can thus construct an MPH cubic curve; otherwise,the positive root of Eq. (15) will do the job.

After we construct an MPH curveg(t) from a pair ofpositive solutions (x,y), we have to check whetherg 0(t) isspace-like for all 0, t , 1. For this purpose, it is enoughthat s (t) has no zeros in the interval (0,1). As we havechosens0 and s2 to be positive, we have only to beconcerned withs1 � d0 2 x 2 ay:

Proposition 1. In cases1 $ 0;g 0�t� is space-like for all

H.I. Choi et al. / Computer-Aided Design 31 (1999) 59–72 65

Fig. 7. G1 interpolation data.

0 , t , 1. In cases1 , 0; g 0�t� is space-like for all0 , t ,1 if and only if xy. s2

1:

If s1 $ 0; thens (t) is always positive for 0, t , 1 bythe convex hull property of the Be´zier–Bernstein polyno-mial. For the cases1 , 0; one can show the propositiongiven before by computing the critical value ofs (t).

3.4. Choice of the solution

When we deal with the quadratic equation raised from theG1 interpolation, we are interested only in the positive solu-tion. In general, the equations may not even have any realsolutions. Even if they have real solutions, there is no guar-antee of the existence of positive solutions. A rigorousdiscussion on the configurations which admit positive solu-tions is far more complicated and involves some delicateLorentzian geometry arguments in the Minkowski space.Details can be found in our forthcoming paper [6].

One fact worth mentioning is that any reasonableG1 dataof the fundamental domain always admit two pairs of posi-tive solutions. Actually if two tangent datae0, e1 are suffi-ciently close and the difference vectord lies ‘‘betweene0,and e1’’ in some sense, then we get two pairs of positivesolutions [6]. And the fundamental domain will eventuallysatisfy this criterion in some step of domain decompositionprocedures. It is because the medial axis transform of the

domain with real analytic boundaries consists of real analy-tic curves inR2,1, and any sufficiently small segment of areal analytic curve looks pretty much like a line segment.

A more important case to settle is when there are twopairs of solutions of (x, y). Figs. 8 and 9 show two cubicMPH curves obtained from the sameG1 data:

e0 � �0:6124;1:0607;0:7071�;

e1 � �0:7769;20:7769;20:4551�;

d � �8;0;0:5�:The correspondingG1 interpolation equation has two

pairs of positive solutions (x, y) � (2.4160, 4.2643) and(18.9404, 20.7887). Fig. 8 illustrates the curve generatedwith the solutionx � 2.4160,y � 4.2643. Fig. 9 illustratesthe one with the other solution. Here we see that the firstcurve is more amenable and suitable for representing themedial axis transform. Actually, in this case, the curvegenerated with the second solution is not a space-likecurve. The constants1 is 213.8441, and this violates thecriterion for the space-like curve which was mentionedbefore.

In most cases, the solution corresponding to the smallervalue ofx produces the MPH curve which is usually bettersuited to represent the medial axis transform. For the solu-tion corresponding to the large value ofx, the resulting cubiccurve should traverse a much longer trajectory as we haveseen in Fig. 9. Thus it will be a good strategy to choose thesmaller value at all times. And this strategy is not harmful tothe approximation because we keep track of maximum errorin any case. If we have an MPH curve obtained from theG1

data, we generate the envelope from the MPH medial axistransform curve and measure the error from the originalboundary curves. If this error is less than the specifiederror tolerance, then we leave this part alone. Otherwise,we find another contact disk in this fundamental domainand subdivide the domain into smaller ones. More detaileddiscussion on the error analysis will be given in a latersection.

3.5. Exceptional cases

While setting up the quadratic equation, we have assumed

H.I. Choi et al. / Computer-Aided Design 31 (1999) 59–7266

Fig. 8. Cubic MPH curve with the smaller values ofx andy.

Fig. 9. Cubic MPH curve with the larger values ofx andy.

Fig. 10. G1 data at the 1-prong osculating circle.

that theG1 data e0 and e1 are space-like vectors. But inreality, the tangent data may become light-like. This kindof situation occurs at the osculating circle as shown in Fig.10. Here we have only to be concerned with the case thate0

is light-like ande1 is space-like. If both of them are light-like, we can divide this domain into subdomains each ofwhich satisfies this assumption.

If e0 is light-like, it is impossible to normalize it under theMinkowski metric. So we modify this vector such that itsprojection to thexy-plane is a unit vector under the Eucli-dean metric of the plane. Then the third component2 cosushould be 1. After that, we can reformulate the equation inx andy. Eq. (9) givess0� 0. Ands2 equalsy from Eq. (13).From Eqs. (10) and (12), we havey� d0=a ands1 � d1 2ax2 y: Then Eq. (11) is reduced to the quadratic polyno-mial equation onx

2a2x2 1 �3d0 2 4ad1�x 1 2�d21 2 udu2� � 0:

So by solving this equation, we get the cubic MPH curve inthe way similar to the regular case.

The other exceptional cases occur when the inner productof two tangent datae0, e1 equals 1 or21/2. In casea�ke0;e1l � 21=2; the second order equation degenerates toa first order equation. So we solve this equation andconstruct an MPH curve. If this approximates the medialaxis transform within sufficient error tolerance, we takethis as the solution ofG1 interpolation problem. Otherwise,we can avoid this problem by adding more contact disks asthe inner productke0;e1l converges to 1 while we subdividethe domain into smaller ones.

The casea � 1 is more difficult. In the Euclidean space,the inner product of two distinct unit vectors is always lessthan 1. But in the Minkowski space, the inner product oftwo unit vectors can be any real number as the Minkowskiinner product does not admit the Schwartz inequality. Forexample, two vectors (1,1,1) and (21,1,21) are distinctunit vectors, but their Minkowski inner product equals 1.

In this case, Eqs. (10) and (12) imply thatd0� d1. If this isnot the case, ourG1 interpolation problem does not have anysolution. But we can avoid this situation by adding morecontact disks.

If a� 1 andd0 � d1, then we have infinitely many cubic

MPH curves compatible with theG1 data. So we suggest away to choose the most reasonable one. By lettingx� y�d0=3; we can construct a cubic MPH curve whose speedunder the Minkowski metric is constant. This kind of medialaxis transform may exist when one side of the boundarycurves is a line segment.

This result is in marked contrast to the fact that in theEuclidean space lines are the only constant speed polyno-mial curves [17]. And this kind of property suggests that theMinkowski is more flexible than the Euclidean space to dealwith when it comes to polynomial speed curves.

See [6] for more detailed geometric considerations forthese exceptional cases.

4. MAT and offset computation: global consideration

So far, we have focused on how to handle fundamentaldomains by decomposing them into simpler subdomains andhow to then approximate the medial axis transform by theMPH curves. From now on, we focus our discussion on theglobal aspect of our algorithm, which after all should be ofprimary interest to practitioners.

4.1. MAT computation algorithm

The detailed description of the algorithm to maintain thesubdomains is proposed in [5]. Here we briefly summarizethe key concepts with some illustrations. One of the keycontribution of this paper is that each fundamental domainis represented by a cubic MPH curve, and they are arrangedin such a way to maintain theG1-continuity.

Fig. 11 shows the domain that we are going to deal with.We successively find the contact disks of the domain. (Here,we do not mention how to find the contact disks. Somegeometric algorithms on where and how to find them aregiven in [5].) We maintain the subdomains and the connec-tivity information between the contact disks by the graphdata structure. Fig. 12 illustrates the graph structure corre-sponding to the contact disks in Fig. 11. For more details,see [5].

Now we apply theG1 interpolation scheme to the subdo-mains. Then we get an approximate medial axis transform ofthe subdomain. It is drawn in the dashed line in Fig. 13. If itlies within the prescribed error tolerance from the truemedial axis transform, then this subdomain is left alone,meaning no more subdivision is done for that particularsubdomain, and we go to the next subdomain. Otherwise,we find another contact disk in this subdomain and insert itinto the data structure. The corresponding graph data struc-ture as in Fig. 12 should then be modified as described in [5].Then we can iterate this algorithm until each subdomain hasa sufficiently good approximate medial axis transform.

The main advantage of our global algorithm is that wecan localize the process to each subdomain. Namely, whenwe deal with a subdomain, whatever we do with one parti-cular subdomain does not affect other subdomains. For

H.I. Choi et al. / Computer-Aided Design 31 (1999) 59–72 67

Fig. 11. The original domain with several contact disks.

Fig. 12. Data structure of contact disks.

example, the insertion of a contact circle into one subdo-main does not cause any change to other subdomains. Oncea subdomain passes the error test, that subdomain can be leftalone. In order to take advantage of this localizing property,it is better to use the local interpolation scheme rather thanto use other more global spline approximation.

It should be stressed, though, that this algorithm based onthe domain decomposition technique is not restricted to anyspecific interpolation scheme. It might be more advanta-geous to use other higher order interpolation; the choicereally depends on the specific problem in hand.

4.2. Error estimation for the MPH interpolation

Now we concentrate on the algorithm combined with thecubic MPH interpolation. When we start to apply the globalalgorithm, the interpolation may fail in the first few steps, asthe domain may be still too wild or theG1 data obtainedfrom the contact disks may not admit the cubic MPH curves.Then we add more contact disks into the subdomain. Even-tually we get simple fundamental domains and the interpo-lation scheme gives us the cubic MPH curves which arecompatible with theG1 data of the fundamental domains.Then we choose the better of the two solutions correspond-ing to two different values ofx andy in the way mentionedbefore.

We now outline a scheme to control error. Of course,there might be many different error estimation methods.We found that the method proposed by Farouki and Rama-murthy [15] is simple and flexible. Their method is about thecurve/curve bisector, but we have to consider the radius too.So we deal with the error between the envelope curves

generated by the medial axis transform and the boundaryof the original domain.

The solid line in Fig. 14 represents the given boundary ofa domain and the dashed line represents the envelope curvesgenerated from the approximated medial axis transform. Letg�t� � �x�t�; y�t�; r�t�� be the approximate MPH curveobtained by solving theG1 interpolation problem. Thisg(t) is displayed in the dashed line. Let us denote byp�t� ��x�t�; y�t�� the corresponding medial axis point. And~p�t� isthe point on the envelope corresponding top(t). Thusup�t�2 ~p�t�u � r�t�: The vectorp ~p

�!can be computed expli-

citly from the envelope formula. And letq(t) be the point onthe original boundary curve at which the distance from~p�t�to the boundary curve is realized. Then we can define theerror at the medial axis pointp(t) by the following formula:

E�t� � u ~p�t�2 q�t�u:Of course we should define the error function for both sidesof the envelope curve. The error functionE(t) has criticalvalues at the points where two vectorspq�! and p ~p

�!point in

the same direction. So we can measure the maximum errorby computing the angle between these two vectors. Letu(t)be the oriented angle fromp ~p

�!to pq�!: Obviously, the maxi-

mum error occurs whenu (t) is zero. In practical application,it will be enough to check the sign ofu (t) at sufficientlymany discrete parameter values. Once the small intervals inwhich the sign ofu (t) changes are found, we run a zerofinding algorithm to numerically compute points at whichu(t) is zero. We then compute the errorE(t) at each point atwhich u(t) is zero, and take the maximum of the value ofE(t) computed this way. This should serve as a good proxyfor the maximum error. Suppose the maximum error islarger than the prescribed error tolerance, we find the nextcontact disk at this position and decompose the subdomain.This way, the error is reduced rapidly. Of course, our errormeasure is not the only one possible, one can certainly useother measures that suit the purpose of the problem in hand.Fig. 14 illustrates this algorithm. Fig. 15 shows the effect ofadding one contact disk where the error is maximum. Theenvelope generated using the new medial axis transformfrom the newly created two subdomains is shown in dashedline. One can see that this has much smaller error.

We now make some comments on the illustration of theaccuracy improvement via the contact disk insertion forthe whole domain. Fig. 13 shows the original boundary inthe solid line overlapped with the approximate boundary

H.I. Choi et al. / Computer-Aided Design 31 (1999) 59–7268

Fig. 13. The original boundary in the solid line and the approximateboundary in the dashed line.

Fig. 14. Error computation between the envelope and the originalboundary.

Fig. 15. The error is reduced by inserting a new contact disk.

in the dashed line computed by the envelope formula from theapproximate medial axis transform obtained by solvingthe G1-interpolation problem usingonly seven contactdisks as in Fig. 11. Fig. 16 shows that the accuracy improvesquite a bit by adding more contact circles. The three dimen-sional figure of the medial axis transform is also drawn inFig. 16.

4.3. Offset computation

One of the major objectives of this paper is to computethe rational offset curve of planar domains. There are manyalgorithms to compute the offset from the boundary curvesof the domain. But most of them deal with the offset curvesfrom the given boundary curves. As mentioned in the intro-duction, these boundary oriented algorithms first generateuntrimmed offset curves, then they are trimmed to yield thegenuine, i.e., trimmed, offset curves. It is well known thatthe trimming process is relatively expensive, even in thecase when the boundary consists of line segments and circu-lar arcs. If the boundary consists of free-form curves, thetrimming process becomes prohibitively expensive. In fact,in this case, computing, or rather approximating, theuntrimmed offset curves themselves is a delicate problemowing to possible numerical instability.

The methodology we advocate in this paper has generalkey points which are different from most other approaches.The first point, amply demonstrated earlier, is that it tremen-dously simplifies the problem if we apply domain decom-position technique to reduce the complicated problem into acollection of simple, and hence easy to handle, ones. As aresult of this reduction process, we have only to deal withthe so-called fundamental domain.

The second point in this paper is that it is advantageous topresent (rather, approximate) the medial axis transform ofeach the fundamental domain in the cubic MPH curve form.We have shown earlier that this can be done within the given

error tolerance. Once the cubic MPH curve for the medialaxis transform of the fundamental domain is known, theuntrimmed offset curves can be written down in rationalform by formulas (3) and (4).

The third point relates to the trimming process. But unlikecommonly used trimming methods, we use a differentapproach. As one can see later, our approach makes thetrimming essentially unnecessary. At this point, one shouldremember we have only to do the offset computation foreach fundamental domain. In fact, the precise formulationis given as the Domain Decomposition Lemma for OffsetCurves, and is illustrated in Fig. 2. We now explain how toget the trimmed offset curves. Fig. 17 showsd-offset curvesof a fundamental domain. As the radiusr(t) is always greaterthan d , the untrimmedd-offset curves coincide with thetrimmed offset curves. In contrast, Fig. 18 shows trimmedd -offset curves in the solid line; the part in the dashed line iswhat was removed by the trimming process. The pointp iscalled the trimming point. The location ofp is such that itscorresponding radius is exactly equal tod , and the remain-ing trimmedd -offset curves correspond to the medial axistransform point at which the radius is greater thand ; theremoved part (in the dashed line) corresponds to the point atwhich the radius is less thand . In fact, the trimming pointcorresponds to the self intersection of the untrimmed offsetcurves.

Fig. 19 shows the global untrimmed offset together withits global trimmed version. Fig. 20 illustrates the medial axisrepresented by the piecewise MPH curves and the rationaloffset curves generated from them.

4.4. MPH curve as a graphic primitive

At this point, the advantage of the MPH curve should beclear. Namely, once we approximate the medial axis trans-form by MPH curves, all the levels of the offsets becomerational. And the trimming is essentially trivial, too. There-fore, as far as medial axis transform and offset curves areconcerned, MPH curves are good geometric primitives. Andwe believe this will be profitably used in many practicalcontext.

H.I. Choi et al. / Computer-Aided Design 31 (1999) 59–72 69

Fig. 16. MAT and the well-approximated domain.

Fig. 17. Untrimmed offset curve is the trimmed offset curve whenr . deverywhere.

Fig. 18. Trimmed offset curve.

Fig. 19. The untrimmed offset curves and the trimmed offset curves.

4.5. Error in offset curve

Now we analyze the errors of the offset curves generatedfrom the medial axis transform. In ourG1 interpolationscheme, we control the error of the medial axis transformbased on the error between the boundaries of the originaldomain and the envelope curves generated from the medialaxis transform. The offset curves are generated from themedial axis transform by exact expression. Therefore themaximum error of the offset curves does not exceed themaximum error of the medial axis transform approximation.This result is independent of offset distance. For moredetails, refer to [3].

4.6. Final illustration

Finally, we illustrate all the results computed according tothe procedure in this paper in Fig. 21. It contains the originaldomain, the medial axis transform and several levels ofoffset curves. All these curves except the original boundary

curves are rational. Fig. 22 shows several levels of offsetcurves elevated to thez-direction with the amount of thecorresponding offset distance.

5. Conclusion

In this paper, we have presented a general method tohandle effectively the medial axis transform and the offsetcurves. The basic underlying philosophy can be summarizedas follows:

• The domain decomposition technique is used to reduce acomplicated domain into a union of simple subdomainseach of which is very easy to handle. This decompositionprocedure works equally well for the medial axis trans-form and the offset curves.

• Each simple piece, or fundamental domain, is repre-sented by a cubic Minkowski Pythagorean hodographcurve by solving aG1 interpolation problem given interms of the contact disk information.

• Once the MPH curve representation for the medial axistransform is known, the rational representation oftrimmedoffset curves is trivially written down.

• TheG1 interpolation scheme is devised in such a way tocontrol the error in representing the medial axis trans-form and the offset curves to satisfy the given error toler-ance. This error control mechanism also relies on thedomain decomposition technique.

• The procedure, which is fairly easy to implement, worksfor the domain whose boundary consists of free-formcurves.

• The domain decomposition procedure naturally localizesthe problem into each fundamental domain so that theinstability of the algorithm can be also localized. Thistends to make the algorithm more robust.

Acknowledgements

We would like to take this opportunity to thank RidaFarouki, Helmut Pottmann and Myung-Soo Kim for theirconstant encouragement and interest in our works.

H.I. Choi et al. / Computer-Aided Design 31 (1999) 59–7270

Fig. 20. Medial axis together with offset curves.

Fig. 21. MAT and offsets.

Fig. 22. Several levels of offsets.

References

[1] Chiang CS, Hoffmann CM, Lynch RE. How to compute offsets with-out self-intersection. Technical Report CSD-TR-91-072. ComputerSciences Department, Purdue University, October 1991.

[2] Choi HI, Choi SW, Han CY, Moon HP, Roh, KH. Mathematicaltheory of two-dimensional offsets via medial axis transform.Submitted for publication.

[3] Choi HI, Choi SW, Han CY, Moon HP, Roh KH, Wee NS. Algorithmfor offset curves via medial axis transform. In preparation.

[4] Choi HI, Choi SW, Moon HP. Mathematical theory of medial axistransform. Pacific Journal of Mathematics 1997;181(1):57–88.

[5] Choi HI, Choi SW, Moon HP, Wee N-S. New algorithm for medialaxis transform of plane domain. Graphical Models and Image Proces-sing 1997;59(6):463–483.

[6] Choi HI, Han CY, Moon HP, Roh KH, Wee NS. Cubic MinkowskiPythagorean hodograph curves. In preparation.

[7] Choi HI, Han CY, Moon HP, Roh KH, Wee NS. A new algorithm foroffset of plain domain via MAT. In: Differential/topological tech-niques in geometric modeling and processing ’98, Pohang, Korea,April 1998, pp. 161–185.

[8] Elber G, Lee IK, Kim MS. Comparing offset curve approximationmethods. IEEE Computer Graphics and Applications 1997;17(3):62–71.

[9] Farouki RT. Pythagorean-hodograph curves in practical use. In: Barn-hill RE, editor. Geometry processing for design and manufacturing.Philadelphia: SIAM, 1992, pp. 3–33.

[10] Farouki RT, Johnstone JK. The bisector of a point and a plane para-metric curve. Computer Aided Geometric Design 1994;11:117–151.

[11] Farouki RT, Johnstone, JK. Computing point/curve and curve/curvebisectors. In: Fisher RB, editor. Design and application of curves andsurfaces. Oxford: Oxford University Press, 1994, pp. 327–354.

[12] Farouki RT, Neff CA. Algebraic properties of plane offset curves.Computer Aided Geometric Design 1990;7:101–127.

[13] Farouki RT, Neff CA. Analytic properties of plane offset curves.Computer Aided Geometric Design 1990;7:83–99.

[14] Farouki RT, Neff CA. Hermite interpolation by Pythagorean-hodo-graph quintics. Mathematics of Computation 1995;64:1589–1609.

[15] Farouki RT, Ramamurthy R. Specified-precision computation ofcurve/curve bisector. International Journal of Computational Geo-metry and Applications. To appear.

[16] Farouki RT, Sakkalis T. Pythagorean hodographs. IBM Journal ofResearch and Development 1990;34:736–752.

[17] Farouki RT, Sakkalis T. Real rational curves are not unit speed.Computer Aided Geometric Design 1991;7:151–157.

[18] Farouki RT, Sakkalis T. Pythagorean-hodograph space curves.Advances in Computational Mathematics 1994;2:41–66.

[19] Farouki RT, Sederberg TW. Analysis of the offset to a parabola.Computer Aided Geometric Design 1995;12:639–645.

[20] Held M. On the computational geometry of pocket machining.Lecture Notes in Computer Science, Vol. 500. Berlin: Springer-Verlag, 1991.

[21] Hoschek J. Offset curves in the plane. Computer-Aided Design1985;17(2):77–82.

[22] Hoschek J. Spline approximation of offset curves. Computer AidedGeometric Design 1988;5:33–40.

[23] Hoschek J, Wissel N. Optimal approximate conversion of splinecurves and spline approximation of offset curves. Computer AidedDesign 1988;20:475–483.

[24] Kim MS, Park EJ, Lim SB. Approximation of variable-radius offsetcurves and its application to Be´zier brush-stroke design. Computer-Aided Design 1993;25(11):684–698.

[25] Lee DT. Medial axis transform of a planar shape. IEEE Trans. PatternAnalysis and Machine Intelligence 1982;PAMI-4(4):363–369.

[26] Lee IK, Kim MS, Elber G. Planar curve offset based on circle approx-imation. Computer-Aided Design 1996;28(8):617–630.

[27] Meek DS, Walton DJ. Offset curves of clothoidal splines. Computer-Aided Design 1990;22(4):199–201.

[28] Moon, HP. Minkowski Pythagorean hodographs. Submitted forpublication.

[29] Moon, HP. Computing rational offsets via medial axis transform usingpolynomial speed curves inR2,1. In: Differential/topological tech-niques in geometric modeling and processing ’98. Pohang, Korea,April 1998, pp. 187–203.

[30] Pham B. Offset curves and surfaces: a brief survey. Computer-AidedDesign 1992;24(4):223–229.

[31] Pottmann H. Curve design with rational Pythagorean-hodographcurves. Advances in Computational Mathematics 1995;3:147–170.

[32] Pottmann H. Rational curves and surfaces with rational offsets.Computer Aided Geometric Design 1995;12:175–192.

[33] Pottmann H, Peternell M. Applications of Laguerre geometry inCAGD I. Technical Report 30, Institut fu¨r Geometrie, May 1996.

[34] Pottmann H, Peternell, M. Applications of Laguerre geometry inCAGD II. Technical Report 31, Institut fu¨r Geometrie, May 1996.

[35] Preparata, FP. The medial axis of a simple polygon. Lecture notes incomputer science: Mathematical Foundation of Computer Science,1977, pp. 443–450.

H.I. Choi et al. / Computer-Aided Design 31 (1999) 59–72 71

Hyeong In Choi is a professor in mathe-matics at Seoul National University, Korea.He works in various areas of pure andapplied differential geometry.

Chang Yong Hanis a PhD student in mathe-matics at Seoul National University, Korea,where he received a BS in physics and an MSin mathematics in 1995 and 1997, respec-tively. His research interests include medialaxis transform and related topics such asoffset curves and surfaces.

Hwan Pyo Moon is a PhD student in mathe-matics at Seoul National University, Korea,where he received a BS and MS in mathe-matics in 1992 and 1994, respectively. Hisresearch interests include differential geo-metry, computer aided geometric designand computer graphics.

H.I. Choi et al. / Computer-Aided Design 31 (1999) 59–7272

Kyeong Hah Rohis a PhD student in mathe-matics at Seoul National University, Korea,she received an MS in 1995. Her researchinterests include differential geometry andcomputer aided geometric design.

Nam-Sook Weeis an associate professor inindustrial engineering at Hansung Univer-sity, Seoul, Korea. She received a PhD inIndustrial Engineering and OperationsResearch from UC Berkely. Her teachingand research intertests include CAD, designand analysis of algorithms in computationalgeometry, solid modelling and computervision.