Constructor
new Path(inputPointArrayopt, inputControlPointIndexArrayopt)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
inputPointArray | Array.<Point2D> | <optional> | The list of Point2D that make the path (optional). |
inputControlPointIndexArray | Array.<number> | <optional> | The list of control point of path, as indexes (optional). Note: first and last point do not need to be equal. |
- Source
Classes
Members
controlPointIndexArray :Array.<number>
List of control points.
Type:
- Array.<number>
- Source
pointArray :Array.<Point2D>
List of points.
Type:
- Array.<Point2D>
- Source
Methods
addControlPoint(point)
Add a control point to the path.
Parameters:
Name | Type | Description |
---|---|---|
point | Point2D | The Point2D to make a control point. |
- Source
addPoint(point)
Add a point to the path.
Parameters:
Name | Type | Description |
---|---|---|
point | Point2D | The Point2D to add. |
- Source
addPoints(newPointArray)
Add points to the path.
Parameters:
Name | Type | Description |
---|---|---|
newPointArray | Array.<Point2D> | The list of Point2D to add. |
- Source
appenPath(other)
Append a Path to this one.
Parameters:
Name | Type | Description |
---|---|---|
other | Path | The Path to append. |
- Source
getLength() → {number}
Get the length of the path.
- Source
Returns:
The length of the path.
- Type:
- number
getPoint(index) → {Point2D}
Get a point of the list.
Parameters:
Name | Type | Description |
---|---|---|
index | number | The index of the point to get (beware, no size check). |
- Source
Returns:
The Point2D at the given index.
- Type:
- Point2D
isControlPoint(point) → {boolean}
Is the given point a control point.
Parameters:
Name | Type | Description |
---|---|---|
point | Point2D | The Point2D to check. |
- Source
Returns:
True if a control point.
- Type:
- boolean