+ All Categories
Home > Documents > Approximate computation of curves on B-spline surfaces

Approximate computation of curves on B-spline surfaces

Date post: 03-Feb-2022
Category:
Upload: others
View: 5 times
Download: 0 times
Share this document with a friend
12
ARTICLE IN PRESS Computer-Aided Design ( ) www.elsevier.com/locate/cad Approximate computation of curves on B -spline surfaces Yi-Jun Yang a,b,c,* , Song Cao a,c , Jun-Hai Yong a,c , Hui Zhang a,c , Jean-Claude Paul a,c,d , Jia-Guang Sun a,b,c , He-jin Gu e a School of Software, Tsinghua University, Beijing, China b Department of Computer Science and Tech., Tsinghua University, Beijing, China c Key Laboratory for Information System Security, Ministry of Education, China d INRIA, France e Jiangxi Academy of Sciences, Nanchang, China Received 15 April 2007; accepted 22 October 2007 Abstract Curves on surfaces play an important role in computer-aided geometric design. Because of the considerably high degree of exact curves on surfaces, approximation algorithms are preferred in CAD systems. To approximate the exact curve with a reasonably low degree curve which also lies completely on the B-spline surface, an algorithm is presented in this paper. The Hausdorff distance between the approximate curve and the exact curve is controlled under the user-specified distance tolerance. The approximate curve is ε T G 1 continuous, where ε T is the user-specified angle tolerance. Examples are given to show the performance of our algorithm. c 2007 Elsevier Ltd. All rights reserved. Keywords: Approximation; B-spline; Curves on surfaces; Curve approximations 1. Introduction Curves lying on free form surfaces play an important role in surface blending, surface–surface intersection, surface trimming and numerical control (NC) tool path generation for machining surfaces [17]. Particularly in surface blending, the blending surface connects the two base surfaces at the linkage curves (see Fig. 1). In this case, the linkage curves are defined by trimming curves on the base surfaces which rarely coincide with the iso-parameter lines. To ensure positional continuity between the blending and base surfaces, linkage curves are usually first computed in the parametric domain, and then represented as the mapping of the domain curves on the base surfaces [1,2,23]. An explicit and control point based representation of a curve on a surface is needed in many circumstances, such as using the curve as a boundary curve of another surface [17]. Also many geometric properties derived from the control polygon, like the * Corresponding author at: School of Software, Tsinghua University, Beijing, China. Tel.: +86 0 10 62795442; fax: +86 0 10 62795460. E-mail address: [email protected] (Y.-J. Yang). Fig. 1. Surface blending. F 1 and F 2 are two base surfaces, F 3 is the blending surface while C 1 and C 2 are two linkage curves. convex hull, can be computed directly. To compute the exact curve on a free form surface in control point representation, many algorithms [3,4,8–10,12,16,17] have been presented. However, the degrees of exact curves are considerably high, which results in computationally demanding evaluations and introduces numerical instability. Mapping a d th-degree B - spline curve onto a p × q th-degree B -spline surface will result in a curve of degree ( p + q )d . To overcome the problems of the exact, explicit represen- tation, many approximation algorithms have been presented [7,11,16–18,21,22]. Recently, Fl¨ ory [7] presented a B -spline 0010-4485/$ - see front matter c 2007 Elsevier Ltd. All rights reserved. doi:10.1016/j.cad.2007.10.011 Please cite this article in press as: Yang Y-J, et al. Approximate computation of curves on B-spline surfaces. Computer-Aided Design (2007), doi:10.1016/j.cad.2007.10.011
Transcript
Page 1: Approximate computation of curves on B-spline surfaces

ARTICLE IN PRESS

Computer-Aided Design ( ) –www.elsevier.com/locate/cad

Approximate computation of curves on B-spline surfaces

Yi-Jun Yanga,b,c,∗, Song Caoa,c, Jun-Hai Yonga,c, Hui Zhanga,c, Jean-Claude Paula,c,d,Jia-Guang Suna,b,c, He-jin Gue

a School of Software, Tsinghua University, Beijing, Chinab Department of Computer Science and Tech., Tsinghua University, Beijing, China

c Key Laboratory for Information System Security, Ministry of Education, Chinad INRIA, France

e Jiangxi Academy of Sciences, Nanchang, China

Received 15 April 2007; accepted 22 October 2007

Abstract

Curves on surfaces play an important role in computer-aided geometric design. Because of the considerably high degree of exact curves onsurfaces, approximation algorithms are preferred in CAD systems. To approximate the exact curve with a reasonably low degree curve which alsolies completely on the B-spline surface, an algorithm is presented in this paper. The Hausdorff distance between the approximate curve and theexact curve is controlled under the user-specified distance tolerance. The approximate curve is εT –G1 continuous, where εT is the user-specifiedangle tolerance. Examples are given to show the performance of our algorithm.c© 2007 Elsevier Ltd. All rights reserved.

Keywords: Approximation; B-spline; Curves on surfaces; Curve approximations

1. Introduction

Curves lying on free form surfaces play an importantrole in surface blending, surface–surface intersection, surfacetrimming and numerical control (NC) tool path generation formachining surfaces [17]. Particularly in surface blending, theblending surface connects the two base surfaces at the linkagecurves (see Fig. 1). In this case, the linkage curves are definedby trimming curves on the base surfaces which rarely coincidewith the iso-parameter lines. To ensure positional continuitybetween the blending and base surfaces, linkage curves areusually first computed in the parametric domain, and thenrepresented as the mapping of the domain curves on the basesurfaces [1,2,23].

An explicit and control point based representation of a curveon a surface is needed in many circumstances, such as using thecurve as a boundary curve of another surface [17]. Also manygeometric properties derived from the control polygon, like the

∗ Corresponding author at: School of Software, Tsinghua University, Beijing,China. Tel.: +86 0 10 62795442; fax: +86 0 10 62795460.

E-mail address: [email protected] (Y.-J. Yang).

Fig. 1. Surface blending. F1 and F2 are two base surfaces, F3 is the blendingsurface while C1 and C2 are two linkage curves.

