Path

dwv.math. Path

new Path(inputPointArray, inputControlPointIndexArray)

Source:

Path shape.

Parameters:
Name Type Description
inputPointArray Array

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

inputControlPointIndexArray Array

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

Members

controlPointIndexArray :Array

Source:

List of control points.

Type:
  • Array

pointArray :Array

Source:

List of points.

Type:
  • Array

Methods

addControlPoint(point)

Source:

Add a control point to the path.

Parameters:
Name Type Description
point dwv.math.Point2D

The Point2D to make a control point.

addPoint(point)

Source:

Add a point to the path.

Parameters:
Name Type Description
point dwv.math.Point2D

The Point2D to add.

addPoints(newPointArray)

Source:

Add points to the path.

Parameters:
Name Type Description
newPointArray Array

The list of Point2D to add.

appenPath(other)

Source:

Append a Path to this one.

Parameters:
Name Type Description
other dwv.math.Path

The Path to append.

getLength() → {number}

Source:

Get the length of the path.

Returns:

The length of the path.

Type
number

getPoint(index) → {dwv.math.Point2D}

Source:

Get a point of the list.

Parameters:
Name Type Description
index number

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}

Source:

Is the given point a control point.

Parameters:
Name Type Description
point dwv.math.Point2D

The Point2D to check.

Returns:

True if a control point.

Type
boolean