22

Bezier - cs.stonybrook.edu

  • Upload
    others

  • View
    6

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Bezier - cs.stonybrook.edu

Bezier Curves

Page 2: Bezier - cs.stonybrook.edu

Curve Geometry

p0

p1

p2

p3

Page 3: Bezier - cs.stonybrook.edu

Curve Mathematics �Cubic�

� Curve� c�u� �P�

i�� piB�i �u�

� Control points� pi

� Basis functions�

� B���u� � ��� u��

� B���u� � �u��� u��

� B���u� � �u���� u�

� B���u� � u�

Page 4: Bezier - cs.stonybrook.edu

Basis Functions �Cubic�

� Refer to P��� of �Computer Graphics� by H�B

Page 5: Bezier - cs.stonybrook.edu

Cubic Bezier Curves

Page 6: Bezier - cs.stonybrook.edu

Basic Properties �Cubic�

� The curve passes through the �rst and the last point

�endpoint interpolation

� Linear combination of control points and basis functio

� Basis functions are all polynomials

� Basis functions sum to one

� All basis functions are nonnegative

� Convex hull �both necessary and su�cient

� Tangent vectors can be easily evaluated at endpoints

c���� � ��p� � p��

c���� � ��p� � p��

� Second derivatives at endpoints can also be easily

computed�

c������ � � � ���p� � p��� �p� � p��� � ��p� � �p�� p�

Page 7: Bezier - cs.stonybrook.edu

c������ � � � ���p� � p��� �p� � p��� � ��p� � �p�� p�

� Predictability

� The derivative of a cubic Bezier curve is a quadratic

Bezier curve

c��u� � ����� u��p������� u�� � �u��� u��p�

����u��� u�� u��p���u�p� �

��p� � p����� u�����p� � p���u��� u� � ��p� � p��u�

Page 8: Bezier - cs.stonybrook.edu

Recursive Evaluation

p p p p

p p p

p p

p

0

0

0 0

2

0

31

1

0

1

1

1

2

2

0

2

1

3

0

(1−u) (u)

=c(u)

Page 9: Bezier - cs.stonybrook.edu

Why Cubic Polynomials

� Lowest degree for specifying curve in space

� Lowest degree for specifying points to interpolate and

tangents to interpolate

� Commonly used in computer graphics

� Lower degree has too little �exibility

� Higher degree is unnecessarily complex exhibit

undesired wiggles

Page 10: Bezier - cs.stonybrook.edu

Cubic Bezier Algorithm

u

1−u

u1−u

u

1−u

u

1−u

u1−u

u

1−u

Page 11: Bezier - cs.stonybrook.edu

Recursive Algorithm �Cubic�

p

pp

p

p

p

ppp

p

0

0

0

1

0

2

0

3

1

0

1

1

1

2

2

02

1

3

0

c(v), [0,u]; c(v), [u,1]

u

1−u

Page 12: Bezier - cs.stonybrook.edu

More Properties �Cubic�

� Two curve spans are obtained�

c�v�� v � �� u

c�v�� v � u��

� Reparameterization�

cl�u�� u � ���

cr�u�� u � ���

� Both are Bezier curves

� The left is de�ned by p���p���p

���p

��

� The right is de�ned by p���p���p

���p

��

Page 13: Bezier - cs.stonybrook.edu

High�Degree Curves

� Generalizing to highdegree curves��� x�u�y�u�z�u�

���� nX

i��

��� ai

bici

���ui

� Advantages�

� easy to compute

� in�nitely di�erentiable

� Disadvantages�

� computationally complex

� undulation undesired wiggles

� How about highorder Hermite� Not natural���

Page 14: Bezier - cs.stonybrook.edu

Bezier Curves �Splines�

� Bezier curves of degree n

� Curve

c�u� �nX

i��

piBni �u�

� Control points� pi

� Basis functions

� Bni �u� are Bernstein polynomials of degree n

Bni �u� �

�n

i

�ui��� u�n�i

�n

i

��

n�

�n� ���i�

� More control points

� What do these basis functions look like�

Page 15: Bezier - cs.stonybrook.edu

Properties

� Basis functions are nonnegative

� The summation of all basis functions is unity

� End point interpolation

c��� � p�

c��� � pn

� Binomial expansion theorem

���� u� � u�n �nX

i��

�n

i

�ui��� u�n�i

� Convex hull� the curve is bounded by the convex hull

de�ned by control points

� Recursive subdivision and evaluation

� Symmetry� c�u� is de�ned by p�� � � � �pn� c��� u� is

de�ned by pn� � � � �p��

Page 16: Bezier - cs.stonybrook.edu

� E�cient evaluation algorithm

� Di�erentiation � integration

� Degree elevation

� use polynomial of degree n�� to express that of

degree n

� Composite curves

� Geometric continuity

� Display of curve

Page 17: Bezier - cs.stonybrook.edu

Recursive Computation

p p

p

0

0

0

n

n

0

n+1 control points

n+1levels

(1−u) (u)

=c(u)

Page 18: Bezier - cs.stonybrook.edu

Recursive Computation

� p�i � pi i � �� � � � � n

� pji � ��� u�p

j��i � up

j��i��

� c�u� � pn��u�

Page 19: Bezier - cs.stonybrook.edu

Tangents and Derivatives

� Endpoint tangents�

c���� � n�p� � p��

c���� � n�pn � pn���

� ith derivatives�

c�i���� depends only on p�� � � � �pi

c�i���� depends only on pn� � � � �pn�i

� Derivatives at nonendpoints�

c�i��u� involve all control points

Page 20: Bezier - cs.stonybrook.edu

Bezier Curve Rendering

� Use its control polygon to approximate the curve

� Recursive subdivision till the tolerance is satis�ed

� Display c�u� de�ned by p�� � � � �pn

� if fp�� � � � �png is �at �with tolerance

then output line segments p�� � � � �pn

� else subdivide the curve at u � ���

� let l�� � � � � ln de�ne the �rst half

� let r�� � � � � rn de�ne the second half

� display �cl�u��

� display �cr�u��

Page 21: Bezier - cs.stonybrook.edu

High�Degree Polynomials

� More degrees of freedom

� Easy to compute

� In�nitely di�erentiable

� Drawbacks�

� highorder

� global control

� expensive to compute complex

� undulation

Page 22: Bezier - cs.stonybrook.edu

Piecewise Polynomials

� Piecewise � di�erent polynomials for di�erent parts

the curve

� Advantages � �exible lowdegree

� Disadvantages � how to ensure smoothness at the

joints �continuity