Rational Bezier Surface The perspective projection of a 4-dimensional polynomial Bezier surface, S w n ( u, v) B i n i 0 m j 0, u ( ) B j m, v ( ) P w ij ME525x NURBS Curve and Surface Modeling Page 97
and, S w ( u, v) H { S w ( u, v) } n m B i, n ( u) B j, m ( v) w ij P ij i 0 j 0 ---------------------------------------------------------------------------------- n i 0 n i 0 m j 0 m j 0 B i, n ( u) B j, m ( v) w ij R i j, ( u, v) P ij ME525x NURBS Curve and Surface Modeling Page 98
where, R i j, ( u, v) ( ) B j, m ( v) w ij ----------------------------------------------------------------------------- n r 0 B i, n u m s 0 B r, n ( u) B s, m ( v) w rs Note that R i,j (u,v ) are rational functions; but they are not products of other basis functions. ME525x NURBS Curve and Surface Modeling Page 99
Hence, S (u,v ) is not a tensor product surface (but S w (u,v ) is). We will generally work with S w (u,v). Exercise: See if you can construct a rational Bezier surface patch representing a quarter-cylinder ME525x NURBS Curve and Surface Modeling Page 100
B-spline Basis Functions Curves consisting of a single polynomial or rational segment may have the following deficiencies: Degree must be high to satisfy a large number of constraints; e.g., need a degree (n-1) polynomial Bezier to pass through n data points ---> numerical instability. ME525x NURBS Curve and Surface Modeling Page 101
Degree must be high to fit complex shapes accurately Not suited to interactive shape design - shape control is not sufficiently localized. ME525x NURBS Curve and Surface Modeling Page 102
One solution is to use curves (surfaces) which are piecewise polynomial or piecewise rational. Consider the following curve C 1 (u) u0 uu 1 uu 2 C 2 (u) u1 C 3 (u) ME525x NURBS Curve and Surface Modeling Page 103
consisting of m ( 3) n-th degree polynomial segments. C (u) is defined on u [0,1]. The parameter values u 0 0 < u 1 < u 2 < u 3 1 are called breakpoints. Curve segments are denoted C i (u), i0,...,m. The segments join with specified continuity (not necessarily the same at each breakpoint). Let C i (j) denote the j-th derivative of C i. ME525x NURBS Curve and Surface Modeling Page 104
Definition: Curve C(u) is said to be C k -continuous at the breakpoint u i, if C ( j) i ( u i ) C j ( i ) + 1 u i for all 0 j k ( ) Note that any of the standard polynomial forms can be used to represent C i (u). ME525x NURBS Curve and Surface Modeling Page 105
Example: Suppose the piecewise curve above is represented using cubic Bezier polynomials. If the breakpoints are fixed, U {u 0, u 1, u 2, u 3 }, and the twelve control points P i j are allowed to vary arbitrarily, we obtain a vector space ϑ of all piecewise cubic polynomial curves on U. ME525x NURBS Curve and Surface Modeling Page 106
Vector space ϑ has dimension 12, and a curve in ϑ can be discontinuous at u 1 or u 2. Now suppose that C 0 -continuity is specified, i.e., P 3 1 P 0 2 and P 3 2 P 0 3. Thus ϑ 0 is the vector space of all piecewise cubic polynomial curves on U which are at least C 0 -continuous. Note that ϑ 0 has dimension 10, and ϑ 0 ϑ. ME525x NURBS Curve and Surface Modeling Page 107
Similarly, if C 1 -continuity is specified, it can be shown that, P 1 3 ( u 2 u 1 ) P 1 2 + ( u 1 u 0 ) P 2 1 ---------------------------------------------------------------------------- u 2 u 0 So ϑ 1 the vector space of all C 1 -continuous piecewise polynomial curves on U has dimension 8, and ϑ 1 ϑ 0 ϑ ME525x NURBS Curve and Surface Modeling Page 108
Thus, storing and manipulating individual polynomial segments of a piecewise polynomial curve has the following deficiencies: redundant data must be stored - e.g., 12 coefficients, where only 8 are required for C 1 - continuity, and 6 for C 2 -continuity ME525x NURBS Curve and Surface Modeling Page 109
continuity of C (u) depends on the positions of the control points, e.g., in our previous example, suppose we like C 1 (u) and C 3 (u), but want to modify C 2 (u) - if we want C 1 - continuity throughout, we are stuck! Determining the continuity of a curve requires computation ME525x NURBS Curve and Surface Modeling Page 110
We want a curve representation of the form, n C ( u) f i ( u) P i i 0 where the P i are control points and the {f i (u), i 0,..., n} are piecewise polynomial functions forming a basis for the vector space of all piecewise polynomial functions of the desired degree and continuity... ME525x NURBS Curve and Surface Modeling Page 111
i.e., continuity is determined by the basis functions, so control points can be modified without altering the curve s continuity. Also, we seek basis functions f i (u) with local support, i.e., each f i (u) should be non-zero on only a limited number of subintervals (not the entire domain [u 0, u m ]). ME525x NURBS Curve and Surface Modeling Page 112
B-spline Basis Functions Definition (Cox-DeBoor): Let U {u 0,..., u m } be a non-decreasing sequence of real numbers, i.e., u i u i+1, i 0,..., m - 1. The u i are called knots, and U is the knot vector. The i-th B-spline basis function of degree p (order p + 1), denoted as N i,p (u), is defined as follows: ME525x NURBS Curve and Surface Modeling Page 113
N i, p ( u) N i, 0 ( u) u i + p u i 1 if ( u i u < u i + 1 ) 0 otherwise u u i -----------------------N i, p 1 ( u) u i + p + 1 u u i + p + 1 u i + 1 + --------------------------------------N i + 1, p ( u) 1 ME525x NURBS Curve and Surface Modeling Page 114
Note the following: N i,0 (u) is a step function, equal to zero everywhere except on the half-open interval u [u i, u i+1 ). For p > 0, N i,p (u) is a linear combination of two degree p - 1 basis functions. Computation of a set of basis functions requires specification of a knot vector U, and the degree, p. ME525x NURBS Curve and Surface Modeling Page 115
The formulation above can yield the quotient 0/0. We define this quotient to be zero. The half-open interval [u i, u i+1 ) is called the i-th knot span. It may have zero length since knots need not be distinct. ME525x NURBS Curve and Surface Modeling Page 116
Computation of the p-th degree functions generates a truncated triangular table, N 0,0 N 0,1 N 1,0 N 2,0 N 3,0 N 4,0 N 1,1 N 2,1 N 3,1 N 0,2 N 1,2 N 2,2 N 0,3 N 1,3 ME525x NURBS Curve and Surface Modeling Page 117
Example: Given U { 0, 0, 0, 1, 1, 1 } compute the B- spline basis functions for degree p 2 N 0, 0 N 1 0 N 2 0, 0 for < u < 1 0 u 1, { 0 otherwise N 3, 0 N 4 0, 0 for < u < ME525x NURBS Curve and Surface Modeling Page 118
N 0 1 -----------N u 0 0 u, 0 0 0, + -----------N 0 0 0 1, 0 0 < u < N 1 1 -----------N u 0 1 u, 0 0 1, + -----------N 0 1 0 2, 0 { ( 1 u) 0 u 1 0 otherwise ME525x NURBS Curve and Surface Modeling Page 119
N 2 1 -----------N u 0 1 u, 1 0 2, + -----------N 0 1 1 3, 0 u 0 u 1 { 0 otherwise N 3 1 -----------N u 1 1 u, 1 1 3, + -----------N 0 1 1 4, 0 0 < u < ME525x NURBS Curve and Surface Modeling Page 120
N 0 2 -----------N u 0 1 u, 0 0 0, + -----------N 1 1 0 1, 1 { ( 1 u) 2 0 u 1 0 otherwise N 1 2 -----------N u 0 1 u, 1 0 1, + -----------N 1 1 0 2, 1 { 2 ( 1 u) 0 u 1 0 otherwise ME525x NURBS Curve and Surface Modeling Page 121
N 2 2 -----------N u 0 1 u, 1 0 2, + -----------N 1 1 1 3, 1 u 2 0 u 1 { 0 otherwise Note that the N i,2 restricted to the interval u [0,1], are the quadratic Bernstein polynomial. ME525x NURBS Curve and Surface Modeling Page 122
Thus, the B-spline representation with knot vector of the form, U { 0,..., 0, 1,..., 1 } p +1 p +1 is a generalization of the Bezier representation. ME525x NURBS Curve and Surface Modeling Page 123