Documente Academic
Documente Profesional
Documente Cultură
bounding trapezoid.
Joining Bezier splines
To join two Bezier splines with C0
continuity, set P3=Q0.
To join two Bezier splines with C1
continuity, require C0 and make the tangent
vectors equal: set P3=Q0 and P3-P2=Q1-Q0.
Q1
Q0
P3
P2
Joining Bezier patches
This works for Bezier patches as well: to join
two patches with C1 continuity at an edge,
ensure that their control points and tangent
vectors on that edge are equal.
NURBS patches are
joined in exactly the
same way.
Beziers
Cubics, of course, are just one example of
Bezier splines:
Linear: P(t) = (1-t)P0 + tP1
Quadratic: P(t) = (1-t)2P0 + 2t(1-t)P1 + t2P2
Cubic: P(t) = (1-t)3P0 + 3t(1-t)2P1 + 3t2(1-t)P2 + t3P3
... n choose v = n! / i!(n-i)!
n
n
General: P (t ) (1 t ) t Pi , 0 t 1
n i i
i 0 i
P1
Beziers (1-t)P1+tP2
(1-t)P0+tP1
Thinking about Beziers P(t) P2
Linear interpolations P0
The linear Bezier is a linear interpolation between two points.
The quadratic Bezier can be seen as a linear interpolation
between two lines:
P(t) = (1-t) ((1-t)P0+tP1) + (t) ((1-t)P1+tP2)
The cubic is a linear interpolation between linear
interpolations between linear interpolations etc.
Another way to see Beziers is as a weighted average
between the control points.
Bernstein polynomials
P(t) = (1-t)3P0 + 3t(1-t)2P1 + 3t2(1-t)P2 + t3P3
1 1
0.4 0.4
0.8 0.8
0.3 0.3
0.6 0.6
0.2 0.2
0.4 0.4
0.2 0.4 0.6 0.8 1 0.2 0.4 0.6 0.8 1 0.2 0.4 0.6 0.8 1 0.2 0.4 0.6 0.8 1
Parameterizing a chain of Beziers
Q1 Q2
We can parameterize this chain
Q0 Q3 over t by saying that instead of
P3 R0 going from 0 to 1, t moves
smoothly through the intervals
[0,1,2,3]
P2 R1
The curve C(t) would be:
Consider a chain of splines C(t) = P(t) ((0 t <1) ? 1 : 0) +
with many control points Q(t-1) ((1 t <2) ? 1 : 0) +
P = {P0, P1, P2, P3} R(t-2) ((2 t <3) ? 1 : 0)
Q = {Q0, Q1, Q2, Q3}
R = {R0, R1, R2, R3} [0,1,2,3] is, in a way, a type of
with C1 continuity knot vector. 0, 1, 2, and 3 are
P3=Q0, P2-P3=Q0-Q1 the knots.
Q3=R0, Q2-Q3=R0-R1 This is not strictly true, but the
idea is right: knots define
intervals.
NURBS
NURBS (Non-Uniform Rational B-
Splines) are a generalization of Beziers.
NU: Non-Uniform. The control points dont have
to be weighted equally.
R: Rational. The spline may be defined by
rational polynomials (homogeneous coordinates.)
BS: B-Spline. A chained series of Bezier splines
with controllable degree.
B-Splines
A Bezier cubic is a polynomial of degree three: it
must have four control points per spline, it must
begin at the first and end at the fourth, and it
assumes that all four control points are equally
important.
Beziers are actually a type of B-spline. B-splines
are a piecewise parameterization of Beziers that
supports an arbitrary number of control points and
lets you specify the degree of the polynomial
which interpolates them.
B-Splines
Well build our definition of a B-spline from:
n+1, the number of control functions
k, the degree of the curve
{P0Pn}, a list of n+1 control points
[t0,t1,,tk+n+1], a knot vector of parameter values
n intervals n+1 control points
k is the degree of the curve, so k+1 is the number of control points
which influence a single interval. k must be at least 1 (two control
points linked by each linear line segments) and no more than n
(the number of intervals.)
There are k+n+2 knots, and ti ti+1 for all ti.
B-Splines
The equation for a B-spline is
n
P (t ) N i ,k (t ) Pi , t min t t max
i 0
N0,2(t) N1,2(t)
N0,3(t)
1, ti t ti 1
N i , 0 (t )
0, otherwise
B-Splines
0 1 1 2 2 3 3 4 4 5
N0,0(t) N1,0(t) N2,0(t) N3,0(t) N3,0(t)
-1 1 2 3 4 5 -1 1 2 3 4 5 -1 1 2 3 4 5 -1 1 2 3 4 5
-1 1 2 3 4 5 -1 1 2 3 4 5 -1 1 2 3 4 5
N0,2(t) N1,2(t) N2,2(t)
(t / 2)(t ) 0 t 1
t 0 3t
N 0,2 (t) N 0,1 (t ) N1,1 (t ) (t / 2)(2 t ) ((3 t ) / 2)(t 1) 1 t 2
20 3 1 ((3 t ) / 2)(3 t )
2t 3
((t 1) / 2)(t 1) 1 t 2
t 1 4t
N1,2 (t) N1,1 (t ) N 2,1 (t ) ((t 1) / 2)(3 t ) ((4 t ) / 2)(t 2) 2t 3
3 1 42 ((4 t ) / 2)(4 t )
3t 4
((t 2) / 2)(t 2) 2t 3
t 2 5t
N1,2 (t) N 2,1 (t ) N 3,1 (t ) ((t 2) / 2)(4 t ) ((5 t ) / 2)(t 3) 3t 4
42 53 ((5 t ) / 2)(5 t )
4t 5
2.5 2.5
2 2
1.5 1.5
1 1
0.5 0.5
t0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10
Multiple knots and Barycentric property
For t4 = t5, N4,8 = 0 N4,6(t5) + N4,7(t5) = 1
N4,7
N4,6 N4,8 N
4,9
t0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10
Multiple knots and Barycentric property
For t3 = t4 = t5, N4,7 = 0 N4,6(t5) = 1
N4,6
N4,9
N4,7 N4,8
t0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10
Control point associated with N4,6(t) is b2: the spline passes through b2
Open vs Closed
A knotvector which repeats its first and last
knot values k+1 times is called closed,
otherwise open.
Repeating the knots k+1 times is the only way to
force the curve to pass through the first or last
control point.
Without this, the functions N0,k and Nn,k which
weight P0 and Pn would still be ramping up and
not yet equal to one at the first and last ti.
range of full support [3, 12)
Example
6
ti = i,
i = 0, , 15 2
For spline to pass through (0, 0),
the knot t4+4-1 = t7 = 7 should have multiplicity 3.
t 5 = t6 = t7 = 7
0
For spline to pass through (8, 0),
the knot t7+4-1 = t10 = 10 should have multiplicity 3.
-2 t8 = t9 = t10 = 10
-4
-6
0 2 4 6 8
Open vs Closed
Two examples you may recognize:
k=2, n+1=3 control points, knots={0,0,0,1,1,1}
k=3, n+1=4 control points, knots={0,0,0,0,1,1,1,1}
Non-Uniform Rational B-Splines
Repeating knot values is a clumsy way to
control the curves proximity to the control
point.
We want to be able to slide the curve nearer or
farther without losing continuity or introducing
new control points.
The solution: homogeneous coordinates.
Associate a weight with each control point: i.
Non-Uniform Rational B-Splines
We Know: [x, y, z, ]H [x / , y / , z / ]
Or: [x, y, z,1] [x, y, z, ] H
Thecontrol point
Pi=(xi, yi, zi)
becomes the homogeneous control point
PiH =(xii, yii, zii)
A NURBSn in homogeneous coordinates is:
PH (t ) N i ,k (t ) PiH , t min t t max
i 0
Non-Uniform Rational B-Splines
Toconvert from homogeneous coords to
normal ncoordinates:
xH (t ) ( xii )( N i ,k (t )) x(t ) xH (t ) / (t )
i 0
n
y (t ) y H (t ) / (t )
y H (t ) ( yii )( N i ,k (t )) z (t ) z H (t ) / (t )
i 0
n
z H (t ) ( zii )( N i ,k (t ))
i 0
n
(t ) (i )( N i ,k (t ))
i 0
Non-Uniform Rational B-Splines
A piecewise
n
rational curve is thus defined by:
P (t ) Ri ,k (t ) Pi , t min t t max
i 0
with supporting rational basis functions:
i N i ,k (t )
Ri ,k (t ) n
N
j 0
j j ,k (t )