\documentclass{article}
\usepackage{pst-solides3d,pst-node,pst-plot,multido,url}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{colortbl}
\usepackage{array}
\usepackage[a4paper,bottom=2.5cm,top=2cm]{geometry}
%%\usepackage[frenchle]{babel}
\makeatletter

\title{\texttt{pst-solides3d} :\\
       Test 11}
\date{\today }
\begin{document}
\maketitle

%\psset{lightsrc=10 20 30,viewpoint=50 20 30 rtp2xyz}
%\psset{SphericalCoor=true,viewpoint=50 20 40}

\section {Définir un objet de type plan}

\begin{center}
%\psset{unit=0.75}
\psset{viewpoint=10 18 60 rtp2xyz,Decran=10,fontsize=10}
\begin{pspicture*}(-5,-4)(6,4)
\psframe(-5,-4)(6,4)
\psset{solidmemory}
\psSolid[object=plantype,
   definition=equation,
   args={[0 0 1 0]},
   base=-2 2 -3 3,
   name=test,
]
\psSolid[object=plan,
   definition=plantype,
   args=test]
%\codejps{test newplan drawsolid}
\axesIIID(0,0,0)(2,3,4)
\end{pspicture*}
\end{center}

\section {Plan défini par une face de solide}

\begin{center}
\psset{SphericalCoor=true,viewpoint=10 18 30,Decran=10,fontsize=10}
\psset{solidmemory}
\begin{pspicture*}(-5,-4)(6,4)
\psframe(-5,-4)(6,4)
\psSolid[object=cube,a=3,fontsize=20,numfaces=all,name=A]
\psSolid[object=plan,
   definition=solidface,
   args=A 0,
   fillcolor=yellow,
   origine=0 0 0,
   base=-2 2 -3 3,
   planmarks,
   plangrid,
   showBase,
]
\axesIIID(0,0,0)(2,3,4)
\end{pspicture*}
\end{center}

\section {Plan défini par son équation}

Avec l'équation $z=0$
\begin{center}
%\psset{unit=0.75}
\psset{viewpoint=10 18 60 rtp2xyz,Decran=10,fontsize=10}
\begin{pspicture*}(-5,-4)(6,4)
\psframe(-5,-4)(6,4)
\psSolid[object=plan,
   definition=equation,
   args={[0 0 1 0]},
   fillcolor=yellow,
   base=-2 2 -3 3,
   planmarks,
   plangrid,
   showBase,
]
\axesIIID(0,0,0)(2,3,4)
\end{pspicture*}
\end{center}

Avec l'équation $z=0$ et en prenant $(0,3,0)$ comme origine. Si
l'origine fournie ne vérifie pas l'équation du plan, alors on ne tient
pas compte de l'origine proposée
\begin{center}
%\psset{unit=0.75}
\psset{viewpoint=10 18 60 rtp2xyz,Decran=10,fontsize=10}
\begin{pspicture*}(-5,-4)(8,4)
\psframe(-5,-4)(6,9)
\psSolid[object=plan,
   definition=equation,
   args={[0 0 1 0]},
   fillcolor=yellow,
   origine=0 3 0,
   planmarks,
   base=-2 2 -3 3,
   ngrid=1. 1.,
]
\axesIIID(0,0,0)(4,4,4)
\end{pspicture*}
\end{center}

\newpage

Avec l'équation $z=0$ et une rotation de $90^\circ $ autour de la normale
\begin{center}
%\psset{unit=0.75}
\psset{viewpoint=10 18 60 rtp2xyz,Decran=10,fontsize=10}
\begin{pspicture*}(-5,-4)(6,4)
\psframe(-5,-4)(6,9)
\psSolid[object=plan,
   definition=equation,
   args={[0 0 1 0] 90},
   fillcolor=yellow,
   base=-2 2 -3 3,
   ngrid=1. 1.,
]
\end{pspicture*}
\end{center}

\newpage
\section {Plan défini par sa normale et un point}

\texttt{args={0 0 -2 [0 0 1]}}

\texttt{args={0 0 1 [0 0 1]}}
\begin{center}
%\psset{unit=0.75}
\psset{viewpoint=10 18 60 rtp2xyz,Decran=10,fontsize=10}
\begin{pspicture*}(-5,-4)(6,4)
\psframe(-5,-4)(6,9)
\psSolid[object=plan,
   definition=normalpoint,
   args={0 0 -2 [0 0 1]},
   fillcolor=cyan,
   base=-2 2 -3 3,
   ngrid=1. 1.,
]
\psSolid[object=plan,
   definition=normalpoint,
   args={0 0 1 [0 0 1]},
   fillcolor=yellow,
   base=-2 2 -3 3,
   ngrid=1. 1.,
]
\end{pspicture*}
\end{center}

\texttt{args={0 0 1 [0 0 1 90]}}
\begin{center}
%\psset{unit=0.75}
\psset{viewpoint=10 18 60 rtp2xyz,Decran=10,fontsize=10}
\begin{pspicture*}(-5,-4)(6,4)
\psframe(-5,-4)(6,9)
\psSolid[object=plan,
   definition=normalpoint,
   args={0 0 1 [0 0 1 90]},
   fillcolor=yellow,
   base=-2 2 -3 3,
   ngrid=1. 1.,
]
\end{pspicture*}
\end{center}

\newpage

\texttt{args={0 0 0 [1 0 0 0 0 1]}}
\begin{center}
%\psset{unit=0.75}
\psset{viewpoint=10 18 60 rtp2xyz,Decran=10,fontsize=10}
\begin{pspicture*}(-5,-4)(6,4)
\psframe(-5,-4)(6,9)
\psSolid[object=plan,
   definition=normalpoint,
   args={0 0 0 [1 0 0 0 0 1]},
   fillcolor=yellow,
   base=-2 2 -3 3,
   ngrid=1. 1.,
]
\end{pspicture*}
\end{center}

\texttt{args={0 0 0 [1 1 0 0 0 1]}}
\begin{center}
%\psset{unit=0.75}
\psset{viewpoint=10 18 60 rtp2xyz,Decran=10,fontsize=10}
\begin{pspicture*}(-5,-4)(6,4)
\psframe(-5,-4)(6,9)
\psSolid[object=plan,
   definition=normalpoint,
   args={0 0 0 [1 1 0 0 0 1]},
   fillcolor=yellow,
   base=-2 2 -3 3,
   ngrid=1. 1.,
]
\end{pspicture*}
\end{center}

\newpage

\begin{center}
%\psset{unit=0.75}
\psset{viewpoint=10 18 60 rtp2xyz,Decran=10,fontsize=10}
\begin{pspicture*}(-5,-4)(6,9)
\psSolid[object=plan,
   definition=equation,
   args={[0 0 1 -1]},
   fillcolor=red,
   origine=-3 0 1,
   base=-2 2 -2 2,
   incolor=orange,
]
\psSolid[object=plan,
   definition=equation,
   args={[0 0 1 -2]},
   fillcolor=cyan,
   origine=2 0 2,
   base=-2 2 -2 2,
   incolor=pink,
]
%% \codejps{
%% /eq1 {[1 0 -2 0]} def   %% equation plan 1
%% eq1 -30 eq2plan
%% {dup [-3 3 -3 3] planputrange
%% dup [1. dup] planputngrid} exec
%% newplan
%% dup videsolid
%% dup (jaune) (jaune) solidputcolors
%% dup videsolid
%% drawsolid*
%% }
\end{pspicture*}
\end{center}

\newpage

\section {Translation, rotations}

\begin{center}
% fabrique du bi-cone
%\codejps{
%-5 3 0 [18 60] newcone
% 5 3 0 [18 60] newcone
% dup solidfacesreverse
% solidfuz
%(bicone) writesolidfile
% }
\begin{pspicture}(-5,-6)(8,7)
\psset{viewpoint=50 -30 20 rtp2xyz,Decran=50}%
\psframe[fillstyle=solid,fillcolor=gray!50](-5,-6)(8,7)%
\psSolid[object=grille,base=-4 4 -4 8,linecolor={[rgb]{0.72 0.72 0.5}}](0,0,-5)%
\psSolid[object=plan,action=draw,
   definition=equation,
   visibility=false,
   RotZ=90,
   plangrid,
   args={[1 0 0 0] 90},
   base=-3 3 -6 5,planmarks,showBase]%
