[pstricks] Setting eofill and another option to fillstyle at the same time

Christoph Bersch usenet at bersch.net
Wed Aug 1 13:41:51 CEST 2012


Am 01.08.2012 11:58, schrieb Counter Terrorist:
> Dear folks,
>
> How to use fillstyle=eofill while we also have to set fillstyle=vline
> (for example)?

this is not possible with the current PSTricks, the Postscript procedure 
LineFill must be redefined to use eoclip instead of clip:

\documentclass[border=12pt]{standalone}
\usepackage{pstricks}
\makeatletter
\pst at def{EOLineFill}<%
   gsave
   abs /hatchWidthInc ED
   abs /hatchSepInc ED
   abs CLW add /a ED
   a 0 dtransform round exch round exch
   2 copy idtransform
   exch Atan rotate
   idtransform pop /a ED
   .25 .25 itransform pathbbox
   /y2 ED
   a Div ceiling cvi /x2 ED /y1 ED
   a Div cvi /x1 ED /y2 y2 y1 sub def
   eoclip %<-- this is the only change compared to /LineFill
   newpath
   2 setlinecap
   systemdict
   /setstrokeadjust known { true setstrokeadjust } if
   x2 x1 sub 1 add {
     x1 a mul y1 moveto 0 y2 rlineto stroke
     /x1 x1 1 add
       hatchWidthInc 0 gt { CLW add } if
     def
     hatchSepInc 0 gt hatchWidthInc 0 gt or {
       /a a hatchSepInc add def
       CLW hatchWidthInc add SLW
     } if
   } repeat
   grestore
   pop pop
 >
\makeatother
\begin{document}
\begin{pspicture}[showgrid](6,6)
   \pscustom[fillstyle=vlines,fillcolor=green]
   {
     \pscircle(3,3){3}
     \psline[liftpen=2](1,2)(5,2)(3,5)(1,2)
   }
\end{pspicture}
\begin{pspicture}[showgrid](6,6)
\makeatletter
\let\tx at LineFill\tx at EOLineFill
\makeatother
   \pscustom[fillstyle=vlines,fillcolor=green]
   {
     \pscircle(3,3){3}
     \psline[liftpen=2](1,2)(5,2)(3,5)(1,2)
   }
\end{pspicture}
\end{document}


This might be included in PSTricks. One would need one parameter to 
define if eofill/eoclip or fill/clip is used by the filling styles.

Christoph


More information about the PSTricks mailing list