1
Three useful references : R. Bartels, J.C. Beatty, B. A. Barsky, An introduction to Splines for use in Computer Graphics and Geometric Modeling, Morgan Kaufmann Publications,1987 JC.Léon, Modélisation et construction de surfaces pour la CFAO, Hermes, 1991 L. Piegl, W. Tiller, The NURBS Book, Second Edition, Springer, 1996 2
Isaac J. Schoenberg (1946) Carl De Boor (1972-76) Maurice G. Cox (1972) Richard Riesenfeld (1973) Wolfgang Boehm (1980) 3
For Bézier curves, the polynomial degree is directly related to the number of control points. The control of the continuity between Bézier curves is not trivial are a generalization in the sense that the degree doesn't depend on the number of control points One can impose every continuity at any point of the curve (we will see later how to do that) They are polynomial curves, by pieces (Bézier curves have a unique polynomial representation along the interval of definition) They may provide local control The parametrization can be freely chosen (with Bézier, it is fixed, usually 0<u<1. ) 4
Basis of Bézier curves : d P u= i=0 P i B i d u The support of the basis functions is the interval [0..1] Continuity is C, and between different Bézier curves it is enforced by a wise choice of the P i 's B-splines basis n P u= P i N d i u i=0 d The basis functions N i are piecewise polynomials Have a compact support + satisfy partition of the unity The continuity is defined at the basis function's level. 5
B-spline basis functions Defined by the nodal sequence and by the polynomials degree of the curve (d) There are n+1 such functions, indexed from 0 to n. Nodal sequence: It is a series of values u i (knots) of the parameter u of the curve, not strictly increasing there can be equal values. There are m+1 such knots, indexed from 0 to m e.g. U={0, 1, 2, 3, 4, 5, 6, 7, 8, 9} U={0, 0, 0, 1, 2, 3, 4, 5, 5, 5} U={0, 0, 0, 1, 2, 2, 3, 4, 4, 4} 6
Construction of B-Spline basis functions Truncated Power Function (u u i ) + d ={ (u u i )d if u u i 0 otherwise It is a function of C d-1 continuity u i 7
Divided differences order one (similar to a simple derivative) [u i,u i1 ] U f U = f u i1 f u i u i1 u i U is a hidden parameter ( like a variable used to differentiate) order 2 : application of the above formula twice... [u i, u i+ 1, u i+ 2 ] U f (U )= [u i+ 1, u i+ 2 ] U f (U ) [u i, u i+ 1 ] U f (U ) u i+ 2 u i [u i,u i+ 1, u i+ 2 ] U f (U )= f (u i+ 2 ) f (u i+ 1 ) u i+ 2 u i+ 1 f (u i+ 1) f (u i ) u i+ 1 u i u i+ 2 u i 8
At the order k [u i,,u i+k ] f = [u i+1,,u i+k ] f [u i,,u i+k 1 ] f u i +k u i One assumed that u i u i1 u i2 Properties (see Bartels, 1987) 1- In the case where u i =u i1 =u i2 [u i,,u ik ] f = 1 d k f k! d u k u=u i 2- if u i u i + 1 u i+ 2 and u i u i1 u i2 [u i,,u ik ] f = 1 k! d k f d u k u=u *,u i u * u ik 9
[u i,, u i+ k ] f 3- is symmetric with respect to the knot vector 4- If f(u) is a polynomial of degree at the most equal to k, then [u i,,u i+ k ] f is a constant with respect to the u i. 5- The divided difference of f=g(u).h(u) is : j=ik [u i,,u ik ] f = j=i [u i,,u j ] g [u j,,u ik ] h 10
Divided differences and (u u 0 ) + 2 (u u k ) + 2 u 0 u 1 u 2 u 3 u 4 u k How to cancel quadratic terms? subtract adjacent truncated power functions. (u u 1 ) + 2 (u u 0 ) + 2 (u u k ) + 2 last term remains u 0 u 1 u 2 u 3 u 4 u k-1 u k (u u k ) + 2 (u u k 1 ) + 2 11
Problem, lower order terms are dependent on k (u u k ) + 2 (u u k 1 ) +2 u>u k =0 u 2 +(u k u k 1 ) u+(u k u k 1 )(u k +u k 1 ) 1 But, dividing by (u k u k 1 ) yields a divided difference : (u u k ) 2 2 + (u u k 1 ) + 2 =[u u k u k 1,u k ] U (u U ) + k 1 2 (u u k ) + last term remains u 0 u 1 u 2 u 3 u 4 u k-1 u k [u 0,u 1 ] U (u U ) + 2 [u k 1, u k ] U (u U ) + 2 12
Now, cancel linear terms (u u k ) + 2 last term remains u 0 u 1 u 2 u 3 u 4 u k-1 u k [u 0, u 1 ] U (u U ) + 2 [u k 1, u k ] U (u U ) + 2 Same procedure : subtract adjacent terms. [u 1, u 2 ] U (u U ) + 2 [u 0,u 1 ] U (u U ) + 2 (u u k ) + 2 Two last term remains u 0 u 1 u 2 u 3 u 4 u k-1 u k [u k 1, u k ] U (u U ) + 2 13
Again, lower order terms are dependent on k [u k 1,u k 2 ] U (u U ) + 2 [u k,u k 1 ] U (u U ) + 2 u>u k =0 u+((u k +u k 1 ) (u k 1 +u k 2 )) 1=(u k u k 2 ) 1 Dividing by (u k u k 2 ) yields a divided difference again : [u k 1,u k 2 ] U (u U ) + 2 [u k,u k 1 ] U (u U ) + 2 u k u k 2 =[u k 2,u k 1,u k ] U (u U ) + 2 (u u k ) + 2 Two last term remains u 0 u 1 u 2 u 3 u 4 u k-1 u k [u 0, u 1,u 2 ] U (u U ) + 2 [u k 1, u k ] U (u U ) + 2 14
Now, cancel constant terms (u u k ) + 2 Two last term remains u 0 u 1 u 2 u 3 u 4 u k-1 u k [u 0, u 1,u 2 ] U (u U ) + 2 [u k 1, u k ] U (u U ) + 2 Same procedure : subtract adjacent terms. [u 1,u 2,u 3 ] U (u U ) + 2 [u 0,u 1,u 2 ] U (u U ) + 2 (u u k ) + 2 Three last term remains u 0 u 1 u 2 u 3 u k-2 u k-1 u k [u k 1, u k ] U (u U ) + 2 15
There are no lower order terms. However we might divide anyway by (u k u k 3 ) to remain consistent and get an expression as a divided difference again... [u k 2,u k 1,u k ] U (u U ) + 2 [u k 3,u k 2,u k 1 ] U (u U ) + 2 u k u k 3 =[u k 3,u k 2,u k 1, u k ] U (u U ) + 2 [u 0, u 1,u 2, u 3 ] U (u U ) + 2 [u k 2, u k 1, u k ] U (u U ) + 2 (u u k ) + 2 Three last term remain that will be discarded! u 0 u 1 u 2 u 3 u k-2 u k-1 u k [u k 1, u k ] U (u U ) + 2 16
The sign is alternating with the degree. Shape functions of even degree are negative, while SFs of uneven degree are positive. Multiplying by ( 1) d +1 makes every SF positive. To ensure that the SF form a partition of unity, we have to multiply again by (u i+d +1 u i ) The compact representation of the basis functions of degree d with the use of divided differences is therefore : N i d =( 1) d +1 (u i+d +1 u i )[u i,,u i +d +1 ] U (u U ) + d 17
N i d =( 1) d+1 (u i +d+1 u i )[u i,,u i+d +1 ] U (u U ) + d u 0 u 1 u 2 u 3 u k-2 u k-1 u k 18
Proof of the partition of unity : consider the before last operation (the cancellation of constant terms) We subtract consecutive terms to form the final shape functions Partition of unity means the sum of all the final shape functions is equal to 1 that this is indeed the case only on a certain range of u. [u m 2 u m ] U (u U ) + d u 0 u 1 u 2 u 3 u 4 u m-3 u m-2 u m-1 u m 1 + - + - + - +... - More generally, there is partition of unity for u d u u m d, m+1 being the number of knots in the knot vector [u 0 u m ] N 0 d (u) K [u m d 1 u m ] U (u U ) d d + N m d 1 (u) 19
Recurrence relations It is easy to see that (u U ) d d 1 + =(u U )(u U ) + Replacing in N d i =( 1) d+1 d (u i +d+1 u i )[u i,, u i+d +1 ] U (u U ) + and using the expression of divided differences of a j=i +k product, [u i,, u i+k ] g h= ([u i,, u j ] g) ([u j,,u i +k ]h) it yields : j=i N d i =( 1) d +1 (u i +d +1 u i ) ([u i ] U (u U )[u i,, u i+d +1 ] U (u U ) d 1 + + d 1 [u i,u i +1 ] U (u U )[u i+1,,u i +d+1 ] U (u U ) + ) because DD of order >1 of (U u)=0. It simplifies to : N d i =( 1) (d +1) d (u i+d +1 u i )((u u i )[u i,,u i+d +1 ] U (u U ) 1 + + d 1 ( 1)[u i+1,,u i+d +1 ] U (u U ) + ) 20
N d i =( 1) (d +1) d (u i+d +1 u i )((u u i )[ u i,,u i+d+1 ] U (u U ) 1 + + d 1 ( 1)[u i+1,,u i+d +1 ] U (u U ) + ) Using the recursive definition of the divided differences [u i,,u i +d +1 ] f = [u,,u ] f [u,,u ] f i +1 i+d +1 i i+d u i+d +1 u i one gets : N d i =( 1) d d (u u i )[u i,,u i +d ] U (u U ) 1 + + ( 1) d (u i+d +1 u)[u i+1,, u i+d +1 ] U (u U ) + d 1 which is, to a term depending on the knot vector and u, equal to N d i = u u i N d 1. u i +d u i + u i+d +1 u d 1 N i u i+d +1 u i+1 i+1 21
Recursive definition of basis functions Setting U ={u 0,, u m }, u i u i1, i=0 m 1 (nodal sequence) The functions are such as : (recurrence formula of Cox de Boor) N i (u)={ 0 1 if u i u< u i+ 1 0 otherwise N d i u= u u i N d 1 u id u i u u u id 1 N d 1 i u id1 u i1 u i1 Where u i+d u i = 0, necessarily N d 1 i u 0 0 By convention, we set in this case when the limit is undefined. 0 =0 22
N 0 0 =0 Example : computation of basis functions of degree d 2 for U ={u 0 =0,u 1 =0,u 2 =0,u 3 =1,u 4 =1,u 5 =1} N 0 1 =0 ={ N 0 1 0 u< 1 2 0 otherwise N 3 0 =0 N 4 0 =0 N 0 1 u= u u 0 u 1 u 0 N 0 0 u u 2 u u 2 u 1 N 1 0 u N 1 0 =0 ={ N 1 1 u 0 u< 1 1 0 otherwise ={ N 1 u 0 u< 1 2 0 otherwise N 3 1 =0 Bernstein polynomials of degree 2 N 0 2 ={ N 1 2 ={ 0 0 =0 by convention (1 u)2 0 u< 1 0 otherwise ={ N 2 u2 2 2 u (1 u) 0 u< 1 0 otherwise 0 u< 1 0 otherwise 23
The Bernstein polynomials of degree d are a particular case of the B-splines basis They correspond to a nodal sequence U B ={u 0 =0,,u d =0,u d 1 =1,,u 2 d 1 =1} Bézier curves are therefore a particular case of B- splines. It is also possible to transform any B-spline into a sequence of Bézier curves because the Bernstein polynomials form a complete basis of polynomials of degree d. 24
Basis functions and control points In contrary to Bézier curves, the number of control points is not imposed by the degree d Let m+1 the number of knots. We have n+1 independent basis functions at our hands For every basis function, we associate a control point n P u= P i N d i u i=0 The number of control points is fixed by the relation n+1=m-d 25
Types of nodal sequence... Uniform The gap between two successive knots is constant U ={u 0,u 1,,u m d 1 }, u i1 u i =k Periodic - The gap between the knots at the start of a nodal sequence is identical to the one at the end of the nodal sequence U ={u 0,,u d d 1 Non uniform, interpolating first and last control point are interpolated U ={a,, a d 1, u d1,,u m d 1, u' 0,,u' d d 1,u d1,,u m d 1,b,,b } d1 }, u ' i u i =k In the sequel, except where indicated, we consider non uniform nodal sequences interpolating the first and last control points. 26
U ={0, 5 6, 10 6, 15 6, 20 6, 25 6,5} d=0 m1=7 n1=6 27
U ={0,0,1,2,3,4,5,5} d =1 m1=8 n1=6 28
U ={0, 0, 0, 5 4, 10 4, 15 4,5, 5,5} d =2 m1=9 n1=6 29
U ={0, 0, 0,0, 5 3, 10 3,5, 5,5,5} d=3 m+1=10 n+1=6 30
U ={0, 0, 0,0,0, 5, 5,5,5,5,5} d =4 m1=11 n1=6 2 31
U ={0, 0, 0,0, 0, 0,5,5, 5,5,5,5} d =5 m1=12 n1=6 Bernstein polynomials (with a factor on u) 32
Properties of B-spline basis functions N d i u=0 outside the interval [ u i,u i +d+1 [ Inside the interval [ u i,u i +1 [, at most d+1 functions N d d d * (u) are non zero : N i d,, N i N d i (u) 0 i,d and u (always positive) i For u [ u i, u i +1 [, N d j (u)=1 (forms a partition of unity) j=i d All derivatives of N d i uexist inside the interval [ u i, u i1 [. At a knot, N d i u is d-k times differentiable, k being the node multiplicity. Except for d=0, N d i u reaches exactly one maximum 33
N i d =( 1) d+1 (u i +d+1 u i )[u i,,u i+d +1 ] U (u U ) + d u 0 u 1 u 2 u 3 u k-2 u k-1 u k 34
U ={0, 0,0,0,1, 2,3,4,5,5,5,5} d=3 m1=12 n1=8 The knot u=3 is of multiplicity 1 35
U ={0, 0, 0,0,1, 2,3,3,5,5, 5,5} d =3 m1=12 n1=8 The node u=3 is of multiplicity 2 36
U ={0, 0, 0,0,1,3, 3, 3,5,5,5,5} d=3 m1=12 n1=8 The node u=3 is of multiplicity 3 37
Curve 1 Curve 2 U ={0, 0, 0,0,3,3,3, 3,5,5,5,5} d =3 m1=12 n1=8 The node u=3 is of multiplicity 4 38
Derivatives of B-spline basis functions Definition by recurrence d k N i d d u k d,k =N i =d N d 1,k 1 i u id u i N i1 d 1,k 1 u id 1 u i1 k should not exceed d : every derivative of higher order vanish. 39
The characteristics of basis functions involve that the B-Spline curve n P u= P i N d i u U ={u 0,, u m }, u i u i1, i=0 m 1 i=0 interpolates P 0 and P n, only if the nodal sequence admits d+1 repetitions at the start and at the end! is invariant by affine transformation, is contained by the convex hull of the control points (because P(u) is a linear combination of the control points with positive coefficients which sum to one) 40
(Following) Is variation diminishing : The number of inflexion points is lower than the number of wiggles of the characteristic polygon Is closed and convex if the characteristic polygon is closed and convex, Is of length shorter or equal than that of the control polygon. Is invariant by linear transformation of the nodal sequence u'=au+b, a>0 41
Control points, degree and nodal sequence We associate a control point for each basis function N i *. We have n+1 control points. The degree d is chosen by the user. The nodal sequence (that defines the intervals of the parameter on which the curve has a unique polynomial definition) is then built. We have m+1=n+d+2 knots (with d+1 repetitions at the start and at the end) there remains n-d values of the parameter to set (without taking the boundaries into account) 42
Geometric examples Constant number of control points We increase the degree Uniform repartition of knots (except at boundaries) For which degree do we have the best approximation of the control points?? 43
Degree 1 0 0 0.0833333 0.166667 0.25 0.333333 0.416667 0.5 0.583333 0.666667 0.75 0.833333 0.916667 1 1 44
degree 2 0 0 0 0.0909091 0.181818 0.272727 0.363636 0.454545 0.545455 0.636364 0.727273 0.818182 0.909091 1 1 1 45
degree 3 0 0 0 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 1 1 1 46
degree 4 0 0 0 0 0 0.111111 0.222222 0.333333 0.444444 0.555556 0.666667 0.777778 0.888889 1 1 1 1 1 47
degree 6 0 0 0 0 0 0 0 0.142857 0.285714 0.428571 0.571429 0.714286 0.857143 1 1 1 1 1 1 1 48
degree 10 0 0 0 0 0 0 0 0 0 0 0 0.333333 0.666667 1 1 1 1 1 1 1 1 1 1 1 49
degree 12 (Bézier) 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 50
Impose interpolation points (and C 0 continuity ) It is the same as positioning knots of multiplicity d in the nodal sequence One could also repeat d control points...(not shown here) 51
u=1 u=0.2 u=0.1 u=0.7 u=0.9 u=0.5 u=0 degree 3 0 0 0 0 0.1 0.2 0.5 0.5 0.5 0.7 0.9 0.9 0.9 1 1 1 1 52
u=1 u=0.1 u=0.9 u=0.5 u=0 degree 3 (4 Bézier curves of continuity C 0 ) 0 0 0 0 0.1 0.1 0.1 0.5 0.5 0.5 0.9 0.9 0.9 1 1 1 1 53
u=1 u=0.1 u=0.9 u=0.8 u=0.4 u=0 degree 3 (3 Bézier curves of continuity C 0 + 1 bspline deg 3 with 4control pts) 0 0 0 0 0.1 0.1 0.1 0.4 0.4 0.4 0.8 0.8 0.8 0.9 1 1 1 1 54
And if we want to impose interpolation points and a certain continuity C k? Add / align control points in a similar way than in the case of Bézier curves. 55
56
Periodic curves They may be represented by modifying the nodal sequence and by repeating some control points. Uniform nodal sequence Non-uniform nodal sequence uniform nodal sequence and periodic curve 57
non uniform nodal sequence interpolating the first and last control points. degree 3 0 0 0 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 1 1 1 58
Periodic nodal sequence (but control points located inadequately) degree 3-0.3-0.2-0.1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 1.1 1.2 1.3 59
degree 3-0.3-0.2-0.1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 1.1 1.2 1.3 60
degree 3-0.3-0.2-0.1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 1.1 1.2 1.3 61
Periodic nodal sequence + control points placed adequately (repeated) = periodic curve degree 3-0.3-0.2-0.1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 1.1 1.2 1.3 62
Algorithms for the manipulation of curves Boehm's knot insertion algorithm Evaluation of the curve (Cox-de Boor algorithm) Derivatives and hodographs Restriction/growth of the useful interval of a curve Degree elevation Recursive Subdivision 63
Boehm's knot insertion algorithm The idea is to determine a new control polygon for the same curve after the insertion of one or several knots in the nodal sequence. The curve is not modified by this change : neither the shape nor the parametrization are affected. Interest : Evaluation of points on the curve Subdivision of the curve Addition of control points 64
n Let P u= P i N d i u a B-Spline curve built on the i=0 nodal sequence : U ={u 0,,u m } Let u [ u k, u k 1 [ a knot to be inserted The new nodal sequence is : U ={u 0 =u 0,, u k =u k, u k 1 =u,, u m1 =u m } The new representation of the curve is : n1 P u= i=0 Q i N i d u The N d i u are the basis functions defined on U, the Q i are the n+2 new control points. Q i How define the so that the shape is unchanged? 65
Let's set We write the relation for n+2 distinct values of u. (a,b,... ) n P (u)= i=0 P i N i d (u)= We obtain a band system, with 3(n+2) unknowns (in 3D) n = P N d 0 a N d i N i 1 d a a i=0 N d 0 b N d n 1 b Q 1 Q0 P i N d i b i=0 n+ 1 i=0 Q i N i d (u) u It's costly to solve and it assumes that the values a,b... are carefully set to avoid a singular lin. system 66
Use of properties of basis functions We have u [ u k,u k +1 [. In this interval [ u k,u k +1 [, we have N d i (u) 0 iff i {k d,, k }(compact support) In the same way, N d i (u) 0 iff i {k d,, k +1} and u [ u k,u k1 [. Thus, we have : k k+1 P (u)= P i N d i (u)= Q i N d i (u) i=k d i=k d N d i (u)= N d i (u) for i {0,,k d 1} N d d i (u)= N i +1 (u) for i {k+1,, n} For i {k d,,k } : N i d (u)= ū ū i ū i+d +1 ū i N i d (u)+ ūi +d+2 ū d N ū i+d+2 ū i +1 i+1 (u) Proof using the definition of shape functions, see Leon's book p.333 67
N d i (u)= N d i (u) for i {0,,k d 1} involves P i =Q i for i {0,,k d 1} N d d i (u)= N i +1 (u) for i {k+1,, n} involves P i =Q i+ 1 for i {k+ 1,, n} N d i (u)= ū ū i N d ū i+d+1 ū i (u)+ ūi +d +2 ū d N i ū i+d +2 ū i +1 (u) i+1 We substitute in k i=k d k +1 P i N d i (u)= i=k d Q i N i d (u) 68
N d i (u)= ū ū i N d ū i+d+1 ū i (u)+ ūi +d +2 ū d N i ū i+d +2 ū i+1 (u) i +1 in k i=k d k +1 P i N d i (u)= Q i N d i (u) i=k d +( ( ū ū k d d N ū k +1 ū k d (u)+ ūk +2 ū d N k d ū k +2 ū k d +1 k d +1 (u)) P k d ū ū k d +1 d N ū k +2 ū k d +1 (u)+ ūk +3 ū d N k d +1 ū k +3 ū k d +2 k d+2 (u)) P k d +1 + +( ū ū k N d ū k +d +1 ū k (u)+ ūk +d +2 ū d N k ū k +d +2 ū k +1 k +1 (u)) P k d = N k d d (u)q k d + + N k +1 (u)q k +1 69
By factoring and replacing the nodal sequence U by U, we obtain : d 0= N k d (u)(q k d P k d ) d + N k d+1 (u)( Q k d +1 ū u k d +1 P u k +1 u k d +1 u k +1 ū P k d +1 u k +1 u k k d +1 d) + N k d (u)( Q k ū u k u k +d u k P k u k +d ū P u k +d u k k 1) + d N k +1 (u)(q k +1 P k ) We set α i = u u i u i+d u i 1 α i = u i+d u u i+d u i with i {k d +1,, k }... 70
... we obtain Q k d =P k d Q i =α i P i +(1 α i ) P i 1 for i {k d +1,, k } Q k +1 =P k We had : so finally : P i =Q i for i {0,, k d 1} P i =Q i +1 for i {k +1,, n} i k d u u Q i =α i P i +(1 α i ) P i 1 with α i ={1 i k d +1 i k u i+ p u i 0 i k +1 71
U ={0, 0, 0,0,0, 0, 1,1, 1,1,1,1} degree 5 72
U ={0, 0, 0,0,0, 0, 1,1, 1,1,1,1} degree 5 73
U ={0, 0, 0,0,0, 0, 1,1, 1,1,1,1} degree 5 74
U ={0, 0, 0,0,0, 0,0.2, 1,1,1,1,1,1} degree 5 75
U ={0, 0, 0,0,0, 0, 0.2, 0.4,1,1,1,1, 1,1} degree 5 76
U ={0, 0, 0,0,0, 0, 0.2, 0.4,0.6,1,1, 1,1,1,1} degree 5 77
U ={0, 0, 0,0,0, 0, 0.2, 0.4,0.6,0.8,1,1,1,1,1, 1} degree 5 78
U ={0, 0, 0,0,0,0, 0.1, 0.2,,0.9,1,1,1,1,1,1} degree 5 79
U ={0, 0, 0,0,0,0, 0.05,0.1,,0.95, 1,1,1,1,1,1} degree 5 80
U ={0, 0, 0,0,0,0, 0.05,0.1,,0.95, 1,1,1,1,1,1} degree 5 Local control... 81
N i d =( 1) d +1 (u i +d+1 u i )[u i,,u i+d +1 ] U (u U ) + d N i (u)={ 0 1 if u i u< u i+ 1 0 otherwise N d i u= u u i N d 1 u id u i u u u id 1 N d 1 i u id 1 u i1 u i1 U ={0, 0, 0,0,0, 0, 0.2, 0.4,1,1,1,1, 1,1} degree 5 82
Boehm s knot insertion formula : i k d u u Q i =α i P i +(1 α i ) P i 1 with α i ={1 i k d +1 i k u i+ p u i 0 i k +1 83
Multiple knot insertions Assume u [ u k, u k 1 [ of multiplicity s ( 0 sd ). We want to insert it r times with rs d. We note Q i r the control points of the r-th insertion step We have then : Q r i =α r i Q r 1 i +(1 α r r 1 i )Q i 1 i k d +r 1 with α r u u i ={1 i k d +r i k s u i +d r +1 u i 0 i k s+1 84
The Q's can be put in a table: P k d 1 Q k d 1 2 Q k d 2 1 Q k d 2 d Q k 1 Q k 1 Q k 1 Q k 2 P k The total number of new control points is d-s+r-1 that replace d-s-1. 85
The use of the algorithm of node insertion up to multiplicity of d=r+s is such that the curve will interpolate the last control point that is computed. P k d 1 Q k d +1 2 Q k d +2 1 Q k d +2 d Q k 1 Q k 1 Q k 1 Q k 2 P k Therefore, one can use this algorithm to compute the position of a point of the curve knowing the parameter. It's precisely the Cox-de Boor algorithm. The sequence of points P i j is not anything else than the Q i j indicated on the graph, cf following 86
Case r+s=d+1 : We carry out the insertion of multiplicity r-1 then we insert one more knot to «cut» the B-spline curve in two independent parts. Q k d The last control point has to be duplicated. Allows to extract a portion of the B-spline. There exists an extension of this algorithm in the case of the simultaneous insertion of many knots: it is the somewhat more complex Oslo algorithm*, not described here. * E. Cohen, T. Lyche, R. Riesenfeld Discrete B-splines and subdivision techniques in computer-aided geometric design and computer graphics, Computer Graphics and Image Processing, 14(2):87-111, 1980. 87
(simplified) Cox-de Boor Algorithm : Determine the interval of u : u [ u i,u i+1 [ 0 Initialization of P j i {d, d +1,,m d 1} For k from 1 to d For j from i-d+k to i P j k =( u u j u j+d +1 k u j ) Endfor Endfor is the point that is sought. P i d What is its complexity? +( P k 1 j u u ) j +d+1 k u j +d+1 k u P k 1 j 1 j quadratic in function of the degree d. 88
On a knot of multiplicity s : Determine the interval of u : 0 Initialization of P j For k from 1 to d-s For j from i-d+k to i-s P j k =( u u j u j+d +1 k u j ) +( P k 1 j Endfor Endfor d s is the point that is sought. P i s u [ u i s = =u i, u i+1 [ and u=u i i {d, d +1,, m d 1} u u ) j +d+1 k u j +d+1 k u P k 1 j 1 j 89
Example of computation P 0 0 =(0,1) P 1 0 =(2,3) P 2 0 =(5, 4) P 3 0 =(7,1) P 4 0 =(6, 1) P 5 0 =(6, 2) U ={0, 0,0,0,1, 2, 3, 3,3,3} d =3 u=3/2 Determination of the interval =( P 1 3/ 2<2, u 4 =1 i=4 k j Iteration 1 P 1 4 =(27/ 4,1/2) P 1 3 =(6,5/ 2) P 1 2 =(17/ 4,15/5) Iteration 2 P 2 4 =(99/16, 2) P 2 3 =(89/16, 45/16) Iteration 3 P 4 3 =(47/8, 77/32)=P (3/ 2) u u j u j+ d+1 k u j ) +( P u k 1 j +d + 1 k u ) j u j+ d+1 k u P k 1 j 1 j 90 JC Leon
The algorithm is similar to De Casteljau's algorithm for Bézier curves It is built on a restriction of the set of control points (d+1 points) On this restriction, it is nearly identical, except for the coefficients related to the nodal sequence (which is potentially non uniform) The complete algorithm is somewhat longer than this one (possibility to have 0/0 : we set conventionally 0/0 = 0!) 91
U ={0, 0, 0,0,0, 0, 1,1, 1,1,1,1} degree 5 92
U ={0, 0, 0,0,0, 0,0.3,1,1,1,1,1, 1} degree 5 93
U ={0,0, 0,0,0, 0, 0.3, 0.3,1, 1,1,1,1,1} degree 5 94
U ={0, 0, 0,0,0, 0, 0.3, 0.3,0.3,1,1,1,1, 1,1} degree 5 95
U ={0, 0, 0,0,0,0, 0.3, 0.3,0.3,0.3, 1,1,1,1,1,1} degree 5 96
U ={0, 0, 0,0,0, 0, 0.3, 0.3,0.3,0.3, 0.3,1,1,1, 1,1,1} degree 5 97
U ={0, 0, 0,0,0, 0, 0.3, 0.3,0.3,0.3, 0.3,1,1,1, 1,1,1} degree 5 98
Computation of a point on a B-Spline curve By the use of basis functions 1 Find the nodal interval in which u is located u [ u i, u i1 [ 2 Calculate the non vanishing basis functions d N i d u,, N d i u 3 Multiply the values of these basis functions with the right control points P u= N d k u P k i d k i k By the algorithm of Cox-de Boor 99
Transformation of a B-Spline curve into a composite Bézier curve We saturate each distinct knot until its multiplicity is equal to d. This is made with the help of Boehm's algorithm of nodal insertion. The curve is not modified! We obtain a nodal sequence which has the following form : U ={a, a, a,a,b,b, b,c, c, c,, z, z, z, z} d+ 1 times d times d times d + 1 times Each distinct value of u corresponds to one of the points of the curve. 100
U ={0,0, 0,0,1, 2,3,3, 3,3} degree 3 101
U ={0,0, 0,0,1, 1,2,3, 3,3,3} 102
U ={0,0, 0,0,1, 1,1, 2,3,3,3,3} 103
U ={0, 0, 0,0,1,1,1,2,2,3, 3,3,3} 104
U ={0, 0, 0,0,1,1,1,2,2,2,3,3,3,3} 105
Bézier n 3 Bézier n 2 Bézier n 1 4 CP 4 CP 4 CP degree 3 degree 3 degree 3 106
Differentiating B-splines For a B-Spline of typical nodal sequence: U ={u 0,,u d,,u m d u m } d+ 1 times d+ 1 times We start from the definition of the derivatives of the basis functions: N i d ' = d u id u i N i d 1 u Proof : Starting from N 1 and verify by induction that the relation is true for N d if it is true for N d-1. At the order k : k d N i = d k 1 N i u k u id u i u k 1 d 1 u d d N 1 u id 1 u i1 u i1 d k 1 N i1 u id 1 u i1 u k 1 d 1 u 107
N i d ' = d d N 1 d u id u i u N d 1 i u id 1 u i1 u i1 n P ' u= i=0 n P ' u= i=0 P i N i d ' u d d N 1 d d u id u i u N 1 i u id1 u i1 i1 u P i n 1 P ' u=d i= 1 d N 1 i1 u P i1 u id 1 u i1 d i=0 n d N 1 i1 u P i u id 1 u i1 Change of index 108
n 1 P ' u=d i= 1 n 1 P ' u=d i=0 d N 1 i1 u d N 1 i1 u P i1 u id 1 u i1 d i=0 n N d 1 i1 u d 1 u P i1 P i d P 0 N 0 u id 1 u i1 u d u 0 P i u id1 u i1 0 P d n1 N 1 n1 u u nd 1 u n1 n 1 P ' (u)= i=0 N i+1 d 1 (u)q i with Q i =d P i+1 P i u i+d+1 u i+1 Empty Interval 109
n 1 P ' (u)= i=0 the nodal sequence used here remains : U ={u 0,,u d d +1 times d N 1 i+ 1 (u)q i with Q i =d,, u m d,,u m } d +1 times P i+ 1 P i u i+ d + 1 u i+ 1 We set U ' ' ' ={u 0,,u d 1 d times n 1 P ' (u)= i=0 ',, u m d ',,u m 2 d times We've got a new B-Spline! } with u i ' =u i +1 N i d 1 (u)q i with N i d 1 defined on U ' 110
The 1 st hodograph of a B-Spline of degree d is a B- Spline of degree d-1. By successive derivation, the same holds for the k th hodograph. P 1 P 2 Q 0 Q i =d P i +1 P i =P u i +3 u i +1 P i i+2 P u Q 3 P ' u U ' ={0,0,2, 4, 6,6} Q 1 P 0 P 4 P 3 degree 1 U ={0,0, 0, 2, 4, 6,6,6} degree 2 Q 2 111
Derivative of order k n k P (k ) (u)= i=0 N i d k (u) P i (k ) with P i (k ) ={ P i k=0 (d k+ 1)( P (k 1) (k i+ 1 P 1) i ) k> 0 u i+ d+ 1 u i+ k U (k ) (k ={u ) (k ) 0,, u d k d + 1 k times (k ),,u m d k + 1 (k ),,u m 2k d + 1 k times } with u i (k ) =u i+ k 112
Knot removal Inverse of Boehm's algorithm Given here without demonstration the manipulations leading to this result are simple but tedious Cf JC Leon «Modelisation de courbes et surfaces pour la CFAO», hermès (1991) - pp352-353 113
Knot removal At each node, the continuity is at least C d-s where s is the multiplicity of the node. A curve of degree 3 has a continuity C 2 if the nodes are simple (multiplicity 1). In the case where the effective continuity C r of the curve at a given node is higher than C d-s, one can decrease the multiplicity of the node by t=d-s-r. If it is not the case, one cannot remove the node without changing the shape of the curve. Before effectively removing a node, one must check the continuity of the curve on both sides of the node. The next algorithm allows to decide this while computing the new control points. 114
We try to delete the knot of multiplicity s. i = r - d ; j = r - s while ( j i > 0 ) u=u r u r1 compute i = u u i u id 1 u i j = u u j u jd 1 u j compute i = i + 1 ; j = j 1 end while P 1 i = P 0 1 i 1 i P i 1 i P 1 j = P 0 1 j j P j1 1 j These two terms are known for the first iteration 0 0 they are respectively and. P r d 1 P r s1 115
Testing the possibility to remove the knot if (i=j) compute 1 1 P= i P i 1 1 i P i1 compute the distance between P and the control point P i otherwise 1 1 compute the distance between P i 1 and P j+ 1 If the distance is lower than a tolerance T, replace the control points P k by the new control points P k 1 and update the nodal sequence as well. 116
Practical example: deletion of u=u 5 P 2 P 3 P 4 P 1 P 5 P 0 U ={0,0, 0,0,1,1,2, 2, 2, 2} 117
Deletion of u=u 5 (r=5, d=3, s=2) U ={0,0, 0,0,1,1,2, 2, 2, 2} 1 1 P 2 P 3 P 2 P 3 P 4 P 1 P 5 P 0 i=r-d=2 j=r-s=3 2 = u u 2 u 6 u 2 =1/2 3 = u u 3 u 7 u 3 =1/2 P 1 2 = P 0 1 2 (1 α 2 ) P 1 α =2 P 0 1 2 P P 1 3 = P 3 1 2 0 α 3 P 4 1 1 α 3 =2 P 3 0 P 4 1 118
New control polygon U ={0,0, 0,0,1, 2, 2,2,2} P 2 P 1 P 3 P 4 P 0 119
Now, deletion of u=u 4 (r=4, d=3, s=1) P 1 1 U ={0, 0,0,0,1,2,2, 2,2} P 2 P 3 1 P 1 P 3 P 4 P 0 i=r-d=1 j=r-s=3 1 = u u 1 u 5 u 1 =1/2 3 = u u 3 u 7 u 3 =1/2 P 1 1 = P 0 1 1 1 1 P 0 =2 P 0 1 1 P 0 1 P 1 3 = P 0 1 3 3 P 4 =2 P 0 1 1 3 P 4 3 120
Verification P 1 1 U ={0, 0,0,0,1,2,2, 2,2} P P 2 P 3 1 P 1 P 3 P 4 P 0 i=r-d=1 j=r-s=3 α 2 = u u 2 u 6 u 2 =1/ 2 P=α 2 P 1 1 +(1 α 2 ) P 3 1 = P 1 1 +P 3 1 2 OK! 121
Final control polygon U ={0, 0, 0,0, 2, 2,2,2} P 1 P 2 P 0 P 3 122
Restriction of the useful interval of a curve Starting with a curve defined on the nodal sequence: U ={u 0,,u d d+ 1 times We want to limit this curve at P u= i=0,,u m d m } d+ 1 times Build the new control points Determine the new nodal sequence P * u= i=0 U * ={u * * 0,,u d d + 1 times k N i d u P i * n P i * *,,u l d u 0 * N i d u P i and,,u l * d + 1 times U * } u l * P 1 P 2 P 0 * P 0 P 1 * u 0 * u l * P 4 P 2 * P 3 P 3 * 123
Use of the Boehm's algorithm * u=u 0 Knot insertion up to a multiplicity equal to d. P 1 P 2 u 0 * P 1 ' P 2 ' P 3 ' u 0 * P 4 ' P 0 P 4 P 3 U ={0, 0, 0, 2, 4, 6,6,6} u 0 * =1 ' P ' ' 0 P 6 P 5 U ' ={0,0, 0, 1,1,2,4,6,6,6} 124
Use of the Boehm's algorithm * u=u 0 Knot insertion at until multplicity is equal to d. Knot insertion at until multiplicity iq equal to d. u=u l * The sequence of these operations is not important. P 1 ' P 2 ' P 3 ' u 0 * " P ' 3 " P 4 P " 4 * P 2 * " u * l u u l P 5 " 0 " P 1 P 6 ' ' " P ' 0 P 6 P 5 P " " 0 P 8 P 7 U ' ={0,0, 0, 1,1,2,4,6,6,6} u l * =3.5 U '' ={0, 0,0,1, 1,2, 3.5, 3.5, 4,6,6,6} 125
Use of the Boehm's algorithm * u=u 0 Knot insertion in until multplicity is equal to d. Knot insertion in until multiplicity is equal to d. u=u l * The order of these operations is not important. Extraction of interesting part of the curve and addition of knots at the start and end of the nodal sequence so as to have a multiplicity equal to d+1 at both extremities P 1 " P 2 " P 3 " u 0 * u l * P 4 " P 5 " P 6 " P 0 * P 1 * P 2 * P 3 * " P " " 0 P 8 P 7 U '' ={0, 0,0,1, 1,2, 3.5,3.5, 4,6,6,6} U * ={1,1,1, 2, 3.5,3.5,3.5} 126
U ={0, 0,0,0,1, 2,3,3,3, 3} 127
U ={0, 0,0,0,0.2,0.2,0.2,1, 2,3, 3, 3,3} 128
U ={0.2,0.2,0.2,0.2,1, 2,3, 3, 3,3} 129
U ={0.2,0.2,0.2,0.2,1, 2, 2.9, 2.9,2.9, 3,3,3,3} 130
U ={0.2,0.2,0.2,0.2,1, 2,2.9,2.9, 2.9, 2.9} 131
Increase of a curve's useful interval n P u= i=0 N i d u P i U ={u 0,,u d d+ 1 times We want to extend the curve to or to,,u m d m } d+ 1 times u=u * 0 u 0 u=u m * u m P 1 P 2 u 0 P 0 P 4 P 3 u 0 * 132
We cannot use the node insertion algorithm directly Instead, use of Cox-de Boor's algorithm «backwards» to determine the new position of the * control points P i u 0 u 0 * We move the node to. The new nodal sequence is : P 1 P 2 u 0 U * ={u 0 *,, u d * d + 1 times, u d + 1,, u m d,, u m } d + 1 times unchanged P 0 P 4 P 3 u 0 * 133
We calculate the point corresponding to u 0 from unknown positions of control points For k from 1 to d For j from i to i-d+k Sequence of points obtained with the Cox-de Boor algorithm : = * * u P k 0 u u * j jd 1 k j * Among these points : * * u jd1 k u j P * k 1 j P i * u jd 1 k P 1 =P 2 *1 u 0 * u j P * k 1 j 1 P 2 =P 2 *0 The points are known (they are the points P i!) P d *d i Only the d+1 first control points are affected (the interval concerned by Cox-de Boor is [u i, u i+1 [, i=d ). for k from 1 to d for j from d to k u 0 P 0 =P 2 * 2 u 0 * * * P 4 =P 4 P 3 =P 3 P *0 * 0 =P 0 134
For k from 1 to d For j from d to k P j * k = Is transformed in : u 0 u j * * * u jd 1 k u j P * k 1 j known u * jd 1 k * u jd 1 k u 0 * u j P *k 1 j 1 = * k P 1 j 1 u * jd1 k * u jd1 k * u j u 0 P * k j u 0 u j * * * u jd 1 k u j u * * jd 1 k u j * u jd 1 k u 0 P * k 1 j * d Initialise P i d =P i For j from d to 1 For k from j to 1 = * k P 1 j 1 u * jd1 k * u jd1 k * u j u 0 P * k j u * j u 0 * u jd 1 k u 0 P * k 1 j 135
d =2 U ={0, 0, 0,1,2,3, 3,3} u 0 =0 U * ={ 0.1, 0.1, 0.1,1,2,3,3, 3} For j from 2 to 1 For k from j to 1 j=2 k=2 = P u *1 3 1 * u 2 * u 3 * P * 2 2 = * k P 1 j 1 u * 2 * u 3 P 1 *1 =1.1 P 2 * 2 0.1 P 2 *1 j=2 k=1 = * P u 0 4 1 * u 2 * u 4 * P * 1 2 u * 2 u 4 * P 1 * 0 =1.05 P 2 *1 0.05 P 2 * 0 u * * j3 k u j * u j3 k P *1 2 P * 0 2 P 1 *0 u 0 * = 0.1 P *k j P 2 *1 u j * * u j3 k P 2 * 2 P 1 *1 P * k 1 j P 4 * P 3 * P 2 *0 136
d =2 U ={0, 0, 0,1,2,3, 3,3} u 0 =0 U * ={ 0.1, 0.1, 0.1,1,2,3,3, 3} u 0 * = 0.1 For j from 2 to 1 For k from j to 1 j=1 k=1 = * P u 0 3 0 * u 1 * u 3 * P *1 1 = * k P 1 j 1 u * 1 * u 3 P 0 *0 =1.1 P 1 *1 0.1 P 1 *0 u * * j3 k u j * u j3 k P * 0 1 P 1 *0 P *k j P 2 *1 u j * * u j3 k P * k 1 j P 2 *0 P 2 * 2 P 1 *1 P 0 *0 P 4 * P 3 * 137
Control polygon and modified nodal sequence U * ={ 0.1, 0.1, 0.1,1, 2,3,3, 3} d =2 { P * *0 i =P i P * i =P i,id,i d P 1 *0 P 2 *0 For an extension on the other side; same algorithm with change of the indices of the affected points. P 0 *0 P 4 * P 3 * 138
U ={0, 0, 0,0,1, 2, 3, 3,3,3} 139
Increase for u=-0.1 U ={ 0.1, 0.1, 0.1, 0.1,1, 2,3,3,3,3} 140
U ={ 0.1, 0.1, 0.1, 0.1,1,1.9,1.9, 1.9,1.9} 141
Degree elevation A B-spline curve of degree d can be converted without loss into a curve of degree d+1. Proof : shape functions of degree d+1 contain those of degree d. The continuity of the curve of degree d at the nodes is given by the nodal sequence. For a same multiplicity of a node, the curve of degree d+1 offers a higher continuity. As a consequence, in the nodal sequence of the new curve, one must increment the multiplicity of each node. 142
Degree elevation algorithm Several algorithms exist : Tiller et al (1983) Direct resolution of a linear system Prautzch et al. (1991) Cf JC Leon, «Modélisation de curves et surfaces pour la CFAO» Piegl et al. (1994) Competitive with Prautzch (specially for multiple elevations) Transform the curve in succession of Bézier curves by insertion of nodes (multiplicity = d) Increase the degree of Bézier curves (ref. ad-hoc algorithm as seen for Bézier curves) Removal of most of nodes that were introduced 143
Recursive subdivision As in the case of Bézier curves, one can increase the number of CPs, this time using Boehm's knot insertion algorithm instead of De Casteljau's. The control polygon converges to the curve as one inserts new knots ( each time in the middle of the widest knot interval) The usual order of B-Spline curves is small (3 or 4, maybe 5), so savings in computational complexity with respect to a systematic evaluation with Cox-de Boor's algorithm are not so dramatic. 144
Some conclusions Flexibility Low order Continuity Periodic curves Conics? 145
Rational curves «Non Uniform Rational» 146
NURBS Representation of conic sections Circles, ellipses, hyperbolas... A fair number of «industrial» geometries do have conic sections in their definition Bézier curves, and other polynomial representations cannot exactly represent all conic sections 147
NURBS Example : the circular arc Parametric form A u is the angle { x u=cos u yu=sin u, u [0, 2 ] u No polynomial representation (or as a series) Parametric form B { x u=1 u yu=u1 u, u [0,1] Problem : square root u 148
NURBS Parametric form C u 2u {x(u)= 1+u 2 y(u)= 1 u2 1+u 2, u [0,1] Ratio of two polynomials of degree 2 x(u) and y(u) have a common denominator 149
NURBS Thus, one can set the following : {x(u) w(u)=2 u y(u) w(u)=1 u 2 w(u)=1+u 2 P u= P w u w u, u [0,1] Vectorial term Weight function (scalar) 150
NURBS Non rational curves P u= N d i up i i Rational curves P (u)= i j N i d (u) P i w i N j d (u)w j = P w (u) w(u) = i R i d (u) P i with R i d (u)= j N d i (u)w i N j d (u)w j A weight w i is associated to every control point P i, A scalar approximation w(u) is built on the same model as for regular 151
NURBS Relation between conics and the central projection With respect to central projection; all conics are equivalent. circle ellipse cone O parabola hyperbola 152
NURBS In particular, parabolas may be modelled with polynomials. Any other conic section can be obtained by projecting a parabola onto an appropriately oriented plane. circle O parabola 153
NURBS Central projection and homogeneous coordinates Everything takes place in a 4-dimensional space We have a class of equivalence : [wx, wy, wz, w] [ x, y, z,1] w>0 This equivalence class is a central projection of all the points located on a straight line passing by the origin onto the plane of equation w=1 How to get cartesian 3D coordinates from the homogeneous 4D coordinates : Just divide all the components by the 4 th component Discard the 4 th component (it is equal to one) 154
NURBS Projection of a parabola to a circle Regular coordinates x, y (, z) circle O parabola Homogeneous coordinate w 1 155
NURBS In practice.. one works on the 4 homogeneous coordinates P w (u)= i N i d (u) P i w with P i w =(x i w i y i w i z i w i w i ) In this space, we just know how to represent parabolas. The equivalence class allows us to divide by the last component and bring us back to euclidean 3D space We can therefore represent any conic section. P i w How to determine the right control points? 156
NURBS Representation of 1/3rd of a circle with the help of B- splines (or Bézier) curves... 3 control points, nodal sequence [0,0,0,1,1,1] (a parabola) We must determine homogeneous coordinates of each control point so that the central projection yields points exactly on the arc. Plane containing the parabola w=0 O 3/2 A= A'=[ r ] r/ 2 0 1 B=B C' w=3/4 C A B A' B' w=3/2 w=1 Plane of the circle 3/2 '=[r ] r /2 0 1 C r C=[0 1] 0 A C 0 3r / 4 0 '=[ ] 3/ 4 In the plane of the circle B P 0 w =A' P 0 w =A' P w 1 =2C ' A'B ' 2 P w 2 =B ' P 1 w C' =[ 0 r 0 1/ 2] P 2 w =B' In the plane of the parabola 157
NURBS 1/3 of a circle U =[0, 0, 0,1,1,1] w=4 w=2 w=10 w=1 w= 1 2 3 2 r w= 1 4 w= 1 10 3 r 158
NURBS Complete circle in three pieces A single B-spline NURBS Non uniform Rational w=1 U =[0,0,0,1,1,2,2,3,3,3] w= 1 2 159
NURBS Parametrization U =[0,0,0,1,1,2,2,3,3,3] 160
NURBS P 0 w Generalization : Circular arc of angle α <= 2p/3 (actually, <p) 2r sin 2 P 1 w w=cos 2 P 2 w w=1 w=1 r tan 2 sin 2 r cos 2 = x P w 0 = x P w 1 = x P w 2 0 y 0 z 0 1 1 cos /2 y 1 cos/2 z 1 cos / 2 cos / 2 2 y 2 z 2 1 161
NURBS Can we represent a circle with only 2 pieces? - yes if we allow control points with w=0 P w 0 =P w 4 =[ r ] 0 0 1 =[ P2 w r 0 0 1 ] P 1 w =[0 r 0 0 ] P 3 w =[ 0 r 0 0 ] U =[0,0,0,1,1,2,2, 2] 162
NURBS Can we represent a circle as a single piece? No (if we remain with degree 2) Interval for the parameter necessary to cover the whole circle : The nodal sequence is therefore undefined R 163
NURBS Can we represent a circle as a single piece? Yes : if we accept to increase the degree (here 5) r P w 2 =[ 2 ] 3r 0 1 P3 =[2r ] w 3 r 0 1 r P w 1 =[ 4 ] r 0 1 P =[ 0 ] P w 0 =P w 5r 5 0 5 =[ w 4 4 r ] r 0 1 164
NURBS Properties of the NURBS basis functions P (u)= i j N i d (u) P i w i N j d (u)w j = P w (u) w(u) = i R i d (u) P i with R i d (u)= j N d i (u)w i N j d (u)w j 165
NURBS Partition of the unity: R d i u=1 with i j N i d (u)w i 1 iff N d j (u)w j j i N j d (u)w j 0 R i d u= j N d i uw i N j d uw j In fact, there is always partition of unity with this definition. The original shape functions (N) must however be all linearly independent, and not all equal to zero at any point... 166
NURBS Properties of NURBS basis functions Non-negativityR d i u 0 R d i u= N d i u w i N Partition of the unity R d d j uw j i u=1 If the nodal sequence is not periodic (d+1 repetitions) one have R d 0 0=R d n 1=1 R d i ureaches exactly one maximum on the definition interval (for d>0) Compact support : i Every derivative exist inside a nodal interval, at one node, SFs are differentiable at least d-k times (k is the multiplicity of a node) j R i d (u)=0 for u [ u i, u i+ d + 1 [ If w i =cst, we have classical non rational curves. 167
NURBS These properties have the same consequences on the curve as in the classical B-Spline case Beware : the w i must remain positive. They may vanish iff w(u) remain always strictly positive. Affine invariance Convex hull Local control of a given control point etc... 168
NURBS Modification of the weight of a control point Does not change the 3D position of the control point (only the distance to the perspective plane in the central projection) Modify the «attraction» of the control point with respect to the curve Means to modify the shape of the curve without moving control points No changes in the geometric continuity of the curve Interesting at the junction of independent curves : the continuity of tangents at the interface is not disturbed even if the modification is not local (ex: for Bézier curves)
NURBS Location of a given point when modifying a weight... We modify the weight w i0 associated to the point P i0 Set N =P (u) wi 0 =1 w i 0 =1 M =P (u) wi 0 =0 The point P=P (u), w i 0 0 is on the straight line joining NM w i 0 N M w i 0 =0 The straight line NM passes by P i0 (limit case w i 0 ) ( Also also true for rational surfaces as seen later...)
NURBS Proof P (u)= i i 0 k i 0 N p i (u) P i w i + N p i 0 (u) P i 0 w i 0 N p k (u)w k + N p i 0 (u) w i 0 P (u)= P +n P i 0 w i 0 N = P+n P i 0 w+n w w+n i 0 N = M w+n P i 0 w+n M = P w P (u)= P +n P i 0 w i 0 w+n w i 0 = M w+(n (w+n) M w)w i 0 w+nw i 0 = N (w+n)w i 0 w+n w i 0 + M (w w w i 0) w+n w i 0 =N f (w i 0 )+ M g (w i 0 ) P=M w P i 0 = N (w+n) M w n
NURBS Calculating NURBS derivatives Presence of the rational term : rules of derivation are more complex. Set Au=wu P u P u= Au wu 3 first components of the homogeneous coordinates last component of the homogeneous coordinates So : P ' (u)= w(u) A' (u) w ' (u) A(u) = w(u) A' (u) w ' (u)w(u) P (u) w(u) 2 w(u) 2 = A' u w ' u P u wu 172
NURBS Derivatives (general case at the order k) Au=wu P u k A k u= k i=0 i wi k u P i u =w u P k u i=1 k k i wi k u P i u P k u= k A k u i=1 k i wi k u P i u w u 173