interpolate - to alter or corrupt by the insertion of new or foreign matter![]()
One can think about a curve as a straight line which has been stretched and deformed by the curve function
. Each component
of the curve function is typically (and this thesis is no exception) a polynomial of the form
. Further, since each component can be dealt with independently, this chapter deals only with curves in
. The discussion generalizes to higher dimensions.
With extremely high-order polynomials it is possible to interpolate every single point in the stroke we'd like to draw. This is a bad idea for a couple of reasons. First, these polynomials can be difficult to work with; changing one part of the curve will have a large impact on the shape of the rest of the curve. Second, interpolation of every single edge pixel isn't going to give nice looking strokes. Instead, interpolating each edge pixel would result in strokes that take many turns -- it won't look nice. Figure 2.1 shows what might happen as a result of trying to interpolate every point.
A different approach, commonly taken in computer graphics applications, is to represent smooth curving paths with small degree polynomial segments. Each polynomial is defined to exist for values of
on the interval
. Where one polynomial segment stops another one begins. It is standard practice to work with cubic polynomials. These polynomials are the smallest polynomial functions capable of being
and yet they are still relatively easy to work with.
|
center
|
curve - trick, deceptionCubic polynomials are of order four, so that four values,
and![]() |
(1) |
Bezier proposed that instead of specifying the four
values directly, we should instead choose four control points, denoted
,
,
, and
, to specify the end points of the curve segment (
and
) and the tangent at the end points (
and
, combined with
and
respectively). Then for any cubic function, we can write our four control points
as the following system of equations.
By inverting
, (from now on,
will be denoted
, the Bezier control matrix) we can now solve for the coefficients
in terms of the control points
.
Based on this result, the cubic polynomial can be written as follows.
While it is true that every cubic polynomial is
, curves consisting of cubic Bezier segments are not guaranteed to have this property at places where the curve pieces join. At these points, the only guarantee is that of
continuity -- that is to say that the curve is continuous but not differentiable. One way to have
continuity everywhere is to use a single Bezier segment for the entire stroke. Unfortunately, four control points (i.e. a single segment of a cubic curve) do not provide a realistic amount of flexibility. It is possible to do a little bit better by remembering that two of the control points in each segment are dedicated to tangent information at the endpoints. Figure 2.3 shows how to obtain
continuity at join points -- if two curves are defined by
and
and joined at
, then the tangent at
needs to be the same in both directions. This can be accomplished by making
,
, and
colinear. Likewise, piecewise curves composed of Bezier segments can be forced to have
continuity everywhere if
are colinear. Unfortunately, this leaves very little flexibility for defining curve segments -- unless the original goal was a set of connected piecewise cubic line segments which gets mildly interesting near the endpoints. One possibility for achieving
continuity everywhere is to use polynomials of higher degree. A more common solution is described in the next section.
spline - a key that is fixed to one of two connected mechanical parts and fits into a keyway in the otherBy starting over and choosing a different set of criteria for blending functions, it is possible to achieve
There is one major drawback to using B-Splines over Bezier segments. While Bezier curves interpolate
and
, B-Splines interpolate neither. In fact, it is much closer to the truth to say that the B-Spline segment determined by points
is only defined on some interval ``between''
and
. This is slightly unclear but hopefully Figure 2.4 will provide a reasonable illustration.
The most popular
relations between the
and
can be derived as follows. Given two curve segments
and
which join ``near''
, not only must
, but also
. Further, because
and
share only the control points
,
, and
, any condition at
must be strictly dependent on only these three control points. As Angel [1] puts it, ``two conditions that satisfy this symmetry condition are''
![]() |
||
![]() |
![]() |
||
![]() |
The process of rendering B-Spline segments is similar. Due to the computational simplicity of recursive subdivision, it is most common to first convert each B-Spline segment to a Bezier segment. Finding the Bezier control points for a B-Spline segment is done as follows. Recall that
and that
. Also recall that
is the Bezier control matrix. Let
be the column vector of B-Spline control points and let
be the column vector of Bezier control points. Given
and
we have