You are on page 1of 28

M2-6: Modeling Non-uniform

Rational B-spline Curves (NURBS)

Dr. Srinivasa Prakash Regalla, PhD


Professor, Department of Mechanical Engineering
BITS-Pilani, Hyderabad Campus

ME/MF F342:
COMPUTER AIDED DESIGN
Learning Outcomes in this Segment

 Need for NURBS

 The rational forms of parametric equation of synthetic curves


 Flexibilities offered exclusively offered by NURBS
BITS Pilani
Hyderabad Campus

Need for NURBS


NURBS integrates free-form surface
patches

 NURBS provides a unified or integrated approach to


represent the curve segments and surface patches of objects
 NURBS is used almost exclusively by all CAD/CAM systems
for geometric entities
BITS Pilani, Hyderabad Campus
NURBS are Rational Curves
 A rational curve is defied by the P (u )  n
wi N i ,k (u )
Pi  Ri ,k Pi
algebraic ratio of two  wi Ni,k (u )
polynomials. Example is i 0

NURBS. where wi  weights;


N i ,k (u )  non - rational polynomial
 Non-rational curve is defined
basis functions
by one polynomial. Example is
Ri ,k  Rationalized polynomial
regular B-spline.
basis functions
 NURBS was invented by
Boeing in 1970s; first
commercial NURBS modeler
by SDRC in 1983

BITS Pilani, Hyderabad Campus


BITS-Pilani, Hyderabad Campus
Advantages of NURBS

 Any curve/surface, synthetic or analytic,


can be formulated by NURBS
 Due to unification of all curves and
surfaces using NURBS, it enables easy
transfer of CAD model from one CAD
system to another using neutral formats
such as IGES or STEP
 Manufacturing and machining accuracy
are enhanced
 NURBS are invariant under both affine
and perspective transformations (non-
rational forms are invariant only under
affine transformations)

BITS Pilani, Hyderabad Campus


Parametric Equation of NURBS curve

The rational B - Spline curve defined for (n  1) control points Pi .


Its parametric form is given as follows.
n
P(u )   Pi Ri ,k (u ) 0  u  umax
i 0

Ri ,k (u ) are the rational B - Spline basis functions and are given by


wi N i ,k (u ) P2
Ri ,k (u )  n P0
 wi Ni,k (u)
i 0

If we substitute wi  1, Ri ,k (u )  N i ,k (u ) P1 P3

The choice of the W  [ w0 w1 w2 w3 ... wn ]T vector controls the behaviour of


the curve.
BITS Pilani, Hyderabad Campus
NURBS curve
P2
 NURBS curve degree = k-1
P0
 P0, P1,..Pn – control points
 Knot vector u = (u0, u1…um)
 W= (w0, w1…wm) – weights
 non negative P3
 The number of control P1
points and the number of
weights must agree  one
weight value associated
with each control point
 Use homogenous
coordinates

BITS Pilani, Hyderabad Campus


Exercise:

Prove that if all wi are set to the value 1 or all wi have the
same value then we have the standard B-Spline curve.

The rational B - Spline curve defined for (n  1) control points Pi .


Its parametric form is given as follows.
n w0 N 0,k (u ) w1 N1,k (u ) wn N n,k (u )
P(u )   Pi Ri ,k (u )  n
P0  n
P1  ...  n
Pn , 0  u  umax
i 0
 wi Ni,k (u)  w1N1,k (u )  wn N n,k (u)
i 0 i 0 i 0
For w0  w1  ....  wn  constant  C P2
P0
 
 
C  N 0,k (u ) N1,k (u ) N n,k (u ) P3
P(u )  P0  n P1  ...  n Pn , 0  u  umax P1
C n

  i ,k
N (u )  1,kN (u )  n ,k
N (u ) 
 i 0 i 0 i 0 
P(u )  N 0,k (u ) P0  N1,k (u ) P1  ...  N n,k (u ) Pn , 0  u  umax

BITS Pilani, Hyderabad Campus


NURBS: Properties of rational B-spline
basis functions
NURBS have all properties of B-Spline:
P2
P0
 Partition of unity,

P1 P3
 Positivity,

 local support, and

 (k-2) order of continuous differentiability

 Generality, for all wi equal to one constant

BITS Pilani, Hyderabad Campus


NURBS: Special properties

 NURBS equations can exactly P2


represent the conic curves (lines, P0
circles, ellipse, parabola…)
 Projective invariance: Projective
transformation of NURBS curve P3
can be obtained by the projective P1
images of its control polygon
without distortion
 Bézier curves and B-spline curves
only satisfy the affine invariance
property but not this projective
invariance property.

BITS Pilani, Hyderabad Campus


NURBS: Knot Vector

 NURBS use two types of knot vector: (1) Uniform, (2) Non-uniform
(1)

BITS Pilani, Hyderabad Campus


