Graphics, Figures & Tablespstricks or rather pst-3dplot behaving bizarely

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
maja z
Posts: 18
Joined: Mon May 18, 2009 8:53 pm

pstricks or rather pst-3dplot behaving bizarely

Post by maja z »

I'm trying to create a rather complicated 3-d graphic consisting of lots of cubes or "boxes".

I'm having trouble with pstThreeDBox, because any rotation seems to mess up its hidden (dashed) lines, so it all looks weird.
So I had a go at psBox, which is supposed to have the form:

\psBox[Options](vector o){width}{depth}{height}

Unfortunately that's not what I'm getting, namely the height parameter gets completely ignored!? Here's a test code, I get three exactly same boxes, even though they hav three different values for the height?

Code: Select all

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

\begin{pspicture}(-3,-3)(3,3)
\pstThreeDCoor
\psBox(0,0,0){1}{2}{3}
\end{pspicture}

\begin{pspicture}(-3,-3)(3,3)
\pstThreeDCoor
\psBox(0,0,0){1}{2}{0.1}
\end{pspicture}

\begin{pspicture}(-3,-3)(3,3)
\pstThreeDCoor
\psBox(0,0,0){1}{2}{0}
\end{pspicture}

\end{document}
Any help will be greatly appreciated!

Maja

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Re: pstricks or rather pst-3dplot behaving bizarely

Post by localghost »

Check the log file for any hints about errors or warnings.


Best regards
Thorsten
maja z
Posts: 18
Joined: Mon May 18, 2009 8:53 pm

Re: pstricks or rather pst-3dplot behaving bizarely

Post by maja z »

I can't really tell! I've attached the log file though.
I don't get any errors, or warnings on compilation, I'm using Latex->PS->PDF in case that's relevant.
Thanks!
Maja.
Attachments
cube test.log
(6.98 KiB) Downloaded 273 times
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

pstricks or rather pst-3dplot behaving bizarely

Post by gmedina »

Hi,

I did some tests and I can confirm the strange results obtained by maja z; the third argument (height) seems to be not taken into account. Can anyone else confirm that?
1,1,2,3,5,8,13,21,34,55,89,144,233,...
maja z
Posts: 18
Joined: Mon May 18, 2009 8:53 pm

pstricks or rather pst-3dplot behaving bizarely

Post by maja z »

It's weird, but I don't think he's noticed (edit: Herbert Voß that is, his mention has now been edited out of a previous post?!). Because the package documentation gives examples of \psBox, where the same problem occurs - it seems what actually happens is that the yz plane is always square, taking the y length for the z side as well!

Does anyone have any other suggestions for this type of drawing?
I've mentioned this, I've been using \pstThreeDBox instead, but here the problem is that I can't rotate to get different views. Using fillstyle=solid seems to only work on the three visible sides, but once you rotate you then see the "invisible" backsides of the cubeoids... Annoying to say the least. Here's another example code.

Code: Select all

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

\begin{pspicture}(-3,-3)(3,3)
\pstThreeDCoor
\pstThreeDBox[fillstyle=solid](0,0,0)(1,0,0)(0,2,0)(0,0,4)
\end{pspicture}

\begin{pspicture}(-3,-3)(3,3)
\pstThreeDCoor
\pstThreeDBox[RotZ=180, fillstyle=solid](0,0,0)(1,0,0)(0,2,0)(0,0,4)
\end{pspicture}

\begin{pspicture}(-3,-3)(3,3)
\pstThreeDCoor
\pstThreeDBox[RotZ=90, fillstyle=solid](0,0,0)(1,0,0)(0,2,0)(0,0,4)
\end{pspicture}


\end{document}
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

pstricks or rather pst-3dplot behaving bizarely

Post by gmedina »

maja z wrote:It's weird, but I don't think he's noticed (edit: Herbert Voß that is, his mention has now been edited out of a previous post?!)...
Yes. Initially I suggested you to contact Herbert Voß, but then I decided to ask for confirmation from another of the regular users of ths board and then contact the author so I edited my previous response.
maja z wrote:...Because the package documentation gives examples of \psBox, where the same problem occurs - it seems what actually happens is that the yz plane is always square, taking the y length for the z side as well!
That is the result of my tests too. Again, let's wait for confirmation from another user and then I would suggest to contact the author.
maja z wrote:...Does anyone have any other suggestions for this type of drawing?
I used to use pstricks to do my drawings, but now I use another package (PGF/TikZ) and have almost forgot all about pstricks (shame on me!).
1,1,2,3,5,8,13,21,34,55,89,144,233,...
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

pstricks or rather pst-3dplot behaving bizarely

Post by localghost »

I can confirm the problem on both my Linux system with TeX Live 2008 and on my Windows system with MikTeX 2.7 and the current version of the involved packages. I added the \listfiles command to the code to get the version of the used files (MiKTeX 2.7).

Code: Select all

 *File List*
 article.cls    2005/09/16 v1.4f Standard LaTeX document class
  size10.clo    2005/09/16 v1.4f Standard LaTeX file (size option)
 xkeyval.sty    2008/08/13 v2.6a package option processing (HA)
 xkeyval.tex    2008/08/13 v2.6a key=value parser (HA)
pstricks.sty    2008/11/26 v0.40 LaTeX wrapper for `PSTricks' (RN,HV)
pstricks.tex    2009/01/25 v1.27 `PSTricks' (tvz,hv)
  xcolor.sty    2007/01/21 v2.11 LaTeX color extensions (UK)
   color.cfg    2007/01/18 v1.5 color configuration of teTeX/TeXLive
   dvips.def    1999/02/16 v3.0i Driver-dependant file (DPC,SPQR)
pst-3dplot.sty    2006/02/07 package wrapper for pst-3dplot.tex (hv)
pst-3dplot.tex    2008/11/18 v1.83 `PST-3dplot' (hv)
pst-xkey.tex    2005/11/25 v1.6 PSTricks specialization of xkeyval (HA)
 ***********
As gmedina already suggested, you should contact the maintainer. There is a mailing list. More details are on the homepage of PSTricks. You are welcome to report in case you got new insights.
Post Reply