Constructor
new Path(startPoint)
Start the path with an initial vertex.
Parameters:
Name | Type | Description |
---|---|---|
startPoint |
Vector3 |
- Source:
Methods
asMostRecent() → {Path}
Get a new {Path} with only the last line of this path.
- Source:
Returns:
- Type
- Path
getCenter() → {Vector3}
Get center of the path --- the mean of all vertices.
- Source:
Returns:
- Type
- Vector3
getRadius() → {number}
Get the distance from the center of the path to the furthest vertex.
- Source:
Returns:
- Type
- number
lastVertex() → {Vector3}
Get the last vertex in the path.
- Source:
Returns:
- Type
- Vector3
next(nextPoint)
Add a point to the path.
Parameters:
Name | Type | Description |
---|---|---|
nextPoint |
Vector3 |
- Source:
(generator) vertices() → {AsyncIterable.<Vector3>}
Get all vertices of the path in addition order, starting with the origin.
- Source:
Returns:
- Type
- AsyncIterable.<Vector3>
withBisectedLines(radius) → {Path}
Construct a path based on this one where the distance between vertices is limited by a specific radius.
If any particular line between two vertices is too long, it will be recursive split with a new vertex between them until no line is too long.
Parameters:
Name | Type | Description |
---|---|---|
radius |
number | the distance between consecutive vertices will always be at most this value |
- Source:
Returns:
- Type
- Path