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

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[]
intersectPolygonBoundsisSafeFloat