CatmullRomSpline class

A 2D spline that passes smoothly through the given control points using a centripetal Catmull-Rom spline.

When the curve is evaluated with transform, the output values will move smoothly from one control point to the next, passing through the control points.

Unlike most cubic splines, Catmull-Rom splines have the advantage that their curves pass through the control points given to them. They are cubic polynomial representations, and, in fact, Catmull-Rom splines can be converted mathematically into cubic splines. This class implements a "centripetal" Catmull-Rom spline. The term centripetal implies that it won't form loops or self-intersections within a single segment. See also:

Inheritance

Constructors

CatmullRomSpline(List<Offset> controlPoints, {double tension: 0.0, Offset startHandle, Offset endHandle})
Constructs a centripetal Catmull-Rom spline curve. [...]
CatmullRomSpline.precompute(List<Offset> controlPoints, {double tension: 0.0, Offset startHandle, Offset endHandle})
Constructs a centripetal Catmull-Rom spline curve. [...]

Properties

hashCode int
The hash code for this object. [...]
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
samplingSeed int
Returns a seed value used by generateSamples to seed a random number generator to avoid sample aliasing. [...]
@protected, read-only, override

Methods

findInverse(double x) double
Returns the parameter t that corresponds to the given x value of the spline. [...]
inherited
generateSamples({double start: 0.0, double end: 1.0, double tolerance: 1e-10}) Iterable<Curve2DSample>
Generates a list of samples with a recursive subdivision until a tolerance of tolerance is reached. [...]
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
Returns a string representation of this object.
inherited
transform(double t) Offset
Returns the value of the curve at point t. [...]
inherited
transformInternal(double t) Offset
Returns the value of the curve at point t. [...]
override

Operators

operator ==(Object other) bool
The equality operator. [...]
inherited