Download as pdf or txt
Download as pdf or txt
You are on page 1of 47

BEZIER CURVES

Dr. Regalla Srinivasa Prakash

I/C, Regalla Srinivasa Prakash

Bezier Curves
A
Approximator
i t
Adds
Add flexibility
fl ibilit and
d intuitive
i t iti
f l in
feel
i
mechanical design
Credited to P. Bezier; P. De Casteljau also developed
independently
Only control points (not necessarily only 2 per segment)
f
form
the
h input,
i
no specification
ifi i
off tangent vectors
provides more direct relation between input (points) and
output
p ((curve))
The order of the Bezier is variable (unlike HCC) and
depends on the number of control points, (n+1)
(n+1) number of control points define an nthh degree
curve (we will term degree of curve as (k-1)
Bezier curve can be smoother than HCC
I/C, Regalla Srinivasa Prakash

The Bezier curve is defined in terms of (n+1)


control points,
points called as control points
These control points form the vertices of the
control or Bezier characteristic polygon
The control or Bezier characteristic polygon
uniquely defines the curve

I/C, Regalla Srinivasa Prakash

The curve shape tends to follow the


polygon shape and thus easy to guess
and sketch

Order of the control points is very essential


because changing the order can change
the shape of the curve

I/C, Regalla Srinivasa Prakash

Bezier Curve
The user supplies ((n+1)) control points, Pi
Write the curve as:
n

P(u ) = Pi Bi ,n (u )

0 u 1

i =0

n i
n i
Bi ,n (u ) = C u (1 u )
i
where the binomial coefficient
n
n!
C or C (n, i ) =
i!(n i )!
i
I/C, Regalla Srinivasa Prakash

The functions Bi,n


are the Bernstein
polynomials
p
y
of degree
g
((k-1)=n
)
We can write the complete form of Bezier curve
while observing
g that C(n,0)=C(n,n)=1
( , ) ( , )
P(u ) = Po (1 u ) n + P1C (n,1)u (1 u ) n 1 + P2C (n,2)u 2 (1 u ) n 2 +
... + Pn1C (n, n 1)u n 1 (1 u ) + Pnu n

0 u 1

Special case,
case 3 control points
B(u) = P0 * ( 1 - u ) 2 + P1 * 2 * u ( 1 - u ) + P2 u2
Special case, 4 control points
B(u) = P0 * ( 1 - u )3 + P1 * 3 * u * ( 1 - u )2 + P2 * 3 * u2 * ( 1 - u ) + P3 * u3
I/C, Regalla Srinivasa Prakash

P(u ) = Po (1 u ) n + P1C (n,1)u (1 u ) n 1 + P2C (n,2)u 2 (1 u ) n 2 +


... + Pn1C (n, n 1)u n 1 (1 u ) + Pnu n

0 u 1

Substitute u=0 and u=1,?


The curve is tangent to the first and last
segments
of
control
polygonal
segments proof?
segmentsproof?
Deriving the parametric form r times
r
n
!
r i
(
)
Pr (u = 0) =

1
C (r , i ) Pi

(n r )! i =0
r
n
!
i
(
)
Pr (u = 1) =

1
C (r , i ) Pn i

(n r )! i =0=0
I/C, Regalla Srinivasa Prakash

Bezier Basis Functions for (n+1)=4


(n 1) 4
1.2
1
0.8

B0
B1
B2
B3

0.6
0.4
0
0.2
0

I/C, Regalla Srinivasa Prakash

Some Bezier Curves

What did
you
observe?

I/C, Regalla Srinivasa Prakash

Characteristics of Bezier Curve


1) The curve interpolates the first and last
control points.
points
It passes through Po and Pn if we
substitute u=0 and u=1

I/C, Regalla Srinivasa Prakash

10

2) The curve is tangent to the first and last


g
of the control p
polygon.
yg
curve segments
n! r
r i
(
)
P (u = 0) =

1
C (r , i ) Pi

(n r )! i =0
r

r
n
!
i
(
)
Pr (u = 1) =

1
C (r , i ) Pn i

(n r )! i =0
Substituting r = 1, the first derivatives at the endpoints are

P' (u = 0) = n(P1 Po )
P' (u = 1) = n(Pn Pn1 )

Can you find the second derivative at P0? What


