[pstricks] Re : [Fwd: pstricks/pst-solides3d question

mluque5130 at aol.com mluque5130 at aol.com
Wed Jun 11 07:06:22 CEST 2008


 



There exist examples of polyhedrons truncated and/or chamfered on the 
 databasis of pst-solides3d as well as animations: 



 

http://melusine.eu.org/lab/bpst/pst-solides3d 
 

http://melusine.eu.org/syracuse/pstricks/pst-solides3d/animations/ 



 

Here are two examples : 



 

%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
 \documentclass{article} 
 \usepackage{pst-solides3d} 
 \makeatletter 
 \def\lightsource{ 
 \pstVerb{\pst at solides@viewpoint 
 /PhI exch def /ThetA exch def /Dist exch def 
 /Lx Dist ThetA cos mul PhI cos mul def 
 /Ly Dist ThetA sin mul PhI cos mul def 
 /Lz Dist PhI sin mul def}% 
 \psset{lightsrc=Lx Ly Lz} } 

\makeatother 

 \begin{document} 
 
\begin{center} 
 \begin{pspicture}(-4,-4)(4,4) 
 \psset{SphericalCoor,viewpoint=100 20 20,Decran=100} 
 \pstVerb{/radius 4 def 
 ? ? ? ? ?/edge_cube radius 4 mul 3 div def 
 ? ? ? ? ?/dot_axes edge_cube 2 div def}% 
 \lightsource 
 \psSolid[object=octahedron, 
 ? ?a=radius , 
 ? ?trunc=all, 
 ? ?hue=.5 .6 0.5 1, 
 ? ?trunccoeff=.3333, 
 ? ?action=draw*] 
 \psSolid[object=octahedron, 
 ? ?a=radius,linecolor=gray, 
 ? ?action=draw] 
 \psSolid[object=cube,linecolor=red, 
 ? ?a=edge_cube, 
 ? ?action=draw] 
 \axesIIID(dot_axes,dot_axes,dot_axes)(5,5,5) 
 \end{pspicture} 
 \end{center} 
 

\end{document} 



 

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


 
 

\documentclass{article} 
 \usepackage{pst-solides3d} 
 \makeatletter 
 \def\lightsource{ 
 \pstVerb{\pst at solides@viewpoint 
 /PhI exch def /ThetA exch def /Dist exch def 
 /Lx Dist ThetA cos mul PhI cos mul def 
 /Ly Dist ThetA sin mul PhI cos mul def 
 /Lz Dist PhI sin mul def}% 
 \psset{lightsrc=Lx Ly Lz} } 

\makeatother 

 \begin{document} 
 
\begin{center} 
 \begin{pspicture}(-4,-4)(4,4) 
 \psset{SphericalCoor,viewpoint=100 20 20,Decran=100} 
 \pstVerb{/radius 4 def 
 ? ? ? ? ?/edge_cube radius 4 mul 3 div def 
 ? ? ? ? ?/dot_axes edge_cube 2 div def}% 
 \lightsource 
 \psSolid[object=octahedron, 
 ? ?a=radius , 
 ? ?trunc=all, 
 ? ?hue=.5 .6, 
 ? ?trunccoeff=.3333, 
 ? ?action=draw,numfaces=all] 
 %\psSolid[object=octahedron, 
 % ? a=radius,linecolor=gray, 
 % ? action=draw] 
 %\psSolid[object=cube,linecolor=red, 
 % ? a=edge_cube, 
 % ? action=draw] 
 %\axesIIID(dot_axes,dot_axes,dot_axes)(5,5,5) 
 \end{pspicture} 
 \end{center} 
 

\begin{center} 
 \begin{pspicture}(-4,-4)(4,4) 
 \psset{SphericalCoor,viewpoint=100 20 10,Decran=100} 
 \pstVerb{/radius 4 def 
 ? ? ? ? ?/edge_cube radius 4 mul 3 div def 
 ? ? ? ? ?/dot_axes edge_cube 2 div def}% 
 \lightsource 
 \psSolid[object=octahedron, 
 ? ?a=radius , 
 ? ?trunc=all, 
 ? ?hue=.5 .6, 
 ? ?trunccoeff=.3333,hollow,incolor=yellow!50, 
 ? ?action=draw**,rm=8 9 10 11 12 13] 
 %\psSolid[object=octahedron, 
 % ? a=radius,linecolor=gray, 
 % ? action=draw] 
 \psSolid[object=cube,linecolor=red, 
 ? ?a=edge_cube, 
 ? ?action=draw] 
 \axesIIID(dot_axes,dot_axes,dot_axes)(5,5,5) 
 \end{pspicture} 
 \end{center} 
 \end{document} 
 

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 






 
Manuel 

 


 




 





 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://tug.org/pipermail/pstricks/attachments/20080611/b08eba02/attachment.html 


More information about the PSTricks mailing list