You are on page 1of 46

C 2 Approximating Splines

p 3 p 4

p
p 2
5

p p 6
1

p 7

p 0
p 8
Uniform B-Spline
B-spline control points: p0 ::: pn

Piecewise Bezier curves with C


2 continuity at joints
Bezier control points:
v1 = 2p1 3+ p2
p + 2p2
v2 = 1
3

v0 = 21 ( p0 +3 2p1 + 2p1 3+ p2 )
= 16 (p0 + 4p1 + p2)
1
v3 = (p1 + 4p2 + p3)
6
In general, i-th segment of B-splines is determined by
pi pi+1 pi+2 pi+3

v1 =
2 p +1 + p +2
3
i i

p +1 + 2p +2
v2 =
3
i i

1
v0 = (p + 4p +1 + p +2)
6 i i i

1
v3 = (p +1 + 4p +2 + p +3)
6 i i i

In matrix form
2 3 2 32 3
v0 1 4 1 0 pi
= 61 00 4 2 0
6
6 v1 7
7 66 77 66 p 77
75 64 i+1
6
4 v2
7
5 64
2 4 0 pi+2
75
v3 0 1 4 1 pi+3

Question: how many bezier segments???


From B-Splines to Bezier
B-Spline Properties
C continuity
2

Approximation
Local control
Each segment are determined by four control points
Convex hull
Questions: what happens if we put more than one
control points in the same location???
{ double vertices
{ triple vertices
{ collinear vertices
End conditions
{ double endpoint: curve will be tangent to line
between rst distinct points
{ triple endpoint: curve interpolate endpoint, start w
a line segment
Display B-splines: transform it to Bezier curves
Catmull-Rom Splines
Keep interpolation
Give up 2 continuity
C

Control tangents locally


Idea: Bezier curve between successive points
How to determine two internal vertices: v1 v2
c(0) = p = v0 i

c(1) = p +1 = v3
i

c (0) = +1 2 ;1 = 3(v1 ; v0)


0 p pi ; i

c (1) = +22 = 3(v3 ; v2)


0 p pi ; i

v1 = +1 6
p +6p p ;1
i i; i

v2 =
; p +2+6p +1+p
i i i
6
In matrix form
2 3 2 32 3
v0 0 6 0 0 pi;1
= 61 01 6 1 0
6
6 v1 7
7 66 ; 77 66 p 77
6
4 v2
7
5 64
1 6 ;1 75 64 i 75
pi+1
v3 0 0 6 0 pi+2

Problem: boundary conditions


Properties: 1, interpolation, local control,
C

non-convex-hull
Catmull-Rom Splines

v 1
v 2

v 0
v 3

p
p i
i+1

p i−1 p i+2
B-Splines
Mathematics
X
( )= ()
n

c u piBi k u
i=0

Control points: p i

Basis functions of degree ; 1: ( ) k Bi k u

Piecewise polynomials
How to formulate ( ) Bi k u

First we introduce a knot sequence (n+k+1) in a


non-decreasing order
u 0 u1 u 2 ::: un +k

The basis function are dened recursively


(
( ) = 1 = +1
0
ui < u < ui
Bi 1 u
otherwise
( )=
Bi k u
u ; ui
ui+k ;1 ; ui
Bi k ; 1 ( )+
u
ui+k ; u B
ui+k ; ui+1
i+1 k ;1 ()
u

The parametric domain of B-spline is:


u in uk ; 1 un+1 ]
B-spline Curves
Curve: c( ) = =0 p ( )
u
Pn
i i Bi k u

Parametric variable: u

n+ 1 control points: p i

n+ + 1 non-decreasing knots:
k u 0  u1  : : :  un+k

Basis functions of degree ; 1: k Bi k u()


Parametric domain: 1  
uk ; u +1
un
Piecewise B-splines

Control Points

Knots
B-spline Example
p 2
n=7 p 6

p k=4
1
p 5

p 3

p
p
7

p
0
4

u 0 u 3
u 8 u 11
B-Spline Properties
c( ): piecewise polynomial of degree
u k ; 1
Continuity at joints: 2
C
k;

n + 1 control points
n + 1 basis (blending) functions
( ) is dened over
+ ], which includes + 1
Bi k u ui ui k

knots and sub-intervals


k

n + + 1 knots
k

Knot sequence divide the parametric axis into + n k

sub-intervals
Parametric domain:
1 +1]
uk ; un

There are ( + 1) ; ( ; 1) = ; + 2 sub-intervals wit


n k n k

the parametric domain


There are ; + 2 piecewise polynomials
n k

Each curve span is in


uenced by control points
k

Each control points at most a ects curve spans


k

Local control!!!
Convex hull
The degree of B-spline polynomial can be independen
from the the number of control point
Compare B-spline with Bezier!!!
Key components: control points, basis functions, orde
knots, parametric domain, local vs. global control,
continuity
Basis Functions
Linear examples
(
0 2( ) = 2 ;

0 1]
2

1 2]
u u
B u
u u 2

(
;1 2
1 2]
B 12 (u) = 3 ; 2
2 3]
u

u
u

(
;2 2
2 3]
B 22 (u) = 4 ; 2
3 4]
u