do you observe?
Ans: It is determined by
y Po, P1 and P2. In g
general,, the rth derivative at
an endpoint is determined by its r neighbouring control points.
I/C, Regalla Srinivasa Prakash

11

3) The curve is symmetric with respect to u and


(1 )
(1-u).
That
is,
reversing
the
direction
of
parametrization does not change the curve
shape. To check this property substitute 1-u = v.
y
y of the Bezier curve is due to the
The symmetry
symmetry (NOT equality) of the Bernstein basis,
which in turn is due to the property of the
binomial functions: C(n,
C(n i) = C(n,
C(n n-i)
n i)
Which makes Bi,n(u) and Bn-i,n(u) to be symmetric
when plotted with respect to u.
Be careful, Bi,n(u) Bn-i,n(u), never, except at
u=0.5.
I/C, Regalla Srinivasa Prakash

12

4) The polynomial Bi,n has a maximum value


of C(n,i)(i/n)i(1 i/n)n-i occuring at u=i/n
This can be obtained by setting dBi,n/du = 0
This means that each ith control p
point is most
influential on the shape of the curve at
u=i/n,, where ((n+1)) are the total control
points.
For example in a cubic Bezier curve defined
f
by Po, P1, P2 and P3, these points are most
i fl
influential
i l at u=0,
0 1/3,
1/3 2/3 and
d 1.
1
I/C, Regalla Srinivasa Prakash

13

5) The shape of the curve (for a given set of control


vertices) can be changed by two methods.

By moving a control point


By providing multiple control points at a vertex of
control polygon. Multiplicity of control points makes the
curve pulled towards that point.

K=3
K=2
K=1
K
1

I/C, Regalla Srinivasa Prakash

Multiple
control
points
are
specified
here

14

6) A closed Bezier curve can be obtained by


making Po and Pn coincident. Will the degree
of the curve change?

By making the
last point coincide with the
first point

By adding additional
control point at the
first point

I/C, Regalla Srinivasa Prakash

15

7) Partition of Unity Property:


For any valid value of u, for any degree of given
curve:

B
i =0

i ,n

=1

This provides for


* invariance of Bezier curve (or invariance of the
relationship between the Bezier curve and its control
polygon)
l
) under
d affine
ffi transformations.
t
f
ti
p
and software
* Method to check numerical computation
developments.
I/C, Regalla Srinivasa Prakash

16

8) Positivity:
For any value of u, given any degree of
curve, each Bernstein polynomial satisfies

Bi ,n > 0
This ensures that the Bezier curve lies
entirely
e
e y in its
s co
convex
e hull.
u

I/C, Regalla Srinivasa Prakash

17

The Convex Hull Property of


B i C
Bezier
Curve
A curve is said to have convex hull
property if it entirely lies in its convex hull
defined by its control polygon.
The Bezier curve defined with Bernstein
polynomial basis possesses the convex
h ll property
hull
t

I/C, Regalla Srinivasa Prakash

18

How to get the Convex Hull of a


B i curve?
Bezier
?
The convex hull of a Bezier curve is the
maximum area obtained by joining all
points to all control p
points.
control p

Example
p 1

Convex Hull

Example
p 2

Degree = 3

(Hatched region)

Degree = 3

I/C, Regalla Srinivasa Prakash

19

Convex Hull
(Hatched region)
Example 3
Degree = ?

Example 4
Degree = ?
I/C, Regalla Srinivasa Prakash

20

Consequences
q
of Convex Hull Property
p y
There are three important aspects:
1) Degeneration to a straight line: useful
2) Clipping like manipulations become easy
3) Wild oscillations
ill ti
off the
th curve about
b t any
control point is avoided
I/C, Regalla Srinivasa Prakash

21

Repeated Slide
Consequences of Convex Hull Property

There are three important aspects:


1) If the control polygon degenerates to a straight
line, the curve segment also should become
straight
g line. This is a useful design
g feature
and is assured by convex hull property.
2) Clipping like manipulations need to clip only
the control polygon not the actual curve, thus
saving in computational time.
3) Wild oscillations of the curve about any control
point is avoided.
I/C, Regalla Srinivasa Prakash

22

Composite Bezier Curves: Blending