convex hull, can be computed directly. To compute the exactcurve on a free form surface in control point representation,many algorithms [3,4,8–10,12,16,17] have been presented.However, the degrees of exact curves are considerably high,which results in computationally demanding evaluations andintroduces numerical instability. Mapping a dth-degree B-spline curve onto a p × qth-degree B-spline surface will resultin a curve of degree (p + q)d.

To overcome the problems of the exact, explicit represen-tation, many approximation algorithms have been presented[7,11,16–18,21,22]. Recently, Flory [7] presented a B-spline

0010-4485/$ - see front matter c© 2007 Elsevier Ltd. All rights reserved.doi:10.1016/j.cad.2007.10.011

Please cite this article in press as: Yang Y-J, et al. Approximate computation of curves on B-spline surfaces. Computer-Aided Design (2007),doi:10.1016/j.cad.2007.10.011

Page 2: Approximate computation of curves on B-spline surfaces

ARTICLE IN PRESS2 Y.-J. Yang et al. / Computer-Aided Design ( ) –

fitting algorithm using squared distance minimization to ap-proximate unordered points lying on a B-spline surface. Someconstraints such as on-manifold, one-sided fitting or excludingregions can be imposed on the fitting curve. Instead of just sim-ply approximating discrete points, Renner [17] utilized the fullgeometrical information contained in the exact representation togenerate high quality curves. The Hausdorff distance betweenthe approximate curve and the exact curve can be controlledunder the user-specified tolerance.

To the authors’ knowledge, all presented approximationalgorithms [7,11,16–18,21,22] generate curves not lyingcompletely on the surface. If such a curve is used as a boundarycurve of another surface, gaps may occur between the twosurfaces, which is not acceptable in many CAD applicationssuch as surface blending and surface–surface intersection. Insurface blending, if the linkage curves are not completely onthe base surfaces, the blending surface and the base surfacesare not even G0 continuous (see Fig. 1). So attention should bepaid to the approximation algorithms that generate low degreecurves lying completely on the free form surfaces, which is theaim of our paper.

In order to generate low degree approximate curves lyingcompletely on the B-spline surface, we first approximate thedomain curve with a polyline (a continuous line composedof one or more line segments) and divide the B-splinesurface into Bezier surfaces. In many applications such assurface–surface intersection, what we obtain is not a curvebut some discrete points in the parametric domain. In thiscase, the polyline that connects the discrete points sequentiallyfollows. Then the domain curve is subdivided such that theHausdorff distance between the approximate curve and theexact curve is controlled under the tolerance εD and theapproximate curve is εT –G1 continuous. Here εD is the user-specified distance tolerance while εT is the user-specified angletolerance. By connecting all the mutual points of adjacentsub-curves in the parametric domain sequentially, we obtainthe resultant polyline, the number of whose line segmentsdepends on the tolerances εD and εT . Finally, the polylineis projected to the Bezier surfaces. The spatial approximatecurve is εT –G1 continuous at the mutual points of adjacentsub-curves. Approximate continuity first proposed by DeRoseand Mann [5] has been applied in many CAD applicationssuch as surface interpolation [5,20], surface blending [6],terrain modelling [13] and n-sided hole filling [15,23]. Todate, the experience from presented algorithms [5,6,13,15,20,23] suggests that approximate continuity will virtually simplifythe surface modelling activities without degrading the qualityof the finished product. The degree of the approximate curve isp+q , where p and q are the u-direction and v-direction degreesof the B-spline surface, respectively. The main contributions ofour work are as follows.

1. The approximate curves generated by our algorithm liecompletely on the B-spline surface.

2. The Hausdorff distance between the approximate curve andthe exact curve can be controlled under the user-specifiedtolerance.

The organization of this paper is as follows. In Section 2,input and output handling is discussed. Section 3 describes howto generate the initial approximate polyline. Section 4 containsdetails on how to control the Hausdorff distance between theapproximate curve and the exact curve under the user-specifiedtolerance. In Section 5, how to generate an εT –G1 continuouscurve is described. Results are given in Section 6, and Section 7concludes the paper.

2. Algorithm overview

A B-spline curve is defined by

D(t) =

nd−1∑k=0

Dk N dk (t),

where Dk are the control points and N dk are the dth-degree B-

spline basis functions. A B-spline surface in three-dimensionalspace is defined by

S(u, v) =

nu−1∑i=0

nv−1∑j=0

Pi, j N pi (u)N q

j (v),

where Pi, j are the control points, and N pi (u), N q

j (v) arethe pth-degree and qth-degree B-spline basis functions,respectively. Assume that we have a B-spline curve D(t) lyingcompletely in the parametric domain of the surface S. Let D(t)denote the image curve obtained by substituting D(t) into thesurface equation of S. We attempt to obtain a spatial low degreecurve C(t) lying completely on the surface S to approximate thecurve D(t). The main algorithm flow is described as follows.

1. Divide the B-spline surface into some Bezier surfaces by theinsertion of knots, and approximate the domain curve with apolyline.

2. Subdivide the domain curve so that the Hausdorff distancebetween the mapped curve of the polyline and that of theB-spline curve is under the user-specified tolerance εD .

3. Subdivide the domain curve so that the spatial approximatecurve is εT –G1 continuous.

4. Project the polyline to the B-spline surface.

The following sections illustrate how to generate theapproximate curve.

3. Approximate polyline

We first define several notations that will be used in thefollowing sections.

Definition 1. Given a point P and a polyline C(t), the distancebetween P and C(t) is ‖P − C(t)‖ = minQ∈C(t) ‖P − Q‖.

An example for the distance between one point and a polylinecomposed of just one line segment on a plane is given inFig. 2. The two lines perpendicular to the line segment (P1, P2)

(denoted as C(t)) and through the end points divide the planeinto three areas: D1, D2 and D3. For all points in area D1 (D3),the closest point on C(t) is P1(P2). Thus we have ‖M1 −

Please cite this article in press as: Yang Y-J, et al. Approximate computation of curves on B-spline surfaces. Computer-Aided Design (2007),doi:10.1016/j.cad.2007.10.011

