Path

Path shape.

Constructor

new Path(inputPointArrayopt, inputControlPointIndexArrayopt)

Parameters:
NameTypeAttributesDescription
inputPointArrayArray.<Point2D><optional>

The list of Point2D that make the path (optional).

inputControlPointIndexArrayArray.<number><optional>

The list of control point of path, as indexes (optional). Note: first and last point do not need to be equal.

Classes

Path

Members

controlPointIndexArray :Array.<number>

List of control points.

Type:
  • Array.<number>

pointArray :Array.<Point2D>

List of points.

Type:

Methods

addControlPoint(point)

Add a control point to the path.

Parameters:
NameTypeDescription
pointPoint2D

The Point2D to make a control point.

addPoint(point)

Add a point to the path.

Parameters:
NameTypeDescription
pointPoint2D

The Point2D to add.

addPoints(newPointArray)

Add points to the path.

Parameters:
NameTypeDescription
newPointArrayArray.<Point2D>

The list of Point2D to add.

appenPath(other)

Append a Path to this one.

Parameters:
NameTypeDescription
otherPath

The Path to append.

getLength() → {number}

Get the length of the path.

Returns:

The length of the path.

Type: 
number

getPoint(index) → {Point2D}

Get a point of the list.

Parameters:
NameTypeDescription
indexnumber

The index of the point to get (beware, no size check).

Returns:

The Point2D at the given index.

Type: 
Point2D

isControlPoint(point) → {boolean}

Is the given point a control point.

Parameters:
NameTypeDescription
pointPoint2D

The Point2D to check.

Returns:

True if a control point.

Type: 
boolean