Spline class

A Catmull-Rom spline through a series of control points.

Produces a smooth curve that passes through every control point. Uses centripetal parameterization (alpha = 0.5) for best results.

Constructors

Spline(List<Point> controlPoints, {double alpha = 0.5})
const

Properties

alpha double
Tension parameter (0.0 = Catmull-Rom, 0.5 = centripetal, 1.0 = chordal)
final
controlPoints List<Point>
The control points the spline passes through
final
hashCode int
The hash code for this object.
no setteroverride
length int
Number of control points
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
segmentCount int
Number of spline segments (between consecutive control points)
no setter

Methods

approximateLength({int samples = 100}) double
Approximate total arc length by sampling.
boundingBox({int samples = 100}) → ({Point max, Point min})
Get the bounding box of the spline (approximate, via sampling).
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pointAt(double t) Point
Evaluate a point on the spline at parameter t.
sample(int count) List<Point>
Sample count evenly-spaced points along the entire spline.
tangentAt(double t) Point
Get the tangent direction at parameter t.
toPolyline({int samplesPerSegment = 20}) List<Line>
Convert the spline to a polyline (list of line segments).
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
override