Page 3: Approximate computation of curves on B-spline surfaces

ARTICLE IN PRESSY.-J. Yang et al. / Computer-Aided Design ( ) – 3

Fig. 2. The distances between points and lines.

Fig. 3. The categories of Bezier curves: (a) a single-sided curve; (b) a double-sided curve.

C(t)‖ = ‖M1 − P1‖ and ‖M3 − C(t)‖ = ‖M3 − P2‖ wherepoint M1 ∈ D1 and point M3 ∈ D3. For an arbitrary pointM2 in area D2, the closest point on C(t) is the foot of theperpendicular from the point to C(t), denoted as M4. Thus wehave ‖M2 − C(t)‖ = ‖M2 − M4‖.

Definition 2. Given a curve C1(t) and a polyline C2(t),the directed Hausdorff distance from C1(t) to C2(t) ish(C1(t), C2(t)) = maxP∈C1(t) ‖P − C2(t)‖. The Hausdorffdistance between C1(t) and C2(t) is H(C1(t), C2(t)) =

max(h(C1(t), C2(t)), h(C2(t), C1(t))).

h(C1(t), C2(t)) = h(C2(t), C1(t)) does not hold in general.Here we classify the Bezier curves into two categories asfollows.

1. Single-sided curves: the Bezier curves that are on only oneside of their corresponding line segments (see Fig. 3(a)). Theline segment connecting the end points of a Bezier curvedefines two half planes. The single-sided curve is a curvecontained in just one half plane.

2. Double-sided curves: the Bezier curves that are on both sidesof their corresponding line segments (see Fig. 3(b)).

If C1(t) is a single-sided Bezier curve and C2(t) is theline segment that connects the end points of C1(t), we haveh(C1(t), C2(t)) ≥ h(C2(t), C1(t)) (see Appendix for thedemonstration). Thus h(C1(t), C2(t)) = H(C1(t), C2(t)). Forsimplicity, without explicit explanation, we use h(C1(t), C2(t))as the Hausdorff distance between C1(t) and C2(t).

Definition 3. Given a polyline C(t), the d tolerance boundaryis composed of all the points P that satisfy ‖P − C(t)‖ = d.

Given a B-spline surface, we divide it into Bezier surfaces bythe insertion of knots (see Fig. 4). Given a B-spline curve D(t)in the parametric domain of the surface (see Fig. 5), we usea polyline to approximate it. First, the B-spline curve D(t) issubdivided as follows.

1. Divide the B-spline curve (see Fig. 6) at

Fig. 4. B-spline surface division: (a) the original B-spline surface; (b) theresultant Bezier surfaces.

Fig. 5. B-spline curve in the surface domain.

Fig. 6. Approximate polyline: × denotes the knot position of D(t), © denotesthe position where the curve crosses a knot value in the u-direction, 4 denotesthe position where the curve crosses a knot value in the v-direction.

. knot positions of D(t);

. parameter values where D(t) crosses a knot value in theu-direction or a knot value in the v-direction.

2. A Bezier curve C1(t) is defined by

C1(t) =

n∑i=0

Bni (t)Pi , 0 ≤ t ≤ 1, (1)

Please cite this article in press as: Yang Y-J, et al. Approximate computation of curves on B-spline surfaces. Computer-Aided Design (2007),doi:10.1016/j.cad.2007.10.011

Page 4: Approximate computation of curves on B-spline surfaces

ARTICLE IN PRESS4 Y.-J. Yang et al. / Computer-Aided Design ( ) –

Fig. 7. The initial polyline. The dots are the split points of the B-spline curve,which are also the end points of the line segments.

where Pi = (ui , vi )T . From Eq. (1), we can obtain the

parameter values of the intersection points of the Beziercurve and the line segment connecting the two end points.For curves of degree three, the parameter values of theintersection points are as follows:

t0 = 0

t1 =(u3 − u0)v1 − (v3 − v0)u1 − u3v0 + u0v3

(u3 − u0)(v1 − v2) + (v3 − v0)(u2 − u1)t2 = 1.

If t1 6∈ (0, 1), the curve is a single-sided curve; otherwise,it is a double-sided curve. We split double-sided curves intosingle-sided Bezier curves at the intersection points. For thedouble-sided curve shown in Fig. 3(b), we divide it into twosingle-sided curves at the intersection point Q.

Then by connecting all the mutual points of adjacent Beziercurves sequentially, we obtain the initial polyline (see Fig. 7).The domain curve D(t) is further subdivided repeatedly tosatisfy the distance and angle tolerances in the followingsections.

4. Approximation precision

A good approximation algorithm should control theHausdorff distance between the approximate curve and theexact curve. To control the Hausdorff distance betweenthe mapped curves of the polyline and the B-spline curveunder the user-specified tolerance εD , we must subdivide theBezier curves whose directed Hausdorff distances to theircorresponding line segments are more than the 2D toleranced in the parametric domain, which will be calculated soon.After the curve splitting in Section 3, each Bezier curve liesinside the parametric domain of one definite Bezier surfaceand all the Bezier curves are single-sided. Suppose that C1(t)and C2(t) are the Bezier curve and its corresponding linesegment, respectively. From the tolerance εD and the locatedBezier surface, we calculate d as follows. Here we use P todenote the spatial mapped element on the B-spline surface of a

Fig. 8. Tolerance computation in the parametric domain.

planar element P in the parametric domain. From Definition 2,the Hausdorff distance between the approximate curve and theexact curve is as follows.

H(C1(t), C2(t)) = maxP∈C1(t)

‖P − C2(t)‖. (2)

Supposing Q to be P’s nearest point on C2(t) (see Fig. 8),we have

maxP∈C1(t)

‖P − C2(t)‖ ≤ maxP∈C1(t)

‖P − Q‖. (3)

Letting R be the intersection point of the v-direction linethrough point P and the u-direction line through point Q, wehave

maxP∈C1(t)

‖P − Q‖ ≤ maxP∈C1(t)

(‖P − R‖ + ‖R − Q‖). (4)

From Eq. (2), and Inequalities (3) and (4), we have

