Skip to content

Function: roundedPolygon() ​

ts
function roundedPolygon(
   poly, 
   radius, 
   maxStep?
): Polygon;

poly with its corners rounded, as a plain polygon: each arc is approximated by straight segments of at most maxStep radians (default 10°). Useful where curves aren't available, such as CSS clip-path: polygon().

Parameters ​

ParameterType
polyPolygon
radiusnumber | readonly number[]
maxStepnumber

Returns ​

Polygon

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