Curve Modeling NURBS Dr. S.M. Malaekae.sharif.edu/~aerocad/Curve modelling-NURBS.pdf · Properties...
Transcript of Curve Modeling NURBS Dr. S.M. Malaekae.sharif.edu/~aerocad/Curve modelling-NURBS.pdf · Properties...
Curve ModelingNURBS
Dr. S.M. MalaekAssistant: M. Younesi
Motivation
Motivation
We need more controlmore controlover the curve
MotivationDesign Sketch
MotivationRendered
MotivationFinal Physical Product
MotivationDifferent weights of control points
MotivationIt is hard to product exact circle with B-spline.
Circles can only be represented with rationalrational function (i.e., functions that are quotients of two polynomials).
four closed B-spline curves with 8 control points :
Degree 2 Degree 3 Degree 5 Degree 10
Motivation Circles, ellipses and many other curves that cannot be represented by polynomials.
we need an extension to B-splinecurves.
Motivation Generalize B-splines to rational curvesusing homogeneous coordinateshomogeneous coordinates:
Non-Uniform Rational B-Splines(NURBS)
NURBS Different weights of Pi, to have different attraction factors.
W1=0.4
W3=3.0
Wi=1
NURBS Different weights of Pi, to have different attraction factors.
Wi=1 W0=W2=W3=W5=1, W1=W4=4
NURBS B-spline Curve: Given n+1 control points P0, P1, ..., Pnand knot vector U = { u0, u1, ..., um } of m+1 knots, the B-spline curve of degree p :
i
n
ipi uNu PC )()(
0,∑=
=
⎥⎥⎥⎥
⎦
⎤
⎢⎢⎢⎢
⎣
⎡
∑==
i
iw
ii
ii
n
ipi
w
wzwywxw
uNu0
, )()(C
⎥⎥⎥⎥
⎦
⎤
⎢⎢⎢⎢
⎣
⎡
=
1i
i
i
i zyx
P⎥⎥⎥⎥
⎦
⎤
⎢⎢⎢⎢
⎣
⎡
=
i
iw
ii
ii
wi
wzwywxw
P
Multiply the coordinates of Piwith a weight w
B-Spline Curve in homogeneous coordinate
NURBS
⎥⎥⎥⎥
⎦
⎤
⎢⎢⎢⎢
⎣
⎡
∑==
i
iw
ii
ii
n
ipi
w
wzwywxw
uNu0
, )()(C
( )( )( )
⎥⎥⎥⎥
⎦
⎤
⎢⎢⎢⎢
⎣
⎡
∑∑∑∑
=
=
=
=
=
i
ni pi
ii
ni pi
ii
ni pi
ii
ni pi
w
wuNzwuNywuNxwuN
u
)()()()(
)(
0 ,
0 ,
0 ,
0 ,
C
NURBS Convert it back to Cartesian coordinate by dividing Cw(u) with the fourth coordinate:
∑
⎥⎥⎥⎥
⎦
⎤
⎢⎢⎢⎢
⎣
⎡
∑=
==
n
ii
i
i
nj ipj
ipi
zyx
wuNwuN
u0
0 ,
,
1)(
)()(C
∑∑ =
=
=n
iiipin
i ipi
wuNwuN
u0
,
0 ,
)()(
1)( PC
∑=
=n
iipi uRu
0, )()( PC∑ =
=nj jpj
ipipi
wuN
wuNuR
0 ,
,,
)(
)()(
TwoTwoImmediate Results
Two Immediate Results
1. If all weights are equal to 1, a NURBScurve reduces to a B-spline curve.
2. NURBS Curves are Rational.
∑=
=n
iipi uRu
0, )()( PC
∑ =
= nj jpj
ipipi
wuN
wuNuR
0 ,
,,
)(
)()(
Propertiesof
NURBS NURBS Basis Function
Properties of NURBS Basis Function1. Ri,p(u) is a degree p rational function in u
2. Nonnegativity -- For all i and p, Ri,p(u) is nonnegative
3. Local Support -- Ri,p(u) is a non-zero on [ui,ui+p+1)
4. On any knot span [ui, ui+1) at most p+1 degree p basis functions are non-zero.
5. Partition of Unity -- The sum of all non-zero degree pbasis functions on span [ui, ui+1) is 1:
Properties of NURBS Basis Function6. If the number of knots is m+1, the degree of the basis
functions is p, and the number of degree p basis functions is n+1, then m = n + p + 1 :
7. Basis function Ri,p(u) is a composite curve of degree prational functions with joining points at knots in [ui, ui+p+1 )
8. At a knot of multiplicity k, basis function Ri,p(u) is Cp-k
continuous.
9. If wi = c for all i, where c is a non-zero constant, Ri,p(u) = Ni,p(u)
Propertiesof
NURBS NURBS Curves
Properties of NURBS Curves1. NURBS curve C(u) is a piecewise curve with each
component a degree p rational curve.
2. Equality m = n + p + 1 must be satisfied .
3. A clamped NURBS curve C(u) passes through the two end control points P0 and Pn
4. Strong Convex Hull Property
5. Local Modification Scheme6. C(u) is Cp-k continuous at a knot of multiplicity k
7. B-spline Curves and Bézier Curves Are Special Cases of NURBS Curves
Properties of NURBS Curves8. Modifying Weights: increasing the value of wi will
pull the curve toward control point Pi
a NURBS curve of degree 6and its NURBS basis functions. The selected control point is P9.
Properties of NURBS Curves Modifying Weights: decreasing the value of wi will pushthe curve away from control point Pi
If a weight becomes zero, the coefficient of Pi is zero and, control point Pi has no impact on the computation of C(u) for any u (i.e., Pi is "disabled").
Properties of NURBS Curves
A NURBS curve of degree 6defined by 9 control points (n = 8) and 16 knots (m = 15) .The selected control point is P4. Since the coefficient of P4, N4,6(u), is non-zero on [u4, u4+6+1) = [0,1),changing w4 affects the entire curve!
Rational Bézier Curves
Rational Bézier Curves We have learned that projecting a 4-dimensional B-spline curve to hyperplane w=1 yields a 3-dimensional NURBS curve.
What if this B-spline curve is a Bézier curve?
The result is a Rational BRational Béézierzier curve!
Rational Bézier Curves Since a rational Bézier curve is a special case of NURBS curves, rational Bézier curves satisfy all important properties that NURBS curves have.
since there is no internal knots, rational Bézier curves do not have the local modification property, which means modifying a control point or its weight will cause a global change
∑=
=n
iini uRu
0, )()( PC ∑ =
= n
j jjn
inini
wuB
wuBuR
0 ,
,,
)(
)()(
Rational Bézier Curves
Modifying the weight of a control point will push or pull the curve away from
or toward the control point.
∑=
=n
iini uRu
0, )()( PC ∑ =
= n
j jjn
inini
wuB
wuBuR
0 ,
,,
)(
)()(
Rational Bézier Curves:Conic Sections
Rational Bézier Curves: Conic Sections we use rational Bézier curve of degree 2, the coefficients are :
22,2
1,2
20,2
)()1(2)(
)1()(
uuBuuuB
uuB
=−=−=
∑ =
= n
j jjn
inini
wuB
wuBuR
0 ,
,,
)(
)()(
∑=
=n
iini uRu
0, )()( PC
Rational Bézier Curves: Conic Sections
The equation of this rational Bézier curve of degree 2 is :
( )210 PPPC 2222 )1(2)1(
)1(2)1(1)( uuwuu
uuwuuu +−+−
+−+−=
10,1
<≤−
= rr
rw
r=0W=0
Straight line
r<1/2W<1Ellipse
r=1/2W=1Parabola
r>1/2W>1Hyperbola
P0=1P1=wP2=1
Rational Bézier Curves: Conic Sections
r=0W=0
Straight line
r<1/2W<1Ellipse r=1/2W=1Parabola r>1/2W>1Hyperbola
P0=1P1=wP2=1
Rational Bézier Curves: Conic Sections
Circular Arcs and Circles
)sin(aw = Weights w is equal to the sine of the half ngle at control point P1
Rational Bézier Curves: Conic Sections
Quarter Circle: P1=90º, a=45º,
22)45sin( == ow
Rational Bézier Curves: Conic Sections
1/3 Circle: P1=60º, a=30º,
21)30sin( == ow
Rational Bézier Curves: Conic Sections
Full Circle:
⎥⎦⎤
⎢⎣⎡= 1,1,1,
32,
32,
32,
31,
31,
31,0,0,0U ⎥⎦
⎤⎢⎣⎡= 1,1,1,
43,
43,
21,
21,
41,
41,0,0,0U