[pstricks] closed Shadow in pscustom

Herbert Voss Herbert.Voss at alumni.TU-Berlin.DE
Fri Apr 16 23:42:49 CEST 2004


vin.gui wrote:
> Hello,
> 
> I am using pscustom and \closedshadow.
> But closedshadow always fills my curve.
> Is this unavoidable ? 
> Do I use the correct syntax?

yes, but have a look at the example, how such a
shadow is build. The original closed path _must_
be filled with the fillcolor, which is by default
set to white to get it in its original color.
After that delete the stuff in the preamble,
because it works with

\closedshadow[fillcolor=white]


Herbert



\documentclass{article}
\usepackage{pstricks}
\makeatletter
\def\pst at closedshadow{%
     \addto at pscode{%
         gsave
         \psk at shadowsize \psk at shadowangle \tx at PtoC
         \tx at Shadow
         \pst at usecolor\psshadowcolor
         gsave fill grestore
         stroke
%        grestore
%        gsave
%        \pst at usecolor\psfillcolor
%        gsave fill grestore
%        stroke
         grestore%
     }%
}
\makeatother
\begin{document}

\begin{pspicture}(0,-5)(5,5)
\pscustom[fillstyle=none,shadowcolor=lightgray]{
     \psbezier(0,0)(1,1)(1,-1)(2,0)
     \psbezier(2,0)(3,1)(1,1)(2,2)
     \closepath
     \closedshadow[shadowsize=10pt]
}
\rput(5,0){
   \pscustom[fillstyle=none,shadowcolor=lightgray,fillcolor=red]{
     \psbezier(0,0)(1,1)(1,-1)(2,0)
     \psbezier(2,0)(3,1)(1,1)(2,2)
     \psline(2,2)(0,0)
     \closepath
     \closedshadow[shadowsize=10pt,fillcolor=white]
   }
}
\end{pspicture}

\end{document}




More information about the PSTricks mailing list