CatmullRomCurve.precompute constructor Null safety
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(tension != null),
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);