B-Spline Basics
Total Page:16
File Type:pdf, Size:1020Kb
B(asic)-Spline Basics Carl de Bo or 1. Intro duction This essay reviews those basic facts ab out (univariate) B-splines which are of interest in CAGD. The intent is to give a self-contained and complete development of the material in as simple and direct a way as p ossible. For this reason, the B-splines are de ned via the recurrence relations, thus avoiding the discussion of divided di erences which the traditional de nition of a B-spline as a divided di erence of a truncated power function requires. This do es not force more elab orate derivations than are available to those who feel at ease with divided di erences. It do es force a change in the order in which facts are derived and brings more prominence to such things as Marsden's Identity or the Dual Functionals than they currently have in CAGD. In addition, it highlights the following point: The consideration of a single B-spline is not very fruitful when proving facts ab out B-splines, even if these facts (such as the smo othness of a B-spline) can be stated in terms of just one B-spline. Rather, simple arguments and real understanding of B-splines are available only if one is willing to consider al l the B-splines of a given order for a given knot sequence. Thus it fo cuses attention on splines, i.e., on the linear combination of B-splines. In this connection, it is worthwhile to stress that this essay (as do es its author) maintains that the term `B-spline' refers to a certain spline of minimal supp ort and, contrary to usage unhappily current in CAGD, do es not refer to a curve which happ ens to b e written in terms of B-splines. It is to o bad that this misuse has b ecome current and entirely unclear why. The essay deals with splines for an arbitrary knot sequence and do es rarely b ecome more sp eci c. In particular, the B(ernstein-Bezier)-net for a piecewise p olynomial, though a (very) sp ecial case of a representation by B-splines, gets much less attention than it deserves, given its immense usefulness in CAGD (and spline theory). The essay deals only with spline functions. There is an immediate extension to spline curves: Allow the co ecients, be they B-spline co ecients or co ecients in some 2 3 p olynomial form, to b e p oints in IR or IR . But this misses the much richer structure for spline curves available b ecause of the fact that even discontinuous parametrizations may describ e a smo oth curve. Splines are of imp ortance in CAD for the same reason that they are used wherever data are to be t or curves are to be drawn by computer: b eing p olynomial, they can be evaluated quickly; b eing piecewise p olynomial, they are very exible; their representation in terms of B-splines provides geometric information and insight. See Riesenfeld's con- tribution in this volume for details concerning the use of splines and, esp ecially, of their B-spline representation, in CAD. See Cox' contribution for details concerning numerical algorithms to handle splines and their B-spline representation. The editor of this volume has asked me to provide a careful discussion of the place- holder notation customary in mathematical pap ers on splines. This notation was invented by p eople who think it imp ortantto distinguish the function f from its value f (x) at the p oint x. It is customarily used in the description of a function of one variable obtained supp orted by the United States Army under Contract No. DAAL03-87-K-0030 from a function of two variables by holding one of those two variables xed. In this essay, it app ears only to describ e functions obtained from others by shifting and/or scaling of the indep endent variable. Thus, f ( z ) is the function whose value at x is the number f (x z ), while g ( + ) is the function whose value at t is g ( + t), etc. It is also worth p ointing out that I have b een very careful to distinguish between `equality' and `equalityby de nition'. The latter I have always indicated by using a colon r on the same side of the equality sign as the term being de ned. I use D f (instead of (r ) f ) to denote the r th derivative of the function f , and use to denote the collection r of all p olynomials of degree r . The notation for the collection of all p olynomials of <r degree < r (i.e., of order r ) will be particularly handy. Finally, I use a double p erio d to indicate an interval; e.g., [x::y):= f(1 t)x + ty :0 t< 1g. This helps to distinguish the interval (a::b) from the point (a; b)in the plane, or the interval [a::b] from the rst divided di erence [a; b]. 2. B-splines de ned We start with a partition or knot sequence, i.e., a nondecreasing sequence t := . The B-splines of order 1 for this knot sequence are the characteristic functions of t i this partition, i.e., the functions 1; if t t< t i i+1 (2:1) B (t):=X (t):= i1 i 0; otherwise. Note that all these functions have b een chosen here to b e right-continuous. Other choices could have b een made with equal justi cation. The only constraint is that these B-splines should form a partition of unity,i.e., X B (t)= 1; for all t: (2:2) i1 i In particular, t = t implies B =X =0: (2:3) i i+1 i1 i From these rst-order B-splines, we obtain higher-order B-splines by recurrence: B := ! B + (1 ! )B (2:4a) ik ik i;k 1 i+1;k i+1;k 1 with tt i ; if t 6= t i i+k 1 t t i i+k 1 ! (t):= (2:4b) ik 0; otherwise. Thus, the second-order B-spline is given by B = ! X + (1 ! )X ; (2:5) i2 i2 i i+1;2 i+1 and so consists, in general, of two nontrivial linear pieces which join continuously to form a piecewise linear function which vanishes outside the interval [t :: t ). For this reason, i i+2 2 Figure 1.1. Linear B-spline with (a) simple knots, (b) a double knot Figure 1.2 Quadratic B-spline with (a) simple knots, (b) a triple knot some call B a linear B-spline. If, e.g., t = t (hence X = 0), but still t < t , i2 i i+1 i i+1 i+2 then B consists of just one nontrivial piece and fails to be continuous at the double i2 knot t = t , as is shown in Fig. 1.1. i i+1 3 The third-order B-spline is given by B = ! B + (1 ! )B i3 i3 i2 i+1;3 i+1;2 = ! ! X + ! (1 ! )+ (1 ! )! X (2:6) i3 i2 i i3 i+1;2 i+1;3 i+1;2 i+1 +(1 ! )(1 ! )X i+1;3 i+2;2 i+2 This shows that, in general, B consists of 3 (nontrivial) quadratic pieces, and, to judge i3 1 from the Fig. 1.2, these seem to join smo othly at the knots to form a C piecewise quadratic function which vanishes outside the interval [t :: t ). Coincidences among the knots i i+3 t ;:::;t would change this. If, e.g., t = t = t (hence X = X = 0), then B i i+3 i i+1 i+2 i i+1 i3 consists of just one nontrivial piece, fails to b e even continuous at the triple knot t ,but i 1 is still C at the simple knot t , as is shown in Fig. 1.2. i+3 After k 1 steps of the recurrence, we obtain B in the form ik i+k 1 X B = b X ; (2:7) ik jk j j =i with each b a p olynomial of degree < k since it is the sum of pro ducts of k 1 linear jk p olynomials. Thus a B-spline of order k consists of p olynomial pieces of degree <k. (In fact, all b are of exact degree k 1.) jk Figure 1.3 A 6th order B-spline and the six quintic p olynomials whose selected pieces makeup the B-spline From this, we infer that B is a piecewise p olynomial of degree < k which vanishes ik outside the interval [t :: t ) and has p ossible breakp oints t ; ;t ; cf. Fig. 1.3. In i i+k i i+k 4 ! ik 1 1 ! i+1;k 0 t t t t i i+1 i+k 1 i+k Figure 1.4 The twoweight functions in (2.4a) are p ositiveon(t ::t )= i i+k supp B . ik particular, B is just the zero function in case t = t . Also, by induction, B is p ositive ik i i+k ik on the op en interval (t ::t ), since b oth ! and 1 ! are p ositive there; cf. Figure i i+k ik i+1;k 1.4. Further, we see that B is completely determined by the k + 1 knots t ;:::;t . For ik i i+k this reason, the notation B (jt ;:::;t ) := B (2:8) i i+k ik is sometimes used.