Sie sind auf Seite 1von 12

1

Wolfgang Heidrich & Alla Sheffer


CPSC 424
Bzier Curves
Wolfgang Heidrich & Alla Sheffer
Syllabus
Curves in 2D and 3D
Implicit vs. Explicit vs. Parametric curves
Bzier curves, Polar forms, de Casteljau algorithm
Continuity
B-Splines
Subdivision Curves
Properties of Curves and Surfaces
Surfaces
2
Wolfgang Heidrich & Alla Sheffer
Curves & Surfaces as
Parametric Functions
Concept:
Curve as function of artificial time parameter t
2D curve:
3D curve:
2
R R : ); ( :
) (
) (
F t F
t F
t F
y
x
y
x
=
|
|
.
|

\
|
=
|
|
.
|

\
|
3
R R : ); ( :
) (
) (
) (
F t F
t F
t F
t F
z
y
x
z
y
x
=
|
|
|
.
|

\
|
=
|
|
|
.
|

\
|
Wolfgang Heidrich & Alla Sheffer
Parametric Curves
Advantage:
Arbitrary curves in arbitrary dimensions
Still a problem:
Unintuitive
Try to find a formula for a specific curve you have
in mind!
Hard to program with
Deal with arbitrary mathematical functions
Solution:
Restrict yourself to specific class of functions
3
Wolfgang Heidrich & Alla Sheffer
Parametric Curves
Commonly used classes:
Polynomials
Bzier curves, Hermite interpolation etc.
Piecewise polynomials
B-splines
Rational and piecewise-rational curves
Rational Bzier curves, rational B-splines (NURBS)
Wolfgang Heidrich & Alla Sheffer
Polynomial Curves
Polynomial Curves:
Restrict to polynomial functions of degree s m:
Note: b
i
are vectors!
Example curve in 2D:

=
=
m
i
i
i
t
0
b x

=
|
|
.
|

\
|
=
|
|
.
|

\
|
m
i
i
i y
i x
t
b
b
y
x
0 ,
,
4
Wolfgang Heidrich & Alla Sheffer
Polynomial Curves
Advantages:
Computationally easy to handle
b
0
b
m
uniquely describe curve (finite storage,
easy to represent)
Disadvantages:
Not all shapes representable
Partially fix with piecewise functions later (splines)
Still not very intuitive
Fix: represent polynomials in different basis
Wolfgang Heidrich & Alla Sheffer
Polynomial Bases: Monomials
Monomials - one common basis
Problem: relationship between this basis and
geometric shape is unintuitive
Thus: use another!
} , , , , 1 {
2 m
x x x
5
Wolfgang Heidrich & Alla Sheffer
Assign GEOMETRIC meaning to
coefficients (base)
Approximate/interpolate set of positions,
derivatives, etc..
Wolfgang Heidrich & Alla Sheffer
Interpolate Control Points:
Lagrange Polynomials
Use points we want to interpolate as basis
Polynomial degree =number of input points
Show Applet
6
Wolfgang Heidrich & Alla Sheffer
Basis Functions:
Lagrange Polynomials
Given: m+1 parameter values t
0
t
m
Define
Clear from definition:
All L
i
m
are polynomials of degree m

In particular, all L
i
m
are linearly independent!
m i
t t
t t
t L
i j m j
j i
j m
i
... 0 ; : ) (
, .. 0
=

=
[
= =

=
=
else
k i
t L
k
m
i
; 0
; 1
) (
Wolfgang Heidrich & Alla Sheffer
Lagrangr Polynomials (cont)
L
i
m
are linearly independent & there are m+1 of them - basis for
polynomials of degree up to m
Can write any polynomial of degree up to m as
In addition, we have for all i:
In other words, the polynomial interpolates the points (t
i
, b
i
)
i
m
i
j
m
i
b t L t F =

=0
) ( ) (
i i
b t F = ) (
7
Wolfgang Heidrich & Alla Sheffer
Geometrically-oriented coefficients
2 positions +2 tangents
Require F(0)=P
0
, F(1) = P
1
, F(0)=T
0
, F(1)=T
1
Define basis function per requirement
Other Option: Hermite Cubic Basis
) ( ) ( ) ( ) ( ) (
11 1 10 0 01 1 00 0
t h T t h T t h P t h P t F + + + =
Wolfgang Heidrich & Alla Sheffer
To enforce C(0)=P
0
, C(1) = P
1
, C(0)=T
0
, C(1)=T
1
basis
should satisfy
Hermite Basis Functions
] 1 , 0 [ , 1 , 0 , : ) ( e = t j i t h
ij
curve F(0) F(1) F(0) F(1)
1
1
1
1
0
0
0 0
0
0 0
0
0
0
0
0
h t
00
( )
h t
01
( )
h t
10
( )
h t
11
( )
) ( ) ( ) ( ) ( ) (
11 1 10 0 01 1 00 0
t h T t h T t h P t h P t F + + + =
8
Wolfgang Heidrich & Alla Sheffer
Can satisfy with cubic polynomials as basis
Obtain - solve 4 linear equations in 4
unknowns for each basis function
Hermite Cubic Basis
0 1
2
2
3
3
) ( a t a t a t a t h
ij
+ + + =
] 1 , 0 [ , 1 , 0 , : ) ( e = t j i t h
ij
curve F(0) F(1) F(0) F(1)
1
1
1
1
0
0
0 0
0
0 0
0
0
0
0
0
h t
00
( )
h t
01
( )
h t
10
( )
h t
11
( )
Wolfgang Heidrich & Alla Sheffer
Four polynomials that satisfy the
conditions
Hermite Cubic Basis
) 1 ( ) ( ) 1 ( ) (
) 3 2 ( ) ( 1 ) 3 2 ( ) (
2
11
2
10
2
01
2
00
= =
= + =
t t t h t t t h
t t t h t t t h
t
h
h
00
h
11
h
01
h
10
hermite
9
Wolfgang Heidrich & Alla Sheffer
Bzier Curves
Definition:
Bzier curve is a polynomial curve that uses
Bernstein polynomials as basis
b
i
are called control points of Bzier curve
Control polygon obtained by connecting control points
with line segments
Advantage of Bzier curves:
Control points & control polygon have clear geometric
meaning and are intuitive to use

=
=
m
i
m
i i
t B t F
0
) ( ) ( b
Wolfgang Heidrich & Alla Sheffer
Bernstein Polynomials
Graph for degree m=1:
! )! (
!
], 1 , 0 [ ; .. 0 ; ) 1 ( : ) (
i i m
m
i
m
t m i t t
i
m
t B
i m i m
i

=
|
|
.
|

\
|
e =
|
|
.
|

\
|
=

10
Wolfgang Heidrich & Alla Sheffer
Bernstein Polynomials
Graph for m=2:
Graph for m=3:
Wolfgang Heidrich & Alla Sheffer
Bernstein Polynomials
Properties:
B
i
m
(t) is a polynomial of degree m

B
i
m
(t)= B
m-i
m
(1-t)
] 1 , 0 [ ; .. 0 ; ) 1 ( : ) ( e =
|
|
.
|

\
|
=

t m i t t
i
m
t B
i m i m
i
B
i
m
(t)>0 for t e[0,1];B
0
m
(0) =1;B
i
m
(0) =0 for i =0
11
Wolfgang Heidrich & Alla Sheffer
Bernstein Polynomials
Properties:
B
i
m
(t) has exactly one maximum in the interval 0..1. It
is at t=i/m (proof: compute derivative)
W/o proof: all (m+1) functions B
i
m
are linearly
independent
Thus they form a basis for all polynomials of
degree s m
] 1 , 0 [ ; .. 0 ; ) 1 ( : ) ( e =
|
|
.
|

\
|
=

t m i t t
i
m
t B
i m i m
i
Wolfgang Heidrich & Alla Sheffer
Bernstein Polynomials
More properties

(proof: apply Binomial Theorem to definition)

(proof on board)
Important (later) for fast evaluation algorithm of Bzier
curves (de Casteljau algorithm)
) ( ) 1 ( ) ( ) (
1 1
1
t B t t B t t B
m
i
m
i
m
i

+ =
1 )) 1 ( ( ) (
0
+ =

=
m
m
i
m
i
t t t B
12
Wolfgang Heidrich & Alla Sheffer
Properties of Bzier Curves
(Pierre Bzier, Renault, about 1970)
Easy to see:
Endpoints b
0
and b
m
of control polygon interpolated &
corresponding parameter values are t=0 and t=1
Without proof for the moment (will be easier
to show later):
Bzier curve is tangential to control polygon at
endpoints
Curve lies within convex hull of control points
Curve is affine invariant
There is a fast, recursive evaluation algorithm

Das könnte Ihnen auch gefallen