Representations for parametric cubic splines

Representations for parametric cubic splines

Computer Aided Geometric Design 6 (I 989) 79-82 North-Halland 79 Short Communication Representations for parametric cubic splines F.N. FRITSCH * Co...

315KB Sizes 2 Downloads 140 Views

Computer Aided Geometric Design 6 (I 989) 79-82 North-Halland

79

Short Communication

Representations for parametric cubic splines F.N. FRITSCH * Computing & Muthematics Research Division, L;lwrence Liuennore National Laborarorv. Lirtermore. CA 94550, USA

Received M5y 1988 Revised October 1988

Abstract. Connections are pointed out among various classes of paramerric cubic splines. Formulas are given for representing a C’ piecewise cubic curve as a B-spline curve.

Keywonk. Cubic splines. v-splines, B-splines, geometric continuity, NURBS.

The utility for CAGD of the extra shape controls available with geometrically continuous cubic splines (such as v-splines [Nielson ‘741, j3-splines [Barsky ‘811.or y-splines [Boehm ‘851) has been amply demonstrated. W&on-Fowler splines [Fritsch ‘861are a de fucrostandard in certain segments of the CAD community. The impression that these splines seem to require special systems, however, has limited their applicability. The main contribution of this note is to show how to represent any of these as a B-spline curve. This is accomplished by first noting that each can be parametrized as 14C’ piecewise cubic, then showing how to represent such ;I curve in B-spline form. It then becomes possible to embed any of these in a NUBS of N URBS system, where all 3f its facilities For evaluation, geometric processing, and rendering become immediately available to the user.

Backgmund

The class of parametric piecewise cubic curves (P-C’s) is the set of curves x( t ), 1 E [a,b], such that each of the component functions of x(f) is a cubic polynomial over each interval [r,,~,..t], where ~==tt-=?~< ...
This work was performed under the auspices of the U.S. Depanm%t

of Energy by Lawrence Livermorc National

Laboratory under Contract W-7405~Eng-48.

01674396,~ 89,;03.50 $ 1989. Elsevier Science Publishers B.V. (North-Holland)

Pig.

I, Rclirtionships among spline cluxses,

huill u knot sequence from known continuity at these breakpoints and represent the curve as a nonuniform B-spline (NUBS) ‘:

Because (1) is simply a particuiarly stable representation for the set of parametric piecewise polynomials, the class of cubic B-splines (C-NUBS) coincides with the P-C%. Since a NUBS is a special case of nonuniform rutionul B-spline (NURBS) [Boehm et al. ‘$4, p. 261,C-NUBS can also be embedded in N WRBS systems. These connections are summarized in Figure 1. Let C-k denote the set of all cmves whose component functions have k continuous derivatives with respect to the para,neter f. Let r-k denote the class of piecewise defined curves which satisfy k-th order geometric joining conditions at the breakpoints: a’(r,.t~)~ff~,,x’(r,-), x”(l,+)~8:,x”(t,-)-ta,,x’(f,-),

&PO,

i=2 ‘I..., i-2

N-l. ,...,

(r-1) N-l.

(T-2)

Since C-l is the special class of r-1 curves for which /3ri= 1, it is clear that r-1 ;z C-l. Similarly, C-2 is the subset of r-2 for which Bti = 1 and p2i = 0, SO r-2 2 C-2. It should be noted that, although these joining conditions are derived from those for continuity of the geometric quantities tangent and curvature, the classes r-k contain curves with comers or cusps, because the case d vanishing tangent vector is not excluded. This is why the notatio I Gk has not been used here. Figure 1 indicates the intersections between various sets of curve:, and continuity classes. Since any r-1 piecewise polynominal curve can be reparametrized to be C-l with no change in polynomial degree, as shown in [Fritsch ‘863for example, a separate set r-1 is not shown ’ ~ollcnving de tkx>r. I distinguish between the distinct hrcakpotnrs between different pol::nomial segments and the Itrrr~ of a B-spline. (Knots may be coincident: breakpoints cannot.) I adopt the current fashion in CAGD of referring to any vector linear csmbinalion ~‘1 &spline basis functions U, (often denoted N,, as in [Boehm et a) ‘SM. p IS)) as a B-qtplinc curio.

F. N. Friisch / Represenminn

of sptines

81

Farin [Farin ‘851 has shown that any F-2 P-C curve is a v-spline. This class is the intersection between P-C’s and F-2 in Figure 1. It should be noted that Farin’s visually C2 splines [Farin ‘821and Boehm’s y-splines [Boehm ‘851are simply alternate ways to construct F-2 P-C’s. This class includes Barsky’s &splines [Barsky ‘811,Wilson-Fowler splines [Fritsch ‘861,and Manning’s curvature continuous splines [Manning ‘741,which have been indicated in the above diagram by appropriately-labeled points in (P-C’s) n (P-2). The characterizing relationship for v-splines is:

i=2,...,

J’(I,+)-~“(t,-)=v,.r’(I,)

N-l.

(2)

The point here is that the second derivative discontinuities in the component functions of x(t) are correlated. From this it is easy to construct C-l P-C’s that are not F-2, so that C-l 3 r-2 is a strict inclusion, as indicated in the diagram. (Examples include Foley’s weighted v-splines [Foley ‘871).

Representing a C-l P-C as a B-spline

Assume that we are given values t,, Xi =x(l,), di = x’(r,) that define a C-l (but not necessarily r-2) P-C with parametric breakpoints I, c . . . 6 rN. If these tangent vectors are not immediately available by some other means, Nielson [Nielson ‘741has shown how to compute d, from ri and xi for a particular Y-spline. For a y-spline, using the notation of [Boehm ‘851, l

l

xi=bJi,

di’~(b,i+,-b,i)=~(b,i-b,l_,). 1

The procedure for representing a Wilson-Fowler spline as C-l P-C is outlined in Section 5 of [Fritsch ‘861. If your spline, like a P-spline, is merely F-1, it will be necessary to first reparametrize the curve according to formulas (4.1), (4.8), (4.10), (4.11) of [Fritsch ‘861. Because the cubic B-spline basis functions with double knots at each of the interior breakpoints r,, . . . , r,,,._, form a basis for the set of C’ piecewise cubic functions with breakpoints {r,}, it is always possible to represent x(r) as a C-NUBS, as in equation (1). We wish to make this representation concrete. The first thing we need to do is establish a knot sequence {q}, so that the B-spline space is completely defined. Since there are 2N conditions to be matched, the dimension of this space of functions is #I= 2N. The required number of knots is n + k = 2N -I- 4. If we put a double knot at each intei-ior breakpoint, this will give a total of 2( N - 2) = 2N - 4. To make up the required total, the ‘standard’ prescription (see [de Boor ‘78, p. 1181 for example) is to put four knots at each of the boundary points. Thus, we have: l

l

q=t,,

j=l,...,

T .2,t,=T2i+~=ri,

4;

@a)

2,..., N-l;

(W

TzN+,=rN, j=l,...,

4.

(3C/

If xN=.rl, d,= d,, and a closed curve is required, it may be better to use a periodic knot sequence; ~r=~Tz=z,-(tN-z&_,);

(3a’j

TLI+1 = T2r+2=tr, i=l...., N; “I‘ 1;‘Nt3 = T2N+4:Ai, + (t2 - t,).

(3b’ ) (3c’)

82

l? N. Fritsch / Representution ofsplines

It turns out to be quite easy to compute the B-spline coefficients ci in (1) in terms of the data ti, ni, d,. An application of formula (9) of [de Boor ‘78, p. 1221 and a certain amount of algebra yields:

where h,=t,+, - t,. Strictly speaking, these formulas only apply for i = 2,. . . , N - 1. They can be extended to the endcases if we define ha = T3 - T,, hN = T2N+4 - TZN+Z. It should be noted that these formulas can also be obtained from the geometric construction of the BCzier representation for a P-C curve, and they in fact appeared on page 13 of [Boehm et al. ‘841.It is instructive to observe that something special happens in the case of y-splines: czi_r = b3i_1 and c2i = bJi.+,; that is, the B-spline coefficients are simply the inner Bezier points that result from Boehm’s construction. Remark. Since a sufficient condition for a B-splint to be nonnegative is that its coefficients be nonnegative, formulas (4) provide a simple alternative proof of Lemma 2 of [Carlson & Fritsch ‘851.

Acknowledgement

The author is indebted to Tom Lyche for pointing out the relevance of formula (9) of [de Boor ‘781and to Greg Nielson for many valuable discussions.

References Barsky, B. (1981), The /3-spline: A local representation based 011 shape parameters and on fundamental geometric measures, Dissertation, Univ. of Utah, Salt Lake City. Boehm, W. (1985), Curvature cantinuous curves and surfaces, Computer Aided Geometric Design 2, 313-323. Boehm, W., Farin. G.. and Kahmann, J. (1984), A survey of curve and surface methods in CAGD, Computer Aided Geometric Design 1, l-60. de Boor, C. (197X), A Prucricul Guide to Splines, Springer, New York. Carlson, R.E., and Ftitsch. F.N. (1985). Monotone piecewise bicubic interpolation, SIAM J. Numer. Anal. 22,386-400. Farin, G. (1982), Visually C” cubic splines, CAD 14, 137-139. Farin. G. (1985). Some remarks on c/ ‘-splines, Computer Aided Geometric Design 2, 325-328. Foley, T.A. (1987), Interpolation with interval and point tension controls using cubic weighted v-splines, ACM Trans. Math. Software 13 68-96. Fritsch, F.N. (1986). The Wilson-Fowler spline is a v-spline, Computer Aided Geometric Design 3, 155-162. Manning. J.R. (1974). Continuity conditions for spline curves, Computer J. 17. ;81-186. Nielson, G.M. (1974), Some piecewise polynomial altematrves to splines undt,r tension, in: R.E. Bamhill and R.F. Riesenfeld. eds., Computer Aided Geometric Design, Academic Press, New rork. 209-235.