Skip to main content

Class: InkPath2D

PathBuilding.InkPath2D(…polygons)

Represents complex shape - collection of polygons.

Constructor

new InkPath2D(…polygons)

Parameters:
NameTypeAttributesDescription
polygonsVarArgs.<PathBuilding.Polygon><repeatable>
Properties:
NameTypeAttributesDefaultDescription
boundsCommon.RectInk path bounds
segmentboolean<optional>falseIt is true when InkPath2D is result from addition or prediction

Since:

  • version 3.0

Extends

Methods

clone() → PathBuilding.PolygonArray

Clone instance

Overrides:

Returns:

PolygonArray instance

Type

PathBuilding.PolygonArray

intersects(path) → PathBuilding.InkPath2D.IntersectionContext

Check are 2 ink paths have common part

Parameters:
NameTypeDescription
pathPathBuilding.InkPath2DIntersect with path
Returns:

Intersection context, when have intersection

Type

PathBuilding.InkPath2D.IntersectionContext

push(…polygons)

Parameters:
NameTypeAttributesDescription
polygonsVarArgs.<PathBuilding.Polygon><repeatable>

Overrides:

toJSON() → {JSON}

Serialize to JSON

Overrides:

Returns:

Ink path data

Type

JSON

transform(matrix) → PathBuilding.PolygonArray

Transform all polygons

Parameters:
NameTypeDescription
matrixCommon.MatrixTransform matrix

Overrides:

Returns:

poly Transformed polygon

Type

PathBuilding.PolygonArray

transformSelf(matrix)

Self transform all polygons

Parameters:
NameTypeDescription
matrixCommon.MatrixTransform matrix

Overrides:

union(cleanDeltaopt) → PathBuilding.Polygon

Removes self-intersections from the supplied polygon (by performing a boolean union operation using the nominated PolyFillType).Polygons with non-contiguous duplicate vertices (ie 'touching') will be split into two polygons.

Parameters:
NameTypeAttributesDefaultDescription
cleanDeltafloat<optional>0.1Uses Radial Reduction algorithm, which merges sequential vertices, if they are at or under certain distance of each other, merge also collinear vertices

See:

Returns:

Merged polygon with holes if they are available

Type

PathBuilding.Polygon

(static) fromJSON(data) → PathBuilding.InkPath2D

Deserialize from JSON

Parameters:
NameTypeDescription
dataJSONInk path data
Returns:

InkPath2D instance

Type

PathBuilding.InkPath2D

Type Definitions

IntersectionContext

Polygons which intersects

Properties:
NameTypeDescription
poly1PathBuilding.Polygon
poly2PathBuilding.Polygon

Home