Threepp.Path¶
2D path
Creates a 2D path made up of multiple curves. It can be drawn with methods similar to the Canvas API.
Members¶
Constructors¶
Properties¶
Methods¶
- getLength
- getPoint
- getPointAt
- moveTo
- lineTo
- quadraticCurveTo
- bezierCurveTo
- arc
- absarc
- absellipse
- splineThru
- closePath
Path¶
Constructor
Arguments
| Arguments | Default | Description |
|---|---|---|
points |
|
Array of initial points (optional). |
Description
Constructor
autoClose¶
Property \ Access: r/w
Description
Whether to close the path automatically
currentPoint¶
Property \ Access: r/w
Description
Current pen position (read-only)
getLength¶
Method
Description
Gets the total length of the path
getPoint¶
Method
Arguments
| Arguments | Default | Description |
|---|---|---|
t |
|
Description
Gets the point at parameter t (0-1)
getPointAt¶
Method
Arguments
| Arguments | Default | Description |
|---|---|---|
u |
|
Description
Gets the point at arc-length parameter u
moveTo¶
Method
Arguments
| Arguments | Default | Description |
|---|---|---|
x |
|
|
y |
|
Description
Moves the pen
lineTo¶
Method
Arguments
| Arguments | Default | Description |
|---|---|---|
x |
|
|
y |
|
Description
Draws a straight line
quadraticCurveTo¶
Method
Arguments
| Arguments | Default | Description |
|---|---|---|
cpX |
|
|
cpY |
|
|
x |
|
|
y |
|
Description
Draws a quadratic Bezier curve
bezierCurveTo¶
Method
Arguments
| Arguments | Default | Description |
|---|---|---|
cp1x |
|
|
cp1y |
|
|
cp2x |
|
|
cp2y |
|
|
x |
|
|
y |
|
Description
Draws a cubic Bezier curve
arc¶
Method
Arguments
| Arguments | Default | Description |
|---|---|---|
x |
|
|
y |
|
|
radius |
|
|
startAngle |
|
|
endAngle |
|
|
clockwise |
|
Description
Draws an arc relative to the current position
absarc¶
Method
Arguments
| Arguments | Default | Description |
|---|---|---|
x |
|
|
y |
|
|
radius |
|
|
startAngle |
|
|
endAngle |
|
|
clockwise |
|
Description
Draws an arc at an absolute position
absellipse¶
Method
Arguments
| Arguments | Default | Description |
|---|---|---|
x |
|
|
y |
|
|
xRadius |
|
|
yRadius |
|
|
startAngle |
|
|
endAngle |
|
|
clockwise |
|
|
rotation |
|
Description
Draws an ellipse
splineThru¶
Method
Arguments
| Arguments | Default | Description |
|---|---|---|
points |
|
Description
Draws a spline through an array of points
closePath¶
Method
Description
Closes the path