CS184 Lecture 21 summary

Bezier Curves

Bezier curves are a class of approximating splines. They are defined using control points, but do not necessarily pass through all the control points. Instead the control points act as "handles" to define the shape of the curve. The general form of a Bezier curve is

P(u) = Sk pk Bk,n(u)

Where k = 0,...,n, and pk is the kth control point, and Bk,n(u) is a Bernstein polynomial:

Bk,n(u) = C(n, k)uk (1 - u)n-k

where C(n, k) is a binomial coefficient = n!/(k! (n-k)!)

From the formulae, notice that you need n+1 control points to define a Bezier curve of degree n. Also notice that only one of the Bernstein polynomials is non-zero at u = 0 (namely B0,n(u) which has value 1 at u=0) and only one of them is non-zero at u = 1 (namely Bn,n(u) = 1 at u=1). Because of these conditions, the Bezier curve passes exactly through the first and last control points. But everywhere else, it is a blend of the control points.

Notice also that all the Bernstein polynomials are non-negative in the range u = 0,...,1. And that

Sk Bk,n(u) = (u + (1-u))n (by the binomial theorem) = 1

That is, every point along a Bezier curve is a convex combination of the control points. Therefore the whole curve lies inside the convex hull of the control points. The convex hull of a set of points is the smallest convex set containing all the points.

Properties of Bezier Curves

The first property of Bezier curves as we have just seen is that the curve lies inside the convex hull of the control points.

To use them in design, we also need to establish continuity conditions, which means computing derivatives. It turns out that there are simple expressions for the derivatives of Bezier curves in terms of their control points.

P'(0) = n (p1 - p0)
P'(1) = n (pn - pn-1)

In other words, the tangents to a Bezier curve at its endpoints are multiples of the chords between the endpoint and the neighboring control point. This makes it easy to join two Bezier curves with C1 or  G1 continuity. The control points on either side of the join point are made colinear with the join point. That is enough for  G1 continuity. For  C1 continuity, we require in addition that the distances from the joint point to the neighboring control points are the same.

The second derivatives are also simple:

P''(0) = n(n-1) (p2 - 2p1 + p0)
P''(1) = n(n-1) (pn - 2pn-1 + pn-2)

and these expressions give linear constraints on the control point positions if C2 continuity is desired.

Bezier Surfaces

Bezier surfaces are derived as follows:

P(u,v) = Sj Sk pj,k Bj,n(v) Bk,n(u)

where both j and k range over 0,..., n. Instead of a series of control points, we now have an array pj,k of control points.

The Bezier surface is the image of a square patch of u, v parameters both ranging from 0 to 1. The boundaries of the patch, which are obtained by setting one of u or v to 0 or 1, are Bezier curves.

Notice that

Sj Sk Bj,n(v) Bk,n(u) = (u + (1-u))n (v + (1-v))n = 1

by the binomial theorem. Therefore the points on a Bezier surface are a blend of the control points, and lie in the convex hulll of the control points.

Bezier surfaces are normally joined along an edge, with say the u = 1 edge of the first surface becoming the u = 0 edge of the second. This curve is defined only by the pj,n control points of the first patch, which should be the same as the pj,0 control points of the second patch. If this is done, the two bounding curves of the patches will be identical, which gives us C0 continuity of the blend between the patches.

To get C1 continuity of the blend, we rewrite the definition of the Bezier patch as

P(u,v) = Sj Bj,n(v) (Sk pj,k Bk,n(u))

For any fixed j, the subexpression Sk pj,k Bk,n(u) is a Bezier curve, call it the jth control curve. We can view the Bezier surface as a blend of these curves with weights determined by the v parameter. Also, every curve v = constant is a Bezier curve which is a blend of the control curves. If all of the control curves are C1 across the join, then so will every blend curve, and the surface itself.