Skip to main content

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#

Constructors#

constructor#

• new PolygonGeometry(polygon, holes?)

Create a polygon geometry.

throws {GeometryTagError} Polygon coordinates must be valid basic coordinates.

Parameters#

NameTypeDescription
polygonnumber[][]Array of polygon vertices. Must be closed.
holes?number[][][]-

Overrides#

VertexGeometry.constructor

Defined in#

component/tag/geometry/PolygonGeometry.ts:32

Accessors#

holes#

• get holes(): number[][][]

Get holes property.

Returns#

number[][][]

Holes of 2d polygon.

Defined in#

component/tag/geometry/PolygonGeometry.ts:100


polygon#

• get polygon(): number[][]

Get polygon property.

Returns#

number[][]

Closed 2d polygon.

Defined in#

component/tag/geometry/PolygonGeometry.ts:92