Skip to content

Function: cssPolygon() ​

ts
function cssPolygon(
   poly, 
   box, 
   precision?, 
   holes?
): string;

polygon(...) for poly, expressed as percentages of box. With holes, it's an even–odd polygon that visits each hole from the outline's first point and comes back, so the connecting lines cancel out.

Parameters ​

ParameterTypeDefault value
polyPolygonundefined
boxRectundefined
precisionnumber4
holesPolygon[][]

Returns ​

string

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