[pstricks] Re : Re : plansepare with a surface

Manuel Luque mluque5130 at aol.com
Sun Feb 27 11:24:27 CET 2011


Yes, it's easier! But I add my version slightly modified by replacing "idiv"with "div".

 Compare the two versions: the same results!

%%%%%%%%%%%%%%%%%%%%%%%%ù

\documentclass{article}
\usepackage{pst-solides3d}
\begin{document}

\begin{center}
\psset{lightsrc=viewpoint,viewpoint=50 60 25 rtp2xyz,Decran=50}
\begin{pspicture}(-5,-3)(6,6)
\psSolid[object=grille,base=-4 4 -4 4,action=draw]%
\pstVerb{
    /nE 20 def %% nb d’etages
    /nM 20 def %% diviseur de 180, nb de meridiens
    /Zmax 4 def %% hauteur 0<z<4
    /sommets [
    0 1 nE {%
     /zP exch def % z= h/a*k
     [ % nombre de sommets sur un étage
      0 1 nM {
     /iM exch def
     /radius 4 Zmax nE div zP mul sub sqrt 2 mul def
    [180 nM div iM mul 180 add cos radius mul
     180 nM div iM mul 180 add sin radius mul
     Zmax nE div zP mul
     ]
     } for
     ]
     }for
     ] def
     /NbreEtages sommets length def
     /NombreSommetsEtage sommets 0 get length def
     /tableau_des_sommets [
     0 1 NbreEtages 2 sub { /i exch def
      0 1 NombreSommetsEtage 2 sub {/k exch def
         sommets i get k get aload pop
         sommets i get k 1 add get aload pop
         sommets i 1 add get k 1 add get aload pop
         sommets i 1 add get k get aload pop
       }for
       }for
       ] def
     /NbrePoints tableau_des_sommets length 3 div cvi def
     /Faces {
     0 4 NbrePoints 4 sub {/N exch def
      [N
       N 1 add
       N 2 add
       N 3 add
      ]
      } for
      } def
   /Sommets {tableau_des_sommets aload pop} def
       }%
\psSolid[object=new,fillcolor=red!40,incolor=yellow!50,
    hollow,
    sommets=Sommets,
    faces={Faces}]%
\defFunction[algebraic]{parabel}(t){t}{0}{-1/4*t^2+4}
\psSolid[object=courbe,
        function=parabel,range=0 4,
        r=0,linecolor=red,
        linewidth=2pt]%
\gridIIID[Zmin=0,Zmax=4,spotX=r](-4,4)(-4,4)
 \end{pspicture}
\end{center}


\begin{center}
\psset{lightsrc=viewpoint,viewpoint=50 60 25 rtp2xyz,Decran=50}
\begin{pspicture}(-5,-3)(6,6)
\psSolid[object=grille,base=-4 4 -4 4](0,0,0)
\defFunction[algebraic]{paraboloid}(u,v)
   {4*sqrt(u/4)*cos(v)}
   {4*sqrt(u/4)*sin(v)}
   {-u+4}
\psSolid[object=surfaceparametree,base=0 4 0 pi neg,
  ngrid=20 20,incolor=red!40,fillcolor=yellow!50,
  intersectionplan={[0 1 0 0]},
  intersectioncolor=(bleu),
  intersectionlinewidth=2,
  intersectiontype=1,
  function=paraboloid]
\gridIIID[Zmin=0,Zmax=4,spotX=r](-4,4)(-4,4)
\end{pspicture}
\end{center}
\end{document}

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

M.L.

 

 


 

 

-----E-mail d'origine-----
De : Herbert Voss <Herbert.Voss at FU-Berlin.DE>
A : Graphics with PSTricks <pstricks at tug.org>
Envoyé le : Dimanche, 27 Février 2011 10:25
Sujet : Re: [pstricks] Re :  plansepare with a surface


Am 26.02.2011 16:59, schrieb Markus Krebs:



> The plane cutting the paraboloid shoud be the xz-plane: y = 0

> 

> Restricting the values for y, here y < 0 should do the job.

> 

>    h=2, %% hauteur 0<z<2

> 

> -4 < y < 0

> 

> Is this possible?



you can use the parametric form of the paraboloid



\documentclass{article}

\usepackage{pst-solides3d}

\begin{document}



\psset{lightsrc=viewpoint,viewpoint=50 60 25 rtp2xyz,Decran=50}

\begin{pspicture}(-5,-3)(6,6)

\psSolid[object=grille,base=-4 4 -4 4](0,0,0)

\defFunction[algebraic]{paraboloid}(u,v)

   {4*sqrt(u/4)*cos(v)}

   {4*sqrt(u/4)*sin(v)}

   {-u+4}

\psSolid[object=surfaceparametree,base=0 4 0 pi neg,

  ngrid=20 20,incolor=red!40,fillcolor=yellow!50,

  intersectionplan={[0 1 0 0]},

  intersectioncolor=(bleu),

  intersectionlinewidth=2,

  intersectiontype=1,

  function=paraboloid]

\gridIIID[Zmin=0,Zmax=4,spotX=r](-4,4)(-4,4)

\end{pspicture}



\end{document}



Herbert

_______________________________________________

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/20110227/87d7616b/attachment.html>


More information about the PSTricks mailing list