Computer Aided Geometric Design
Bezier Curves
Introduction
Engineers of the automotive industry created the first geometric models in the 1960’s,and so initiated the domain of CAGD. Beginning in the 1960’s, engineers designing carbody parts started to use computers, an emerging technology, to represent the surfaces they were to produce. Parametric surfaces which had been long known and studied by mathematicians are well suited for representing these surfaces. Nevertheless finding appropriate numerical representations for these surfaces and tools adapted to manipulate them was a completely new task, and therefore developing these new representations was the first goal of the pioneers of the field. These new representations for surfaces, using intuitive numeric parameters to control their shape, quickly made their way to other manufacturers: from car bodies, to airplanes, to mechanical parts. The need for geometric modeling rapidly extended to other domains–to medicine, to architecture, and to geology– following the growing influence of computers. More recently, virtual worlds have also used geometric models, for the conception of physical shapes or simply for representing non physical objects. With the role of computers always increasing,the need for geometric models is growing too. The increase in computational power allows richer models to be developed, and users expect the manipulation tools and algorithms to be increasingly efficient and to offer more and more functionality. The ability to understand, construct and process three-dimensional geometric models on the computer is essential for many modern engineering fields, such as computer-aided design and manufacturing (CAD/CAM), engineering simulation, biomedical imaging, robotics, computer vision, and computer graphics. We focus here on CAGD techniques for modeling freeform curves and surfaces such as body shapes of ships, automobiles and aircrafts. Many consumer products as well as electronic devices are also designed with freeform aesthetic shapes. For this, we need to define the concept of Bezier Curves. Pierre Bezier was a French Arts & Métiers engineer (Pa27) who did his career at Renault.
Linear Bezier curve
Linear Bezier parametric curve is obtained by linear interpolation between
two given control points
Here,
Quadratic Bezier curve
Quadratic Bezier curve is obtained from three control points
By construction Bezier curve goes through its terminal control points
(
Cubic Bezier curve
In a similar way, for
Bezier curve of degree
The initial control points are given by the following list:
On the right, we can see all the Bernstein polynomials
By moving the control points (blue circles), you can see that the red curve, is always located in the convex hull of the control points of the Bezier curve. This property can be demonstrated.
The de Casteljau Algorithm
In 1958, Paul Faget de Casteljau engineer at Citroën, developped a simple algorithm
which allows to calculate the value of
For example if
They are calculated as follows for

In the following Figure, the two points

More generally, Paul de Casteljau demonstrated the following theorem:
Exercice[de Casteljau Algorithm]
We want to draw a Bezier curve by using the de Casteljau algorithm.
-
Plot all the Bernstein polynomials for
. For this, use the following binomial function. -
By using the result of the previous Theorem, implement the de Casteljau function for
. This function will return the value of for a given . is the list of the control points of the Bezier curve. -
By using the previous decast function, draw the cubic Bezier curve with control polygon
. For this you can use a subdivision of by using np.linspace(0,1,100). Calculate for each values the corresponding values of the Bezier curve. The drawing of the Bezier curve is obtained by joining all these values. As in the previous Bezier examples you can draw also this control polygon.
import numpy as np
from math import factorial as fac
def binomial(n,i):
try:
binom=fac(n)/(fac(i)*fac(n-i))
except ValueError:
binom=0.0
return binom
def bernstein(n,i,t):
#TO DO
return
def bernstein(n,i,t): res=binomial(n,i)*(1-t)**(n-i)*t**i return res t=np.linspace(0,1,100) n=3 for i in range(n+1): y=[bernstein(n,i,x) for x in t] plt.plot(t,y) plt.show()
import numpy as np
def decast(t,P):
#TO DO
return
def decast(t,P): n=len(P)-1 L0=P for k in range(n): L=L0 L0=[] for i in range(n-k): L0.append(np.dot(1-t,L[i])+np.dot(t,L[i+1])) return L0[0][0],L0[0][1]
import numpy as np
import matplotlib.pyplot as plt
def DrawBezier(P,nb=100):
#TO DO
return
def DrawBezier(P,nb=100): z=np.linspace(0,1,nb) X=[] Y=[] for t in z: x,y=decast(t,P) X.append(x) Y.append(y) return X,Y P=[[0.1,0.1],[0.9,0.9],[0.1,0.9],[0.9,0.1]] p=np.transpose(P) X,Y=DrawBezier(P) # Plot the control polygon of the Bezier curve plt.plot(p[0],p[1],'r') plt.plot(X,Y) plt.show()
Geometric Continuity
In practice, the modeled objects can be produced from several Bézier curves. In the following example, the two curves are joined with the

To guarantee a certain regularity of fitting, it is necessary to know how to calculate the derivatives of a Bézier curve. The following proposition makes it possible.
Moreover,
Consequently, we have at the extremities:
Exercice [ -continuity]
In this exercice, we wish to build a cubic Bezier curve with unknow control polygon

-
Let us give the cubic Bezier curve with control polygon
, by using the previous proposition calculate the , , and derivatives at and respectively. -
By using the previous results, calculate the values of points
, , and such that this cubic Bezier curve joins at with the cubic Bezier Curve with control polygon at . -
Draw these two Bezier curves.
P=[[0.1,0.1],[0.9,0.9],[0.1,0.9],[0.9,0.1]] p=np.transpose(P) X,Y=DrawBezier(P) # Plot the control polygon of the Bezier curve plt.plot(p[0],p[1],'r') plt.plot(X,Y) # Calculate the control polygon Q for the C2-continuity Q0=P[2] Q1=Q0+(np.add(P[2],np.dot(-1,P[1]))) Q2=np.add(P[0],np.dot(4,(np.add(P[2],np.dot(-1,P[1]))))) # in this case Q3 is free of constraint Q3 = [1,1] Q=[Q0,Q1,Q2,Q3] q=np.transpose(Q) X,Y=DrawBezier(Q) plt.plot(q[0],q[1],'r') plt.plot(X,Y) plt.show() # for the C3 case, the location of Q3 is given by defining # the symmetric point of R3 (see the previous Figure) # You can calculate it by ourself.
References
- J.H. Ahlberg, E.N. Nilson & J.L. Walsh (1967) The Theory of Splines and Their Applications. Academic Press, New York.
- C. de Boor (1978) A Practical Guide to Splines. Springer-Verlag.
- G.D. Knott (2000) Interpolating Cubic Splines. Birkhäuser.
- H.J. Nussbaumer (1981) Fast Fourier Transform and Convolution Algorithms. Springer-Verlag.
- H. Späth (1995) One Dimensional Spline Interpolation. AK Peters.