Function: roundedRectSDF()
ts
function roundedRectSDF(px, py, hx, hy, r): number;Experimental
Exact signed distance from (px, py) to a rounded rect centred at the origin with half extents (hx, hy) and corner radius r (≤ min(hx, hy)); negative inside. Mirror of the GLSL version.
Parameters
| Parameter | Type |
|---|---|
px | number |
py | number |
hx | number |
hy | number |
r | number |
Returns
number