H(C1(t), C2(t)) ≤ maxP∈C1(t)

(‖P − R‖ + ‖R − Q‖). (5)

Given a Bezier surface defined by

S(u, v) =

m∑i=0

n∑j=0

Bmi (u)Bn

j (v)Pi, j ,

u ∈ [0, 1], v ∈ [0, 1], (6)

Selimovic [19] derived the bound on the first-order derivative:∥∥∥∥∂S∂u

∥∥∥∥ ≤ m maxi,h,k

‖Pi+1,h − Pi,k‖ (7)

and∥∥∥∥∂S∂v

∥∥∥∥ ≤ n maxi,h,k

‖Ph,i+1 − Pk,i‖. (8)

From Inequality (8), we have

‖P − R‖ ≤

∣∣∣∣∫ Pv

Rv

∂S∂v

dv

∣∣∣∣Please cite this article in press as: Yang Y-J, et al. Approximate computation of curves on B-spline surfaces. Computer-Aided Design (2007),doi:10.1016/j.cad.2007.10.011

Page 5: Approximate computation of curves on B-spline surfaces

ARTICLE IN PRESSY.-J. Yang et al. / Computer-Aided Design ( ) – 5

Fig. 9. Distance between a single-sided curve and its corresponding linesegment.

≤ n‖P − R‖ maxi,h,k

‖Ph,i+1 − Pk,i‖. (9)

From Inequality (7), we similarly have

‖R − Q‖ ≤ m‖R − Q‖ maxi,h,k

‖Pi+1,h − Pi,k‖. (10)

From Inequalities (5), (9) and (10), we have

H(C1(t), C2(t)) ≤ maxP∈C1(t)

(‖P − R‖ + ‖R − Q‖)

≤ maxP∈C1(t)

(n‖P − R‖ maxi,h,k

‖Ph,i+1 − Pk,i‖

+ m‖R − Q‖ maxi,h,k

‖Pi+1,h − Pi,k‖)

≤ maxP∈C1(t)

(‖P − Q‖)(n maxi,h,k

‖Ph,i+1 − Pk,i‖

+ m maxi,h,k

‖Pi+1,h − Pi,k‖)

= H(C1(t), C2(t))(n maxi,h,k

‖Ph,i+1

− Pk,i‖ + m maxi,h,k

‖Pi+1,h − Pi,k‖)

≤ εD. (11)

From Inequality (11), we have

H(C1(t), C2(t))

≤εD

n maxi,h,k

‖Ph,i+1 − Pk,i‖ + m maxi,h,k

‖Pi+1,h − Pi,k‖. (12)

Let

d =εD

n maxi,h,k

‖Ph,i+1 − Pk,i‖ + m maxi,h,k

‖Pi+1,h − Pi,k‖.

If H(C1(t), C2(t)) ≤ d , the Hausdorff distance between C2(t)and C1(t) is controlled under the user-specified tolerance εD .If this condition holds for all Bezier curves in the parametricdomain, the Hausdorff distance between the approximate curveand the exact curve is also controlled under εD .

To compute H(C1(t), C2(t)), the single-sided Bezier curveis divided into sub-curves by C2(t)’s perpendicular lines

through its end points. An example is given in Fig. 9. The curveC1(t) is divided into three sub-curves at the intersection pointsQ1 and Q2. For the sub-curve in D2, the farthest point Q3 tothe line segment is the point whose tangent is parallel to theline C2(t) if it exists, or otherwise, one of the end points. Forthe sub-curve in D3, the farthest point Q4 to Pn is the pointwhose tangent is perpendicular to the line (Pn, Q4) if it exists,or otherwise, the end point Q2. A similar method is used forthe sub-curve in D1. In all, to compute the Hausdorff distancebetween the Bezier curve and its corresponding line segment,we need to compute the following candidate points:

1. The intersection points of the Bezier curve and the lineswhich are perpendicular to the corresponding line segmentthrough its end points.

2. The point on the Bezier curve whose tangent is parallel tothe corresponding line segment. The derivative of the curve(1) is

C′

1(t) = nn−1∑i=0

Bni (t)(Pi+1 − Pi ), 0 ≤ t ≤ 1. (13)

Let V denote the vector (v0 − vn, un − u0)T , which is

perpendicular to the line. Because the derivative is parallelto the line (P0, Pn), we have

C′

1(t) · V = 0. (14)

From Eqs. (13) and (14), we have

n−1∑i=0

Bni (t)(Pi+1 − Pi ) · V = 0. (15)

Eq. (15) is a polynomial of variable t . Roots of Eq. (15) in(0, 1) are parameter values of the candidate points.

3. The points on the Bezier curve whose tangents areperpendicular to the lines from them to the end points. Forthe end point P0, the parameter values of the candidate pointssatisfy the following equation:

C′

1(t) · (C1(t) − P0) = 0. (16)

Roots of Eq. (16) whose corresponding points lie inside areaD1 are the candidate parameter values. For the end pointPn , the parameter values of the candidate points satisfy thefollowing equation:

C′

1(t) · (C1(t) − Pn) = 0. (17)

Roots of Eq. (17) whose corresponding points lie inside areaD3 are parameter values of the candidate points. Eqs. (16)and (17) can be solved using an iterative method.

Select the farthest point to the line from candidate pointscalculated above. Letting d1 denote the distance between thefarthest point and the line, we have d1 = H(C1(t), C2(t)). Ifd1 ≤ d holds for all Bezier curves, we get the final polyline;otherwise, each Bezier curve that fails, which is single-sideddue to the curve splitting in Section 3, is handled as follows.

Step 1. The Bezier curve is subdivided at the farthest point.Step 2. If the sub-curves are double-sided, they are split at

the intersection points of the sub-curves and theircorresponding line segments.

Please cite this article in press as: Yang Y-J, et al. Approximate computation of curves on B-spline surfaces. Computer-Aided Design (2007),doi:10.1016/j.cad.2007.10.011

Page 6: Approximate computation of curves on B-spline surfaces

ARTICLE IN PRESS6 Y.-J. Yang et al. / Computer-Aided Design ( ) –

