1 \section{The object
\texttt{plan
}}
3 \subsection{Presentation: type
\texttt{plan\/
} and type
\texttt{solid
} }
6 \Lkeyval{plan
} is special in
7 \texttt{pst-solides3d
}. However, all the objects presented until now have had a common structure:
8 they are of type
\verb+solid+: in other words, they are defined by a list of vertices, faces and colours.
10 For many applications, it is necessary to have some additional information for a
\Index{plane
}: an origin, an
11 orientation, a reference base etc.
13 To fulfill all these requirements, another
14 data structure of type
\Lkeyval{plan
} was created, which allows one to save all this necessary information. These manipulations of the plane will be controlled
16 Only when rendering takes place will an object of type
\Lkeyval{plan
} be converted to an object of type
\verb+solid+ which conforms to the macro
\Lcs{psSolid
}.
18 An object of type
\Lkeyval{plan
} is used to describe an oriented affine plane.
19 For a complete definition of such an object,
21 $I$, a basis $(
\vec u,
\vec v)$ for that plane, a scaling of the axis $(I,
\vec u)$ and a scaling of the axis
22 $(I,
\vec v)$ are needed.
23 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
24 while transforming in an object of the type
\verb+solid+.
%I'm confused by this last phrase.
26 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
28 Its usage is quite easy to understand for users of PSTricks.
29 The only thing that you need to know is that, if we manipulate a
30 \texttt{\Lkeyword{object
}=
\Lkeyval{plan
}} with the macro
\Lcs{psSolid
}, we manipulate two objects at the same time: one of type
\Lkeyval{plan
} and
31 the other of type
\verb+solid+. When we select a backup
32 of that object (see chapter ``
\textit{Advanced usage
}'') with the name $monplan$ for example with the option
\texttt{\Lkeyword{name
}=monplan
}, there are
33 in fact
2 backups that are effected.
34 The first, with the name
\texttt{monplan
}, is an object of type
\Lkeyval{plan
}, and the second, with the name
\texttt{monplan
\_s}, is an object of type
\verb+solid+.
37 \subsection{Defining an oriented plane
}
39 To generate such an object, one uses
\texttt{\Lkeyword{object
}=
\Lkeyval{plan
}} which comes with a few arguments:
43 \item \Lkeyword{definition
} which specifies the method to defining the plane.
45 \item \Lkeyword{args
} which specifies the necessary arguments for the method chosen.
47 \item \texttt{\Lkeyword{base
}=$xmin$ $xmax$ $ymin$ $ymax$
} which specifies the dimensions of each axis.
49 \item \verb+
[phi
]+ (value $
0$ by default) which specifies the angle of rotation (in degrees) of the plane around its normal.
55 \subsection{Special options
}
57 The object
\verb+plan+ comes with some special options for viewing:
59 \item \Lkeyword{planmarks
} which shows axes and scaling (with ticks),
60 \item \Lkeyword{plangrid
} which shows the grid,
61 \item \Lkeyword{showbase
} which shows the basis vectors for the plane, and
62 \item \Lkeyword{showBase
} (note the capital letters) which shows the basis vectors of the plane
63 and draws the associated normal vector.
65 These options apply regardless of the method of definition of the plane.
69 \psset{viewpoint=
10 18 60 rtp2xyz,Decran=
10,fontsize=
10}
70 \begin{pspicture*
}(-
5,-
4)(
6,
4)
76 base=-
2.2 2.2 -
3.2 3.2]
80 \psset{viewpoint=
10 18 60 rtp2xyz,Decran=
10,fontsize=
10}
81 \begin{pspicture*
}(-
5,-
4)(
6,
4)
87 base=-
2.2 2.2 -
3.2 3.2,
92 \psset{viewpoint=
10 18 60 rtp2xyz,Decran=
10,fontsize=
10}
93 \begin{pspicture*
}(-
5,-
4)(
6,
4)
99 base=-
2.2 2.2 -
3.2 3.2,
104 \psset{viewpoint=
10 18 60 rtp2xyz,Decran=
10,fontsize=
10}
105 \begin{pspicture*
}(-
5,-
4)(
6,
4)
107 \psSolid[object=plan,
110 fillcolor=Aquamarine,
111 base=-
2.2 2.2 -
3.2 3.2,
116 \psset{viewpoint=
10 18 60 rtp2xyz,Decran=
10,fontsize=
10}
117 \begin{pspicture*
}(-
5,-
4)(
6,
4)
119 \psSolid[object=plan,
122 fillcolor=Aquamarine,
123 base=-
2.2 2.2 -
3.2 3.2,
128 \psset{viewpoint=
10 18 60 rtp2xyz,Decran=
10,fontsize=
10}
129 \begin{pspicture*
}(-
5,-
4)(
6,
4)
131 \psSolid[object=plan,
134 fillcolor=Aquamarine,
135 base=-
2.2 2.2 -
3.2 3.2,
143 These options can be used, even if the plane is not drawn.
145 \subsection{Defining a plane with a cartesian equation
}
147 The
\textit{cartesian equation
} of a plane is of the form
151 The coefficients $a$, $b$, $c$ and $d$ determine an affine plane.
153 \subsubsection{Usage with default orientation and origin
}
155 To define an affine plane, we can use
156 \texttt{\Lkeyword{definition
}=
\Lkeyval{equation
}}, and
\texttt{\Lkeyword{args
}=\
{[$a$ $b$ $c$
157 $d$
]\
}}. The orientation and origin of the affine plane must be given.
159 For example, the quadruple $(a, b, c, d) = (
0,
0,
1,
0)$ determines
160 the plane with the equation $z=
0$:
162 \begin{LTXexample
}[width=
6.5cm
]
163 \psset{viewpoint=
10 18 60 rtp2xyz,Decran=
10,
164 fontsize=
10,unit=
0.65}
165 \begin{pspicture*
}(-
5,-
4)(
5,
4)
166 \psSolid[object=plan,
169 fillcolor=Aquamarine,
171 base=-
2.2 2.2 -
3.2 3.2,
173 \axesIIID(
0,
0,
0)(
2.2,
3.2,
4)
177 The parameter
\texttt{\Lkeyword{base
}=$xmin$ $xmax$ $ymin$ $ymax$
} specifies the extent along each axis.
179 \subsubsection{Specifying the origin
}
181 The parameter
\texttt{\Lkeyword{origine
}=$x_0$ $y_0$ $z_0$
} specifies
182 the origin of the affine plane.
183 If the chosen point $(x_0, y_0, z_0)$ doesn't fit the equation of the plane, it will be ignored.
% The meaning of this is unclear to me.
185 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?)
188 \begin{LTXexample
}[width=
6.5cm
]
189 \psset{viewpoint=
10 18 60 rtp2xyz,Decran=
10,
190 fontsize=
10,unit=
0.65cm
}
191 \begin{pspicture*
}(-
4,-
5.5)(
6,
4)
192 \psSolid[object=plan,
195 fillcolor=Aquamarine,
197 base=-
2.2 2.2 -
3.2 3.2,
199 \axesIIID(
0,
0,
0)(
2.2,
3.2,
4)
204 \subsubsection{Specifying the orientation
}
206 If the chosen orientation is unsatisfactory,
207 we can specify an angle of rotation $
\alpha $ (in degrees) around the normal of the plane with the syntax
208 \texttt{\Lkeyword{args
}=\
{[a b c d
] $
\alpha $\
}}.
211 \begin{LTXexample
}[width=
6.5cm
]
212 \psset{viewpoint=
10 18 60 rtp2xyz,
213 Decran=
10,fontsize=
10,unit=
0.65cm
}
214 \begin{pspicture*
}(-
5,-
4)(
5,
4)
215 \psSolid[object=plan,
218 fillcolor=Aquamarine,
219 base=-
2.2 2.2 -
3.2 3.2,
221 \axesIIID(
0,
0,
0)(
3.2,
2.2,
4)
226 \subsection{Defining a plane using a normal vector and a point
}
228 It is also possible to define a plane by giving a point and a normal vector.
229 In this case one uses the parameter
\texttt{\Lkeyword{definition
}=
\Lkeyval{normalpoint
}}.
231 If wanted, we can specify the orientation, but it can be omitted.
233 \subsubsection{First Method: orientation Unspecified
}
235 We use
\texttt{\Lkeyword{args
}=\
{$x_0$ $y_0$ $z_0$
[$a$ $b$ $c$
]\
}} where $(x_0,
236 y_0, z_0)$ is the origin of the affine plane, and $(a, b, c)$ is a vector normal to that plane.
239 \begin{LTXexample
}[width=
6.5cm
]
240 \psset{viewpoint=
10 18 60 rtp2xyz,
241 Decran=
10,fontsize=
10,unit=
0.65cm
}
242 \begin{pspicture*
}(-
5,-
4)(
5,
4)
243 \psSolid[object=plan,
244 definition=normalpoint,
245 args=
{0 0 0 [0 0 1]},
246 fillcolor=Aquamarine,
248 base=-
2.2 2.2 -
3.2 3.2,
250 \axesIIID(
0,
0,
0)(
2.2,
3.2,
4)
255 \subsubsection{Second Method: Specifying an angle of rotation
}
257 We use
\texttt{\Lkeyword{args
}=\
{$x_0$ $y_0$ $z_0$
[$a$ $b$ $c$ $
\alpha
258 $
]\
}} where $(x_0, y_0, z_0)$ is the origin of the affine plane, $(a, b,
259 c)$ a normal vector of that plane, and $
\alpha $ the angle of rotation (in
260 degrees) around the normal vector of that plane.
264 \begin{LTXexample
}[width=
6.5cm
]
265 \psset{viewpoint=
10 18 60 rtp2xyz,
266 Decran=
10,fontsize=
10,unit=
0.65}
267 \begin{pspicture*
}(-
5,-
4)(
5,
4)
268 \psSolid[object=plan,
269 definition=normalpoint,
270 args=
{0 0 0 [0 0 1 45]},
271 fillcolor=Aquamarine,
273 base=-
2.2 2.2 -
3.2 3.2,
275 \axesIIID(
0,
0,
0)(
2.2,
3.2,
4)
280 \subsubsection{Third Method: Specifying the first basis vector
}
282 We use
\texttt{\Lkeyword{args
}=\
{$x_0$ $y_0$ $z_0$
[$u_x$ $u_y$ $u_z$ $a$ $b$
283 $c$
]\
}} where $(x_0, y_0, z_0)$ is the origin of the affine plane,
284 $(a, b, c)$ a normal vector of that plane, and $(u_x, u_y, u_z)$ the first basis vector for that plane.
287 \begin{LTXexample
}[width=
6.5cm
]
288 \psset{viewpoint=
10 18 60 rtp2xyz,
289 Decran=
10,fontsize=
10,unit=
0.65cm
}
290 \begin{pspicture*
}(-
5,-
4)(
5,
4)
291 \psSolid[object=plan,
292 definition=normalpoint,
293 args=
{0 0 0 [1 1 0 0 0 1]},
294 fillcolor=Aquamarine,
296 base=-
2.2 2.2 -
3.2 3.2,
299 \axesIIID(
0,
0,
0)(
2.2,
3.2,
4)
304 \subsubsection{Fourth Method: Specifying the first basis vector and an angle of rotation
}
306 We use
\texttt{\Lkeyword{args
}=\
{$x_0$ $y_0$ $z_0$
[$u_x$ $u_y$ $u_z$ $a$ $b$
307 $c$ $
\alpha $
]\
}} where $(x_0, y_0, z_0)$ is the origin of the affine plane,
308 $(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.
311 \begin{LTXexample
}[width=
6.5cm
]
312 \psset{viewpoint=
10 18 60 rtp2xyz,
313 Decran=
10,fontsize=
10,unit=
0.65cm
}
314 \begin{pspicture*
}(-
5,-
4)(
5,
4)
315 \psSolid[object=plan,
316 definition=normalpoint,
317 args=
{0 0 0 [1 1 0 0 0 1 45]},
318 fillcolor=Aquamarine,
320 base=-
2.2 2.2 -
3.2 3.2,
322 \axesIIID(
0,
0,
0)(
2.2,
3.2,
4)
327 \subsection{Defining a plane from a face of a solid
}
329 We use
\texttt{\texttt{\Lkeyword{definition
}=
\Lkeyval{solidface
}}} with the arguments
330 \texttt{\texttt{\Lkeyword{args
}=$name$ $i$
}} where $name$ is the name of the designated solid and
331 $i$ is the index of the face. The origin is taken as the centre of the chosen face.
333 In the example below, the plane is defined through the face with the index
0 from the cube named $A$.
336 \begin{LTXexample
}[width=
6.5cm
]
337 \psset{viewpoint=
10 18 20 rtp2xyz,Decran=
8}
338 \begin{pspicture
}(-
3.5,-
2)(
3,
2.5)
340 \psSolid[object=cube,a=
2,fontsize=
20,numfaces=all,name=A
]
341 \psSolid[object=plan,
342 definition=solidface,
348 If the user specifies the coordinates $(x, y, z)$ within the macro
349 \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.
352 \begin{LTXexample
}[width=
6.5cm
]
353 \psset{viewpoint=
10 18 20 rtp2xyz,Decran=
8}
354 \begin{pspicture
}(-
3.5,-
1.5)(
3,
3)
356 \psSolid[object=cube,a=
2,fontsize=
20,numfaces=all,name=A
]
357 \psSolid[object=plan,
358 definition=solidface,