[pstricks] Cylinder with planar cut

Poul Riis Poul.Riis at skolekom.dk
Thu Sep 2 11:31:46 CEST 2010


I'm still hoping that someone  can tell me how to modify the project below
so that the coloured slice gets vertical (parallel to the xz-plane) in
stead of horizontal
- or tell me that it is not possible with pst-solides3d...

Poul Riis



\usepackage[x11names]{xcolor}
\usepackage[gray,cmyk,x11names]{pstricks}
\usepackage{pst-func}
\usepackage{pst-solides3d}

\usepackage{pstricks-add}
\usepackage{amsmath,amsfonts}
\definecolor{pureblack}{cmyk}{0 0 0 1}
\usepackage{siunitx}
\usepackage{comma}

\begin{document}

\begin{pspicture}[solidmemory](-4,-5)(7,4)
\psset{viewpoint=50 -40 10
rtp2xyz,Decran=50,linecolor=Red2,lightsrc=viewpoint}
\psset{solidmemory}
\pstVerb{/phi 30 def /cosphi phi cos def /sinphi phi sin def /nx sinphi
def /ny 0 def /nz cosphi def /rcyl 3 sqrt 4 mul def /hcut rcyl sinphi mul
cosphi div def /hcyl hcut 2 mul def /h1 1.5 def /dh 0.5 def /h2 h1 dh add
def}
\psset{ngrid=1 30}
\psSolid[object=cylindre,r=rcyl,h=hcyl,plansepare={[nx ny nz
0]},name=partiescylindre,action=none](0,0,hcut neg)
%\psSolid[object=load,load=partiescylindre1,fillcolor={[rgb]{0.7 1 0.7
}},fcol=0 (1 1 0.7 setrgbcolor),opacity=0.5]
\psSolid[object=load,load=partiescylindre1,fillcolor={[rgb]{0.7 1 0.7
}},fcol=0 (1 1 0.7 setrgbcolor)]
\psSolid[object=cylindre,r=rcyl,h=hcyl,plansepare={[nx ny nz
0]},name=partiescylindre,action=none](0,0,h2 neg)
\psSolid[object=load,load=partiescylindre1,fillcolor={[rgb]{0.7 1
0.4}},fcol=0 (0.8 1 0.4 setrgbcolor)]
%\psSolid[object=load,load=partiescylindre1,fillcolor={[rgb]{0.7 1
0.4}},fcol=0 (0.8 1 0.4 setrgbcolor),opacity=0.7]
\psSolid[object=cylindre,r=rcyl,h=hcyl,plansepare={[nx ny nz
0]},name=partiescylindre,action=none](0,0,h1 neg)
\psSolid[object=load,load=partiescylindre1,fillcolor={[rgb]{0.7 1 0.7
}},fcol=0 (1 1 0.7 setrgbcolor)]
\end{pspicture}

\end{document}


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/pstricks/attachments/20100902/664bd99b/attachment.html>


More information about the PSTricks mailing list