Check overlap dist from projected axis
first polygon
second polygon
unit axis
Given a Pt in the polygon group, the adjacent sides are the two sides which the Pt touches.
a group of Pts
the target Pt
a boolean to specify whether the polygon should be closed (ie, whether the final segment should be counted).
Find the area of a convex polygon.
a group of Pts
Get a convex hull of the point set using Melkman's algorithm (Reference: http://geomalgorithms.com/a12-_hull-3.html)
a group of Pt
a boolean value to indicate if the group is pre-sorted by x position. Default is false.
a group of Pt that defines the convex hull polygon
Check if a convex polygon and a circle has intersections using Separating Axis Theorem.
a Group representing a convex polygon
a Group representing a circle
an IntersectContext
object that stores the intersection info, or undefined if there's no intersection
Check if two convex polygons has intersections using Separating Axis Theorem.
a Group representing a convex polygon
a Group representing a convex polygon
an IntersectContext
object that stores the intersection info, or undefined if there's no intersection
Get a new polygon group that is derived from midpoints in this polygon
a Group of Pts
a boolean to specify whether the polygon should be closed (ie, whether the final segment should be counted).
a value between 0 to 1 for interpolation. Default to 0.5 which will get the middle point.
Find the perimeter of this polygon, ie, the lengths of its sides.
a group of Pts
a boolean to specify whether the polygon should be closed (ie, whether the final segment should be counted).
an object with total
length, and segments
which is a Pt that stores each segment's length
Generated using TypeDoc
Polygon class provides static functions to create and operate on polygons. A polygon is usually represented as a Group of 3 or more Pts. You can use the static function as-is, or apply the
op
method in Group or Pt to many of these functions. See Op guide for details.