[pstricks] Some questions about slicing in pst-solides3D

Nitecki, Zbigniew H. Zbigniew.Nitecki at tufts.edu
Fri Jul 22 20:37:39 CEST 2011


I am attaching the output from the code below, which is modelled on the last example at
http://tug.org/PSTricks/main.cgi?file=Examples/Gallery3D/Gallery3D
I have modified a few details, like the specific cutting plane and the grid and color, but the definition of bicone is verbatim from the example, as is most of the code.
I have two questions about this:
1. Why doesn't the intersection curve show up? In the example, it is there in red.
2. The definition of bicone using faces, etc leads to some strange behavior near the cone vertex (see picture).  I had better luck creating a cone using the code shown at the very bottom, but when I tried to incorporate it into the larger picture here I appear to have hit an infinite loop: the program ran very long and still hadn't created any pdf.
3. How would I go about putting in some more curves on the plane, and perhaps fuse this with another, horizontal plane also containing some lines and curves?

Since the original example appears to have been written by Manuel Luque, perhaps he is the best person to address questions 1 and 2.
************************************************************************************************
\def\bicone{% generation du bicone
         /dZ 0.5 def
         /Rayon 3 def % rayon de la base
         /Hauteur 3 def % hauteur d'un cone
         /THETA Rayon Hauteur atan def
         /tanTHETA {Rayon Hauteur div} bind def
         /dPHI 10 def
         /tableau_des_sommets [
             Hauteur neg dZ Hauteur dZ sub{/Z exch def
             0 dPHI 360 {/PHI exch def
                  /r1 Z abs tanTHETA mul def
                  /r2 Z dZ add abs tanTHETA mul def
                  r1 PHI cos mul % x0
                  r1 PHI sin mul % y0
                  Z             % z0
                  r1 PHI dPHI add cos mul % x1
                  r1 PHI dPHI add sin mul % y1
                  Z                      % z1
                  r2 PHI dPHI add cos mul % x2
                  r2 PHI dPHI add sin mul % y2
                  Z dZ add               % z2
                  r2 PHI cos mul % x3
                  r2 PHI sin mul % y3
                  Z dZ add       % z3
             } for
             } for
                  ]
           def
         /Sommets {tableau_des_sommets aload pop} def
         /NbrePoints tableau_des_sommets length 3 div cvi def
        /Faces  {0 4 NbrePoints 4 sub {
                 /Ni exch def
               [ Ni Ni 1 add  Ni 2 add Ni 3 add]
                                     } for
              } def
        /Faces_internes {0 4 NbrePoints 4 sub {
                 /Ni exch def
               [Ni 3 add Ni 2 add Ni 1 add Ni]
                                     } for
             } def
             }

\psset{unit=0.5}
\psset{lightsrc=viewpoint}
\psset{lightsrc=40 180 30,viewpoint=30 40 25 rtp2xyz},

\begin{pspicture}(-7.5,-7.5)(7,7)
\pstVerb{\bicone}%
\psset{solidmemory}
\psSolid[object=new,sommets=Sommets,faces={Faces},
   hollow,
   plansepare={[0 0.5 1 -1.3]},
   name=partbicone,
   grid,
   action=none]
\psSolid[object=load,
   hollow,rm=0,
   fillcolor=lightgray,
   incolor=lightgray,
   grid,
   load=partbicone1,
   intersectiontype=0,
   intersectionlinewidth=2,
   intersectioncolor=(rouge),
   intersectionplan={[0 0.5 1 -1.31]}
   ]
\psSolid[object=plan,definition=equation,
   args={[0 0.5 1 -1.3] 180},
   base=-3 3 -3 3.5,linewidth=0.01,
   action=draw]
\end{pspicture}

-------------- next part --------------
A non-text attachment was scrubbed...
Name: Briefpicturetest2.pdf
Type: application/pdf
Size: 12326 bytes
Desc: Briefpicturetest2.pdf
URL: <http://tug.org/pipermail/pstricks/attachments/20110722/26e08f27/attachment-0001.pdf>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/pstricks/attachments/20110722/26e08f27/attachment-0001.htm>


More information about the PSTricks mailing list