Quiz: B-splines and NURBS
Before this unit: Polynomial wiggles, piecewise cubics and Bézier curves (previous unit); Day 1: Images, filters and frequencies.
See also: Day 5: Deconvolution; Day 14: Labelling.
Short questions to test your understanding. Try each on paper first, then open the answer.
Q1. What does “a curve is a linear combination of basis functions” mean for a B-spline curve? What plays the role of the coefficients?
\mathbf{C}(t) = \sum_i \mathbf{P}_i N_i(t).
Every curve point is a weighted sum of the control points, with weights given by fixed bump functions N_i(t) of the parameter. The control points are the coefficients (the coordinates of the curve in the basis), one 2D coefficient per bump.
Q2. Nearest-neighbour, linear and cubic B-spline interpolation correspond to B-splines of which degrees? Which of them pass through the data values when the data are used directly as control values?
Look at each bump’s values at the integers.
Degrees 0 (box), 1 (hat) and 3 (cubic bell). The box and the hat are 1 at their own sample and 0 at all others, so they interpolate. The cubic bell has values \tfrac16, \tfrac46, \tfrac16 at the integers: used directly, it averages neighbouring values and does not pass through them (it smooths). Unit 4 fixes this with a prefilter.
Q3. A closed uniform cubic B-spline has control points (0,0), (6,0), (6,6), (0,6). Where is the curve point at the knot that belongs to (6, 0)?
Weights \tfrac16, \tfrac46, \tfrac16 on the point and its two neighbours.
\tfrac16[(0,0) + 4(6,0) + (6,6)] = \tfrac16(30, 6) = (5, 1): inside the square, the corner is cut.
Q4. A cubic B-spline curve has 20 control points. You move control point 10. How many spans (knot intervals) of the curve change? What would change in a single Bézier curve of degree 19 through the same points?
Support of a cubic basis function.
4 spans (the support of N_{10,3} covers 4 knot intervals); the rest of the curve does not move. In the degree-19 Bézier curve every point except the two ends moves.
Q5. What does a triple interior knot do to a cubic B-spline curve? Why might you want one?
Continuity C^{p - m}.
The curve is only C^{3-3} = C^0 there: it passes through a control point and can have a sharp corner, while staying C² everywhere else. Useful for outlines with real corners (a crystal, a cut edge) in an otherwise smooth curve.
Q6. Why can no polynomial curve trace a circle exactly, and what do NURBS add to make it possible?
Rational functions.
A circle needs x(t)^2 + y(t)^2 = 1 for all t; polynomials cannot do this (other than constants), so polynomial circles are always approximations (the best cubic Bézier quarter circle is off by 0.027 %). NURBS give every control point a weight and divide by the weighted sum of the basis functions: rational functions, such as x = (1 - t^2)/(1 + t^2), y = 2t/(1 + t^2), can trace a circle exactly.
Q7. In the NURBS mechanism “lift, evaluate, divide”, what are the lifted coordinates of a control point (3, -1) with weight 2, and what happens if all weights are equal?
(w x, w y, w).
(6, -2, 2). If all weights equal w, the third coordinate of the evaluated point is w\sum_i N_i = w, and dividing by it gives back the ordinary B-spline curve: the weights only matter when they differ.
Q8. (math) Use Cox–de Boor on the uniform knots 0, 1, 2, 3 to compute N_{0,2}(0.5).
At t = 0.5 only N_{0,0} is non-zero among the boxes.
N_{0,0}(0.5) = 1, N_{1,0}(0.5) = 0. N_{0,1}(0.5) = \frac{0.5 - 0}{1 - 0}\cdot 1 + \frac{2 - 0.5}{2 - 1}\cdot 0 = 0.5, N_{1,1}(0.5) = 0. N_{0,2}(0.5) = \frac{0.5 - 0}{2 - 0}\cdot 0.5 + \frac{3 - 0.5}{3 - 1}\cdot 0 = 0.125.