Class: InkPath2D
PathBuilding.InkPath2D(…polygons)
Represents complex shape - collection of polygons.
Constructor
new InkPath2D(…polygons)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
polygons | VarArgs.<PathBuilding.Polygon> | <repeatable> |
Properties:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
bounds | Common.Rect | Ink path bounds | ||
segment | boolean | <optional> | false | It 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
intersects(path) → PathBuilding.InkPath2D.IntersectionContext
Check are 2 ink paths have common part
Parameters:
Name | Type | Description |
---|---|---|
path | PathBuilding.InkPath2D | Intersect with path |
Returns:
Intersection context, when have intersection
Type
PathBuilding.InkPath2D.IntersectionContext
push(…polygons)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
polygons | VarArgs.<PathBuilding.Polygon> | <repeatable> |
Overrides:
toJSON() → {JSON}
Serialize to JSON
Overrides:
Returns:
Ink path data
Type
JSON
transform(matrix) → PathBuilding.PolygonArray
Transform all polygons
Parameters:
Name | Type | Description |
---|---|---|
matrix | Common.Matrix | Transform matrix |
Overrides:
Returns:
poly Transformed polygon
Type
transformSelf(matrix)
Self transform all polygons
Parameters:
Name | Type | Description |
---|---|---|
matrix | Common.Matrix | Transform 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:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
cleanDelta | float | <optional> | 0.1 | Uses 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
(static) fromJSON(data) → PathBuilding.InkPath2D
Deserialize from JSON
Parameters:
Name | Type | Description |
---|---|---|
data | JSON | Ink path data |
Returns:
InkPath2D instance
Type
Type Definitions
IntersectionContext
Polygons which intersects
Properties:
Name | Type | Description |
---|---|---|
poly1 | PathBuilding.Polygon | |
poly2 | PathBuilding.Polygon |