\section{The object \texttt{plan}} \subsection{Presentation: type \texttt{plan\/} and type \texttt{solid} } The object \verb+plan+ is special in \texttt{pst-solides3d}. However, all the objects presented until now have had a common structure: they are of type \verb+solid+: in other words, they are defined by a list of vertices, faces and colors. For many applications, it is necessary to have some additional information for a plane: an origin, an orientation, a reference base etc. To fulfill all these requirements, another data structure of type \verb+plan+ was generated, which allows one to save all this necessary information. These manipulations of the plane will be controlled by such an object. Ce n'est qu'au moment de la repr\'{e}sentation que l'objet de type \verb+plan+ sera converti en un objet de type \verb+solid+ repr\'{e}sentable par la macro \bs{psSolid}. An object of type \verb+plan+ is used to describe an oriented affine plane. For a complete definition of such an object, an origin $I$, a basis $(\vec u, \vec v)$ for that plane, a scaling of the axis $(I, \vec u)$ and a scaling of the axis $(I, \vec v)$ are needed. In addition, we can specify the fineness of the grid---in other words, the number of faces---used to represent that portion of the affine plane while transforming in an object of the type \verb+solid+.%I'm confused by this last phrase. This type of object can be used to define planes of section; it is then necessary to define a plane for projection.%check if this keeps your sense Its usage is quite easy to understand for users of PSTricks. The only thing that you need to know is that, if we manipulate a \verb+[object=plan]+ with the macro \bs{psSolid}, we manipulate two objects at the same time: one of type \verb+plan+ and the other of type \verb+solid+. When we select a backup of that object (see chapter ``\textit{Advanced usage}'') with the name $monplan$ for example with the option \verb+[name=monplan]+, there are in fact $2$ backups that are effected. The first, with the name $monplan$, is an object of type \verb+plan+, and the second, with the name $monplan\_s$, is an object of type \verb+solid+. \subsection{Defining an oriented plane} To generate such an object, one uses \verb+[object=plan]+ which comes with a few arguments: \begin{itemize} \item \verb+[definition=...]+ which specifies the method to defining the plane. \item \verb+[args=...]+ which specifies the necessary arguments for the method chosen. \item \texttt{[bases=$xmin$ $xmax$ $ymin$ $ymax$]} which specifies the dimensions of every axis. \item \verb+[phi]+ (value $0$ by default) which specifies the angle of rotation (in degrees) of the plane around its normal. \end{itemize} \subsection{Special options} The object \verb+plan+ comes with some special options for the view: \begin{itemize} \item \verb+[planmarks]+ which shows axes and scaling (with ticks), \item \verb+[plangrid]+ which shows the grid, \item \verb+[showbase]+ which shows the basis vectors for the plane, and \item \verb+[showBase]+ (note the capital letters) which shows the basis vectors of the plane and draws the associated normal vector. \end{itemize} These options apply regardless of the method of definition of the plane. \begin{center} \psset{unit=0.4} \psset{viewpoint=10 18 60 rtp2xyz,Decran=10,fontsize=10} \begin{pspicture*}(-5,-4)(6,4) \psframe(-5,-4)(5,3) \psSolid[object=plan, definition=equation, args={[0 0 1 0]}, fillcolor=Aquamarine, base=-2.2 2.2 -3.2 3.2, ] \end{pspicture*} %% \psset{unit=1} \psset{viewpoint=10 18 60 rtp2xyz,Decran=10,fontsize=10} \begin{pspicture*}(-5,-4)(6,4) \psframe(-5,-4)(5,3) \psSolid[object=plan, definition=equation, args={[0 0 1 0]}, fillcolor=Aquamarine, base=-2.2 2.2 -3.2 3.2, planmarks, ] \end{pspicture*} %% \psset{unit=1} \psset{viewpoint=10 18 60 rtp2xyz,Decran=10,fontsize=10} \begin{pspicture*}(-5,-4)(6,4) \psframe(-5,-4)(5,3) \psSolid[object=plan, definition=equation, args={[0 0 1 0]}, fillcolor=Aquamarine, base=-2.2 2.2 -3.2 3.2, plangrid, ] \end{pspicture*} %% \psset{unit=1} \psset{viewpoint=10 18 60 rtp2xyz,Decran=10,fontsize=10} \begin{pspicture*}(-5,-4)(6,4) \psframe(-5,-4)(5,3) \psSolid[object=plan, definition=equation, args={[0 0 1 0]}, fillcolor=Aquamarine, base=-2.2 2.2 -3.2 3.2, showbase, ] \end{pspicture*} %% \psset{unit=1} \psset{viewpoint=10 18 60 rtp2xyz,Decran=10,fontsize=10} \begin{pspicture*}(-5,-4)(6,4) \psframe(-5,-4)(5,3) \psSolid[object=plan, definition=equation, args={[0 0 1 0]}, fillcolor=Aquamarine, base=-2.2 2.2 -3.2 3.2, showBase, ] \end{pspicture*} %% \psset{unit=1} \psset{viewpoint=10 18 60 rtp2xyz,Decran=10,fontsize=10} \begin{pspicture*}(-5,-4)(6,4) \psframe(-5,-4)(5,3) \psSolid[object=plan, definition=equation, args={[0 0 1 0]}, fillcolor=Aquamarine, base=-2.2 2.2 -3.2 3.2, plangrid, showBase, action=none ] \end{pspicture*} \end{center} These options could be used, even if the plane is not drawn. \subsection{Defining a plane with a cartesian equation} The \textit{cartesian equation} of a plane is of the form \[ ax+by+cz+d=0 \] The coefficients $a$, $b$, $c$ and $d$ determine an affine plane. \subsubsection{Usage with default orientation and origin} To define an affine plane, one can use \verb+[definition=equation]+, and \texttt{[args=\{[$a$ $b$ $c$ $d$]\}]}. The orientation and origin of the affine plane must be given. For example, the quadruple $(a, b, c, d) = (0, 0, 1, 0)$ determines the plane with the equation $z=0$: \psset{viewpoint=10 18 60 rtp2xyz,Decran=10,fontsize=10} \begin{LTXexample}[width=6.5cm] \psset{unit=0.65} \begin{pspicture*}(-5,-4)(5,4) \psSolid[object=plan, definition=equation, args={[0 0 1 0]}, fillcolor=Aquamarine, planmarks, base=-2.2 2.2 -3.2 3.2, showbase] \axesIIID(0,0,0)(2.2,3.2,4) \end{pspicture*} \end{LTXexample} The parameter \texttt{[base=xmin xmax ymin ymax]} specifies the scale along each axis. \subsubsection{Specifying the origin} The parameter \texttt{[origine=$x_0$ $y_0$ $z_0$]} specifies the origin of the affine plane. If the chosen point $(x_0, y_0, z_0)$ doesn't fit the equation of the plane, then we needn't consider this origin.% The meaning of this is unclear to me. For example, a plane with the equation $z=0$ for which $(1, 2, 0)$ has been chosen as a possible origin:%(finish the sentence---it does what?) \psset{viewpoint=10 18 60 rtp2xyz,Decran=10,fontsize=10} \begin{LTXexample}[width=6.5cm] \psset{unit=0.65} \begin{pspicture*}(-4,-5.5)(6,4) \psSolid[object=plan, definition=equation, args={[0 0 1 0]}, fillcolor=Aquamarine, origine=1 2 0, base=-2.2 2.2 -3.2 3.2, planmarks] \axesIIID(0,0,0)(2.2,3.2,4) \end{pspicture*} \end{LTXexample} \subsubsection{Specifying the orientation} If the chosen orientation is unsatisfactory, we can specify an angle of rotation $\alpha $ (in degrees) around the normal of the plane with the syntax \texttt{[args=\{[a b c d] $\alpha $\}]}. \psset{viewpoint=10 18 60 rtp2xyz,Decran=10,fontsize=10} \begin{LTXexample}[width=6.5cm] \psset{unit=0.65} \begin{pspicture*}(-5,-4)(5,4) \psSolid[object=plan, definition=equation, args={[0 0 1 0] 90}, fillcolor=Aquamarine, base=-2.2 2.2 -3.2 3.2, planmarks] \axesIIID(0,0,0)(3.2,2.2,4) \end{pspicture*} \end{LTXexample} \subsection{Defining a plane using a normal vector and a point} It is also possible to define a plane by giving a point and a normal vector. In this case one uses the parameter \verb+[definition=normalpoint]+. If wanted, one can specify the orientation, but it can be omitted. \subsubsection{First Method: orientation Unspecified} We use \texttt{[args=\{$x_0$ $y_0$ $z_0$ [$a$ $b$ $c$]\}]} where $(x_0, y_0, z_0)$ is the origin of the affine plane, and $(a, b, c)$ is a vector normal to that plane. \psset{viewpoint=10 18 60 rtp2xyz,Decran=10,fontsize=10} \begin{LTXexample}[width=6.5cm] \psset{unit=0.65} \begin{pspicture*}(-5,-4)(5,4) \psSolid[object=plan, definition=normalpoint, args={0 0 0 [0 0 1]}, fillcolor=Aquamarine, planmarks, base=-2.2 2.2 -3.2 3.2, showbase] \axesIIID(0,0,0)(2.2,3.2,4) \end{pspicture*} \end{LTXexample} \subsubsection{Second Method: Specifying an angle of rotation} One uses \texttt{[args=\{$x_0$ $y_0$ $z_0$ [$a$ $b$ $c$ $\alpha $]\}]} where $(x_0, y_0, z_0)$ is the origin of the affine plane, $(a, b, c)$ a normal vector of that plane, and $\alpha $ the angle of rotation (in degrees) around the normal vector of that plane. \newpage \psset{viewpoint=10 18 60 rtp2xyz,Decran=10, fontsize=10} \begin{LTXexample}[width=6.5cm] \psset{unit=0.65} \begin{pspicture*}(-5,-4)(5,4) \psSolid[object=plan, definition=normalpoint, args={0 0 0 [0 0 1 45]}, fillcolor=Aquamarine, planmarks, base=-2.2 2.2 -3.2 3.2, showbase] \axesIIID(0,0,0)(2.2,3.2,4) \end{pspicture*} \end{LTXexample} \subsubsection{Third Method: Specifying the first basis vector} One uses \texttt{[args=\{$x_0$ $y_0$ $z_0$ [$u_x$ $u_y$ $u_z$ $a$ $b$ $c$ ]\}]} where $(x_0, y_0, z_0)$ is the origin of the affine plane, $(a, b, c)$ a normal vector of that plane, and $(u_x, u_y, u_z)$ the first basis vector for that plane. \psset{viewpoint=10 18 60 rtp2xyz,Decran=10,fontsize=10} \begin{LTXexample}[width=6.5cm] \psset{unit=0.65} \begin{pspicture*}(-5,-4)(5,4) \psSolid[object=plan, definition=normalpoint, args={0 0 0 [1 1 0 0 0 1]}, fillcolor=Aquamarine, planmarks, base=-2.2 2.2 -3.2 3.2, showbase, ] \axesIIID(0,0,0)(2.2,3.2,4) \end{pspicture*} \end{LTXexample} \subsubsection{Fourth Method: Specifying the first basis vector and an angle of rotation} We use \texttt{[args=\{$x_0$ $y_0$ $z_0$ [$u_x$ $u_y$ $u_z$ $a$ $b$ $c$ $\alpha $]\}]} where $(x_0, y_0, z_0)$ is the origin of the affine plane, $(a, b, c)$ is a normal vector of that plane, $(u_x, u_y, u_z)$ is the first basis vector for that plane and $\alpha $ (in degrees) is a rotation around the axis of the normal vector. \psset{viewpoint=10 18 60 rtp2xyz,Decran=10,fontsize=10} \begin{LTXexample}[width=6.5cm] \psset{unit=0.65} \begin{pspicture*}(-5,-4)(5,4) \psSolid[object=plan, definition=normalpoint, args={0 0 0 [1 1 0 0 0 1 45]}, fillcolor=Aquamarine, planmarks, base=-2.2 2.2 -3.2 3.2, showbase] \axesIIID(0,0,0)(2.2,3.2,4) \end{pspicture*} \end{LTXexample} \subsection{Defining a plane from a face of a solid} One uses \verb+[definition=solidface]+ with the arguments \texttt{[args=$name$ $i$]} where $name$ is the name of the designated solid and $i$ is the index of the face. The origin is taken as the center of the chosen face. In the example below, the plane is defined through the face with the index $0$ from the cube named $A$. \psset{viewpoint=10 18 20 rtp2xyz,Decran=10} \begin{LTXexample}[width=6.5cm] \begin{pspicture*}(-4,-2)(4,2.3) \psset{solidmemory} \psSolid[object=cube,a=2,fontsize=20,numfaces=all,name=A] \psSolid[object=plan, definition=solidface, args=A 0, showBase] \composeSolid \end{pspicture*} \end{LTXexample} If the user specifies the coordinates $(x, y, z)$ within the macro \verb+\psSolid[...](+$x,y,z$\verb+)+, a plane is generated parallel to the face with index $i$ of the solid $name$, and translated to the point $(x, y, z)$ which now is taken as the origin. \psset{viewpoint=10 18 25 rtp2xyz,Decran=10} \begin{LTXexample}[width=6.5cm] \begin{pspicture*}(-4,-2)(4,3.5) \psset{solidmemory} \psSolid[object=cube,a=2,fontsize=20,numfaces=all,name=A] \psSolid[object=plan, definition=solidface, args=A 0, showBase](0,0,2) \composeSolid \end{pspicture*} \end{LTXexample}