Geometry of Vector Spaces/Curves and Surfaces

Lesson 9.5988 words

Curves and Surfaces

Bézier curves are affine combinations of control points with polynomial weights, so they lie in the convex hull of those points and bend toward them. The de Casteljau algorithm evaluates them by repeated interpolation, a matrix form factors them for computation, and matching endpoints and tangents joins segments into smooth curves and surfaces.

╌╌╌╌

Design software stores a curved letter, a car panel, or a font glyph not as a dense list of points but as a handful of control points. The curve is recovered from them by a fixed rule, and moving one control point reshapes only a local piece. Bézier curves are the rule that made this practical, and they are built entirely from affine and convex combinations of the control points.1

Bézier curves

A Bézier curve is a combination of control points with polynomials in as weights, for . A quadratic curve uses three control points; a cubic uses four:

At each the polynomial weights are nonnegative and sum to — for the cubic, by the binomial theorem. Every point of the curve is a convex combination of the control points, so the curve lies inside their convex hull. It passes through the first and last control points, at and , but generally not through the interior ones; those pull the curve toward themselves without lying on it.

A quadratic curve on three control points and a cubic on four. Each curve stays inside the convex hull of its control polygon and touches only the end control points.

The convex-hull property is inherited by any affine image of the curve. If is a matrix, then is the Bézier curve on the transformed control points , because matrix multiplication distributes over the combination. Rotating, scaling, or shearing a curve amounts to transforming four points and redrawing.

Tangents at the endpoints

The control polygon governs the direction of the curve at its ends. For a parametric curve, the tangent direction at is the derivative , taken coordinate by coordinate.

The endpoint tangents run along the first and last edges of the control polygon, each twice the length of its edge.

The de Casteljau algorithm

A Bézier curve can be evaluated without expanding any polynomials, using only repeated linear interpolation between control points. At parameter , replace each consecutive pair of points by the point a fraction of the way between them; repeat on the shorter list until one point remains, which is .

Algorithm:
  1. 1
    de Casteljau evaluation of a Bézier curve at parameter t
  2. 2
    input: control points p[0..n], parameter t in [0,1]
  3. 3
    for i = 0 to n do
  4. 4
    b[i] ← p[i]
  5. 5
    for r = 1 to n do
  6. 6
    for i = 0 to n - r do
  7. 7
    b[i] ← (1 - t) · b[i] + t · b[i+1]
  8. 8
    return b[0]

At every interpolation is a midpoint, which makes the construction easy to follow. For a cubic with control points , the first round of midpoints is ; the second is ; the third is the curve point .

The de Casteljau construction at . Midpoints of the control edges give , midpoints of those give , and their midpoint is the curve point.

The construction also splits the curve. The points are the control points of the piece from to , and control the piece beyond. Repeated subdivision produces control polygons that converge to the curve, the basis for drawing a Bézier curve as a short chain of line segments.

Joining curves

Complex outlines are built from many short Bézier segments joined end to end. The smoothness of a join is graded by how much the two segments agree at the shared point.

  • (geometric) continuity: the segments meet, with the terminal point of the first equal to the initial point of the second. Without more, a corner may appear.
  • continuity: the tangent vectors at the join point in the same direction, though their lengths may differ. No corner, but the parameterization may jump in speed.
  • (parametric) continuity: the tangent vectors at the join are equal, not merely parallel. The strongest of the three, and the usual target.
A join can show a corner where the tangents disagree; a join matches tangents so the segments meet smoothly.

The continuity conditions translate into constraints on the control points.

For continuity the shared control point is the midpoint of its two neighbors, so the three points , , are collinear and evenly spaced.

Matching second derivatives as well gives continuity, which is possible for cubics but tightly constrains the control points. B-splines relax this by sharing three control points between adjacent segments, gaining smoothness at the cost of no longer passing through any control point.

Matrix form

A Bézier curve is a linear combination of control points with polynomial weights, so it factors into a matrix product. For the cubic, collect the control points into a geometry matrix and the powers of into :

The Bézier basis matrix holds the coefficients of the blending polynomials , , , , expanded in powers of . Multiplying recovers the four weights; multiplying by applies them to the control points. Other cubic families reuse the same factored form with a different basis matrix: a Hermite curve replaces by a Hermite basis matrix and stores tangent vectors instead of interior control points, and a B-spline uses the B-spline basis matrix.

Bézier surfaces

A surface patch is the two-parameter analogue. Take a grid of control points and let each of the four rows control a Bézier curve in the parameter ; the four resulting curves are then blended by a second Bézier combination in a parameter . The patch is

with the four cubic blending polynomials. The sixteen control points form a web that the surface bends toward, and the surface stays inside their convex hull.

A bicubic Bézier patch is controlled by a web of sixteen points; the surface passes through the four corners and is drawn toward the interior twelve.

The essential structure remains the affine combination. A Bézier object is a weighted average of control points with weights that are nonnegative and sum to one, which places every curve and surface in the convex hull of its control net and returns the geometry of this module to the algebra of affine combinations.

Footnotes

  1. Lay, Linear Algebra and Its Applications, §8.6 — Curves and Surfaces: quadratic and cubic Bézier curves and the convex-hull property, tangent vectors (Example 1), // continuity and the joining conditions (Example 2), the matrix form , and the bicubic surface patch. The de Casteljau algorithm is the repeated-interpolation form of the recursive subdivision discussed there.

╌╌ END ╌╌