CS184 Lecture 24 summary

B-Splines and subdivision

Question: Is it possible to compute a rational B-spline using the subdivision scheme from last time?

Answer: Yes, a rational B-spline is just the projection (perspective) of a 4D normal B-spline where the original points are given homogeneous coordinates and scaled by the weight vectors. So, starting with 3D control points pk, generate 4D control points which are: (wkxk, wkyk, wkzk, wk). Then apply the subdivision scheme to give a 4D B-spline with the desired smoothness. Then map the points on the approximate spline back into 3D using the homogeneous transform:  (X(u)/W(u), Y(u)/W(u), Z(u)/W(u))

Fractals

Last time we showed how to refine a piecewise-linear curve using subdivision. First the segments are split by adding the midpoints, then an averaging mask is applied to a subset of the points to generate points on a "smoother" curve. We saw that iterating this process leads to a smooth limit curve. The limit curve is a B-spline for suitable choices of the averaging mask.

But not all recursive subdivision procedures produce smooth results. If instead of an averaging mask, we add an offset normal to the line segment being subdivided, we generate fractals instead.

Example

The von Koch curve. Start with a line segment, divide it into 3 equal pieces. Then attach an equilateral triangle of side 1/3 to the middle segment. Replace the middle segment with the other two sides of this triangle. The resulting curve has four equal-length segments.

The same subdivision scheme can be applied to each of the four segments of the new curve. And then to the segments of length 1/9 of the second subdivision etc. In the limit, we obtain a limit curve called the von Koch snowflake. It is a fractal.

Fractals differ from smooth curves and surfaces because the apparent dimension or volume of their image differs from that of their parametrization. In fact, the natural definitions of dimension give fractional rather than integer values.

Fractal Dimension

A point-set S has dimension D if the following holds:

There is some integer N such that if S is scaled down by 1/N, then exactly ND copies of the scaled shape cover the original shape simply (each point in S is covered once).

Example

A line segment l. Pick any N, say N = 2. Then scaling the segment by 1/2 gives a segment of half the length. Exactly 2 copies of this segment cover the original simply. So 2 = ND, with N = 2, so D = 1.

Example 2

A unit square (including its interior). Pick N = 2. Then scaling the square by 1/2 gives a new square with area 1/4. Exactly 4 copies of this square cover the original simply. So 4 = ND, with N = 2. It follows that D = 2 as expected.

Example 3

The definition of dimension gets interesting when we apply it to the von Koch curve. First, notice that the basic subdivision process breaks the curve into 3 pieces, each of which is scaled by 1/3. So we pick N = 3. Now notice that the final limit curve can be divided into 4 pieces which are similar to the whole curve scaled down by 1/3.

So 4 = ND with N = 3 in this case. It follows that D = log3 4 = 1.26, or D = log 4 / log 3 where the logs can be to any base.