diff options
Diffstat (limited to 'Master/texmf-dist/tex/generic/pstricks/pstricks.tex')
-rw-r--r-- | Master/texmf-dist/tex/generic/pstricks/pstricks.tex | 101 |
1 files changed, 93 insertions, 8 deletions
diff --git a/Master/texmf-dist/tex/generic/pstricks/pstricks.tex b/Master/texmf-dist/tex/generic/pstricks/pstricks.tex index 073895b2440..36467cd0dd2 100644 --- a/Master/texmf-dist/tex/generic/pstricks/pstricks.tex +++ b/Master/texmf-dist/tex/generic/pstricks/pstricks.tex @@ -65,8 +65,8 @@ \pst@addfams{pstricks} \ifx\PSTFPloaded\endinput\else \input pst-fp.tex\fi % -\def\fileversion{2.10} -\def\filedate{2010/08/27} +\def\fileversion{2.11} +\def\filedate{2010/09/09} % % stolen from latex.ltx to make it TeX compatible \newcount\psLoopIndex @@ -1097,6 +1097,86 @@ }} \psset[pstricks]{fillstyle=none} % +%--------------------------- continous linewidth ------------------- +\newdimen\psk@startLW +\newdimen\psk@endLW +\define@key[psset]{pstricks}{startLW}[\pslinewidth]{\pssetlength{\psk@startLW}{#1}}% +\define@key[psset]{pstricks}{endLW}[\pslinewidth]{\pssetlength{\psk@endLW}{#1}}% +\define@key[psset]{pstricks}{startWL}[380]{\pst@getint{#1}\psk@startWL}% +\define@key[psset]{pstricks}{endWL}[780]{\pst@getint{#1}\psk@endWL}% +\define@boolkey[psset]{pstricks}[Pst@]{variableLW}[true]{} +\define@boolkey[psset]{pstricks}[Pst@]{variableColor}[true]{} +\psset[pstricks]{startLW=\pslinewidth,endLW=\pslinewidth,variableColor=false,variableLW=false,startWL=380,endWL=780} +% +\def\pst@flattenpath{ + /Coors [] def % the array of all points + /lambda \psk@startWL\space def + % + /add2Values { Coors aload length 2 add array astore /Coors exch def } def + /add6Values { Coors aload length 6 add array astore /Coors exch def } def +% + 0.1 setflat % the value for the line snippets + flattenpath % flatten the existing path into line segments +% + { add2Values } % what to do with moveto + { add2Values } % what to do with lineto + { add6Values } % what to do with curveto (not needed here) + { } % what to do with closepath + pathforall % do it for the existing path +% + \pst@number\psk@startLW setlinewidth + 2 setlinejoin + 0 setlinecap + Coors aload length 2 sub 2 div cvi /N0 exch def % set number of points + /NN 0 def + /N N0 def + { N 3 gt { N 3 sub /N ED }{ N 1 sub /N ED } ifelse + NN 1 add /NN ED + N 0 eq { exit } if + } loop + /dLW \pst@number\psk@endLW \pst@number\psk@startLW sub NN div def % the step for the linewidth + \ifPst@variableColor + /dColor \psk@endWL\space \psk@startWL\space sub NN div def + lambda dColor add dup /lambda ED + tx@addDict begin wavelengthToRGB Red Green Blue end setrgbcolor + \else + \pst@usecolor\pslinecolor + \fi + moveto % move to the first one + /N N0 def + { + N 3 gt { +% CP 6 2 roll + \psk@curvature\space /c ED /b ED /a ED + /ArrowA {} def + /ArrowB {} def + BOC NC EOC % curveto + N 3 sub /N ED }{ lineto N 1 sub /N ED } ifelse + currentlinewidth dLW add setlinewidth % increase line width + \ifPst@variableColor + lambda dColor add dup /lambda ED + tx@addDict begin wavelengthToRGB Red Green Blue end setrgbcolor + \else + \pst@usecolor\pslinecolor + \fi + CP /Y ED /X ED % put coors of current point on the stack +% 0.4 .setopacityalpha + stroke % draw the line segment + N 0 eq { exit }{ X Y moveto } ifelse + } loop +% N { % repeat for the other N coords +% lineto % line to next point +% currentlinewidth dLW add setlinewidth % increase line width +% lambda dColor add dup /lambda ED +% tx@addDict begin wavelengthToRGB Red Green Blue end setrgbcolor +% currentpoint % put coors of current point on the stack +% 0.4 .setopacityalpha +% stroke % draw the line segment +% moveto +% } repeat +} + +% %--------------------------- A R R O W S --------------------------- % \def\psk@arrowA{} @@ -1811,6 +1891,7 @@ \psk@curvature\space /c ED /b ED /a ED \ifshowpoints true \else false \fi \ifx\pslinestyle\psls@@symbol \psls@symbol OpenSymbolCurve \else \tx@OpenCurve \fi + \ifPst@variableLW \pst@flattenpath \fi }% \ifx\pslinestyle\psls@@symbol\def\pslinestyle{none}\fi% \end@OpenObj% @@ -2905,13 +2986,13 @@ pop \def\psarc@iii(#1)#2#3#4{% \begin@OpenObj \pst@getangle{#3}\pst@tempa - \psDEBUG[psarc]{angleA=\pst@tempa}% \pst@getangle{#4}\pst@tempb - \psDEBUG[psarc]{angleB=\pst@tempb}% \ifx\pst@tempa\pst@tempb \else \pst@@getcoor{#1}% \pssetlength\pst@dima{#2}% - \addto@pscode{\psarc@iv \psarc@v}% + \addto@pscode{\psarc@iv \psarc@v + \ifPst@variableLW \pst@flattenpath \fi + }% \gdef\psarc@type{0}% \showpointsfalse \fi @@ -3069,7 +3150,9 @@ pop \pst@getcoor{#2}\pst@tempb% a,b \pst@getangle{#3}\pst@tempc% start angle \pst@getangle{#4}\pst@tempd% end angle - \addto@pscode{\psellipticarc@definearg \psellipticarc@draw}% + \addto@pscode{\psellipticarc@definearg \psellipticarc@draw + \ifPst@variableLW \pst@flattenpath \fi + }% \showpointsfalse \end@OpenObj% } @@ -3163,10 +3246,11 @@ pop \addto@pscode{ \pst@coor \ifPst@SpecialLength \pst@SpecialLength \else \pst@number\pst@dimc \fi -% \pst@number\pst@dimc \psk@dimen CLW mul sub 0 360 arc - closepath }% + \ifPst@variableLW \pst@flattenpath \fi + closepath + }% \showpointsfalse \end@ClosedObj \fi @@ -3251,6 +3335,7 @@ pop \fi \pst@tempa \tx@Ellipse + \ifPst@variableLW \pst@flattenpath \fi closepath }% \def\pst@linetype{2}% |