Fig. 10. Approximate polylines for (a) εD = 0.5, (b) εD = 0.1, (c) εD = 0.01, (d) εD = 0.001.

Step 3. Check whether d1 ≤ d holds for all generated sub-curves. For each sub-curve that fails, go to Step 1.

After the splitting procedure above, the Hausdorff distancebetween the approximate curve obtained in this section andthe exact curve is under the user-specified tolerance εD . Alsoall the planar Bezier curves in the parametric domain aresingle-sided, which is a necessary condition for Theorem 1in the next section. For the B-spline curve shown in Figs. 5and 10(a)–(d) show the approximate polylines for εD =

{0.5, 0.1, 0.01, 0.001}. The B-spline curve is located in theparametric domain of the surface shown in Fig. 4(a).

Comparison between user-specified distance tolerances andthe resulting errors would help us to know whether the distancebound is tight or not. If we map the curve shown in Fig. 4to the B-spline surface of degree 3 × 3 shown in Fig. 4,the spatial approximate curves deviate from the exact curvedifferently according to the user-specified tolerances. Theresulting Hausdorff distances between the spatial approximatecurves and the exact curve are given in Table 1. From Table 1,when the tolerances become small enough, the resulting errorsare about one tenth of them. From Eq. (12), the larger theobtained 2D tolerance d is, the tighter the distance bound wouldbe. How to compute a larger 2D tolerance for a user-specified3D distance tolerance is left as a future work. How to generate

an εT –G1 continuous approximate curve that lies completelyon the surface is described in the next section.

5. εT –G1 continuous curves

Curves are said to be εT –G1 continuous if the maximumtangent discrepancy between any pair of adjacent curves (seeFig. 11) is bounded by the angle tolerance εT . The endderivatives of the mapped curve are computed as follows. Theline segment C2(t) shown in Fig. 8 can be represented in theform of the parameter equation of variable t as follows.

C2(t) = P0(1 − t) + tPn, 0 ≤ t ≤ 1, (18)

where P0 = (u0, v0)T and Pn = (un, vn)T . By substituting Eq.

(18) into Eq. (6), we have

C2(t) = S(C2(t))

= S(u0 + t (un − u0), v0 + t (vn − v0)). (19)

According to the chain rule, we get from Eq. (19)

C′

2(t) =∂S∂u

du

dt+

∂S∂v

dv

dt

= (un − u0)∂S∂u

(u0 + t (un − u0), v0 + t (vn − v0))

Please cite this article in press as: Yang Y-J, et al. Approximate computation of curves on B-spline surfaces. Computer-Aided Design (2007),doi:10.1016/j.cad.2007.10.011

Page 7: Approximate computation of curves on B-spline surfaces

ARTICLE IN PRESSY.-J. Yang et al. / Computer-Aided Design ( ) – 7

Fig. 11. Tangent discrepancy between curves: (a) three line segments in the parametric domain; (b) angles between the end derivatives of the adjacent mappedcurves.

Table 1Comparison of user-specified distance tolerances and the resulting errors

Tolerance 1 0.5 0.3 0.1 0.01 0.001 0.0001

Error 0.02798 0.02798 0.01858 0.00773 0.00102 0.00011 0.00001

+ (vn − v0)∂S∂v

(u0 + t (un − u0), v0

+ t (vn − v0)). (20)

For a Bezier surface defined in Eq. (6), the partial derivatives[14] are

∂S∂u

(u, v) = mm−1∑i=0

n∑j=0

Bm−1i (u)Bn

j (v)(Pi+1, j − Pi, j ), (21)

and

∂S∂v

(u, v) = nm∑

i=0

n−1∑j=0

Bmi (u)Bn−1

j (v)(Pi, j+1 − Pi, j ). (22)

Letting t = 0 and t = 1, from Eqs. (20)–(22), we obtain the twoend derivatives of the mapped curve C2(t). If the angle (denotedas α) between the end derivatives at the mutual point of twoadjacent mapped curves exceeds the angle tolerance εT , theBezier curve with the greater deviation from its correspondingline segment is subdivided at the farthest point. This operationis performed repeatedly until α < εT holds for all theadjacent line segments. After the splitting operations, we shouldguarantee that Hausdorff distance between the approximatecurve and the exact curve remain under the tolerance εD foreach Bezier curve in the parametric domain.

Theorem 1. For a single-sided Bezier curve in the parametricdomain, if the Hausdorff distance between the approximatecurve and the exact curve is under the tolerance εD , it alsoholds after splitting operations.

Proof. After splitting operations, a polyline C3(t) is generatedto approximate a single-sided Bezier curve C1(t) (see Fig. 12).

Fig. 12. Demonstration of Theorem 1.

Table 2Results for a curve on a Bezier surface

Exact Degree reduction Our algorithm

Tolerance – 1 × 10−3 1 × 10−3/10◦

Degree 8 3 4Number of control points 9 16 33Number of segments 1 7 8Distance to S 0 0.63 × 10−4 0Continuity G1 G1 10◦–G1

Processor time (ms) 0.23 21 15

For the curve C1(t), the d tolerance boundary of itscorresponding line segment (P0, Pn) is the curve AIBGHEFA.The lines perpendicular to C2(t) through points P0 and Pn

intersect the tolerance boundary AIBGHEFA at points Eand H, respectively. Because C1(t) is single-sided, it lies onone side of the line (P0, Pn). Suppose that C1(t) lies inside

Please cite this article in press as: Yang Y-J, et al. Approximate computation of curves on B-spline surfaces. Computer-Aided Design (2007),doi:10.1016/j.cad.2007.10.011

Page 8: Approximate computation of curves on B-spline surfaces

ARTICLE IN PRESS8 Y.-J. Yang et al. / Computer-Aided Design ( ) –

Fig. 13. Approximate polylines for εD = 0.1 and (a) εT = 10◦, (b)εT = 1◦.

