[pstricks] \pspolygon and dimen=inner

Herbert Voss LaTeX at zedat.fu-berlin.de
Sun Feb 5 14:20:35 CET 2006


Adam Fenn wrote:
>>> The graphics parameter dimen=inner may be used with \psframe, 
>>> \pscircle, \psellipse and
>>> \pswedge. Can the same effect be created for \pspolygon?
> 
> 
>  >no, because it makes no sense. What is inner and outer
>  >when you have crossed lines, e.g. drawing an eight.
> 
> None of my polygons have crossing lines, so they do enclose 'inner' space.

sure, but you can have a right turn or a left turn ...
and then the meaning of inner/outer changes.

Herbert

\documentclass{minimal}
\usepackage{pstricks}
\SpecialCoor
\makeatletter
\def\psline at iii{%
   /IO { CLW \psk at dimen\space mul add } def
   \ifdim\pslinearc>\z@
     /r \pst at number\pslinearc def
     /Lineto { IO exch IO exch \tx at Arcto } def
   \else
     /Lineto { IO exch IO exch lineto } def
   \fi
   \ifshowpoints true \else false \fi
}
  \makeatother

\begin{document}

\psset{linewidth=10pt,showpoints=true}
\pspicture[showgrid=true](4,4)
    \pspolygon[linewidth=10pt](1,1)(1,4)(2,3)(3,4)(4,2)
\endpspicture
\pspicture[showgrid=true](4,4)
    \pspolygon[linewidth=10pt,dimen=inner](1,1)(1,4)(2,3)(3,4)(4,2)
\endpspicture
\pspicture[showgrid=true](4,4)
    \pspolygon[linewidth=10pt,dimen=middle](1,1)(1,4)(2,3)(3,4)(4,2)
\endpspicture


\end{document}





More information about the PSTricks mailing list