3

How can I reproduce the 3D prisms shown below using pgfplots (even if they'll be a collection of surfaces is ok)? My main problem is the generation of the bottom and top surfaces. I also tried to use the pst-solides3d package but it didn't work out for the right most prism.

enter image description here

The best result I achieved so far is the following:

\documentclass{standalone}
\usepackage{pst-solides3d}
\begin{document}
\psset{unit=0.5}
\psset{lightsrc=viewpoint,viewpoint=50 60 25 rtp2xyz,Decran=50}
\begin{pspicture} (-1,-1)(8.5,10)
\defFunction{F}(t){t cos 3 mul}{t sin 3 mul}{}
\defFunction{G}(t){t cos 1 mul}{t sin 1 mul}{}
\defFunction{K}(t){-4}{t}{}
\defFunction{H}(t){t cos 0 mul}{t sin 0 mul}{}

%solid 3
\psSolid[object=prisme,
h=8,fillcolor=green,
RotX=0,RotY=0,RotZ=0,
ngrid=8 18,
%base= 4 -4 {K2} CourbeR2+
base= 4 -4 {K} CourbeR2+
225 135 {F} CourbeR2+](-2,0,0)

%solid 1
\psSolid[object=prisme,
h=8,fillcolor=green,
RotX=0,RotX=0,RotX=0,
ngrid=8 18,
base=135 225 {G} CourbeR2+
225 135 {H} CourbeR2+](0,0,0)

%solid 2
\psSolid[object=prisme,
h=8,fillcolor=green,
RotX=0,RotX=0,RotX=0,
ngrid=8 18,
base=135 225 {F} CourbeR2+
225 135 {G} CourbeR2+](-1,0,0)

\end{pspicture}
\end{document}

enter image description here

The solid on the left and at the center are ok, but the one on the right is not correct and I can't figure out the solution.

Stefan Pinnow
  • 29,535
MarcelloM
  • 255

1 Answers1

2

Are you looking for something like this?

\documentclass{standalone}
\usepackage{pst-solides3d}
\begin{document}
\psset{unit=0.5}
\psset{lightsrc=viewpoint,viewpoint=50 60 25 rtp2xyz,Decran=50}
\begin{pspicture} (-1,-1)(8.5,10)
\defFunction{F}(t){t cos 3 mul}{t sin 3 mul}{}
\defFunction{G}(t){t cos 1 mul}{t sin 1 mul}{}
\defFunction{K}(t){-4}{t}{}
\defFunction{H}(t){t cos 0 mul}{t sin 0 mul}{}  
    %solid 3
\psSolid[object=prisme,
    h=8,incolor=green,fillcolor=green,hollow,fillstyle=solid,
    ngrid=8 18,
    base= 225 135 {F} CourbeR2+
            3.8  -3.8 {K} CourbeR2+ ](-2,0,0)   
    %solid 1
\psSolid[object=prisme,
    h=8,fillcolor=green,
    RotX=0,RotX=0,RotX=0,
    ngrid=8 18,
    base=135 225 {G} CourbeR2+
         225 135 {H} CourbeR2+](0,0,0)
    %solid 2
\psSolid[object=prisme,
    h=8,fillcolor=green,
    RotX=0,RotX=0,RotX=0,
    ngrid=8 18,
    base=135 225 {F} CourbeR2+
         225 135 {G} CourbeR2+](-1,0,0)
\end{pspicture}
\end{document}

enter image description here

  • No, the outer surface of the right most block/prism should be straight (not curved). – MarcelloM Apr 10 '16 at 15:03
  • see edited answer –  Apr 10 '16 at 17:53
  • That's very close to what I'm looking for. However, I'd like the right most prism to be closed on top. Moreover, the code doesn't seem robust: it works only for certain given coordinates for the right most surface (now denoted by "3.8 -3.8"). It doesn't work using coordinates "4 -4", but it works with "9 -9".... is this a bug or something I don't understand? – MarcelloM Apr 10 '16 at 21:23