Upload
others
View
6
Download
0
Embed Size (px)
Citation preview
Bezier Curves
Curve Geometry
p0
p1
p2
p3
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�
Basis Functions �Cubic�
� Refer to P��� of �Computer Graphics� by H�B
Cubic Bezier Curves
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�
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�
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)
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
Cubic Bezier Algorithm
u
1−u
u1−u
u
1−u
u
1−u
u1−u
u
1−u
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
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
��
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���
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�
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��
� 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
Recursive Computation
p p
p
0
0
0
n
n
0
n+1 control points
n+1levels
(1−u) (u)
=c(u)
Recursive Computation
� p�i � pi i � �� � � � � n
� pji � ��� u�p
j��i � up
j��i��
� c�u� � pn��u�
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
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��
High�Degree Polynomials
� More degrees of freedom
� Easy to compute
� In�nitely di�erentiable
� Drawbacks�
� highorder
� global control
� expensive to compute complex
� undulation
Piecewise Polynomials
� Piecewise � di�erent polynomials for di�erent parts
the curve
� Advantages � �exible lowdegree
� Disadvantages � how to ensure smoothness at the
joints �continuity