[pstricks] pst-3dvue and \psset

Herbert Voss Herbert.Voss at alumni.TU-Berlin.DE
Sat Apr 30 14:18:43 CEST 2005


jmpapy wrote:

>Hello everybody,
>
>The attached code draws a cube with bars inside. It compiles fine. The
>only problem is when I change the unit value with \psset. For instance
>when I set unit=0.5cm, only the external cube is reduced and not the
>bars. The bars are drawn in the \multido loop. Does it have something to
>do with multido ? pst-vue3d ?
>  
>
pst-vue3d uses the scale option but I suppose that there is some
mismatch between the unit and scale setting.
Try the following, but I have no idea, if there are some sieeffects.

Herbert

\documentclass[12pt,a4paper]{article}
\usepackage{pstricks}
\usepackage{pst-vue3d}
\usepackage{multido}
\makeatletter
\g at addto@macro{\variablesTroisD}{%
    /xUnit \pst at number\psxunit def
    /yUnit \pst at number\psyunit def
 }%
\pstVerb{
tx at 3DDict begin
/CalcCoordinates {
    formulesTroisD
%    Xi 28.45 mul Yi 28.45 mul
    Xi xUnit mul Yi yUnit mul } def
end }
\makeatother

\begin{document}

\psset{unit=2cm}
\begin{pspicture}(-3.8,-3)(3,3)
  %\psframe(-3.8,-3)(3,3)
  \psset{THETA=30,PHI=30,Dobs=150,Decran=10}
  %\AxesThreeD[linecolor=red,linestyle=dashed](50,60,50)
  \pNodeThreeD(25,-25,25){A}
  \pNodeThreeD(25,25,25){B}
  \pNodeThreeD(25,25,-25){C}
  \pNodeThreeD(25,-25,-25){D}
  \pNodeThreeD(-25,-25,25){E}
  \pNodeThreeD(-25,25,25){F}
  \pNodeThreeD(-25,25,-25){G}
  \pNodeThreeD(-25,-25,-25){H}
  %%% hidden faces of the exterior cube
  \pspolygon(A)(E)(H)(D)
  \pspolygon(E)(F)(G)(H)
  %%% mode-3 vectors
  \multido{\iZ=-20+10}{5}{%
    \multido{\iY=-20+10}{5}{%
      \CubeThreeD[A=23,B=3,C=3](0,\iY,\iZ)%
    }%
  }%
  %%% front faces of the exterior cube
  \pspolygon(A)(B)(C)(D)
  \pspolygon(B)(F)(G)(C)
\end{pspicture}

\end{document}

-- 
http://TeXnik.de/
http://PSTricks.de/
ftp://ftp.dante.de/tex-archive/info/math/voss/Voss-Mathmode.pdf
http://www.dante.de/faq/de-tex-faq/
http://www.tex.ac.uk/cgi-bin/texfaq2html?introduction=yes





More information about the PSTricks mailing list