[pstricks] filling non-simply connected regions
Zbigniew Nitecki
zbigniew.nitecki at tufts.edu
Fri Jan 2 18:14:13 CET 2009
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/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://tug.org/pipermail/pstricks/attachments/20090102/926729ad/attachment.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: picturetestshort.pdf
Type: application/pdf
Size: 7764 bytes
Desc: not available
Url : http://tug.org/pipermail/pstricks/attachments/20090102/926729ad/attachment.pdf
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://tug.org/pipermail/pstricks/attachments/20090102/926729ad/attachment-0001.html
More information about the PSTricks
mailing list