[page:Curve] →
[name]
An abstract base class further extending [page:Curve]. A CurvePath is simply an array of connected curves,
but retains the api of a curve.
Constructor
[name]()
The constructor take no parameters.
Properties
[property:array curves]
The array of [page:Curve]s
[property:array bends]
An array of [page:Curve]s used to transform and bend the curve using [page:CurvePath.getWrapPoints].
[property:boolean autoClose]
Whether or not to automatically close the path.
Methods
[method:Array getWrapPoints]( [page:Array vertices], [page:Curve curve] )
vertices -- An array of [page:Vector2]s to modify
curve -- An array of 2d [page:Curve]s
Modifies the array of vertices by warping it by the curve. The curve parameter also accepts objects with similar
interfaces such as [page:CurvePath], [page:Path], [page:SplineCurve], etc. Returns the original vertices after
modification.
[method:null addWrapPath]( [page:Curve curve] )
curve -- A [page:Curve] or object with a similar interface.
Pushes a curve onto the bends array.
[method:Geometry createGeometry]( [page:Vector3 points] )
points -- An array of [page:Vector3]s
Creates a geometry from points
[method:Geometry createPointsGeometry]( [page:Integer divisions] )
divisions -- How many segments to create with [page:Vector3]s. Defaults to 12.
Creates a [page:Geometry] object comprised of [page:Vector3]s
[method:Geometry createSpacedPointsGeometry]( [page:Integer divisions] )
divisions -- How many segments to create with [page:Vector3]s. Defaults to 12.
Creates a [page:Geometry] object comprised of [page:Vector3]s that are equidistant.
[method:null add]( [page:Curve curve] )
curve -- The [page:Curve curve] to add
Pushes a curve onto the curves array.
[method:null closePath]()
Adds a curve to close the path.
[method:Object getBoundingBox]()
Returns an object with the keys minX, minY, maxX, maxY, (if 3d: maxZ, minZ)
[method:Float getCurveLengths]()
Adds together the length of the curves
[method:Array getTransformedPoints]( [page:Integer segments], [page:Array bends] )
segments -- The number of segments to create using the getPoints()
bends -- (optional) An array of [page:Curve]s used to transform the points. Defaults to this.bends if blank.
Uses this CurvePath to generate a series of points transformed by the curves in the bends array. Returns an
array of [page:Vector2]s.
[method:Array getTransformedSpacedPoints]( [page:Integer segments], [page:Array bends] )
segments -- The number of segments to create using the getPoints()
bends -- (optional) Defaults to this.bends if blank. An array of [page:Curve]s used to transform the points.
Uses this CurvePath to generate a series equidistant points that are then transformed by the curves in the bends.
Returns an array of [page:Vector2]s.
Source
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]