NURBS : modifying weights
• increasing the value of wi will pull the curve toward control
point Pi. In fact, all affected points on the curve will also be
pulled in the direction to Pi
• When wi approaches infinity, the curve will pass through
control point Pi
• decreasing the value of wi will push the curve away from
control point Pi

BITS-Pilani, Hyderabad Campus


NURBS : modifying weights

BITS-Pilani, Hyderabad Campus


NURBS
Exercise
When all weights are equal in NURBS, the following is the consequence:

(A) The NURBS curve becomes straightline


(B) The NURBS curve becomes a n ordinary B-spline
(C) The NURBS curve becomes fully interpolating
(D) The NURBS curve will lose C1 continuity
BITS Pilani
Hyderabad Campus

(2) Using Non-uniform knot vector


NURBS : circle/arc
• NURBS equations represents the circle
– Consider a half circle
– Split the half circle into two circular arcs -1 and 2
(actually many ways)

P2
P3 P1
2 1
P4 P0

BITS-Pilani, Hyderabad Campus


NURBS : circle/arc
• Consider arc 1
• Conic section (quadratic) – degree = 2
• 3 control points, P0= (1,0) ,P1 =(1,1), P2 = (0,1)
• (n+1) = 3, n=2, (k -1) = 2, k=3, n+k+1=6, n-k+2=1
• Knot values are (0,0,0,1,1,1)
• Weights w0 =1 w1 = cos  = cos 45 = 1/2 w2=1

P2

P1
1
P0
BITS-Pilani, Hyderabad Campus
NURBS : semi-circle/arc
• Composite curve (arc 1 and arc 2)
• P0= (1,0) ,P1 =(1,1), P2 = (0,1),P3 =(-1,1), P4 = (-1,0)
• Weights w0 =1 w1 = 1/2 w2=1, w3 = 1/2, w4=1
k = 3, n= 4 number of knot = 8
Non-uniform knot vector:
 (0, 0, 0,1, 1, 2, 2, 2)

P2
P3 P1
2 1
P4 P0 BITS-Pilani, Hyderabad Campus
NURBS : circle
• So, for a circle
P2
P3 P1
2 1
P4 P0 P8

P5 P7
P6

• P0= P8= (1,0) ,P1 =(1,1), P2 = (0,1),P3 =(-1,1),P4 = (-1,0),


P5 =(-1,-1), P6 =(0,-1), P7 =(1,-1)
• Weights w0 =1 w1 = 1/2 w2=1, w3 = 1/2, w4=1
k = 3, n= 8 number of knot = 12
 (0, 0, 0,1, 1, 2, 2, 3, 3, 4, 4, 4)
BITS-Pilani, Hyderabad Campus
NURBS : circle

• Other way  split into 3 arcs


 = 60
P3

P2 P4

P1  P5
P0

BITS-Pilani, Hyderabad Campus


NURBS : circle

• show that NURBS equations exactly represent the


circle
• Consider arc 1
• NURBS equation is
– P(u) =  wiNi,k(u)pi
–  wiNi,k(u)
• P(u) = w0P0N0, 3(u) + w1P1N1, 3(u) + w2P2N2, 3(u)
• w0N0, 3(u) + w1N1, 3(u) + w2N2, 3(u)
BITS-Pilani, Hyderabad Campus
NURBS : circle
• w0 = w2 =1, w1 = 2 /2 = 1/2
• N0, 3= (1-u) 2, N1, 3= 2u(1-u), N2, 3= u2
• P(u) = P0 (1-u) 2 +(2 /2)[P1 2u(1-u)]+ P2 u2
• (1-u) 2 +(2 /2)[ 2u(1-u)]+ u2
• P0 = [1,0,1] P1 = [1,1,1], P2 = [0,1,1]  homogenous
• x(u) = (1- 2) u2 +2 (1-2)u + 1
• (2- 2) u2 +(2-2)u + 1
• y(u) = ( 1- 2) u2 +2u .
• (2- 2) u2 +(2-2)u + 1
• x(u) 2 + y(u) 2 = 1 - circle radius 1  prove!!
BITS-Pilani, Hyderabad Campus
Calculation of Rational B-spline Curves

• Consider the control polygon given by the vertices


P1[ 0 0 ], P2[ 1 2 ], P3[ 5/2 0 ], P4[ 4 2 ], P5[ 5 0 ]
Determine the point at u= 3/2 for the quadratic (k = 3) non-
periodic rational B-spline curve with homogeneous
weighting factors given by
[W ] = [1 1 w3 1 1], w3 = 0, 1/4, 1, 5.

I/C, Regalla Srinivasa Prakash 26


• The knot vector is [0 0 0 1 2 3 3 3].
• The parameter range is 0≤u ≤ 3.
• The curves are composed of three piecewise
rational quadratics, one for each of the interior
intervals in the knot vector.

I/C, Regalla Srinivasa Prakash 27


End of the module
• Thank you!
• Any Questions?

BITS-Pilani, Hyderabad Campus

You might also like