Creates a Shape from the points
The first point defines the offset, then successive points are added to the curves array as LineCurves. If no points are specified, an empty Shape is created and the .currentPoint is set to the origin.
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.
200
Expects a Integer
Whether or not to automatically close the path.
false
The current offset of the path. Any new Curve added will start here.
new THREE.Vector2()
The array of Curves.
[]
An array of paths that define the holes in the shape.
[]
Readonly
typeA Read-only string to check if this
object type.
Sub-classes will update this value.
Shape
UUID of this object instance.
This gets automatically assigned and shouldn't be edited.
Adds an absolutely positioned EllipseCurve to the path.
Optional
aClockwise: booleanAdds an absolutely positioned EllipseCurve to the path.
The radius of the ellipse in the x axis. Expects a Float
The radius of the ellipse in the y axis. Expects a Float
Optional
aClockwise: booleanOptional
aRotation: numberAdds an EllipseCurve to the path, positioned relative to .currentPoint.
Optional
aClockwise: booleanAdds a lineCurve to close the path.
Generates the Frenet Frames
Expects a Integer
Optional
closed: booleanRequires a Curve definition in 3D space Used in geometries like TubeGeometry or ExtrudeGeometry.
Copies another Curve object to this instance.
Adds an EllipseCurve to the path, positioned relative to .currentPoint.
The radius of the ellipse in the x axis. Expects a Float
The radius of the ellipse in the y axis. Expects a Float
Optional
aClockwise: booleanOptional
aRotation: numberGet total Curve arc length.
Returns a vector for a given position on the curve.
A position on the curve. Must be in the range [ 0, 1 ]
. Expects a Float
Optional
optionalTarget: Vector2If specified, the result will be copied into this Vector, otherwise a new Vector will be created. Default new T
.
Returns an array of points representing a sequence of curves
Optional
divisions: numberNumber of pieces to divide the curve into. Expects a Integer
. Default 12
The division
parameter defines the number of pieces each curve is divided into
However, for optimization and quality purposes, the actual sampling resolution for each curve depends on its type
For example, for a LineCurve, the returned number of points is always just 2.
Returns a unit vector tangent at t
A position on the curve. Must be in the range [ 0, 1 ]
. Expects a Float
Optional
optionalTarget: Vector2If specified, the result will be copied into this Vector, otherwise a new Vector will be created.
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.
Given u in the range [ 0, 1 ]
,
Expects a Float
Expects a Float
t
also in the range [ 0, 1 ]
. Expects a Float
.
u
and t
can then be used to give you points which are equidistant from the ends of the curve, using .getPoint.
Connects a LineCurve from .currentPoint to x, y onto the path.
Expects a Float
Expects a Float
Points are added to the curves array as LineCurves.
Connects a new SplineCurve onto the path.
Defines an arbitrary 2d Shape plane using paths with optional holes
Remarks
It can be used with ExtrudeGeometry, ShapeGeometry, to get points, or to get triangulated faces.
Example
See