6

I'm trying to draw two cylindric rings on top of each other with pst-solides3d. Here is what I have:

\documentclass{article}

\usepackage{pstricks}
\usepackage{pst-solides3d}

\begin{document}

    \begin{pspicture}(0,0)(3,5)

    \psset{viewpoint=60 80 30 rtp2xyz,Decran=60,lightsrc=viewpoint}

    \psSolid[object=anneau, h=1.7, R=4.4, r=3.8](0,0, 0.77)

    \psSolid[object=anneau, h=0.6, R=5, r=4.4](0,0,0.46)

    \end{pspicture}

\end{document}

And here is what if gives (latex doc.tex; dvips doc.dvi; ps2pdf doc.ps):

And a view from the bottom (change 30 to -50 in psset):

Have I done a silly mistake or there is a visibility problem ?

0

1 Answer 1

7

you draw the rings without using hidden surfaces. In this case the second polygon surfaces are simply drawn over the first ones. You have to collect all polygon surfaces and then draw them by using object=fusion, then hidden surfaces are taken into account.

\documentclass{article}

\usepackage{pst-solides3d}

\begin{document}
\begin{pspicture}(-3,-3)(3,5)
 \psset{viewpoint=60 80 30 rtp2xyz,Decran=60,lightsrc=viewpoint,solidmemory}
 \psSolid[object=anneau,h=1.7,R=4.4,r=3.8,
          name=A1,action=none,hue=0 1](0,0, 0.77)% no action, name=A1
 \psSolid[object=anneau,h=0.6,R=5,r=4.4,
          name=A2,action=none](0,0,0.46)%          no action, name=A2
 \psSolid[object=fusion,base=A1 A2]
\end{pspicture}
\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .