[pstricks] : 3D Function and intersection plan - error

Manuel Luque mluque5130 at aol.com
Sun Sep 28 07:05:27 CEST 2014


Try the object=surfaceparametree, I think it's easier.
 
\documentclass{article}
\usepackage{pst-solides3d}

\begin{document}

\begin{pspicture}(-5,-5)(5,5)
\psset{viewpoint=50 70 30 rtp2xyz,Decran=50,lightsrc=viewpoint}
\defFunction[algebraic]{SURFACE}(x,y){x}{y}{15*(x^3-x*y^4-x/5)*Euler^(-x^2-y^2)+2*Euler^(-((x-1.225)^2+y^2))}
\psSolid[object=surfaceparametree,
         fillcolor=green!20,incolor=gray!20,
         linewidth=0.01,
         base=-4 4 -4 1.5,
         function=SURFACE,
         intersectionplan={[0 1 0 -1.5]},
         intersectioncolor=(rouge),
         intersectionlinewidth=2,
         intersectiontype=0,
         ngrid=50]%
\psSolid[object=plan,definition=normalpoint,opacity=0.5,
         fillcolor=cyan!20,
         base=-4 4 -8 8,args={0 1.5 0 [0 1 0 0]}]
\psSolid[object=surfaceparametree,
         fillcolor=green!20,incolor=gray!20,
         linewidth=0.01,
         base=-4 4 1.5 4,
         function=SURFACE,
         intersectionplan={[0 1 0 -5.5]},
         intersectioncolor=(rouge),
         intersectionlinewidth=2,
         intersectiontype=0,
         ngrid=50](0,4,0)
\end{pspicture}
\end{document} 

 

Manuel 

 




 

-----E-mail d'origine-----
De : Carlo Alberini <carloalbe1 at yahoo.it>
A: Manuel Luque <mluque5130 at aol.com>
Envoyé le : Sa, 27 Sep 2014 15:39
Sujet : Re: Re : [pstricks] 3D Function and intersection plan - error



Thank you very much! The output is wonderful!! I will use the first one!!


Best regards


C
 



 
 
 
  Il Sabato 27 Settembre 2014 15:26, Manuel Luque <mluque5130 at aol.com> ha scritto:
  
  

 

 Dear Carlo,

I propose this solution:
1) generate the files of the surface
2) divide the surface into 2 parts

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

\begin{document}

\begin{pspicture}(-1,-1)(1,1)
\psset{viewpoint=50 70 30 rtp2xyz,Decran=50,lightsrc=viewpoint}
\psSurface[ngrid=.15 .15,
           algebraic,
           file=Surface,biface=false,
           action=writesolid](-4,-4)(4,4)%
   { 15*(x^3-x*y^4-x/5)*Euler^(-x^2-y^2)+2*Euler^(-((x-1.225)^2+y^2)) }
\end{pspicture}

\begin{pspicture}(-7,-8)(7,8)
\psset{viewpoint=50 50 20 rtp2xyz,Decran=50,lightsrc=viewpoint}
\psset{solidmemory}
\psSolid[object=new,
    sommets={(Surface-sommets.dat) run},
    faces={(Surface-faces.dat) run},
    plansepare={[0 1 0 -1.5]},
    name=SurfaceY,
    action=none]
\psSolid[object=load,
   load=SurfaceY1,
%% enregistre les caractéristiques du solide
   file=SurfaceY1,
   action=writesolid
  ]%
\psSolid[object=load,
   load=SurfaceY0,
%% enregistre les caractéristiques du solide
   file=SurfaceY0,
   action=writesolid
   ]%
\end{pspicture}

\end{document}

3) Show in the order you want.

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

\begin{document}

\begin{pspicture}(-7,-8)(7,8)
\psset{viewpoint=50 50 20 rtp2xyz,Decran=50,lightsrc=viewpoint}
\psSolid[object=datfile,
         linewidth=0.5\pslinewidth,
         file=SurfaceY1,
         fillcolor=yellow!50,
         intersectionplan={[0 1 0 -1.5]},
         intersectioncolor=(rouge),
         intersectionlinewidth=2,
        intersectiontype=0]
\psSolid[object=plan,definition=normalpoint,opacity=0.5,
         base=-4 4 -8 6,args={0 1.5 0 [0 1 0 0]}]
\psSolid[object=datfile,
         linewidth=0.2\pslinewidth,
         file=SurfaceY0,
         fillcolor=yellow!50,
         intersectionplan={[0 1 0 -5.5]},
         intersectioncolor=(rouge),
         intersectionlinewidth=2,
        intersectiontype=0](0,4,0)
\end{pspicture}
\newpage
\begin{pspicture}(-7,-8)(7,8)
\psset{viewpoint=50 50 20 rtp2xyz,Decran=50,lightsrc=viewpoint}
\psSolid[object=datfile,
         linewidth=0.5\pslinewidth,
         file=SurfaceY1,
         fillcolor=yellow!50,
         intersectionplan={[0 1 0 -1.5]},
         intersectioncolor=(rouge),
         intersectionlinewidth=2,
        intersectiontype=0]
\psSolid[object=plan,definition=normalpoint,%opacity=0.5,
         fillcolor=yellow!20,
         base=-4 4 -6 6,args={0 1.5 0 [0 1 0 0]}]
\psSolid[object=datfile,
         linewidth=0.2\pslinewidth,
         file=SurfaceY0,
         fillcolor=yellow!50,
         intersectionplan={[0 1 0 -1.5]},
         intersectioncolor=(rouge),
         intersectionlinewidth=2,
        intersectiontype=0](0,0,0)
\end{pspicture}

\newpage
\begin{pspicture}(-7,-8)(7,8)
\psset{viewpoint=50 50 20 rtp2xyz,Decran=50,lightsrc=viewpoint}
\psSolid[object=datfile,
         linewidth=0.5\pslinewidth,
         file=SurfaceY1,
         fillcolor=yellow!50,
         intersectionplan={[0 1 0 -1.5]},
         intersectioncolor=(rouge),
         intersectionlinewidth=2,
        intersectiontype=0]
\psSolid[object=plan,definition=normalpoint,%opacity=0.5,
         fillcolor=yellow!20,ngrid=0.2 0.2,plangrid,
         linewidth=0.2\pslinewidth,
         base=-4 4 -6 6,args={0 1.5 0 [0 1 0 0]}]
\psSolid[object=datfile,
         linewidth=0.2\pslinewidth,
         file=SurfaceY0,
         fillcolor=yellow!50,
         intersectionplan={[0 1 0 -1.5]},
         intersectioncolor=(rouge),
         intersectionlinewidth=2,
        intersectiontype=0](0,0,0)
\end{pspicture}

\newpage
\begin{pspicture}(-7,-8)(7,8)
\psset{viewpoint=50 50 20 rtp2xyz,Decran=50,lightsrc=viewpoint}
\psSolid[object=datfile,
         linewidth=0.5\pslinewidth,
         file=SurfaceY1,
         fillcolor=yellow!50,
         intersectionplan={[0 1 0 -1.5]},
         intersectioncolor=(rouge),
         intersectionlinewidth=2,
        intersectiontype=0]
\psSolid[object=plan,definition=normalpoint,opacity=0.5,
         fillcolor=yellow!20,ngrid=0.2 0.2,plangrid,
         linewidth=0.2\pslinewidth,
         base=-4 4 -6 6,args={0 1.5 0 [0 1 0 0]}]
\psSolid[object=datfile,
         linewidth=0.2\pslinewidth,
         file=SurfaceY0,
         fillcolor=yellow!50,
         intersectionplan={[0 1 0 -1.5]},
         intersectioncolor=(rouge),
         intersectionlinewidth=2,
        intersectiontype=0](0,0,0)
\end{pspicture}
\end{document}

The exterior and interior colors are not displayed correctly. So no incolor.

Best regards,

 

Manuel

 

 

-----E-mail d'origine-----
De : Carlo Alberini <carloalbe1 at yahoo.it>
A: pstricks <pstricks at tug.org>
Envoyé le : Ve, 26 Sep 2014 22:17
Sujet : [pstricks] 3D Function and intersection plan - error





Dear list,
   I have a problem with an intersection between a plan and a function (the equation of the function is downloaded from PSTricks main web page).


I need to have the intersection with the function and the plan y=1.5 and to have a red line marking the inersection. Here is the code:


\documentclass[12pt]{article}
\usepackage{pst-solides3d}
\pagestyle{empty}


\begin{document}


\psset{viewpoint=50 70 20 rtp2xyz,Decran=50,lightsrc=viewpoint}
\begin{pspicture}(-7,-8)(7,8)
{\psset{object=courbe,r=0,linecolor=blue,resolution=360,range=-5 5}}
\psSurface[name=FUNC,ngrid=.15 .15,fillcolor=green!30,incolor=gray!30,
  linewidth=0.4pt,algebraic](-4,-4)(4,4)%
   { 15*(x^3-x*y^4-x/5)*Euler^(-x^2-y^2)+2*Euler^(-((x-1.225)^2+y^2)) }
\axesIIID[linecolor=gray](0,0,0)(7,7,5)


\psSolid[object=plan,definition=equation,
   args={[0 1 0 -1.5]},
   base=-25 -5 -15 5,ngrid=40 40,fillcolor=blue!30,
   name=PLANE,action=none]
  \psSolid[object=fusion,base=PLANE_s FUNC]


\end{pspicture}
\end{document}


The problem is: I have no plan in the output ...


Thank you very much for the help!


Carlo










_______________________________________________
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/20140928/6531b8d2/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: carlo.png
Type: image/png
Size: 247115 bytes
Desc: not available
URL: <http://tug.org/pipermail/pstricks/attachments/20140928/6531b8d2/attachment-0001.png>


More information about the PSTricks mailing list