Public function

Create a new convex polygon as the intersection of two convex polygons.

Signature
function intersectPolygonPolygon(
  polygonA: VecLike[],
  polygonB: VecLike[]
): null | VecLike[]
Parameters
NameDescription

polygonA

VecLike[]

An array of points representing the first polygon.

polygonB

VecLike[]

An array of points representing the second polygon.

Returns
null | VecLike[]
References

VecLike

Source

packages/editor/src/lib/primitives/intersect.ts

intersectPolygonBoundsisSafeFloat