curveCatmullRomAlpha function Curves
Returns a cubic Catmull–Rom curve with the specified alpha
in the range
[0, 1].
If alpha
is zero, produces a uniform spline, equivalent to curveCardinal
with a tension of zero; if alpha
is one, produces a chordal spline; if
alpha
is 0.5, produces a
centripetal spline.
Centripetal splines are recommended to avoid self-intersections and
overshoot. For example:
final line = Line(…)..curve = curveCatmullRom(0.5);
Implementation
CurveFactory curveCatmullRomAlpha(num alpha) =>
(Path context) => alpha != 0 && !alpha.isNaN
? CurveCatmullRom(context, alpha)
: CurveCardinal(context, 0);