Class: PolygonGeometry
component.PolygonGeometry
classdesc
Represents a polygon geometry in the 2D basic image coordinate system.
All polygons and holes provided to the constructor needs to be closed.
example
var basicPolygon = [[0.5, 0.3], [0.7, 0.3], [0.6, 0.5], [0.5, 0.3]];var polygonGeometry = new PolygonGeometry(basicPolygon);
#
Hierarchy↳
PolygonGeometry
#
Constructors#
constructor• new PolygonGeometry(polygon
, holes?
)
Create a polygon geometry.
throws
{GeometryTagError} Polygon coordinates must be valid basic coordinates.
#
ParametersName | Type | Description |
---|---|---|
polygon | number [][] | Array of polygon vertices. Must be closed. |
holes? | number [][][] | - |
#
OverridesVertexGeometry.constructor
#
Defined incomponent/tag/geometry/PolygonGeometry.ts:32
#
Accessors#
holes• get
holes(): number
[][][]
Get holes property.
#
Returnsnumber
[][][]
Holes of 2d polygon.
#
Defined incomponent/tag/geometry/PolygonGeometry.ts:100
#
polygon• get
polygon(): number
[][]
Get polygon property.
#
Returnsnumber
[][]
Closed 2d polygon.