Curve class

Extensible curve object.

Some common of curve methods: .getPoint( t, optionalTarget ), .getTangent( t, optionalTarget ) .getPointAt( u, optionalTarget ), .getTangentAt( u, optionalTarget ) .getPoints(), .getSpacedPoints() .getLength() .updateArcLengths()

This following curves inherit from THREE.Curve:

-- 2D curves -- THREE.ArcCurve THREE.CubicBezierCurve THREE.EllipseCurve THREE.LineCurve THREE.QuadraticBezierCurve THREE.SplineCurve

-- 3D curves -- THREE.CatmullRomCurve3 THREE.CubicBezierCurve3 THREE.LineCurve3 THREE.QuadraticBezierCurve3

A series of curves can be represented as a THREE.CurvePath.

Implementers

Constructors

Curve()
Curve.fromJson(Map<String, dynamic> json)

Properties

arcLengthDivisions int
This value determines the amount of divisions when calculating the cumulative segment lengths of a curve via getLengths. To ensure precision when using methods like getSpacedPoints, it is recommended to increase arcLengthDivisions if the curve is very large. Default is 200.
getter/setter pair
autoClose bool
getter/setter pair
cacheArcLengths List<double>?
getter/setter pair
cacheLengths List<double>?
getter/setter pair
currentPoint ↔ Vector2
getter/setter pair
curves List<Curve>
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
isCubicBezierCurve bool
getter/setter pair
isEllipseCurve bool
getter/setter pair
isLineCurve bool
getter/setter pair
isLineCurve3 bool
getter/setter pair
isQuadraticBezierCurve bool
getter/setter pair
isSplineCurve bool
getter/setter pair
needsUpdate bool
getter/setter pair
points List<Vector>
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
userData Map<String, dynamic>
getter/setter pair
v0 ↔ Vector
getter/setter pair
v1 ↔ Vector
getter/setter pair
v2 ↔ Vector
getter/setter pair

Methods

clone() Curve
Creates a clone of this instance.
computeFrenetFrames(int segments, bool closed) FrenetFrames
Generates the Frenet Frames. Requires a curve definition in 3D space. Used in geometries like TubeGeometry or ExtrudeGeometry.
copy(Curve source) Curve
Copies another name object to this instance.
fromJson(Map<String, dynamic> json) Curve
Copies the data from the given JSON object to this instance.
getLength() double
Get total curve arc length
getLengths(int? divisions) List<double>
Get list of cumulative segment lengths
getPoint(double t, [Vector? optionalTarget]) → Vector?
getPointAt(double u, [Vector? optionalTarget]) → Vector?
u - A position on the curve according to the arc length. Must be in the range 0, 1 .
getPoints([int divisions = 5]) List<Vector?>
divisions -- number of pieces to divide the curve into. Default is 5.
getSpacedPoints([int divisions = 5, int offset = 0]) List<Vector?>
divisions -- number of pieces to divide the curve into. Default is 5.
getTangent(double t, [Vector? optionalTarget]) → Vector
t - A position on the curve. Must be in the range 0, 1 .
getTangentAt(double u, [Vector? optionalTarget]) → Vector
u - A position on the curve according to the arc length. Must be in the range 0, 1 .
getUtoTmapping(double u, [double? distance]) double
Given u in the range ( 0 .. 1 ), returns t also in the range ( 0 .. 1 ). u and t can then be used to give you points which are equidistant from the ends of the curve, using getPoint.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Returns a JSON object representation of this instance.
toString() String
A string representation of this object.
inherited
updateArcLengths() → void
Update the cumulative segment distance cache. The method must be called every time curve parameters are changed. If an updated curve is part of a composed curve like CurvePath, updateArcLengths must be called on the composed curve, too.

Operators

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

Static Methods

castJson(Map<String, dynamic> json) Curve