Afin d'illustrer un exercice de devoir surveillé, j'ai dessiné une roue de loterie. Y-a-t-il des modules d'Asymptote que je ne connais qui auraient permis de faire un code plus court ?
Merci.
*** Pour masquer/découvrir le code Asymptote qui a permis de créer la figure, il faut cliquer dessus. ;-) ***
- CODE ASYMPTOTE de la figure ci-dessus : Tout sélectionner
- import geometry;
- size(4cm,0);
- pen[][] p={{lightgray},
- {gray}};
- point z1=(0,0);
- circle C=circle(z1,1);
- point z2=relpoint(C,11/16);
- point z3=relpoint(C,13/16);
- real n=8, a=360/n;
- for (int i = 0; i < n; ++i)
- filldraw(z1--arc(z1,1,i*a,(i+1)*a)--cycle,yellow);
- filldraw(z1--arc(z1,1,45,90)--cycle^^z1--arc(z1,1,180,225)--cycle,orange);
- point z4=angpoint(C,50);
- point z5=angpoint(C,60);
- point z6=rotate(90,z5)*z4;
- point z7=rotate(-90,z4)*z5;
- arc a1=arc(C,50,60);
- latticeshade(buildcycle(a1,z5--z6,z6--z7,z7--z4),p);
- draw(z4--z5--z6--z7--cycle);
- point z8=scale(1.3,z1)*z2;
- point z9=scale(1.3,z1)*z3;
- arc a2=arc(C,247,292.5);
- latticeshade(buildcycle(a2,z2--z8,z8--z9,z9--z1),p);
- draw(z2--z8--z9--z3);
- point z10=z8-0.1;
- point z11=z9+0.1;
- point z12 =shift(0,-0.1)*z10;
- point z13 =shift(0,-0.1)*z11;
- latticeshade(z8--z10--z12--z13--z11--z9--cycle,p);
- draw(z8--z10--z12--z13--z11--z9--cycle);
- point z14=0.9*dir(55);
- point z15=midpoint(z6--z7);
- draw(z15--z14,Arrow());
- draw(C);