Source
``````
input geometriesyr16;
u:=0.75cm;
save \$;
pair A[],I[],O,centre[],J[];
path cc[],poly;
picture \$;
\$=image(
O=u*(3,3);
A1=u*(1,1);
for j=2 upto n:
A[j]=rotation(A[j-1],O,-360/n);
endfor;
trace A1
for k=2 upto n:
--A[k]
endfor
--cycle withpen pencircle scaled 1.25bp withcolor gris;
trace droite(A1,A[n]);
for k=0 upto n-2:
centre[k]=A[n] shifted(k*(A[n]-A[1]));
endfor;
I0=A1;
for k=0 upto (n-2):
for j=1 upto (360/n):
I[k*(360/n)+j]=rotation(I[k*(360/n)],centre[k],-j);
endfor;
endfor;
J0=O;
for k=0 upto (n-2):
for j=1 upto (360/n):
J[k*(360/n)+j]=rotation(J[k*(360/n)],centre[k],-j);
endfor;
endfor;
cc1=I[0]
for j=1 upto (360-360/n):
..I[j]
endfor
;
trace cc1 withcolor orange;
if t=1:
marque_p:="plein";
for k=0 upto n-2:
for j=10 step 30 until (360/n):
pointe(I[k*(360/n)+j]);
trace centre[k]--
for p=1 upto n-1:
rotation(centre[k],J[k*(360/n)+j],-p*(360/n))--
endfor
cycle dashed evenly withcolor 0.4[blanc,bleu];
endfor;
endfor;
fi;
);
\$:=rotation(\$,A1,-angle(A[n]-A[1]));
\$
enddef;
figure(-.5u,0,18u,6.5u);
%trace feuillet;
fin;
figure(-.5u,0,18u,7.5u);
%trace feuillet;
fin;
figure(-1.5u,0,19u,7.5u);
%trace feuillet;
fin;
figure(-1.5u,0,20u,7.5u);
%trace feuillet;
fin;
figure(-1.5u,0,21u,7.5u);
%trace feuillet;
fin;
figure(-1.5u,0,21u,7.5u);
%trace feuillet;
fin;
figure(-1.5u,0,20u,7.5u);
currentpicture:=nullpicture;
nomme.bot(A1);
nomme.llft(A2);
nomme.llft(A3);
nomme.lft(A4);
nomme.rt(A7);
nomme.lrt(A8);
nomme.lrt(A9);
currentpicture:=rotation(currentpicture,A1,-angle(A[9]-A[1]));
fin;
figure(-2.5u,0,20u,7.5u);
fin;
figure(-.5u,0,18u,6.5u);
%trace feuillet;