Cubic Spline Parameterization
Spline parameterization determines how much relative time the point (x(t),y(t)) spends on each component Bezier curve. The parameterization, specified in ccCubicSpline as the IntervalMode, affects the shape of the curve when you move control points.
Different interval modes supported for cubic splines in CVL include the following:
- Uniform mode: intervals between control points are all equal to 1.0. This is the only parameterization that is invariant under affine transformation of the control points. This has advantages when mapping splines. This is the default parameterization.
- Chord length mode: based on the geometry of the control points. Intervals between control points are proportional to the distance between control points. This sometimes produces a better-shaped spline than uniform parameterization, although it can produce somewhat loopy splines.
- Centripetal mode: also based on the geometry of the control points. Intervals are proportional to the square root of the distance between control points. This produces even less loopy splines than chord length parameterization, and is often a compromise between the uniform and chord length parameterizations. This mode often produces the best-shapes splines.
- Fixed mode: intervals are not modified when control points are moved.
The parameterization modes described above only determine how intervals are adjusted when control points are added, deleted, or moved. Through appropriate setters, you can individually adjust each of the intervals to achieve custom parameterizations.
Cubic interpolation spline in the shape of a star
Effect of moving control point under uniform mode
Effect of moving control point under chord length mode
Effect of moving control point under centripetal mode
The last four figures show the effects of moving the control point highlighted in the first figure for different interval modes. The uniform mode (shown in the second figure) produces a curve that most closely resembles the original. The chord length mode (shown in the third figure) produces the loopiest curve. The centripetal mode (shown in the fourth figure) often produces the best-shaped curve.