Constructor
new ROI(pointsopt)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
points | Array.<Point2D> | <optional> | Optional initial point list. |
- Source
Classes
Methods
addPoint(point)
Add a point to the ROI.
Parameters:
Name | Type | Description |
---|---|---|
point | Point2D | The Point2D to add. |
- Source
addPoints(rhs)
Add points to the ROI.
Parameters:
Name | Type | Description |
---|---|---|
rhs | Array.<Point2D> | The array of POints2D to add. |
- Source
getCentroid() → {Point2D}
Get the centroid of the roi. Only valid for a non-self-intersecting closed polygon. Ref: https://en.wikipedia.org/wiki/Centroid#Of_a_polygon.
- Source
Returns:
The centroid point.
- Type:
- Point2D
getLength() → {number}
Get the length of the point list.
- Source
Returns:
The length of the point list.
- Type:
- number
getPoint(index) → {Point2D|undefined}
Get a point of the list at a given index.
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 |
undefined
getPoints() → {Array.<Point2D>}
Get the point list.
- Source
Returns:
The list.
- Type:
- Array.<Point2D>