%% %% rajoute au chemin existant (eventuellement vide), en tournant dans
%% %% le sens trigo inverse
%% %% syntaxe : x0 y0 r ang1 ang2 sarcn_
%% /sarcn_ { %% 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
%% arcn
%% } def
%%
%% %% syntaxe x0 y0 r ang1 ang2 tracearcn
%% /sarcn { %% x0 y0 r ang1 ang2
%% gsave
%% newpath
%% 5 copy pop dup %% x0, y0, r, ang1, ang2, x0, y0, r, ang1, ang1
%% cos 5 1 roll %% x0, y0, r, ang1, ang2, cos(ang1), x0, y0, r, ang1
%% sin exch dup %% x0, y0, r, ang1, ang2, cos(ang1), x0, y0, sin(ang1),r, r
%% 6 1 roll %% x0, y0, r, ang1, ang2, r, cos(ang1), x0, y0, sin(ang1),r
%% mul add 4 1 roll %% x0, y0, r, ang1, ang2, y0 + r sin(ang1), r, cos(ang1), x0
%% 3 1 roll mul add %% x0, y0, r, ang1, ang2, y0 + r sin(ang1), x0 + r cos(ang1)
%% exch
%% smoveto
%% sarcn_
%% stroke
%% grestore
%% } def
%% syntaxe : x0 y0 r ang1 ang2 sarcn_
/sarcn_ {
4 dict begin
/ang2 exch def
/ang1 exch def
/r exch def
/A defpoint
A jtoppoint
r xunit mul
ang1 ang2
arcn
end
} def
%% syntaxe : x0 y0 r ang1 ang2 sarcn
/sarcn {
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
sarcn_
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
|