[pstricks] Filling and pst-eucl

Alan Ristow ristow at ece.gatech.edu
Thu Oct 14 14:35:08 CEST 2004


Hi,

First of all, apologies if you have received this message twice. Our
outgoing mail servers appear to be having some issues, and 14 hours
after I first sent the message it has yet to appear on the mailing list.

I am trying to draw a cylinder-type object using pst-eucl (I wasn't
happy with actual 3D drawing, so I'm faking it). The example below draws
four cylinders, and I am quite pleased with the result. However, I am
having a very difficult time filling the "surface" of the cylinder. (In
my example, a portion of the surface is filled so that you may
understand what I mean by "surface.") The "end" of the cylinder should
remain white.

The seemingly obvious solution is to use a \pscustom routine like this:

\pscustom[fillstyle=solid,fillcolor=gray]{%
	\pstArcOAB{O}{D}{B}%
	\pstLineAB{B}{B'}%
	\pstArcOAB{O'}{D'}{B'}%
	\pstLineAB{D'}{D}%
}%

However, it appears that the node names are no longer recognized within
\pscustom, as (for example) \pstArcOAB{O}{D}{B} draws a very different
arc from that which is drawn outside of \pscustom. 

Is there another way, or does pst-eucl simply not play nicely will
fills?

Alan



\documentclass{article}%
\usepackage{pst-eucl}%

\newcommand*{\tRadiusA}{\pstDistVal{0.5}}%
\newcommand*{\tRadiusB}{\pstDistVal{0.45}}%
\newcommand*{\tRadiusDiff}{\pstDistVal{0.05}}%
\newcommand{\wsroller}{
  \psset{PointSymbol=none}%
  \pstGeonode(0,0){O}(1,1.5){O'}%
  \pstCircleOA[Radius=\tRadiusA]{O}{}%
  \pstMiddleAB{O}{O'}{M}%
  \pstInterCC[RadiusA=\tRadiusDiff]{O}{}{M}{O}{X}{Y}%
  \pstInterLC[Radius=\tRadiusA]{O}{X}{O}{}{A}{B}%
  \pstInterLC[Radius=\tRadiusA]{O}{Y}{O}{}{C}{D}%
  \pstTranslation{O}{B}{O'}{X'}%
  \pstTranslation{O}{D}{O'}{Y'}%
  \pstInterLC[Radius=\tRadiusB]{O'}{X'}{O'}{}{A'}{B'}%
  \pstInterLC[Radius=\tRadiusB]{O'}{Y'}{O'}{}{C'}{D'}%
  \psset{fillstyle=solid,fillcolor=gray}%
  \pstLineAB{B}{B'}%
  \pstLineAB{D}{D'}%
  \pstArcOAB{O'}{D'}{B'}%
}%

\begin{document}
  \psset{unit=0.5in}%
  \begin{pspicture}(0,0)(8,8)%
    \rput(1,1){\wsroller}%
    \rput(5,1){\wsroller}%
    \rput(1,5){\wsroller}%
    \rput(5,5){\wsroller}%
  \end{pspicture}%
\end{document}




More information about the PSTricks mailing list