Source PostScript (sarc.pps)

Retour Texte non formaté
%% rajoute au chemin existant (eventuellement vide), en tournant dans %% le sens trigo %% syntaxe : x0 y0 r ang1 ang2 sarc %% /sarc { %% x0 y0 r ang1 ang2 %% 5 -1 roll %% y0 r ang1 ang2 x0 %% xunit mul %% 5 1 roll %% 4 -1 roll %% yunit mul %% 4 1 roll %% 3 -1 roll %% xunit mul %% 3 1 roll %% arc %% } def %% 19-06-06 %% %% syntaxe : x0 y0 r ang1 ang2 sarc_ %% 19-06-06 %% /sarc_ { %% x0 y0 r ang1 ang2 %% 19-06-06 %% 0 0 5 copy pop pop %% x0 y0 r ang1 ang2 0 0 r ang1 ang2 %% 19-06-06 %% 10 -1 roll %% 19-06-06 %% 10 -1 roll %% 19-06-06 %% yunit mul exch %% 19-06-06 %% xunit mul exch %% 19-06-06 %% translate %rlineto %% 19-06-06 %% 3 -1 roll %% 19-06-06 %% xunit mul %% pour le rayon, on prend l'echelle sur Ox %% 19-06-06 %% 3 1 roll %% 19-06-06 %% arc %% 19-06-06 %% pop pop pop %% 19-06-06 %% } def %% 19-06-06 %% %% syntaxe : x0 y0 r ang1 ang2 sarc_ %% 19-06-06 %% /sarc_ { %% x0 y0 r ang1 ang2 %% 19-06-06 %% 3 dict begin %% 19-06-06 %% /ang2 exch def %% 19-06-06 %% /ang1 exch def %% 19-06-06 %% /r exch def %% 19-06-06 %% jtoppoint %% 19-06-06 %% r xunit mul %% 19-06-06 %% ang1 ang2 %% 19-06-06 %% arc %% 19-06-06 %% end %% 19-06-06 %% } def %% 19-06-06 %% %% 19-06-06 %% %% syntaxe : x0 y0 r ang1 ang2 sarc %% 19-06-06 %% /sarc { %% 19-06-06 %% gsave %% 19-06-06 %% newpath %% 19-06-06 %% 5 copy pop dup %% x0, y0, r, ang1, ang2, x0, y0, r, ang1, ang1 %% 19-06-06 %% cos 5 1 roll %% x0, y0, r, ang1, ang2, cos(ang1), x0, y0, r, ang1 %% 19-06-06 %% sin exch dup %% x0, y0, r, ang1, ang2, cos(ang1), x0, y0, sin(ang1),r, r %% 19-06-06 %% 6 1 roll %% x0, y0, r, ang1, ang2, r, cos(ang1), x0, y0, sin(ang1),r %% 19-06-06 %% mul add 4 1 roll %% x0, y0, r, ang1, ang2, y0 + r sin(ang1), r, cos(ang1), x0 %% 19-06-06 %% 3 1 roll mul add %% x0, y0, r, ang1, ang2, y0 + r sin(ang1), x0 + r cos(ang1) %% 19-06-06 %% exch %% 19-06-06 %% smoveto %% 19-06-06 %% sarc_ %% 19-06-06 %% stroke %% 19-06-06 %% grestore %% 19-06-06 %% } def %% 23-06-06 %% %% syntaxe : x0 y0 r ang1 ang2 sarc_ %% 23-06-06 %% /sarc_ { %% 23-06-06 %% 4 dict begin %% 23-06-06 %% /ang2 exch def %% 23-06-06 %% /ang1 exch def %% 23-06-06 %% /r exch def %% 23-06-06 %% /A defpoint %% 23-06-06 %% %% 23-06-06 %% ang1 A jtoppoint r xunit mul cpoint %% 23-06-06 %% lineto %% 23-06-06 %% A jtoppoint %% 23-06-06 %% r xunit mul %% 23-06-06 %% ang1 ang2 %% 23-06-06 %% arc %% 23-06-06 %% end %% 23-06-06 %% } def %% 23-06-06 %% %% 23-06-06 %% %% syntaxe : x0 y0 r ang1 ang2 sarc %% 23-06-06 %% /sarc { %% 23-06-06 %% 5 dict begin %% 23-06-06 %% gsave %% 23-06-06 %% newpath %% 23-06-06 %% dup isstring { %% 23-06-06 %% /option exch def %% 23-06-06 %% } if %% 23-06-06 %% %% 23-06-06 %% /ang2 exch def %% 23-06-06 %% /ang1 exch def %% 23-06-06 %% /r exch def %% 23-06-06 %% /A defpoint %% 23-06-06 %% A circ2 %% 23-06-06 %% ang1 A jtoppoint r xunit mul cpoint %% 23-06-06 %% moveto %% 23-06-06 %% A r ang1 ang2 %% 23-06-06 %% sarc_ %% 23-06-06 %% currentdict /option known { %% 23-06-06 %% arrowcpathpoints %% 23-06-06 %% option %% 23-06-06 %% gere_arrowhead %% 23-06-06 %% } if %% 23-06-06 %% %% 23-06-06 %% stroke %% 23-06-06 %% grestore %% 23-06-06 %% end %% 23-06-06 %% } def %% syntaxe : x0 y0 r ang1 ang2 sarc_ /sarc_ { 4 dict begin /ang2 exch def /ang1 exch def /r exch def /A defpoint A jtoppoint r xunit mul ang1 ang2 arc end } def %% syntaxe : x0 y0 r ang1 ang2 sarc /sarc { 5 dict begin gsave newpath dup isstring { /option exch def } if /ang2 exch def /ang1 exch def /r exch def /A defpoint % A circ2 ang1 A jtoppoint r xunit mul cpoint moveto A r ang1 ang2 sarc_ currentdict /option known { newarrowpath ang1 A jtoppoint r xunit mul cpoint ptojpoint ang1 A .1 add jtoppoint r xunit mul cpoint ptojpoint arrowpath0 ang2 .1 sub A jtoppoint r xunit mul cpoint ptojpoint ang2 A jtoppoint r xunit mul cpoint ptojpoint arrowpath1 option gere_arrowhead } if stroke grestore end } def