A simple example for producing Spirograph-like
patterns (Cycloids) in CindyScript.
The entire script is:
====================
n=250;
//Picking the parameters from the sliders:
s=|A,C|;
k=round(10*(|D,F|-1));
l=round(10*(|G,K|-1));
//Draw the numbers
drawtext(K+(0.1,0.1),l);
drawtext(F+(0.1,0.1),k);
//Calculate the curve points
pts=apply(0..n,i,
w=i*2*pi/n;
(sin(l*w),cos(l*w))+s*(cos(k*w),sin(k*w));
);
//Draw them
connect(pts,size->1);
drawall(pts,size->1,border->false,color->(0.5,0,0));