LECTURE
LECTURE 1
CURVES
What is a curve? Euclid proposed three descriptions
(see [1]).
The answer is not obvious, even in the plane.
We might say a curve is a continuous
function g: [0,1]® R2.
But this may convey more information that we need - the
parametrization of points on this curve may not be
part of our notion of a curve.
We can view the the curve simply as the image of g.
But for other purposes, this may convey too little information.
In particular, we need some effective or constructive methods
of describing the curve. We can thus
define a curve in R2 as the set of points
that satisfy a given equation f(x,y) = 0.
Effectivity is achieved, for instance, if
the function f(x,y) is a polynomial with integer coefficients.
This is essentially the view point of algebraic geometry.
From a differential geometry viewpoint, notions
of effectivity might involve the the curvature, etc.
Finally in the fielf of geometric modeling, the notion of
effectivity is stronger - we want curves that
are ``constrollable''. In some sense, any
parametric family of curves is controllable
(e.g., we can control the algebraic curves which
are defined by polynomials by changing their coefficients).
Controllability in geometric modeling refers to parameters
that bears a more direct relation to the actual spatial layout
of the curve. This brings us to topics
such as splines, Bézier curves and NURBS.
This will be the main focus of this chapter.
1 Implicit and Parametric Curves
Let f(x,y) be a polynomial with real coefficients.
The equation f(x,y) = 0 defines a curve in R2.
For instance, f(x,y) = x2+y2-1 defines
the unit circle. See figure 1(a).
Picture Omitted
Picture Omitted
Figure 1: Unit Circle
On the other hand, we can also represent the
circle as a curve p(t) = (x(t), y(t)) where
x(t) = |
1-t2 1+t2
|
, y(t) = |
2t 1+t2
|
. |
|
We call x(t), y(t) the coordinate functions of the curve.
Thus p(0) = (1,0) and p(1) = (0,1). This
is illustrated in figure 1(b). Note the the point
(-1,0) is represented twice by this
representation: p(¥) = p(-¥) = (-1,0).
Alternative, in homogenous coordinates,
the curve can be written as
(x(t),y(t),w(t)) = (1-t2, 2t, 1+t2). |
|
This simple example illustrates two ways to
represent a curve: as an equation (or system of
equations in higher dimensions) or in terms
of its coordinate functions. They are called, respectively,
the implicit representation and
parametric representaion of curves.
We restrict the functions in both representations
to be rational (i.e., a ratio of two polynomials).
Depending on the applications, one or the other
may be better. Implicit representations are
more general: we will see that every parametric
representation has an implicit form but not vice-versa.
Parametric representations are very useful when we
need to perform ``curve tracing'', namely to plot points on
the curve to be used in visualization or rendering.
2 Casteljau's Algorithm and Bézier Curves
Consider curves in Euclidean space Rd, d ³ 1.
A polynomial parametric curve in Rd is a function
f: [u,v] ® Rd such that f(t) = åj = 0n pi ti
for some p0, p1 ,¼, pn Î Rd, and
-¥ £ u £ v £ +¥.
The domain of f is typically [u,v] = [0,1] but
sometimes [u,v] = [-¥,+¥] = R.
If pn ¹ \0, then the degree of f is n.
Alternatively, we can view f in terms
of its coordinate functions, f(t) = (f1(t) ,¼, fd(t))
where each fi(t) is a polynomial of degree n or less.
We begin with a particular representation of polynomial
parametric curves, called Bézier curves.
To obtain our first intuition, let a,b,c Î R3
be three distinct points. Consider the points parametrized by
a real value t,
a1(t) |
: =
| (1-t) a+ t b, b1(t) |
: =
| (1-t) b+ t c |
|
and also
|
|
| |
|
(1-t)2 a+ 2t(1-t) b+ t2 c. |
|
|
We call a2(t) the ``Bézier curve generated by the
control points a,b,c''.
It is easy to see that a2(0) = a and a2(1) = c, and
the curve lies in the triangle (a,b,c)
when t is restricted to [0,1].
To see that this curve is a parabola, first consider
the case where a = (-1,1), b = (0,-1) and c = (1,1).
Let a2(t) = (x(t), y(t)). Then we have
x(t) = (1-t)2 (-1) + t2 (1) = 2t -1, y(t) = (2t-1)2 |
|
Thus we have the parabola y = x2. As noted below,
Bézier curves are preserved by affine transformation.
Hence the Bézier curve defined by any three points a,b,c
can be affinely transformed to the Bézier curve defined
by a = (-1,1), b = (0,-1), c = (1,1). Since
parabolas are preseved by affine transformations,
this proves our claim.
The above process for generating a parabola from
three points a,b,c can be generalized. This idea
was introduced by Paul de Casteljau (1959), and this
process is called Casteljau's Algorithm.
The algorithmic idea of Casteljau's can be said to be
more important than the corresponding Bézier curves:
the algorithmic idea can be fruitfully used in other
contexts. Moreover, it is the existence
of this algorithm that distinguishes Bézier curves
as a useful tool in geometric modeling.
See Farin [2]
for an account of the discovery of these
curves in the French automobile industry
(Casteljau was at Citroen and Bézier at Renault).
Let p0, p1 ,¼, pn Î R3 be n+1 distinct points
and let t Î R.
Define a doubly-indexed family of curves
{pir(t) : r = 1 ,¼, n, i = 0, 1 ,¼, n-r} |
|
where
pir(t) = (1-t) pir-1(t) + t pi+1r-1(t) |
| (1) |
where pi0(t) = pi for all i and t.
The superscript r indicates the ``rank'' of the curve,
with the input points having rank 0. It turns out,
the curves of rank r is a polynomial parametric curve of degree r.
This is easily seen from (1) where the
rank r curves are generated from rank r-1 curves.
There are n-r+1 rank r curves. Thus there is
only one curve of rank n, namely, p0n(t).
This is the Bézier curve defined (or generated)
by p0 ,¼, pn. Call p0 ,¼, pn the knots
or control points for the curve.
If p = (p0 ,¼, pn), then by a slight abuse of
notation, we will write
p(t) to denote the Bézier curved defined by p.
We may write pr(t) instead of pr0(t) (dropping
the 0 subscripts). Then p(t) is just pn(t).
The family {pir(t)}r,i may be arranged
in a triangular shape, with the rank r functions in column r+1.
Illustrating this for n = 3:
Let us consider the rank r of curves.
Rank 0 curves are constant functions, and rank 1
curves are linear functions. For instance,
pi1(t) is the parametrized line passing through
the points pi and pi+1.
As shown above, a rank 2 Bézier curve is a parabola.
As expected from this progression,
the rank r curves have algebraic degree r.
This is seen from the recursive equation (1):
if the curves bir-1 and bi+1r-1 has degree £ r-1,
then bir has degree £ r.
We have the following convex hull property:
for 0 £ t £ 1, the point p(t) is contained
in the convex hull of p0 ,¼, pn. More generally, we claim:
the point pir(t) (r ³ 1, i ³ 0) is contained
in the convex hull of pi(t), pi+1(t) ,¼, pi+r(t).
This is true for r = 1. To see this for r > 1, note that
the point pir+1(t) is contained in the
convex hull of pir(t) and pi+1r(t).
These two points, by induction, are contained in the convex hull of
pi(t), pi+1(t) ,¼, pi+r(t), pi+r+1(t). |
|
Thus our claim follows.
Horner Scheme for Casteljau's Algorithm.
Suppose we want to compute the point p(t) for a numerical
value of t. We can give a Horner-like scheme for its
evaluation as follows:
3 Affine Maps and Convex Combinations
A function a: Rd® Rd is called
affine if it has the form
for some vector b and d×d matrix A.
Such functions are completely defined by its actions on any d+1
points that do not lie on a hyperplane. The canonical
set of points is {\0, e1 ,¼, ed}
where \0 is the origin, and ei is the elementary
vector with 1 at the ith position and 0 elsewhere.
Indeed, it is easily seen that b = a(\0)
and the ith column of A is simply a(ei)-a(\0).
If A is invertible, then the affine map is invertible.
Let p = (p0 ,¼, pn) be points in Rd.
An expression of the form
is called a linear combination of the points p0 ,¼, pn.
If the coefficients ci are constrained to satisfy
åi = 0n ci = 1, then this is called a affine combination.
Finally, the ci's are non-negative in an affine combination,
we call it a convex combination. The set of all
linear (resp., affine)
combinations of p forms a linear (resp., affine) subspace of Rd.
The set of convex combinations of p is a convex set; its
boundary is called the convex hull of p.
A simple property of affine maps a(x) = b+ Ax
is that it preserves affine combinations:
a( |
n å
i = 0
|
ci pi) = |
n å
i = 0
|
ci a(pi), |
n å
i = 0
|
ci = 1. |
| (3) |
In proof:
Let q = (q0 ,¼, qn) where qi = a(pi) for all i.
How are the Bézier curves q(t) and p(t) related?
We have:
for all t,r,i. In short, Bézier curves are preserved by
affine maps. The proof is immediate from (3),
and the fact that Casteljau's algorithm uses affine
combinations to construct rank r curves from rank r-1 curves.
This is related to the fact that affine maps preserves ratios:
|
\sc Ratio
| (a,b,c) = |
\sc Ratio
| (a(a),a(b),a(c)). |
|
4 Bernstein Polynomials
Bézier curves are intimately connected to the Bernstein polynomials:
for each natural number n, define
Bni(t) |
: =
| |
ì ï ï í
ï ï î
|
|
æ ç
è
|
n
i
|
ö ÷
ø
|
ti (1-t)n-i |
| |
| |
|
|
| (4) |
Also, Bn0(t) = (1-t)n and Bnn(t) = tn.
In particular, when n = 0, B00(t) is the constant 1.
For n = 1, B10(t) = (1-t) and B11(t) = t.
For n = 2,
B20(t) = (1-t)2, B21(t) = 2(1-t)t, B22(t) = t2. |
|
It is clear from the definition that Bni(t) is a polynomial of
degree n.
To see connection to the Bézier curves, consider the
second degree case:
|
|
| |
|
(1-t) [(1-t)p0 + t p1] + t [(1-t) p1 + t p2] |
| |
|
(1-t)2 p0 + 2(1-t)t p1 + t2 p2 |
| |
|
B20(t) p0 + B21(t) p1 + B22(t) p2. |
|
|
In general, the Bézier curve
p(t) generated by p0 ,¼, pn is given by
p(t) = |
n å
j = 0
|
Bnj(t) pj. |
| (5) |
More generally, we have
pri(t) = |
r å
j = 0
|
Brj(t) pi+j. |
| (6) |
This is easily verified by induction.
The expression (5) is called the Bernstein form
of the Bézier curve p(t).
From (5), we see that a Bézier curve of degree n is
a weighted sum of the knot points p0 ,¼, pn.
The weights are given by the n Bernstein polynomials.
Conversely, we will show below that every polynomial parametric curve
is a Bézier curve.
Let us consider the behavior of the polynomial Bnj(t) in the
range 0 £ t £ 1.
As t increases from 0 to t, the function
Bn0(t) decreases from 1 to 0,
Bnn(t) increases from 0 to 1.
But in general, Bnj(t) is non-negative
(Bnj(t) ³ 0)
and a unimodal function which attains its maximum when t = i/n.
This is obvious for i = 0 or i = n. For 0 < i < n, this is
shown next, with other properties of the Bernstein polynomials.
- Symmetry
-
We have: Bnj(t) = Bnn-j(1-t). This comes
directly from the definition.
- Partition of unity
-
This means åj = 0n Bnj(t) = 1.
Writing [`t] for 1-t, we have
1 = (t + |
t
|
)n = |
n å
j = 0
|
|
æ ç
è
|
n
j
|
ö ÷
ø
|
tj |
t
|
n-j
|
= |
n å
j = 0
|
Bnj(t). |
|
Combined with the fact that Bnj(t) ³ 0, we conclude
from (1) that p(t) is a convex combination
of the points p0 ,¼, pn.
This gives another proof of the convex hull property. - Recurrence
-
The degree n polynomials can be expressed
as an affine combination of the degree n-1 polynomials:
Bni(t) = (1-t)Bn-1i(t) + t Bn-1i-1(t).
This follows from the standard identity,
|
æ ç
è
|
n
i
|
ö ÷
ø
|
= |
æ ç
è
|
n-1
i
|
ö ÷
ø
|
+ |
æ ç
è
|
n-1
i-1
|
ö ÷
ø
|
. |
|
Thus,
|
|
|
æ ç
è
|
n
i
|
ö ÷
ø
|
ti (1-t)n-i |
| |
|
|
æ ç
è
|
n-1
i
|
ö ÷
ø
|
ti (1-t)n-i + |
æ ç
è
|
n-1
i-1
|
ö ÷
ø
|
ti (1-t)n-i |
| |
|
(1-t) |
æ ç
è
|
n-1
i
|
ö ÷
ø
|
ti (1-t)n-1-i + t |
æ ç
è
|
n-1
i-1
|
ö ÷
ø
|
ti-1 (1-t)n-i |
| |
|
(1-t) Bn-1i(t)+ t Bn-1i-1(t). |
|
|
- Derivative
-
We have:
|
d dt
|
Bni(t) = n[Bn-1i-1(t) - Bn-1i(t) ]. |
| (7) |
The derivation is rather similar to the previous one.
If we equate (8) to 0 and solve for t,
we obtain t = i/n. This point cannot be
a minima (for 0 < i < n, we use the fact that
Bni(t) ³ 0 with equality at t = 0, 1).
This proves our earlier assertion
that Bni(t) attains its maximum at t = i/n.
Applying this to the derivative of
the Bézier curve p(t) in (5), we obtain
|
d dt
|
p(t) = n |
n-1 å
j = 0
|
(pj+1-pj)Bn-1j(t), |
| (8) |
which is another Bézier curve.
-
Polynomial Basis:
Note that the set {1, t, t2 ,¼, tn} of monomials
is a basis for the vector space of
polynomials of degree at most n.
We now prove that {Bni: i = 0 ,¼, n} is also a basis.
This from the following
|
æ ç
è
|
n
i
|
ö ÷
ø
|
ti = |
n å
j = i
|
|
æ ç
è
|
j
i
|
ö ÷
ø
|
Bnj(t) |
| (9) |
In proof, let us expand both sides using factorials:
|
| |
|
n å
j = i
|
|
j! i!(j-i)!
|
Bnj(t) |
|
| |
|
n å
j = i
|
|
j! i!(j-i)!
|
|
n! j!(n-j)!
|
tj (1-t)n-j |
|
| |
|
n å
j = i
|
|
(n-i)! (j-i)!(n-j)!
|
tj (1-t)n-j |
|
| |
|
n å
j = i
|
|
(n-i)! (j-i)!(n-j)!
|
tj-i (1-t)n-j |
|
| |
|
n-i å
j = 0
|
|
(n-i)! j!(n-i-j)!
|
tj (1-t)n-i-j |
|
| |
|
m å
j = 0
|
|
m! j!(m-j)!
|
tj (1-t)m-j |
|
| | |
|
|
|
where m = n-i. But the final expression is 1 by partition of unity. - Subdivision
-
This says
Bni(ct) = |
n å
j = 0
|
Bji(c)Bnj(t). |
|
- Product
-
We have
Bmi(t)Bnj(t) |
æ ç
è
|
m+n
i+j
|
ö ÷
ø
|
= |
æ ç
è
|
m
i
|
ö ÷
ø
|
|
æ ç
è
|
n
j
|
ö ÷
ø
|
Bm+ni+j(t). |
|
- Degree Elevation
-
There are three formulas that expresses Bni(t) in
terms of degree n+1 Bernstein polynomials.
5 Spline Curves
A spline curve
is a continuous curve such that there exists
ui, u0 < u1 < ¼ < un-1 < un, (called
breakpoints) such that s[ui, ui+1] is a polynomial curve.
We consider the case where the s[ui, ui+1] are
Bézier curves.
Subdivision.
Let p = (p0 ,¼, pn) are given and 0 < u < 1 is given.
Consider the subdivision problem: find q = (q0 ,¼, qn) such that
q[0,1] = p[0,u].
The subdivision property for Bézier curves says:
For instance, q0 = p0 and q1 = p10(u) = (1-u)p0 + t p1.
This is illustrated in figure 2.
Picture Omitted
Picture Omitted
Figure 2: Casteljau's algorithm to plot the point a2(t).
Extrapolation.
The converse of the subdivision problem is the following:
Given q = (q0 ,¼, qn) and 0 < u < 1,
we want to find p = (p0 ,¼, pn)
such that q[0,1] = p[0,u].
Smoothness.
Suppose s is a spline curve that
the concatenation of the Bézier curves s1 = s[u0,u1]
and s2 = s[u1,u2] defined
(respectively) by p = (p0 ,¼, pn) and
p¢ = (pn ,¼, p2n). Then we have the theorem:
The curve s is Cr at pn if and only if pn+i = bin-i(t)
for i = 0 ,¼, r and t = (u2-u0)/(u1-u0).
6 Spline Surfaces
Let P = (p0,0, p0,1, p1,0, p1,1) Î R3.
The surface
x(u,v) = |
1 å
i = 0
|
|
1 å
j = 0
|
pi,jB1i(u)B1j(v) |
|
is the hyperbolic paraboloic defined by P.
We now need to use the matrix notation to achieve
a compact notation:
thus we write
x(u,v) = [(1-u), u] · |
é ê
ë
|
|
|
ù ú
û
|
· |
é ê
ë
|
|
|
ù ú
û
|
. |
|
More generally, if
P = (pi,j: i, j = 0 ,¼, n) |
|
and (u,v) Î R2, we have
pri,j (u,v) = [(1-u), u] · |
é ê
ë
|
|
|
ù ú
û
|
· |
é ê
ë
|
|
|
ù ú
û
|
, (r = 1 ,¼, n, i,j = 0 ,¼, n-r). |
|
We call P above a control net. The above P
has a square shape, which could be generalized to a rectangular shape.
Bézier Triangles.
We can also use triangular control nets.
To do this, we need to use barycentric coordinates.
If a,b,c are the vertices of a triangle in the plane,
then for any point p Î R2 can be uniquely
expressed as p = u a+ v b+w c where
(u,v,w) are three real numbers such that u+v+w = 1.
We call u = (u,v,w) the barycentric coordinates of p
(with respect to a,b,c). Furthermore,
p is inside the triangle a,b,c if
and only if u, v, w are all non-negative.
Let D(a,b,c) be the signed area of the
triangle a,b,c
given by half the determinant of the matrix (a1 | b1 | c1)
whose the columns are a1, b1, c1 where
in general, a1 is obtained
by appending a 1 to the end of the vector a.
Then we have
u = D(p,b,c)/D(a,b,c),v = D(a,p,c)/D(a,b,c),w = D(a,b,p)/D(a,b,c). |
|
Let
P = (pi,j,k : i+j+k = n; i, j, k ³ 0} |
|
This control net has (n+1)(n+2)/2 control points.
To illustrate this, consider the case n = 4 which has 15
control points:
In general, let i = (i,j,k) denote an index triple,
and write |i| = i+j+k.
Also, let ei be the triple with 1 at the ith
position and zero elsewhere.
If u = (u,v,w) is a barycentric coordinate, we define the functions
pri(u) = u pr-1i+e1(u) +v pr-1i+e2(u) +w pr-1i+e3(u), |i| = n-r; r = 1 ,¼, n. |
|
The surface P(u,v,w) = pn0i(u,v,w)
is called the Bézier triangle
generated by the control net P.
Show that if p,q,r are distinct points on a parabola
and the tangents at these points meet at t(p,q), t(q,r)
and t(p,r),
respectively, then ratio() ...
(Linear Precision)
Give an interpretation of this formula in terms of
Bézier curves: consider the control points p0 ,¼, pn
where are uniformly distributed along the straightline
segment connecting p0 and pn.
Program the Horner-like schme for evaluating points
on Bézier curves
(use your favorite programming language).
References
- [1]
-
V. G. Boltyanskii and V. A. Efremovich.
Intuitive Combinatorial Topology.
Springer, 2001.
Translated by Abe Shenitzer.
- [2]
-
G. Farin.
Curves and Surfaces for Computer Aided Geometric Design: A
Practical Guide.
Academic Press, Inc, second edition, 1990.
File translated from
TEX
by
TTH,
version 2.78.
On 27 Apr 2001, 10:52.