[pstricks] troubles with psBox and pstThreeDBox

maja zaloznik maja.zaloznik at gmail.com
Wed Jul 29 00:39:33 CEST 2009


Hi everyone!
I'm having some trouble with psBox and pstThreeDBox. Below is an example
code, here a brief overview:

Fig.1: psBox seems to have a bit of trouble interpreting my coordinates.
Here all three cubes should have their origin one (1) unit from the origin,
but have for some reason doubled to two units?

Fig.2: This is what Fig.1 should look like - I am assuming based my
understanding of the documentation that says both psBox and pstThreeDBox
have vector o determining their origins.

Fig.3: Swooshing round to see the back of the construction, the
pstThreeDBox-es, which should be solid, show  weird "hidden" lines. The
fillstyle=solid only seems to work on the from three sides, but then even
the hidden lines aren't completely correct as the vertical one is missing.

Fig.4: This is what I want Fig 3 to look like, however the axes are wrong
here, and I had to manually correct the origin of one of the boxes. What I
thought would be possible would be to use the code for Fig.2 and then simply
rotate it to get the desired alternative views. This is quite important as
my actual drawing involves 36 cuboids, and it would be very complicated for
me to rewrite all their coordinates to get a few alternative views. Is there
any simpler way?

Any help will be greatly appreciated!
Maja

******************************************************************************************************
\documentclass{article}
\pagestyle{empty}
\usepackage{pstricks, pst-3dplot}
\begin{document}

\begin{figure}
\begin{centering}
\begin{pspicture}(-3,-3)(3,3)
\pstThreeDCoor[IIIDticks=true]
\psBox[showInside=false](1,0,0){1}{1}{1}
\psBox[showInside=false](0,1,0){1}{1}{1}
\psBox[showInside=false](0,0,1){1}{1}{1}
\end{pspicture}
\caption{The origins are the same as in the next figure but seem to have
doubled somehow?}
\end{centering}
\end{figure}

\begin{figure}
\begin{centering}
\begin{pspicture}(-3,-3)(3,3)
\pstThreeDCoor[IIIDticks=true]
\pstThreeDBox[fillstyle=solid](0,0,1)(1,0,0)(0,1,0)(0,0,1)
\pstThreeDBox[fillstyle=solid](0,1,0)(1,0,0)(0,1,0)(0,0,1)
\pstThreeDBox[fillstyle=solid](1,0,0)(1,0,0)(0,1,0)(0,0,1)
\end{pspicture}
\caption{This one works perfectly... form this perspective that is...}
\end{centering}
\end{figure}

\begin{figure}
\begin{centering}
\begin{pspicture}(-3,-3)(3,3)
\pstThreeDBox[RotZ=180, fillstyle=solid](1,0,0)(1,0,0)(0,1,0)(0,0,1)
\pstThreeDBox[RotZ=180, fillstyle=solid](0,1,0)(1,0,0)(0,1,0)(0,0,1)
\pstThreeDBox[RotZ=180, fillstyle=solid](0,0,1)(1,0,0)(0,1,0)(0,0,1)
\pstThreeDCoor[RotZ=180,IIIDticks=true]
\end{pspicture}
\caption{Turning round the axis and boxes by 180 degrees shows the unsightly
backs..}
\end{centering}
\end{figure}

\begin{figure}
\begin{centering}
\begin{pspicture}(-3,-3)(3,3)
\pstThreeDCoor[IIIDticks=true]
\pstThreeDBox[fillstyle=solid](0,1,0)(1,0,0)(0,1,0)(0,0,1)
\pstThreeDBox[fillstyle=solid](1,0,0)(1,0,0)(0,1,0)(0,0,1)
\pstThreeDBox[fillstyle=solid](1,1,1)(1,0,0)(0,1,0)(0,0,1)
\end{pspicture}
\caption{This is the back view I would like, but of course with the axes in
position and without having to rewrite the coordinates!}
\end{centering}
\end{figure}


\end{document}
************************************************************************************************************************

PS. There is another bug in \psBox namely the height parameter gets ignored
and the depth gets used instead. (This is not an issue in the above example
as they are all cubes). Herbert has been kind enough to tell me the fix
before its uploaded:
\pssetlength\pst at dima{#4}\pssetlength\pst at dimb{#5}\pssetlength\pst at dimc{#6}

the last parameter must be #6, but in the current file it  is #5
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/pstricks/attachments/20090728/d914eb1f/attachment.html>


More information about the PSTricks mailing list