Threepp.Shape¶
Shape (2D shape with holes)
A 2D shape class that inherits from Path and can have holes. Used with ExtrudeGeometry and ShapeGeometry.
Members¶
Constructors¶
Properties¶
Methods¶
- getLength
- getPoint
- getPointAt
- moveTo
- lineTo
- quadraticCurveTo
- bezierCurveTo
- arc
- absarc
- absellipse
- splineThru
- closePath
- addHole
- getHole
- getHoleCount
- uuid
Shape¶
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
addHole¶
Method
Arguments
| Arguments | Default | Description |
|---|---|---|
hole |
|
Description
Adds a hole (a Path object)
getHole¶
Method
Arguments
| Arguments | Default | Description |
|---|---|---|
index |
|
Description
Gets a hole
getHoleCount¶
Method
Description
Gets the number of holes
uuid¶
Method
Description
Gets the UUID of the shape