the closed curve AP0PnBGHEFA. We divide the domaininside AP0PnBGHEFA into three areas by lines (P0, E) and(Pn, H), which are the area inside the curve AP0EFA, thearea inside the curve EP0PnHE, and the area inside the curveHPnBGH. Based on the division, every point inside curveAP0PnBGHEFA is demonstrated to lie inside the d toleranceboundary of the polyline C3(t) as follows.

Case 1. For an arbitrary point P lying inside the curveAP0EFA, the nearest point on C2(t) is P0. Then wehave ‖P − C3(t)‖ ≤ d . Thus each point lying insidethe curve AP0EFA is inside the d tolerance boundaryof C3(t).

Case 2. Similarly, each point P lying inside the curveHPnBGH can be demonstrated to lie inside the dtolerance boundary of C3(t).

Case 3. The line through point P, which is perpendicular toC2(t), intersects curves C2(t), (E, H) and C3(t) atpoints Q1, Q2 and Q3, respectively. For each pointP lying inside EP0PnHE, the nearest point on C2(t)is Q1. The length of line (Q1, Q2) is d , so thedistance between points P and Q3 is not greater thand . Thus ‖P − C3(t)‖ ≤ d holds for all points insideEP0PnHE.

In all, h(C3(t), C1(t)) ≤ d holds. Using a similar method, wecan demonstrate that h(C1(t), C3(t)) ≤ d . Thus H(C3(t),C1(t)) ≤ d . As all the curves above lie inside theparametric domain of one definite Bezier surface, we haveH(C1(t), C3(t)) ≤ εD . �

After the approximate precision operations in Section 4,the Bezier curves are all single-sided. From Theorem 1, afterthe splitting operations in this section, the Hausdorff distancebetween the approximate curve and the exact curve will remainunder the tolerance εD . For the B-spline curve shown in Fig. 5,Fig. 13(a)–(b) show the approximate polylines for εD = 0.1and εT = {10◦, 1◦

}.After the final approximate polyline is obtained, we map

it to the spatial B-spline surface by composition of Beziersimplexes. Eq. (19) is a composition of Eqs. (18) and (6), which

are in the Bezier form. Blossoming techniques [3,4] are utilizedto get the mapped curves in the Bezier form of the approximateline segments. The degree of the mapped curves is p+q, wherep and q are the u-direction degree and v-direction degree of theB-spline surface, respectively.

6. Results

To show the performance of the algorithm presented inthis paper, three examples are given below, which are allimplemented in the environment with Intel Pentium IV CPU2.0 GHz, 1G Memory, Microsoft Windows XP, and MicrosoftVisual C++ 6.0.

In the first example, a quadratic curve with 3 control pointsP0 = (0.1, 0.1)T , P1 = (0.5, 1.8)T and P2 = (0.8, 0.1)T ismapped onto a biquadratic Bezier surface with 3 by 3 controlpoints. The control points of the Bezier surface are

P00 = (0, 2, −1)T

P10 = (1, 1, −2)T

P20 = (1, 0, −3)T ,

P01 = (2.5, 1, 0)T

P11 = (1, 0, −0.5)T

P21 = (1, −1, −2)T ,

and

P02 = (1, 0, 1.5)T

P12 = (2.5, −1, 0)T

P22 = (−0.51, −2, −1)T .

The exact curve on the surface [17] has 9 control points, asshown in Fig. 14(b). The degree reduction algorithm introducedin [17] is implemented to generate one approximate curve (seeFig. 14(c)), where the tolerance is set to 10−3. The result of ouralgorithm is given in Fig. 14(d), where the distance toleranceis set to 10−3 and the angle tolerance is set to 10◦. Results ofthe three algorithms are given in Table 2. The curves generatedby our algorithm and the exact algorithm lie completely onthe surface, while the degree of the curve generated by ouralgorithm is 4, much lower than that of the exact 8th-degreecurve. Though the curve generated by the degree reductionalgorithm is very close to the surface, it does not lie completelyon it. In addition, a comparison of the processor time taken bythe degree reduction algorithm and our algorithm shows the

Please cite this article in press as: Yang Y-J, et al. Approximate computation of curves on B-spline surfaces. Computer-Aided Design (2007),doi:10.1016/j.cad.2007.10.011

Page 9: Approximate computation of curves on B-spline surfaces

ARTICLE IN PRESSY.-J. Yang et al. / Computer-Aided Design ( ) – 9

Fig. 14. Exact and approximate images of a quadratic Bezier curve on a biquadratic Bezier surface: (a) the exact curve; (b) the exact curve and its control polygon;the approximate curve and its control polygon generated by (c) the degree reduction algorithm and (d) our algorithm.

high efficiency of our algorithm. Though more subdivisionsare needed, our algorithm is even faster than Renner’s degreereduction algorithm.

In the second example, the cubic, closed B-spline curve inFig. 5 with 10 control points lying in the parametric domainof bicubic human face model in Fig. 4(a) is mapped ontothe human face surface with 17 by 17 control points (seeFig. 15(a)). The exact curve and its control polygon [17]are shown in Fig. 15(b). The result of the degree reductionalgorithm in [17] is shown in Fig. 15(c), where the target degreeis set to 3 and the tolerance is set to 10−3. One approximation isalso computed using our presented algorithm (see Fig. 15(d)),where εD is set to 10−3 and εT is set to 1◦. Results of the threealgorithms are given in Table 3.

In the third example, a cubic curve consisting of 20 segmentsis mapped onto a bicubic B-spline tiger ear surface with 19by 19 control points (see Fig. 16(a)). The exact curve onthe surface has more than 800 control points, as shown inFig. 16(b). The result of the degree reduction algorithm isshown in Fig. 16(c), where the tolerance is set to 10−3. Theresult of our algorithm is given in Fig. 16(d), where the distancetolerance to the exact curve is set to 10−3 and the angletolerance is set to 1◦. Results of the three algorithms are givenin Table 4.

The approximation algorithms in [16,17] generate curvesthat are not completely on the B-spline surface. From Tables 2–4, though our algorithm needs more subdivisions than Renner’sapproximation and exact algorithms, it generates a considerablylower degree curve than the exact algorithm, while thegenerated curve also lies completely on the B-spline surface,which is indispensable for many CAD applications, such as

