CatmullRomCurve.precompute constructor
Constructs a centripetal CatmullRomCurve.
Same as CatmullRomCurve.new, but it precomputes the internal curve data structures for a more predictable computation load.
Implementation
CatmullRomCurve.precompute(this.controlPoints, {this.tension = 0.0})
: assert(
() {
return validateControlPoints(
controlPoints,
tension: tension,
reasons: _debugAssertReasons..clear(),
);
}(),
'control points $controlPoints could not be validated:\n ${_debugAssertReasons.join('\n ')}',
),
// Pre-compute samples so that we don't have to evaluate the spline's inverse
// all the time in transformInternal.
_precomputedSamples = _computeSamples(controlPoints, tension);