[Tex/LaTex] Draw 3D lines between points with PSTricks

pst-solides3dpstricks

Consider the following exmaple:

Code

\documentclass{article}

\usepackage{auto-pst-pdf,pst-solides3d}

\begin{document}

\begin{figure}
 \psset{
   viewpoint=15 -30 11,
   Decran=10
 }
  \begin{pspicture}[solidmemory]
   \psSolid[object=point,args=15 0 8.5,name=L]
   \psSolid[object=point,args=-60 5 5,name=R]
   \psSolid[object=line,linecolor=red!50,linestyle=dashed,linewidth=2pt,args=R L]
   \psSolid[object=parallelepiped,a=6.1,b=6.3,c=7.3,RotZ=-8,fillcolor=blue!50,
     name=parallelepipedum,action=draw*](0 0 2)
   \multido{\iA=0+1}{8}{%
     \psSolid[object=point,linecolor=black,definition=solidgetsommet,
       args=parallelepipedum \iA,name=C\iA]
    \psset{
      object=line,
      linecolor=darkgray!50,
      linestyle=dotted
    }
     \psSolid[args=L C\iA]
     \psSolid[args=R C\iA]
   }
   \psSolid[object=parallelepiped,a=6.1,b=6.3,c=7.3,RotZ=-8,
     name=parallelipipidum,action=draw](0 0 2)
  \end{pspicture}
\end{figure}

\end{document}

Output

enter image description here

Question

How do I draw the two diagonals at the top of the box with solid, black lines? Furthermore, I would like to mark the intersection point of the diagonals with a dot.

Best Answer

please provide minimal examples. The dashed lines are not important for your problem.

\documentclass{minimal}
\usepackage{pst-solides3d}
\begin{document}

\psset{viewpoint=15 -30 11,Decran=10}
\begin{pspicture}[
% showgrid,
 solidmemory,
% num=all
](-2,-1)(2,3)
  \psSolid[object=parallelepiped,a=6.1,b=6.3,c=7.3,RotZ=-8,
     name=parallelipipidum,fillcolor=blue!40,action=draw*](0 0 2)
   \multido{\iA=0+1}{4}{%
     \psSolid[object=point,definition=solidgetsommet,
              args=parallelipipidum \iA,name=Top\iA,action=none]}
   \psSolid[object=line,args=Top0 Top2]
   \psSolid[object=line,args=Top1 Top3]
   \psSolid[object=point,definition=solidcentreface,args=parallelipipidum 0]
  \end{pspicture}

\end{document}

enter image description here

the points are internally defined as <objectname> <no>. The <no> can be found with the optional argument num=all. For the top they are 0 1 2 3

Related Question