surface blending and surface–surface intersection. The timecost of our algorithm is comparable with that of the degreereduction algorithm in [17], which satisfies the real-timeneeds of CAD applications. Also the curves generated in ouralgorithm are ε−G1 continuous. For many applications such asNC-machining and surface blending, it is sufficient for surfacesto be ε − G1 continuous. Engineering practice suggests thatthere is no ambiguity within acceptable working tolerance. Thegeometric discrepancies in the ε − G1 surface models are verysmall and may be blended out in the subsequent manufacturingprocesses.

7. Conclusions

An approximation algorithm for computing a curve on aB-spline surface has been presented. First the initial polylineof the domain curve is generated. The domain curve is thensubdivided repeatedly until the Hausdorff distance between theapproximate curve and the exact curve is under the distancetolerance, after which the angle deviation between the mappedcurves is controlled under the user-specified tolerance byanother subdivision procedure. Compared with exact curves,the degree of the generated curves of our algorithm ismuch lower. Moreover, different from previous approximationalgorithms, our algorithm generates curves that lie completelyon the B-spline surface, which is indispensable for many CADapplications.

Acknowledgements

The research was supported by Chinese 973 Program(2004CB719400), and the National Science Foundation of

Please cite this article in press as: Yang Y-J, et al. Approximate computation of curves on B-spline surfaces. Computer-Aided Design (2007),doi:10.1016/j.cad.2007.10.011

Page 10: Approximate computation of curves on B-spline surfaces

ARTICLE IN PRESS10 Y.-J. Yang et al. / Computer-Aided Design ( ) –

Table 3Results for a curve on a face surface

Exact Degree reduction Our algorithm

Tolerance – 1 × 10−3 1 × 10−3/10◦ 1 × 10−3/1◦

Degree 18 3 6 6Number of control points 332 215 499 1159Number of segments 20 73 83 193Distance to S 0 0.58 × 10−3 0 0Continuity G1 G1 10◦–G1 1◦–G1

Processor time (ms) 9 150 79 196

Table 4Results for a curve on an ear surface

Exact Degree reduction Our algorithm

Tolerance – 1 × 10−3 1 × 10−3/10◦ 1 × 10−3/1◦

Degree 18 3 6 6Number of control points 825 227 739 1225Number of segments 47 89 123 204Distance to S 0 0.46 × 10−3 0 0Continuity G1 G1 10◦–G1 1◦–G1

Processor time (ms) 22 232 121 308

Fig. 15. Exact and approximate images of a cubic domain curve on a bicubicB-spline surface of a human face: (a) the exact curve; (b) the exact curve andits control polygon; the approximate curve and its control polygon generatedby (c) the degree reduction algorithm and (d) our algorithm.

China (60625202, 60533070). The third author was supportedby the project sponsored by a Foundation for the Author

Fig. 16. Exact and approximate images of a cubic domain curve on a bicubicB-spline surface of an ear face: (a) the exact curve; (b) the exact curve and itscontrol polygon; the approximate curve and its control polygon generated by(c) the degree reduction algorithm and (d) our algorithm.

of National Excellent Doctoral Dissertation of PR China(200342), and a Program for New Century Excellent Talentsin University (NCET-04-0088).

Appendix

Theorem 2. Given a Bezier curve C1(t) and the correspondingline segment C2(t) connecting the end points of curve C1(t), the

Please cite this article in press as: Yang Y-J, et al. Approximate computation of curves on B-spline surfaces. Computer-Aided Design (2007),doi:10.1016/j.cad.2007.10.011

Page 11: Approximate computation of curves on B-spline surfaces

ARTICLE IN PRESSY.-J. Yang et al. / Computer-Aided Design ( ) – 11

Fig. 17. The Hausdorff distance.

directed Hausdorff distance from C1(t) to C2(t) is equal to theHausdorff distance between them.

Proof. Given a Bezier curve C1(t) and the correspondingline segment C2(t) connecting the end points of curve C1(t),the directed Hausdorff distance from C2(t) to C1(t) ish(C2(t), C1(t)) = maxQ2∈C2(t) ‖Q2 − C1(t)‖. For an arbitrarypoint Q2 ∈ C2(t), there exists a point Q1 ∈ C1(t) such that

‖Q2 − C1(t)‖ ≤ ‖Q1 − C2(t)‖, (23)

which will be demonstrated soon. If Condition (23) holds forevery point Q2 ∈ C2(t), we have

maxQ2∈C2(t)

‖Q2 − C1(t)‖ ≤ maxQ1∈C1(t)

‖Q1 − C2(t)‖,

which is

h(C2(t), C1(t)) ≤ h(C1(t), C2(t)). (24)

From Definition 2, we have

H(C1(t), C2(t))

= max(h(C1(t), C2(t)), h(C2(t), C1(t))). (25)

From Eqs. (24) and (25), we have

H(C1(t), C2(t)) = h(C1(t), C2(t)). (26)

Condition (23) is demonstrated as follows. For an arbitrarypoint Q2 ∈ C2(t) (see Fig. 17), a circle M centered at Q2touches the Bezier curve C1(t) at the closest point Q3 (which isthe closest point on curve C1(t) to point Q2). The perpendicularline of line segment C2(t) through point Q2 intersects circleM and curve C1(t) at points Q4 and Q1, respectively. Becausethere exists no point of curve C1(t) lying inside the circle M(from the definition of the closest point), we have ‖Q2 −Q3‖ =

‖Q2 − Q4‖ ≤ ‖Q1 − Q2‖. From Definition 1, ‖Q2 − C1(t)‖ =

minQ∈C1(t) ‖Q2 − Q‖ = ‖Q2 − Q3‖ and ‖Q1 − C2(t)‖ =

minQ∈C2(t) ‖Q1 − Q‖ = ‖Q1 − Q2‖. Condition (23) follows.Thus Condition (26) holds. �

References

[1] Chuang JH, Lin CH, Hwang WC. Variable-radius blending of parametricsurfaces. The Visual Computer 1995;11(10):513–25.

[2] Chuang JH, Hwang WC. Variable-radius blending by constrained spinegeneration. The Visual Computer 1997;13(7):316–29.

