Curves and Surfaces (Advanced Methods in Computer Graphics) Part 2

Parametric Continuity

In the previous section we saw an example (Fig. 7.2) of a set of piecewise cubic curves joined together to form a single “continuous” curve. Clearly we require higher levels of continuity at the points where two curves meet, in order to get a smooth transition from one polynomial curve on to another.

A parametric curve defined using cubic polynomials as in Eq. 7.8 has the property that the first and second order derivatives exist and are continuous over the interval in which the curve is defined. Two parametric curves PA(t) = (xA(t), yA(t), zA(t)) and PB(t) = (xB(t), yB(t), zb(t)) are said to have C° continuity if they meet at a common point M (Fig. 7.3). That is, there exits valid parametric values t1, t2 such that

tmpc2f9-433_thumb_thumb

If the tangents to the two curves at M also coincide, then the curves have C1 continuity. The tangent direction at M is obtained by differentiating the cubic polynomials with respect to t, and substituting the parametric value for the knot M. We use the following notation for the derivatives of the x-polynomial in Eq. 7.8:


tmpc2f9-434_thumb_thumb

with similar notations for the y-polynomial and the z-polynomial. The vector (xA ‘(t), yA’(t), zA’(t)) gives the tangent direction on the curve A at point P(t). If t denotes time, then this vector represents the velocity of the point P as it moves along the curve A. C1 continuity implies that the velocity of P considered as a point on the curve A at the knot M is the same as its velocity when considered as a point on the curve B:

tmpc2f9-435_thumb_thumb

If two curves are joined with C1 continuity, the point P(t) will have at most finite acceleration as it crosses the knot M. Second order continuity denoted by C2 requires that the second derivatives of both curves at M are equal. That is,

tmpc2f9-436_thumb_thumb

 

Examples of piecewise cubic curves with different orders of parametric and geometric continuity

Fig. 7.3 Examples of piecewise cubic curves with different orders of parametric and geometric continuity

The above vectors represent the curvature at M, or equivalently acceleration of the point P(t) if t denotes time. The continuity constraints discussed above are often relaxed to just smoothness constraints that define only the important shape characteristics used for constructing splines. For example, the requirement in Eq. 7.22 to have the same tangent vector for both curves at the joint can be relaxed to the condition that the tangent vectors are just parallel, with possibly unequal magnitudes. The modified constraint can be written as

tmpc2f9-438_thumb_thumb

for some constant ß. Two curves satisfying the above equation are said to have a geometric continuity G1 at the common point M. Note that we can always re-parameterize the curve A by substituting t = ßu in its equation, and the resultant tangent vectors at M would still be equal, satisfying the C1 continuity constraint. The geometric continuity G2 is also similarly defined by introducing a constant of proportionality in Eq. 7.23. The difference between parametric and geometric continuity is illustrated through an example in Fig. 7.3.

In column (a) of Fig. 7.3, the curves A and B meet at M with C0 continuity. The first and the second derivatives of the curves do not meet at the corresponding point. Column (b) shows the curves with C1 continuity at M where the tangent vectors are equal. Correspondingly, the first derivatives of the curves meet at a point. The curves formed using second derivatives are discontinuous. Column (c) shows the curves with G1 continuity where the tangent vectors at M are only parallel but unequal in magnitude. The first derivatives of the curves therefore do not meet at the corresponding point. In column (d), the curves meet with C2 continuity at M. In this case, the first derivatives meet at a common point with C1 continuity. The second derivatives of the curves also meet with C0 continuity. Note that the second derivatives of cubic polynomial curves are always straight lines.

Hermite Splines

Hermite splines are cubic polynomial interpolation curves passing through two control points P1 = (x1, y1, z1) and P2 = (x2, y2, z2), with the additional requirement that the curve is tangential to the specified directions at the two end points (Fig. 7.4).

In Fig. 7.4a, the required tangent directions at the end points are denoted by m1 and m2 with components (x10, y10, z10) and (x20, y20, z20) respectively. For the interpolating curve, we use the parametric equation given in Eq. 7.8. The control point P1 corresponds to the parameter value of 0, and P2 corresponds to t = 1. The tangent vector components at t are given by

tmpc2f9-439_thumb_thumb

 

Hermite polynomial interpolation

Fig. 7.4 Hermite polynomial interpolation

Similar to Eq. 7.10, we can now write an equation using position coordinates and tangent vector components:

tmpc2f9-441_thumb_thumb

Substituting the parameter values for the end points in the above equation, we have

tmpc2f9-442_thumb_thumb

The basis matrix for Hermite polynomial interpolation is the inverse of the 4 x 4 matrix in the above equation, and is given by

tmpc2f9-443_thumb_thumb

Pre-multiplying the above matrix by T = [1, t, t2, t3], we get the blending functionsf (t) (seeEq. 7.19):

tmpc2f9-444_thumb_thumb

From the above expressions, we get the parametric equation for the Hermite polynomial curve:

tmpc2f9-445_thumb_thumb

 

Hermite interpolation spline

Fig. 7.5 Hermite interpolation spline

The tangent vectors m1 and m2 can have arbitrary magnitude if we require only G1 continuity at the end points when two curves are joined together. Increasing the magnitude causes the curve to align closer to the tangent direction. A scale parameter a > 0 for the tangents is introduced into this equation to control the shape of the cubic curve:

tmpc2f9-447_thumb_thumb

a is sometimes referred to as the tension parameter of the curve. An example with four different values of a is shown in Fig. 7.4b. Note that when a = 0, the above equation represents a linear interpolation between P1 and P2.

Given n points (n > 2), we can develop an interpolating spline that passes through all the points by constructing Hermite cubic curves for every consecutive pair of points. The tangent direction at each knot must be carefully specified by the user in such a way that it corresponds to the tangents to curves on both sides of the knot.

In Fig. 7.5, piecewise Hermite polynomial curves are fitted through a set of points. The points are the same as the knots of the interpolation curve shown in Fig. 7.2. The common tangent vectors are all defined as parallel to negative y-axis.

Cardinal Splines

A cardinal spline is a smooth piecewise cubic polynomial curve that passes through every point except the first and the last in a given set of control points, maintaining first-order continuity at every point. A cardinal spline works very much like a Hermite spline with the exception that the tangent directions are not specified by the user but derived from the control points themselves.

Consider a set of four control points P0, P1, P2, P3 as shown in Fig. 7.6. The tangent at P1 is specified in the direction of the vector P2 — P0, and the tangent at P2 in the direction of the vector P3 — P1. We can now use Eq. 7.31 with m1 = P2 — P0, and m2 = P3 — P1 to generate a Hermite cubic polynomial curve between P1 and P2.

A cardinal spline definition using four points

Fig. 7.6 A cardinal spline definition using four points

The scaling parameter a controls the tension of the curve. Without any reference to the tangent directions, the curve’s equation can be rewritten as a function of the control points alone as below.

tmpc2f9-449_thumb[2]

Writing the coefficients of 1, t, t2, t3 of each blending function in the above equation as columns of a 4 x 4 matrix, we obtain the basis matrix for cardinal splines:

tmpc2f9-450_thumb[2]

Given a set of n + 2 control pointstmpc2f9-451_thumb[2]we can fit a cubic curve with the above basis matrix to every pair of consecutive control pointstmpc2f9-452_thumb[2]with    tangent    vectors    defined    astmpc2f9-453_thumb[2]

andtmpc2f9-454_thumb[2]In    other    words we need to process overlapping blocks of

four control pointstmpc2f9-455_thumb[2]with    only    the    middle two points used for interpolation at a time.

When a = 0.5, we get a special case of cardinal splines called Catmull-Rom splines. It directly follows from Eq. 7.33 that Catmull-Rom splines are given by the parametric equation:

tmpc2f9-461_thumb[2]

 

A Catmull-Rom spline through a set of control points

Fig. 7.7 A Catmull-Rom spline through a set of control points

Figure 7.7 shows a Catmull-Rom spline generated using a set of control points. Compare this figure with the piecewise cubic spline in Fig. 7.2 where the same set of control points was used.

Next post:

Previous post: