Skip to content

Function: insetConvex() ​

ts
function insetConvex(poly, distance): Polygon;

Shrink a convex polygon by moving every edge inward by distance. Implemented as a half-plane intersection, so edges that collapse simply vanish and an over-inset polygon returns [].

Parameters ​

ParameterType
polyPolygon
distancenumber

Returns ​

Polygon

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