[3] DeRose T. Composing Bezier simplexes. ACM Transaction on Graphics1988;7(3):198–221.

[4] DeRose T, Goldman R, Hagen H, Mann S. Functional compositionalgorithm via blossoming. ACM Transaction on Graphics 1993;12(2):113–35.

[5] DeRose T, Mann S. An approximately G1 cubic surface interpolant.In: Lyche T, Schumaker L, editors. Mathematical methods in computeraided geometric design, vol. II. Academic Press; 1992. p. 185–96.

[6] Elsas PAV, Vergeest JSM. Fast approximate G1 surface blending tosupport interactive sculptured feature design. In: Pratt MJ, Sriram RD,Wozny MJ, editors. Product modeling for computer integrated design andmanufacture. London: Chapman & Hall; 1997. p. 149–61.

[7] Flory S, Hofer M. Constrained curve fitting on manifolds. Computer-Aided Design [in press].

[8] Hu Y-P, Sun T-C. Moving a B-spline surface to a curve — A trimmedsurface matching algorithm. Computer-Aided Design 1997;29(6):449–55.

[9] Knuth D. The art of computer programming-fundamental algorithms, vol.1. Reading (MA): Addison-Wesley; 1969.

[10] Lee E. Computing a chain of blossom, with application to products ofsplines. Computer Aided Geometric Design 1994;11(6):597–620.

[11] Lee I-K. Curve reconstruction from unorganized points. Computer AidedGeometric Design 2000;17(2):161–77.

[12] Liu W, Mann S. An optimal algorithm for expanding the composition ofthe polynomials. ACM Transaction on Graphics 1997;16(2):155–78.

[13] Pferifer N. 3D terrain models on the basis of a triangulation.Geowissenschaftliche Mitteilungen, Heft 2002.

[14] Piegl LA, Tiller W. The NURBS book. 2nd ed. New York: Springer; 1997.[15] Piegl LA, Tiller W. Filling n-sided regions with NURBS patches. The

Visual Computer 1999;15(2):77–89.[16] Renner G, Weiß V. Curves on surfaces: Analysis and new solutions.

In: Cripps R, editor. The mathematics of surfaces, vol. VIII. InformationGeometers; 1998. p. 57–71.

[17] Renner G, Weiß V. Exact and approximate computation of B-splinecurves on surfaces. Computer-Aided Design 2004;36(4):351–62.

[18] Saux E, Daniel M. An improved Hoschek intrinsic parametrization.Computer Aided Geometric Design 2003;20(8–9):513–21.

[19] Selimovic I. New bounds on the magnitude of the derivative of rationalBezier curves and surfaces. Computer Aided Geometric Design 2005;22(4):321–6.

[20] Tookey R, Ball A. Approximate G1 continuous interpolation of aquadrilateral network of rational cubic curves. Computer-Aided Design1996;28(12):1007–16.

[21] Wang WP, Pottmann H, Liu Y. Fitting B-spline curves to point cloudsby curvature-based squared distance minimization. ACM Transaction onGraphics 2006;25(2):214–38.

[22] Yang HP, Wang WP, Sun JG. Control point adjustment for B-spline curveapproximation. Computer-Aided Design 2004;36(7):639–52.

[23] Yang YJ, Yong JH, Zhang H, Paul JC, Sun JG. A rational extension ofPiegl’s method for filling n-sided holes. Computer-Aided Design 2006;38(11):1166–78.

Yi-Jun Yang is a Ph.D. student in the Departmentof Computer Science and Technology at TsinghuaUniversity, China. He received his B.S. and M.S. inComputer Science from Shandong University of Chinain 2000 and 2003, respectively. His research interestsare computer-aided design and computer graphics.

Please cite this article in press as: Yang Y-J, et al. Approximate computation of curves on B-spline surfaces. Computer-Aided Design (2007),doi:10.1016/j.cad.2007.10.011

Page 12: Approximate computation of curves on B-spline surfaces

ARTICLE IN PRESS12 Y.-J. Yang et al. / Computer-Aided Design ( ) –

Song Cao is a senior student in the School of Soft-ware at Tsinghua University, China. His researchinterests include artificial intelligence, human com-puter interaction, robotic operation and computer-aideddesign.

Jun-Hai Yong is currently a professor in the Schoolof Software at Tsinghua University, China. He receivedhis B.S. and Ph.D. in computer science from TsinghuaUniversity, China, in 1996 and 2001, respectively. Heheld a visiting researcher position in the Department ofComputer Science at Hong Kong University of Science& Technology in 2000. He was a post-doctoral fellow inthe Department of Computer Science at the Universityof Kentucky from 2000 to 2002. His research interestsinclude computer-aided design, computer graphics,

computer animation, and software engineering.

Hui Zhang is an associate professor in the School ofSoftware at Tsinghua University, China. She receivedher B.Sc. and Ph.D. in computer science from TsinghuaUniversity, China, in 1997 and 2003, respectively.Her research interests are computer-aided design andcomputer graphics.

Jean-Claude Paul is a senior researcher at CNRSand INRIA (France), and currently visiting professorat Tsinghua University. He received his Ph.D. inMathematics from Paris University in 1976. Hisresearch interests are numerical analysis, physics-basedmodelling and computer-aided design.

Jia-Guang Sun is a professor in the Schoolof Software at Tsinghua University, China. Hisresearch interests are computer graphics, computer-aided design, computer-aided manufacturing, productdata management and software engineering.

He-jin Gu is a senior professor at Jiangxi Academyof Sciences. He was a visiting professor at the StateUniversity of New York in USA from 2005 to 2006. Heheld a visiting professor position at School of Software,Tsinghua University in 2007. He has obtained threeAwards of Science and Technology from the ministriesof China and Jiangxi Province. His research interestsinclude computer-aided design, computer graphics, andsoftware engineering.

Please cite this article in press as: Yang Y-J, et al. Approximate computation of curves on B-spline surfaces. Computer-Aided Design (2007),doi:10.1016/j.cad.2007.10.011


Recommended