Skip to content

Instantly share code, notes, and snippets.

GRID_FINE=0.000001;
M_PI=3.14159265358979323846;
function getFragments(r,fn,fs,fa) =
(r < GRID_FINE)?3:
(fn > 0.0)?(fn >= 3 ? fn : 3):
ceil(max(min(360.0 / fa, r*2*M_PI / fs), 5));
function getPhi(i,f) = (i*360)/f;
function getCircle_x(r,i,f) = r*sin(getPhi(i,f));