BooleanOperations

Methods

(static) calculateIntersections(polygon1, polygon2) → {Array.<Array.<Point>>}

Returns intersection points between boundaries of two polygons as two array of points
Points in the first array belong to first polygon, points from the second - to the second. Points in each array are ordered according to the direction of the correspondent polygon
Source:
Parameters:
Name Type Description
polygon1 Polygon first operand
polygon2 Polygon second operand
Returns:
Type:
Array.<Array.<Point>>

(static) innerClip(polygon1, polygon2) → {Array.<Array.<Shape>>}

Returns boundary of intersection between two polygons as two arrays of shapes (Segments/Arcs)
The first array are shapes from the first polygon, the second array are shapes from the second
Source:
Parameters:
Name Type Description
polygon1 Polygon first operand
polygon2 Polygon second operand
Returns:
Type:
Array.<Array.<Shape>>

(static) intersect(polygon1, polygon2) → {Polygon}

Intersect two polygons and returns new polygon Point belongs to the resulted polygon is it belongs to the first AND to the second polygon
Source:
Parameters:
Name Type Description
polygon1 Polygon first operand
polygon2 Polygon second operand
Returns:
Type:
Polygon

(static) outerClip(polygon1, polygon2) → {Array.<Shape>}

Returns boundary of subtraction of the second polygon from first polygon as array of shapes
Source:
Parameters:
Name Type Description
polygon1 Polygon first operand
polygon2 Polygon second operand
Returns:
Type:
Array.<Shape>

(static) subtract(polygon1, polygon2) → {Polygon}

Subtract second polygon from the first and returns new polygon Point belongs to the resulted polygon if it belongs to the first polygon AND NOT to the second polygon
Source:
Parameters:
Name Type Description
polygon1 Polygon first operand
polygon2 Polygon second operand
Returns:
Type:
Polygon

(static) unify(polygon1, polygon2) → {Polygon}

Unify two polygons polygons and returns new polygon.
Point belongs to the resulted polygon if it belongs to the first OR to the second polygon
Source:
Parameters:
Name Type Description
polygon1 Polygon first operand
polygon2 Polygon second operand
Returns:
Type:
Polygon