Skip to content

Function: insetPolygon() ​

ts
function insetPolygon(poly, distance): Polygon;

Shrink a simple polygon (convex or not) by moving every edge inward by distance. Returns [] if nothing is left. If the shape splits, the largest piece is returned.

Parameters ​

ParameterType
polyPolygon
distancenumber

Returns ​

Polygon

Hat tiling and isohedral tilings after Craig S. Kaplan's hatviz and Tactile (BSD 3-Clause).