%% %% \psSolid[object=plan,action=draw,
%% %%    definition=equation,%RotZ=90,
%% %%    args={[1 0 0 -0.25] 90},
%% %%    base=-3 3 -6 5,planmarks,showBase](0,5,1)%
%% %\axesIIID[linecolor=blue](0,0,0)(4,3,6)%
\end{pspicture}
\end{center}

\section {\`A partir d'une face de solide}

\begin{center}
% fabrique du bi-cone
%\codejps{
%-5 3 0 [18 60] newcone
% 5 3 0 [18 60] newcone
% dup solidfacesreverse
% solidfuz
%(bicone) writesolidfile
% }
\begin{pspicture}(-5,-6)(8,7)
\psset{viewpoint=50 -30 20,Decran=50}%
\psset{solidmemory}
\psframe[fillstyle=solid,fillcolor=gray!50](-5,-6)(8,7)%
\psSolid[object=cube,a=3,name=A,fontsize=20,numfaces=all]%
%% psSolid[object=plan,action=draw,
%%   definition=equation,
%%   visibility=false,
%%   RotZ=90,
%%   plangrid,
%%   args={[1 0 0 0] 90},
%%    base=-3 3 -6 5,planmarks,showBase]%
\composeSolid
\end{pspicture}
\end{center}


\newpage

\section {Avec du code jps}

\begin{center}
%\psset{unit=0.75}
\psset{viewpoint=-50 70 30 rtp2xyz,Decran=50}
\begin{pspicture*}(-5,-4)(6,9)
\psframe(-5,-4)(6,9)
\codejps{
{
.1 setlinewidth
/eq1 [1 0 -2 0] def   %% equation plan 1
/eq2 [0 1 0 0] def    %% equation plan 2
eq1 -30 eq2plan
dup [-3 3 -3 3] planputrange
dup [1. dup] planputngrid
newplan
eq2 solideqplansepare
dup (orange) solidputcolors
dup videsolid
/planA1 exch def
dup (orange) solidputcolors
dup videsolid
/planA2 exch def
eq2 -20 eq2plan
dup [-3 3 -3 3] planputrange
dup [1. dup] planputngrid
newplan
%eq1 solidplansection
dup (jaune) (jaune) solidputcolors
dup videsolid
/planB exch def
planA2 drawsolid*
planB drawsolid*
planA1 drawsolid*
} exec
}
\end{pspicture*}
\end{center}

\begin{center}
%\psset{unit=0.75}
\psset{SphericalCoor=true,viewpoint=10 18 10,Decran=10}
\begin{pspicture*}(-5,-4)(6,9)
\psframe(-5,-4)(6,9)
\codejps{
/eq1 {[0 0 1 -1]} def
/eq2 {[0 0 1 0]} def
/eq3 {[0 0 1 1]} def
/eq4 {[1.2 1 0 -.8]} def
%% plan d equation z = 1
eq1 eq2plan
newplan
dup eq4 solideqplansepare
dup (blanc) solidputcolors
/Plan1a exch def
dup (blanc) solidputcolors
/Plan1b exch def
%% plan d equation z = 0
eq2 eq2plan
newplan
dup eq4 solideqplansepare
dup (blanc) solidputcolors
/Plan2a exch def
dup (blanc) solidputcolors
/Plan2b exch def
%% plan d equation z = -1
eq3 eq2plan
newplan
dup eq4 solideqplansepare
dup (blanc) solidputcolors
/Plan3a exch def
dup (blanc) solidputcolors
/Plan3b exch def
%% plan d equation x + y + 1 = 0
eq4 eq2plan
newplan
dup (cyan) solidputcolors
/Plan4 exch def
Plan3a drawsolid*
Plan2a drawsolid*
Plan4 drawsolid*
10 setfontsize
setCourier
eq4 eq2plan planmarks
Plan3b drawsolid*
Plan2b drawsolid*
pointilles
Plan3a drawsolid
Plan2a drawsolid
}
\end{pspicture*}
\end{center}



\end{document}
