next up previous
Next: dd_splines Up: dd_splines Previous: dd_splines

3. B-spline curves

An easy way of making a controlled-design curve with many control points is to use B-spline curves. The ones we shall discuss are called relaxed uniform cubic B-spline curves. You start by specifying a control polygon of points $ B_0,
B_1,\dots B_n $, and you end by getting a curve like the one in Figure [*].

Figure: A relaxed uniform cubic B-spline curve

\begin{picture}(399,165)
\put(0,0){\includegraphics{\epsfile }}
\put(0,8){\makeb...
...(399,85){\makebox(0,0){$B_4$}}
\put(228,161){\makebox(0,0){$B_5$}}
\end{picture}

Here is the method, if done by hand: Divide each leg of the control polygon in thirds by marking two ``division'' points. At each $ B_i $ except the first and last, draw the line segment between the two nearest ``division'' points, and call the midpoint $ S_i $. Then you have made an A-frame with $ B_i $ at the apex, as shown. For completeness, let $ S_0 = B_0 $ and $ S_n = B_n $. See if you can locate the four A-frames in Figure [*].

Figure: A-frames for a relaxed cubic B-spline

\begin{picture}(391,170)
\put(0,0){\includegraphics{\epsfile }}
\put(1,0){\makeb...
...t(293,43){\makebox(0,0){$S_3$}}
\put(335,85){\makebox(0,0){$S_4$}}
\end{picture}

Finally, sketch a cubic Bézier curve from each point $ S_i $ to the next, using as Bézier control points the four points $ S_i $, two ``division'' points, and $ S_{i+1} $, as in Figure [*].

Figure: Construction of a relaxed cubic B-spline

\begin{picture}(391,170)
\put(0,0){\includegraphics{\epsfile }}
\put(1,0){\makeb...
...{3}}
\put(335,85){\makebox(0,0){S}}
\put(344,76){\makebox(0,0){4}}
\end{picture}

As you see, the points of gluing meet the A-frame condition automatically and at the ends the second derivative is zero. Therefore you obtain a relaxed cubic spline curve.

The method as performed on a computer is the same; we merely need to find the Bézier control points in terms of the original B-spline control points:

The ``division'' points on the line segment from $ B_{i-1} $ to $ B_i $ are $ {\frac 2 3} B_{i-1} + {\frac 1 3} B_i $ and $ {\frac 1 3} B_{i-1} + {\frac 2 3} B_i $. Also, $ S_i $ is the average of the ends of its ``cross-segment'', so that

$ S_i = {\frac 1 2}({\frac 1 3} B_{i-1} + {\frac 2 3} B_i) +
{\frac 1 2}( {\frac 2 3} B_i + {\frac 1 3} B_{i+1}) $ $ = $ $ {\frac 1 6} B_{i-1} + {\frac 2 3} B_i + {\frac 1 6} B_{i+1} $, for $ i = 1,\dots, n-1 $.

To summarize the computer method:

Given B-spline control points $ B_0,\dots, B_n $, calculate $ S_i $ $ = $ $ {\frac 1 6} B_{i-1} + {\frac 2 3} B_i + {\frac 1 6} B_{i+1} $, for $ i = 1,\dots, n-1 $, and let $ S_0 = B_0 $, $ S_n = B_n $. There are $ n $ Bézier curves to plot; curve #$ i $ has control points $ S_{i-1} $, $ {\frac 2 3} B_{i-1} + {\frac 1 3} B_i $, $ {\frac 1 3} B_{i-1} + {\frac 2 3} B_i $, and $ S_i $. On curve #$ i $, you can plot points on the curve for, say, $ t = 0, .05, .10,\dots, .95,1 $.

Finally, let's consider the situation mathematically. Let $ p_i (t) $ be the $ i $th Bézier curve ( $ 0 \leq t
\leq 1 $). These $ n $ curves can be combined into a single curve $ P(t) $ for $ 0 \leq t \leq n $ by letting

$ P(t) = p_1 (t) $ for $ 0 \leq t
\leq 1 $,

$ P(t) = p_2 (t-1) $ for $ 1 \leq t \leq 2 $, etc. In general,

$ P(t) = p_i (t- (i-1)) $ for $ i-1 \leq t \leq i $, where $ i = 1,\dots, n $.

Then $ P(t) $ is a relaxed cubic spline curve. $ P(t) $ is called a uniform spline curve because its domain $ 0 \leq t \leq n $ was made from intervals all of length 1. Non-uniform curves will be considered in Section 10.

An important virtue of B-spline curves is that the influence of individual control points is local. In fact, any one point on the curve is influenced by at most four of the B-spline control points. The reason is that for Bézier curve #$ i $, all four control points can be computed from a knowledge of $ B_{i-2} $, $ B_{i-1} $, $ B_i $, and $ B_{i+1} $. Similarly, control point $ B_i $ influences only four Bézier-curve segments: the two that join at $ S_i $ and the two additional ones joined to those. The local effect can be illustrated by changing a single control point. In Figure [*], two choices of the middle control point are indicated, along with the corresponding B-spline curves. Dots on the curves indicate some gluing points $ S_i $.

Figure: The effect of varying one control point

\begin{picture}(391,150)
\put(0,0){\includegraphics{\epsfile }}
\put(195,150){\m...
...here}}
\put(195,72){\makebox(0,0){$\leftarrow$\ or $\rightarrow$}}
\end{picture}

What if you don't want relaxed end conditions? In that case, you can just use less of the curve, say the part from $ S_1 $ to $ S_{n-1} $, i.e., $ 1 \leq t \leq n $. $ B_0 $ and $ B_n $ can still be used as control points to affect the shape of the part of the curve that you are using.




next up previous
Next: dd_splines Up: dd_splines Previous: dd_splines
Kirby A. Baker 2002-03-01