Curve
An abstract base class for creating an analytic curve object that contains methods for interpolation.
Attributes
- Graph
-
- Supertypes
-
class Objecttrait Anyclass Objecttrait Matchableclass Any
- Known subtypes
-
class CurvePathclass CatmullRomCurve3class CubicBezierCurve3class EllipseCurveclass LineCurve3class QuadraticBezierCurve3Show all
Members list
Value members
Concrete methods
Returns a new curve with copied values from this instance.
Returns a new curve with copied values from this instance.
Attributes
- Returns
-
{Curve} A clone of this instance.
- Definition Classes
-
Object
Generates the Frenet Frames. Requires a curve definition in 3D space. Used in geometries like [[TubeGeometry]] or [[ExtrudeGeometry]].
Generates the Frenet Frames. Requires a curve definition in 3D space. Used in geometries like [[TubeGeometry]] or [[ExtrudeGeometry]].
Value parameters
- {boolean}
-
[closed=false] - Whether the curve is closed or not.
- {number}
-
segments - The number of segments.
Attributes
- Returns
-
{{tangents: Array
, normals: Array , binormals: Array }} The Frenet Frames.
Copies the values of the given curve to this instance.
Copies the values of the given curve to this instance.
Value parameters
- {Curve}
-
source - The curve to copy.
Attributes
- Returns
-
{Curve} A reference to this curve.
Deserializes the curve from the given JSON.
Deserializes the curve from the given JSON.
Value parameters
- {Object}
-
json - The JSON holding the serialized curve.
Attributes
- Returns
-
{Curve} A reference to this curve.
Returns the total arc length of the curve.
Returns the total arc length of the curve.
Attributes
- Returns
-
{number} The length of the curve.
Returns an array of cumulative segment lengths of the curve.
Returns an array of cumulative segment lengths of the curve.
Value parameters
- {number}
-
[divisions=this.arcLengthDivisions] - The number of divisions.
Attributes
- Returns
-
{Array
} An array holding the cumulative segment lengths.
This method returns a vector in 2D or 3D space (depending on the curve definition) for the given interpolation factor.
This method returns a vector in 2D or 3D space (depending on the curve definition) for the given interpolation factor.
Value parameters
- {(Vector2|Vector3)}
-
[optionalTarget] - The optional target vector the result is written to.
- {number}
-
t - A interpolation factor representing a position on the curve. Must be in the range
[0,1].
Attributes
- Returns
-
{(Vector2|Vector3)} The position on the curve. It can be a 2D or 3D vector depending on the curve definition.
This method returns a vector in 2D or 3D space (depending on the curve definition) for the given interpolation factor. Unlike [[Curve#getPoint]], this method honors the length of the curve which equidistant samples.
This method returns a vector in 2D or 3D space (depending on the curve definition) for the given interpolation factor. Unlike [[Curve#getPoint]], this method honors the length of the curve which equidistant samples.
Value parameters
- {(Vector2|Vector3)}
-
[optionalTarget] - The optional target vector the result is written to.
- {number}
-
u - A interpolation factor representing a position on the curve. Must be in the range
[0,1].
Attributes
- Returns
-
{(Vector2|Vector3)} The position on the curve. It can be a 2D or 3D vector depending on the curve definition.
This method samples the curve via [[Curve#getPoint]] and returns an array of points representing the curve shape.
This method samples the curve via [[Curve#getPoint]] and returns an array of points representing the curve shape.
Value parameters
- {number}
-
[divisions=5] - The number of divisions.
Attributes
- Returns
-
{Array<(Vector2|Vector3)>} An array holding the sampled curve values. The number of points is
divisions + 1.
This method samples the curve via [[Curve#getPointAt]] and returns an array of points representing the curve shape. Unlike [[Curve#getPoints]], this method returns equi-spaced points across the entire curve.
This method samples the curve via [[Curve#getPointAt]] and returns an array of points representing the curve shape. Unlike [[Curve#getPoints]], this method returns equi-spaced points across the entire curve.
Value parameters
- {number}
-
[divisions=5] - The number of divisions.
Attributes
- Returns
-
{Array<(Vector2|Vector3)>} An array holding the sampled curve values. The number of points is
divisions + 1.
Returns a unit vector tangent for the given interpolation factor. If the derived curve does not implement its tangent derivation, two points a small delta apart will be used to find its gradient which seems to give a reasonable approximation.
Returns a unit vector tangent for the given interpolation factor. If the derived curve does not implement its tangent derivation, two points a small delta apart will be used to find its gradient which seems to give a reasonable approximation.
Value parameters
- {(Vector2|Vector3)}
-
[optionalTarget] - The optional target vector the result is written to.
- {number}
-
t - The interpolation factor.
Attributes
- Returns
-
{(Vector2|Vector3)} The tangent vector.
Same as [[Curve#getTangent]] but with equidistant samples.
Same as [[Curve#getTangent]] but with equidistant samples.
Value parameters
- {(Vector2|Vector3)}
-
[optionalTarget] - The optional target vector the result is written to.
- {number}
-
u - The interpolation factor.
Attributes
- Returns
-
{(Vector2|Vector3)} The tangent vector.
- See also
-
[[Curve#getPointAt]]
Given an interpolation factor in the range [0,1], this method returns an updated interpolation factor in the same range that can be ued to sample equidistant points from a curve.
Given an interpolation factor in the range [0,1], this method returns an updated interpolation factor in the same range that can be ued to sample equidistant points from a curve.
Value parameters
- {?number}
-
distance - An optional distance on the curve.
- {number}
-
u - The interpolation factor.
Attributes
- Returns
-
{number} The updated interpolation factor.
Serializes the curve into JSON.
Serializes the curve into JSON.
Attributes
- Returns
-
{Object} A JSON object representing the serialized curve.
- See also
-
[[ObjectLoader#parse]]
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]], this method must be called on the composed curve, too.
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]], this method must be called on the composed curve, too.
Attributes
Inherited methods
Attributes
- Inherited from:
- Object
Attributes
- Inherited from:
- Object
Attributes
- Inherited from:
- Object
Attributes
- Inherited from:
- Object
Attributes
- Inherited from:
- Object
Concrete fields
The type property is used for detecting the object type in context of serialization/deserialization.
The type property is used for detecting the object type in context of serialization/deserialization.
Attributes
This value determines the amount of divisions when calculating the cumulative segment lengths of a curve via [[Curve#getLengths]]. To ensure precision when using methods like [[Curve#getSpacedPoints]], it is recommended to increase the value of this property if the curve is very large.
This value determines the amount of divisions when calculating the cumulative segment lengths of a curve via [[Curve#getLengths]]. To ensure precision when using methods like [[Curve#getSpacedPoints]], it is recommended to increase the value of this property if the curve is very large.
Attributes
An internal cache that holds precomputed curve length values.
An internal cache that holds precomputed curve length values.
Attributes
Must be set to true if the curve parameters have changed.
Must be set to true if the curve parameters have changed.