Bezier class Null safety

Abstract base class of Bézier curves.

Implementers

Constructors

Bezier(List<Vector2> points)
Constructs a Bézier curve from a List of Vector2.
Bezier.fromPoints(List<Vector2> curvePoints)
Returns a new instance of the proper subclass of Bezier based on the number of entries in curvePoints. If curvePoints contains three points, returns a QuadraticBezier. If curvePoints contains four points, returns a CubicBezier.
factory

Properties

boundingBox Aabb2
Returns the axis-aligned bounding box of the curve.
read-only
endPoint Vector2
The ending guide point for the curve.
read-only
extrema List<double>
Returns the parameter values that correspond with extrema on both the x and y axes.
read-only
extremaOnX List<double>
Returns the parameter values that correspond with minimum and maximum values on the x axis.
read-only
extremaOnY List<double>
Returns the parameter values that correspond with minimum and maximum values on the y axis.
read-only
firstOrderDerivativePoints List<Vector2>
Derivative points for the first order.
read-only
hashCode int
The hash code for this object. [...]
read-only, inherited
isClockwise bool
True if the curve is clockwise. [...]
read-only
isLinear bool
True if the y values of the control points after being translated and rotated are within a specified small distance (the constant linearTolerance) from zero.
read-only
isSimple bool
True if the normal vectors at the start and end points form an angle less than 60 degrees. [...]
read-only
length double
The approximate arc length of the curve. [...]
read-only
order int
The order of the Bézier curve. [...]
read-only
points List<Vector2>
The start point, end point and control points of the Bézier curve.
final
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
startPoint Vector2
The starting guide point for the curve.
read-only

Methods

derivativeAt(double t, {List<Vector2>? cachedFirstOrderDerivativePoints}) Vector2
Returns the tangent vector at parameter t. [...]
derivativePoints({int derivativeOrder = 1}) List<Vector2>
Derivative points for the order derivativeOrder. Derivative points describe the derivative function of the polynomial function of this and are used by other methods to calculate derivative values. [...]
hullPointsAt(double t) List<Vector2>
Returns the hull points at the parameter value t.
intersectionsWithCurve(Bezier curve, {double curveIntersectionThreshold = 0.5, double minTValueDifference = 0.003}) List<Intersection>
Returns the List of intersections between this and curve. [...]
intersectionsWithLineSegment(Vector2 lineStartPoint, Vector2 lineEndPoint) List<double>
Returns the List of parameter values for intersections between this and the line segment defined by lineStartPoint and lineEndPoint.
intersectionsWithSelf({double curveIntersectionThreshold = 0.5, double minTValueDifference = 0.003}) List<Intersection>
Returns the List of intersections between this and itself. [...]
leftSubcurveAt(double t) Bezier
Returns the subcurve obtained by taking the portion of the curve to the left of parameter value t.
nearestTValue(Vector2 point, {List<Vector2>? cachedPositionLookUpTable, double stepSize = 0.1}) double
Returns the parameter value along the curve that is closest (in terms of geometric distance) to the given point. The approximation uses a two-pass projection test that relies on the curve's position look up table. First, the method determines the point in the look up table that is closest to point. Afterward, it checks the fine interval around that point to see if a better projection can be found. [...]
normalAt(double t, {List<Vector2>? cachedFirstOrderDerivativePoints}) Vector2
The normal vector of the curve at parameter value t. [...]
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
offsetCurve(double distance, {double stepSize = 0.01}) List<Bezier>
Returns a List of Bezier instances that, when taken together, form an approximation of the offset curve distance units away from this. [...]
offsetPointAt(double t, double distance, {List<Vector2>? cachedFirstOrderDerivativePoints}) Vector2
Returns the point distance units away in the clockwise direction from the point along the curve at parameter value t. [...]
overlaps(Bezier curve) bool
True if the bounding box of this intersects with the bounding box of curve.
pointAt(double t) Vector2
Returns the point along the curve at the parameter value t.
positionLookUpTable({int intervalsCount = 50}) List<Vector2>
Returns a List of Vector2 positions at evenly spaced parameter values from 0.0 to 1.0. [...]
rightSubcurveAt(double t) Bezier
Returns the subcurve obtained by taking the portion of the curve to the right of parameter value t.
scaledCurve(double distance) Bezier
Returns a Bezier instance whose endpoints are distance units away from the endpoints of this and whose control points have been moved in the same direction. [...]
simpleSlices({double stepSize = 0.01}) List<BezierSlice>
Returns a List of BezierSlice instances containing simple Bezier instances along with their endpoint parameter values from this. In cases where no simple subcurves can be found with the given stepSize, returns an empty List. [...]
simpleSubcurves({double stepSize = 0.01}) List<Bezier>
Returns a List of simple Bezier instances that make up this when taken together. In cases where no simple subcurves can be found with the given stepSize, returns an empty List. [...]
subcurveBetween(double t1, double t2) Bezier
Returns the subcurve obtained by taking the portion of the curve between parameter values t1 and t2.
toString() String
A string representation of this object. [...]
inherited

Operators

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

Constants

linearTolerance → const double
Maximum distance threshold used for determination of linear curves.
0.0001
originIntersectionTestDistance → const double
Distance used when creating the lines to determine the origin for scaled curves.
10.0