[pstricks] Re : Some questions about slicing in pst-solides3D

Manuel Luque mluque5130 at aol.com
Sat Jul 23 11:45:27 CEST 2011


Dear Nitecki,

To draw of the intersection, write

intersectionplan = {[0 1 0.5 1295]

instead of

intersectionplan = {[0 1 -1.31 0.5]

For the default display, delete certain facets: rm =... (as in 
my example)
This defect appears after the partition of the solid.


The computing time of the cutting of the solid is proportional 
to the number of facets and thus sides. This is why I advise 
to save the data in order to finalize the drawing.

http://manuel.luque.perso.neuf.fr/Zbigniew/

At least, it is better to calculate the intersection (here an 
ellipse): the drawing is nicer.

Computed files are here. To write yourself the data files, 
uncomment the lines (%)

Best regards

ML

 

 


 

 

-----E-mail d'origine-----
De : Nitecki, Zbigniew H. <Zbigniew.Nitecki at tufts.edu>
A: PSTricks PSTricks <pstricks at tug.org>
Envoyé le : Vendredi, 22 Juillet 2011 20:38
Sujet : [pstricks] Some questions about slicing in pst-solides3D


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}


 
_______________________________________________
PSTricks mailing list
PSTricks at tug.org
http://tug.org/mailman/listinfo/pstricks
archive: http://www.tug.org/pipermail/pstricks/

 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/pstricks/attachments/20110723/b38cae50/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Zbigniew1.pdf
Type: application/pdf
Size: 59277 bytes
Desc: not available
URL: <http://tug.org/pipermail/pstricks/attachments/20110723/b38cae50/attachment-0001.pdf>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Zbigniew1.tex
Type: text/x-tex
Size: 1894 bytes
Desc: not available
URL: <http://tug.org/pipermail/pstricks/attachments/20110723/b38cae50/attachment-0001.bin>


More information about the PSTricks mailing list