For Co continuity:
y the last control of the first Bezier
curve segment be coincided with the first point of the
second Bezier curve segment.
For C1 continuity:
y The end slope
p of the first segment
g
need to be equal to the starting slope of the second
segment. This requires that the (n-1)th point of the first
segment, the joining point and the second point of the
second segment be collinear.
collinear
Now:
(n+1) = Number of the control points of the first segment
(m+1) = Number of the control points of the second
segment
g the tangent
g
vectors ((a sufficient condition))
Equating

{n(Pn Pn-1)}first segment = {m(P1 Po)}second segment


{(Pn Pnn-11)}first segment = ((m/n){(P
{(
){( 1 Po)}second segment
I/C, Regalla Srinivasa Prakash

23

Example
If the first segment is formed by Po, P1, P2
and P3 and second segment is formed by
P4, P5, P6, P7 and P8, then P2, P3
(coinciding with P4) and P5 must be
collinear. Therefore
f
(P3 P2)= (4/3)(P5 P4)
P7
P2
P4
P1
P8
P3
P5
P6
P
o

I/C, Regalla Srinivasa Prakash

24

Sub-Dividing Bezier Curves

de Casteljaus
Casteljau s Algorithm
Step 1: Find the midpoints of the lines joining the
original
g
control vertices. Call them M01, M12, M23
Step 2: Find the midpoints of the lines joining
M01, M12 and M12, M23. Call them M012, M123
Step
St 3:
3 Find
Fi d the
th midpoint
id i t off the
th line
li joining
j i i M012,
M123. Call it M0123
The curve with control p
points P0, M01, M012 and
M0123 exactly follows the original curve from the
point with u=0 to the point with u=0.5
The curve with control points M0123 , M123 , M23
and P3 exactly follows the original curve from the
point with u=0.5 to the point with u=1
I/C, Regalla Srinivasa Prakash

25

Sub-Dividing
Sub
Dividing Bezier Curves
M12

P1
M012

M0123

P2
M123

M01

M23

P0

P3

I/C, Regalla Srinivasa Prakash

26

Sub-Dividing
Sub
Dividing Bezier Curves
P1

P2

P0

P3

I/C, Regalla Srinivasa Prakash

27

de Casteljaus Algorithm
You can find the point on a Bezier curve for any
parameter value u with a similar algorithm
Say you want u=0.25,
u=0 25 instead of taking
midpoints take points 0.25 of the way
M12

P2

P1

M23
t=0.25
M01
P0

P3
I/C, Regalla Srinivasa Prakash

28

Bit questions

I/C, Regalla Srinivasa Prakash

29

Who invented Bezier curve?


Bzier curve is attributed and named after
a French engineer, Pierre Bzier, who
used them for the body design of the
Renault car in the 1970's.

I/C, Regalla Srinivasa Prakash

30

What are the applications of Bezier curve


curve,
past and present?
They have since obtained dominance in
th typesetting
the
t
tti industry
i d t and
d iin particular
ti l
with the Adobe Postscript and font
products.
d t

I/C, Regalla Srinivasa Prakash

31

If only one control point is given,


given what will
be the Bezier curve?
If there is only one control point P0, i.e., n=0,
th P(u)
then
P( ) = P0 for
f allll u.

I/C, Regalla Srinivasa Prakash

32

If there are only two control points P0 and


P1, what will be the nature of Bezier
curve?
i.e., n=1, then the formula reduces to a line
segment between the two control points.
1

P(u ) = Pi Bi ,1 (u ) =P0 B0,1 (u ) + P1B1,1 (u )


i =0

= Po (1 u ) + P1u = Po + u (P1 Po )
I/C, Regalla Srinivasa Prakash

0 u 1
33

Prove that the Bezier curve with Bernstein


polynomials in general does not pass
g any
y of the control points except
through
the first and last.
Solution:
From the formula P(0) = P0 and P(1) = Pn.

I/C, Regalla Srinivasa Prakash

34

Prove that the curve is always contained


within the convex hull of the control points
and that it never oscillates wildly away
from the control points.
Solution: Positivity property.

I/C, Regalla Srinivasa Prakash

35

How do you obtain the closed Bezier curve? What is


the effect on the degree of the curve?
Solution: Closed curves can be generated by making the
last control point the same as the first control point. First
order continuity can be achieved by ensuring the tangent
between the first two points and the last two points are
the same.

I/C, Regalla Srinivasa Prakash

36

What is meant by multiplicity of control points and what is


the consequence of it? Will multiple control points at a
coordinate
di
l
location
i change
h
the
h degree
d
off the
h curve?
?
Solution:
Adding multiple control points at a single position in space will
add more weight to that point "pulling" the Bzier curve
towards it.

I/C, Regalla Srinivasa Prakash

37

Why it is necessary to blend multiple Bezier curve segments to


model a part represented by a set of data points, instead of building
g curve?
a single

Solution:
As the number of control points increases it is necessary to have higher
order polynomials and possibly higher factorials. It is common
therefore to piece together small sections of Bzier curves to form a
g
curve. This also helps
p control local conditions, normally
y
longer
changing the position of one control point will affect the whole curve.
Of course since the curve starts and ends at the first and last control
point it is easy to physically match the sections. It is also possible to
g
at the ends is along
g the
match the first derivative since the tangent
line between the two points at the end.

I/C, Regalla Srinivasa Prakash

38

Does Bezier curve provide C2 continuity at


the blend point?
Solution;
Second order continuity is generally not
possible.
ibl

I/C, Regalla Srinivasa Prakash

39

Is it possible to build two parallel Bezier


curves?
Solution:
Except for the redundant cases of 2 control
points (straight line), it is generally not
possible to derive a Bzier curve that is
parallel to another Bzier curve. It isn't
possible to create a Bzier curve that is
parallel to another, except in the trivial
cases of coincident parallel curves or
straight line Bzier curves.
I/C, Regalla Srinivasa Prakash

40

Can a circle be exactly represented by a


Bezier curve?
Solution:
A circle cannot be exactly represented with
a Bzier
B i curve.

I/C, Regalla Srinivasa Prakash

41

What are the advantages of Bezier curve?


Is it possible to build interpolating Bezier
curve?
S l ti
Solution:
Bzier curves have wide applications
because they are easy to compute and
very stable. There are similar formulations
which are also called Bzier curves which
behave differently, in particular it is
possible to create a similar curve except
that it passes through the control points.
I/C, Regalla Srinivasa Prakash

42

How the degree of Bezier curve is decided? Is the


curve ever symmetric?

Soution:
The degree of the curve is
one less than the number of
control points, so it is a
quadratic for 3 control
points. It will always be
symmetric for a symmetric
control point arrangement.
I/C, Regalla Srinivasa Prakash

Courtesy: http://astronomy.swin.edu.au/~pbourke/curves/bezier/

43

What is the advantage of tangency of Bezier curve to the


first and last control polygonal segments?

Th
The curve always
l
passes
through the end points and
is tangent to the line
between the last two and
first two control points.
points
This permits ready piecing
p Bzier curves
of multiple
together with first order
continuity.
I/C, Regalla Srinivasa Prakash

44

What is meant by the curve well behaving?

The curve always lies within the convex


hull of the control points.
points Thus the curve
is always "well behaved" and does not
oscillating erratically.
erratically

I/C, Regalla Srinivasa Prakash

Courtesy: http://astronomy.swin.edu.au/~pbourke/curves/bezier/

45

What are the limitations of Bezier Curve?


Solution:
When interpolation is required, Bezier curve can
not provide that feature.
There is no local control
control, only global control is
available
When a large
g number of control p
points are to be
modeled by a single curve segment, Bezier
curve is practically impossible because the
degree
deg
ee o
of tthe
e cu
curve
e has
as to be very
e y high,
g ,e
exactly
act y
one less than the number of control points.
Moreover, it will only be local control over the
entire portion the curve
curve.
I/C, Regalla Srinivasa Prakash

46

What is invariance of Bezier curve?

Translational invariance means that translating the control points


and then evaluating the curve is the same as evaluating and then
t
translating
l ti th
the curve
Rotational invariance means that rotating the control points and then
evaluating the curve is the same as evaluating and then rotating the
curve
These properties are essential for parametric curves used in
graphics
It is easy to prove that Bezier curves, Hermite curves and everything
else we will study are translation and rotation invariant
Some forms of curves, rational splines, are also perspective
invariant
Can do perspective transform of control points and then evaluate the
curve
I/C, Regalla Srinivasa Prakash

47

You might also like