[pstricks] severe problem with code-fragment for dot-dashed lines
Goebel, Juergen, OPE26
juergen.goebel at eads.com
Mon Sep 27 16:23:57 CEST 2004
Hi there,
the following code worked well for about two years until last week
I updated pstricks-add. Since then the resulting ps-code crashes
GSview.
Is this behavior comprehensible?
TIA,
Jürgen
% ----------------------------------------------------------------
% Erweiterung fuer Strichpunkt-Linien
% Erhalten ueber PStricks-Mailing-Liste am 23. Mai 2002
% von Etienne Riga
% 24. Mai 2002
%% Selon communication de Denis Girou 25-3-98
%% Extension du dash pattern à la PiCTeX
%
% Example: \psline[linestyle=dashed,dash=3pt 1pt 1pt 1pt](0,0)(10,10)
\chardef\letter=11
\edef\PstAtCode{\the\catcode`\@}
\catcode`\@\letter
\def\pst at empty{\z@}
\def\psset at dash#1{%
\pst at expandafter\psset@@dash{#1} {\pst at empty} {\pst at empty}
{\pst at missing} {\pst at missing} {}\@nil
\edef\psk at dash{\pst at number\pst at dimg \pst at number\pst at dimh
\pst at number\pst at dimc \pst at number\pst at dimd}}
\def\psset@@dash#1 #2 #3 #4 #5\@nil{%
\pssetlength\pst at dimg{#1}%
\pssetlength\pst at dimh{#2}%
\pssetlength\pst at dimc{#3}%
\pssetlength\pst at dimd{#4}}
\psset at dash{5pt 3pt}
\pst at def{DashLine}<%
dup 0 gt { /a .5 def PathLength exch div } { pop /a 1 def
PathLength } ifelse /b ED /x1 ED /y1 ED /x ED /y ED /z y x add y1
add x1 add def /Coef b a .5 sub 2 mul y mul sub z Div round z mul
a .5 sub 2 mul y mul add b exch Div def /y y Coef mul def /x x
Coef mul def /y1 y1 Coef mul def /x1 x1 Coef mul def x1 0 gt y1 0
gt x 0 gt y 0 gt and { [ y x y1 x1 ] 1 a sub y mul} { [ 1 0] 0 }
ifelse setdash stroke>
\catcode`\@=\PstAtCode\relax
More information about the PSTricks
mailing list