File: Curve.md | Updated: 11/15/2025
An abstract base class for creating an analytic curve object that contains methods for interpolation.
Constructs a new curve.
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.
Default is 200.
Must be set to true if the curve parameters have changed.
Default is false.
The type property is used for detecting the object type in context of serialization/deserialization.
Returns a new curve with copied values from this instance.
Returns: A clone of this instance.
Generates the Frenet Frames. Requires a curve definition in 3D space. Used in geometries like TubeGeometry or ExtrudeGeometry.
segments | The number of segments.
---|---
closed | Whether the curve is closed or not. Default is false.
Returns: The Frenet Frames.
Copies the values of the given curve to this instance.
source | The curve to copy.
---|---
Returns: A reference to this curve.
Deserializes the curve from the given JSON.
json | The JSON holding the serialized curve.
---|---
Returns: A reference to this curve.
Returns the total arc length of the curve.
Returns: The length of the curve.
Returns an array of cumulative segment lengths of the curve.
divisions | The number of divisions. Default is this.arcLengthDivisions.
---|---
Returns: 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.
t | A interpolation factor representing a position on the curve. Must be in the range [0,1].
---|---
optionalTarget | The optional target vector the result is written to.
Returns: 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.
u | A interpolation factor representing a position on the curve. Must be in the range [0,1].
---|---
optionalTarget | The optional target vector the result is written to.
Returns: 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.
divisions | The number of divisions. Default is 5.
---|---
Returns: 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.
divisions | The number of divisions. Default is 5.
---|---
Returns: 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.
t | The interpolation factor.
---|---
optionalTarget | The optional target vector the result is written to.
Returns: The tangent vector.
Same as Curve#getTangent but with equidistant samples.
u | The interpolation factor.
---|---
optionalTarget | The optional target vector the result is written to.
See:
Returns: The tangent vector.
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.
u | The interpolation factor.
---|---
distance | An optional distance on the curve. Default is null.
Returns: The updated interpolation factor.
Serializes the curve into JSON.
See:
Returns: A JSON object representing the serialized curve.
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.