dwv.math. Path

new Path(inputPointArray, inputControlPointIndexArray)

Path shape.

Parameters:
NameTypeDescription
inputPointArrayArray

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

inputControlPointIndexArrayArray

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

Members

controlPointIndexArray :Array

List of control points.

Type:
  • Array

pointArray :Array

List of points.

Type:
  • Array

Methods

addControlPoint(point)

Add a control point to the path.

Parameters:
NameTypeDescription
pointdwv.math.Point2D

The Point2D to make a control point.

addPoint(point)

Add a point to the path.

Parameters:
NameTypeDescription
pointdwv.math.Point2D

The Point2D to add.

addPoints(newPointArray)

Add points to the path.

Parameters:
NameTypeDescription
newPointArrayArray

The list of Point2D to add.

appenPath(other)

Append a Path to this one.

Parameters:
NameTypeDescription
otherdwv.math.Path

The Path to append.

getLength() → {number}

Get the length of the path.

Returns:

The length of the path.

Type: 
number

getPoint(index) → {dwv.math.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: 
dwv.math.Point2D

isControlPoint(point) → {boolean}

Is the given point a control point.

Parameters:
NameTypeDescription
pointdwv.math.Point2D

The Point2D to check.

Returns:

True if a control point.

Type: 
boolean