CurvePath

THREE.extras.core.CurvePath
class CurvePath extends Curve

A base class extending [[Curve]]. CurvePath is simply an array of connected curves, but retains the API of a curve.

Attributes

Graph
Supertypes
class Curve
class Object
trait Any
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def add(curve: Curve): Unit

Adds a curve to this curve path.

Adds a curve to this curve path.

Value parameters

{Curve}

curve - The curve to add.

Attributes

Adds a line curve to close the path.

Adds a line curve to close the path.

Attributes

Returns

{CurvePath} A reference to this curve path.

override def copy(source: Curve): CurvePath

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.

Definition Classes
override def fromJSON(json: Object): CurvePath

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.

Definition Classes
def getCurveLengths(): Array[Double]

Returns list of cumulative curve lengths of the defined curves.

Returns list of cumulative curve lengths of the defined curves.

Attributes

Returns

{Array } The curve lengths.

override def getLength(): Double

Returns the total arc length of the curve.

Returns the total arc length of the curve.

Attributes

Returns

{number} The length of the curve.

Definition Classes
override def getPoint(t: Double, optionalTarget: UndefOr[Vector2 | Vector3]): Vector2 | Vector3

This method returns a vector in 2D or 3D space (depending on the curve definitions) for the given interpolation factor.

This method returns a vector in 2D or 3D space (depending on the curve definitions) 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.

Definition Classes
override def getPoints(divisions: Double): Array[Vector2 | Vector3]

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.

Definition Classes
override def getSpacedPoints(divisions: Double): Array[Vector2 | Vector3]

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.

Definition Classes
override def toJSON(): Object

Serializes the curve into JSON.

Serializes the curve into JSON.

Attributes

Returns

{Object} A JSON object representing the serialized curve.

See also

[[ObjectLoader#parse]]

Definition Classes

Inherited methods

override def clone(): Curve

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
Curve -> Object
Inherited from:
Curve
def computeFrenetFrames(segments: Double, closed: Boolean): FrenetFrames

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.

Inherited from:
Curve
def getLengths(divisions: Double): Array[Double]

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.

Inherited from:
Curve
def getPointAt(u: Double, optionalTarget: UndefOr[Vector2 | Vector3]): Vector2 | Vector3

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.

Inherited from:
Curve
def getTangent(t: Double, optionalTarget: UndefOr[Vector2 | Vector3]): Vector2 | Vector3

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.

Inherited from:
Curve
def getTangentAt(u: Double, optionalTarget: UndefOr[Vector2 | Vector3]): Vector2 | Vector3

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]]

Inherited from:
Curve
def getUtoTmapping(u: Double, distance: UndefOr[Double]): Double

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.

Inherited from:
Curve
def hasOwnProperty(v: String): Boolean

Attributes

Inherited from:
Object
def isPrototypeOf(v: Object): Boolean

Attributes

Inherited from:
Object
def propertyIsEnumerable(v: String): Boolean

Attributes

Inherited from:
Object
def toLocaleString(): String

Attributes

Inherited from:
Object
def updateArcLengths(): Unit

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 from:
Curve
def valueOf(): Any

Attributes

Inherited from:
Object

Concrete fields

var autoClose: Boolean

Whether the path should automatically be closed by a line curve.

Whether the path should automatically be closed by a line curve.

Attributes

var curves: Array[Curve]

An array of curves defining the path.

An array of curves defining the path.

Attributes

Inherited fields

val `type`: String

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

Inherited from:
Curve
var arcLengthDivisions: Double

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

Inherited from:
Curve
var cacheArcLengths: Array[Double]

An internal cache that holds precomputed curve length values.

An internal cache that holds precomputed curve length values.

Attributes

Inherited from:
Curve
var needsUpdate: Boolean

Must be set to true if the curve parameters have changed.

Must be set to true if the curve parameters have changed.

Attributes

Inherited from:
Curve