u
u

How does it look like???


Quadric examples
8
>
>
<
1 u2
2
0 1] u 2
0 3( ) = (2 ) + 12 (3 ; )( ; 1)
1 2]
1u ; u u 2
B u
> 2 u u
>
:(3 )
1 ;u 2
2
2 3] u 2

8
< 2 ( ; 1) 2
1 2]
>
> 1 u
2 u

1 3( ) = > 2 ( ; 1)(3 ; ) + 2 (4 ; )( ; 2) 2
2 3]
B u
1 u u
1 u u u
: 1 (4 ; )2
>
2
3 4]
2 u u
How does it look like???
Cubic example
81 3
>
>
> 6u
>
<1 2
( ) = >> 6 ( (2 ; ) + (3 ; )( ; 1) + (4 ; )( ; 1)2
u u u u u u u
B 04 u
>
>
1
6 ( (3 ; )2 + (4 ; )( ; 1)(3 ; ) + (4 ; )2(
u u u u u u
: 1
6 (4 ; )3
u
B-spline Basis Functions
One example: quadratic
Knot vector:
0 1 2 3 4 5 6]
8
>
>
<
1 u2
2 for 0  u < 1
B 03 ( )=
u
> (2 ) + 21 ( ; 1)(3 ;
1u ; u
2 u u) for 1  u < 2
>
:(3 )
1 ;u 2
2 for 2  u < 3
8
< 2 ( ; 1) for 1 
>
> 1 u
2 u <

1 3( ) = > 2 ( ; 1)(3 ; ) + 2 ( ; 2)(4 ; ) for 2 


B u
1 u u
1 u u u <
: 1 (4 ; )2
>
for 3 
2 u u <

B 2 3( ) =
u :::

B 3 3( ) =
u :::
B-spline Basis Functions
(
( ) = 1 for  +1
0 otherwise
ui u < ui
Bi 1u

Bi k u( ) = + ;1
ui
u;ui

k ;ui1( ) + +
Bi k ;
+u
ui
ui
k ;u
k ;ui+1 B +1
i k; 1 ()
u :
Basis Functions

B 0,1 B 1,1 B 2,1 B 3,1 B 4,1 B 5,1 B 6,1

B 0,2 B 1,2 B 2,2 B 3,2 B 4,2 B 5,2

B 0,3 B 1,3 B 2,3 B 3,3 B 4,3

B 0,4 B 1,4 B 2,4 B 3,4

0 1 2 3 4 5 6 7
B-Spline Basis Functions
B-spline Properties
Control points and basis functions: + 1
n

Degree of basis functions: ; 1


k

Partition of unity, positivity, and recursive evaluation


basis functions
The degree is independent of the number of control
points
The curve is ( 2) continuous in general
C
k;

Local control
Special case: Bezier splines
Ecient algorithms & tools
{ evaluation
{ knot insertion
{ degree elevation
{ derivative, integration
{ continuity
Composite Bezier curves for B-splines
Another formulation
Uniform B-spline
Matrix representation
Normalization to 2
0 1]
u

End-point positions and tangents


1
c(0) = (p0 + 4p1 + p2)
6
1
c(1) = (p1 + 4p2 + p3)
6
1
c (0) = (p2 ; p0)
2
0

1
c (1) = (p3 ; p1)
2
0

2 3
c(0)
66 c(1) 77
c( ) =
c (0) 5
u U Mh 640 7
0
c (1)
2 3
p0
6 77
= 06
U Mh M 6
4
p1
p2
75
p3
= UM p

Basis matrix
2 3
1 3 ;3 1
;
= 61 33 ;06 33 00
66 77
M 64 75
;
1 4 1 0
Basis functions ( 2
0 1]):
u

( ) = 1 (1 ; )3
B04 u
6 u

( ) = 1 (3 3 ; 6 2 + 4)
14
B u
6 u u

( ) = 1 ( ;3 3 + 3 2 + 3 + 1)
24
B u
6 u u u

( ) = 1 3
B34 u
6 u
Uniform B-Spline
p 1 p 2

p 0

p
Uniform B−Spline 3
B-Spline Rendering
Transform it to a set of Bezier curves
Display B-Spline (fp0 p g)
::: n

For = 0 to ; + 1 do
i n k

Convert i-span controlled by p p+ ::: 1 into a bezie


curve represented by v0 v 1
i i k;

::: k;

Display Bezier Curve (fv0 v 1g)


::: k;
From B-splines to NURBS
What are NURBS???
Non Uniform Rational B-Splines (NURBS)
Rational curve motivation
Polynomial-based splines can not represent
commonly-used analytic shapes such as conic sections
circles, ellipses, parabolas
Rational splines can achieve this goal
NURBS are a unied representation
{ polynomial, conic section, etc
{ industry standard
NURBS Mathematics
c( )=
Pn
i=0
piwiBi k ()
u
u Pn
i=0 wiBi k ()
u
Geometric Meaning | Projection!
B-splines 2 3
pi xwi
X 66 77
( )= pi y wi
()
n

c u 64 75 Bi k u
i=0
pi z wi
wi

Homogeneous representation
2 3
( ) X" #
() =
x u
6 77
6 p
()
n

()
y u i wi
6
4 75 Bi k u
w
()
z u
=0 i
i

w u

NURBS is obtained from projection


Properties of NURBS: represent standard shapes,
invariant under perspective projection B-spline is a
special case, weights as extra degrees of freedom,
common analytic shapes such as circles, clear geomet
meaning of weights
Rational Bezier Curve
From B-splines to NURBS
NURBS Weights
NURBS Properties
Generalization of B-splines and Bezier splines
Unied formulation for free-form and analytic shapes
Weights as extra DOFs
Various smoothness requirements
Powerful geometric toolkits
Ecient and fast evaluation algorithm
Invariance under standard transformations
Composite curves
Continuity conditions
NURBS Circle
NURBS for Analytic Shapes
Conic Sections
Natural quadrics
Extruded surfaces
Ruled surfaces
Surfaces of revolution
Cardinal Splines
Four vertices: v0, v1, v2, and v3,
c(0) = v1, c(1) = v2,

c(1)(0) = 12 (1 ; )(v2 ; v0),




c(1) (1) = 12 (1 ; )(v3 ; v1)




Special case: Catmull-Rom splines when = 0

More general case: Kochanek-Bartels splines


{ tension, bias, continuity parameters
Cardinal Splines
Kochanek-Bartels Splines
Four vertices: v0, v1, v2, and v3
c(0) = v1, c(1) = v2,

c(1) (0) =
1 (1 ; )
(1 + )(1 ; )(v ; v ) + (1 ; )(1 + )(v ; v )]
2    1 0   2 1

c(1)(1) =
1 (1 ; )
(1 + )(1 + )(v ; v ) + (1 ; )(1 ; )(v ; v )]
2    2 1   3 2

Tension parameter: 

Bias parameter: 

Continuity parameter: 
Summary
Parametric curves and surfaces
Polynomials and rational polynomials
Free-form curves and surfaces
Other commonly used geometric primitives sphere,
ellipsoid, torus, superquadrics, blobby
Motivation: fewer degrees of freedom more geometri
coverage
Interpolation Splines
Approximation Splines
Interpolation/Approximation
Natural C 2 Cubic Splines
A set of piecewise cubic polynomials
C
2 continuity at each vertex
2 3
()
c( )= ()
x u
64 7
5
()
i u y u

z u
Natural C 2 Cubic Splines
From Curve to Surface

You might also like