[pstricks] filling non-simply connected regions

Juergen Gilg gilg at acrotex.net
Fri Jan 2 18:32:29 CET 2009


Dear Zbigniew,

try this one -- this avoids the gaps:

\begin{pspicture}(-3.5,-3)(3.5,3.5)
\pscircle[fillstyle=solid,fillcolor=lightgray,linestyle=black,linewidth=2pt](0,0){2}
\pscircle[fillstyle=solid,fillcolor=white,linestyle=black,linewidth=2pt](0,0){1}
\psarc[linewidth=2pt, arrows=->, arrowscale=2](0,0){2}{20}{100}
\psarc[linewidth=2pt, arrows=->, arrowscale=2](0,0){2}{100}{180}
\psarc[linewidth=2pt, arrows=->, arrowscale=2](0,0){2}{180}{260}
\psarc[linewidth=2pt, arrows=->, arrowscale=2](0,0){2}{260}{340}
\psarc[linewidth=2pt](0,0){2}{340}{20}

\psarcn[liftpen=2,linewidth=2pt, arrows=->, arrowscale=2](0,0){1}{340}{260}
\psarcn[linewidth=2pt, arrows=->, arrowscale=2](0,0){1}{260}{180}
\psarcn[linewidth=2pt, arrows=->, arrowscale=2](0,0){1}{180}{100}
\psarcn[linewidth=2pt, arrows=->, arrowscale=2](0,0){1}{100}{20}
\psarcn[linewidth=2pt](0,0){1}{20}{260}
\end{pspicture}


Regards,

Juergen


Zbigniew Nitecki wrote:
> I wanted to draw an annulus, filled in light gray, with arrows along 
> the edges.
> The code below gives more-or-less what I want (although I am not sure 
> how to get rid of the
> gaps in the circles):
> **********************************************
> \begin{pspicture}(-3.5,-3)(3.5,3.5)
> \pscircle[fillstyle=solid, fillcolor=lightgray, linestyle=none](0,0){2}
> \pscircle[fillstyle=solid, fillcolor=white, linestyle=none](0,0){1}
> \psarc[linewidth=2pt, arrows=->, arrowscale=2](0,0){2}{20}{100}
> \psarc[linewidth=2pt, arrows=->, arrowscale=2](0,0){2}{100}{180}
> \psarc[linewidth=2pt, arrows=->, arrowscale=2](0,0){2}{180}{260}
> \psarc[linewidth=2pt, arrows=->, arrowscale=2](0,0){2}{260}{340}
> \psarc[linewidth=2pt](0,0){2}{340}{20}
>
> \psarcn[liftpen=2,linewidth=2pt, arrows=->, 
> arrowscale=2](0,0){1}{340}{260}
> \psarcn[linewidth=2pt, arrows=->, arrowscale=2](0,0){1}{260}{180}
> \psarcn[linewidth=2pt, arrows=->, arrowscale=2](0,0){1}{180}{100}
> \psarcn[linewidth=2pt, arrows=->, arrowscale=2](0,0){1}{100}{20}
> \psarcn[linewidth=2pt](0,0){1}{20}{260}
> \end{pspicture}
> *****************************************************
> But I wonder if there is a way of filling the annulus using
> a single \pscustom command.  The following code gives the second 
> picture below: the main problem is the small bit of filled-in area 
> inside the "hole", another is that the lines print thin, and the 
> arrows are cut in half.  (Also, I needed to leave off the last arrow 
> because otherwise I got an even worse picture):
> *******************************************************
> \begin{pspicture}(-3.5,-3)(3.5,3.5)
> \pscustom[fillstyle=solid, fillcolor=lightgray]{
> \psarc[linewidth=2pt, arrows=->, arrowscale=2](0,0){2}{20}{100}
> \psarc[linewidth=2pt, arrows=->, arrowscale=2](0,0){2}{100}{180}
> \psarc[linewidth=2pt, arrows=->, arrowscale=2](0,0){2}{180}{260}
> \psarc[linewidth=2pt, arrows=->, arrowscale=2](0,0){2}{260}{340}
> \psarc[linewidth=2pt](0,0){2}{340}{20}
>
> \psarcn[liftpen=2,linewidth=2pt, arrows=->, 
> arrowscale=2](0,0){1}{340}{260}
> \psarcn[linewidth=2pt, arrows=->, arrowscale=2](0,0){1}{260}{180}
> \psarcn[linewidth=2pt, arrows=->, arrowscale=2](0,0){1}{180}{100}
> \psarcn[linewidth=2pt, arrows=->, arrowscale=2](0,0){1}{100}{20}
> \psarcn[linewidth=2pt](0,0){1}{20}{260}
> }
> \end{pspicture}
> ***************************************************************
> Output pdf attached:
>
> ------------------------------------------------------------------------
>
>
> Zbigniew Nitecki
>
> Department of Mathematics
>
> Tufts University
>
> Medford, MA 02155
>
>
> telephones:
>
> Office    (617)627-3843
>
> Dept.    (617)627-3234
>
> Dept. fax    (617)627-3966
>
> http://www.tufts.edu/~znitecki/ <http://www.tufts.edu/%7Eznitecki/>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> PSTricks mailing list
> PSTricks at tug.org
> http://tug.org/mailman/listinfo/pstricks
>   

-- 
 Jürgen Gilg
 Austr. 59
 70376 Stuttgart
-------------------------------------
 Tel       0711.59 27 88
 e-Mail    gilg at acrotex.net
 Websites  www.acrotex.net
           www.brueckenkurs-physik.de
           www.gilligan-online.de

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://tug.org/pipermail/pstricks/attachments/20090102/2741c608/attachment-0001.html 


More information about the PSTricks mailing list