1 \section{Positioning a solid
}
3 \subsection{\Index{Translation
}}
6 \texttt{\Lcs{psSolid
}[object=cube,+
\textit{options
}](x,y,z)
} shifts the
7 centre of the cube to the point with the coordinates $
\mathtt{(x,y,z)
}$.
9 The next example will copy the cube with edge length of
1
10 \begin{pspicture
}(-
0.5,-
0.5)(
.5,
.5)
11 \psset{Decran=
40,viewpoint=
50 35 35 rtp2xyz,a=
1,lightsrc=
50 30 20}
12 \psset{fillcolor=yellow,mode=
3}
13 \psSolid[object=cube
](
0.5,
0.5,
0.5)
% c1
15 to the points with the coordinates $
\mathtt{(
0.5,
0.5,
0.5)
}$,
16 $
\mathtt{(
4.5,
0.5,
0.5)
}$ etc. so that the copied cubes setup the vertices
17 of a new cube with the edge length
5.
19 \begin{pspicture
}(-
4,-
5)(
5,
5)
21 %\psset{SphericalCoor,Decran=3,viewpoint=10 35 35,a=1,lightsrc=50 20 10}
22 \psset{Decran=
40,viewpoint=
50 35 35 rtp2xyz,a=
1,lightsrc=
50 30 20}
23 \psSolid[object=grille,base=
0 6 0 6,fillcolor=gray!
40]%%
24 \psSolid[object=grille,base=
0 6 0 6,RotY=
90,fillcolor=gray!
30](
0,
0,
6)
%
25 \psSolid[object=grille,base=
0 6 0 6,RotX=-
90,fillcolor=gray!
20](
0,
0,
6)
%
26 \psPoint(
1,
0.5,
0.5)
{c11
}
27 \psPoint(
0.5,
0.5,
1)
{c12
}
28 \psPoint(
0.5,
1,
0.5)
{c13
}
29 \psPoint(
4.5,
4.5,
1)
{c21
}
30 \psPoint(
4,
4.5,
0.5)
{c22
}
31 \psPoint(
4.5,
4,
0.5)
{c23
}
32 \psPoint(
4,
0.5,
0.5)
{c41
}
33 \psPoint(
4.5,
0.5,
1)
{c42
}
34 \psPoint(
4.5,
1,
0.5)
{c43
}
35 \psPoint(
0.5,
4,
0.5)
{c51
}
36 \psPoint(
0.5,
4.5,
1)
{c52
}
37 \psPoint(
1,
4.5,
0.5)
{c53
}
38 \psPoint(
0.5,
0.5,
4)
{c61
}
39 \psPoint(
0.5,
1,
4.5)
{c62
}
40 \psPoint(
1,
0.5,
4.5)
{c63
}
41 \psPoint(
4,
0.5,
4.5)
{c71
}
42 \psPoint(
4.5,
1,
4.5)
{c72
}
43 \psPoint(
4.5,
0.5,
4)
{c73
}
44 \axesIIID(
1,
1,
1)(
6,
6,
6)
45 {\psset{fillcolor=yellow,mode=
3}
46 \psSolid[object=cube
](
0.5,
0.5,
0.5)
% c1
47 \psline[linestyle=dashed,linecolor=red,linewidth=
1.5pt
](c11)(c41)
48 \psline[linestyle=dashed,linecolor=red,linewidth=
1.5pt
](c12)(c61)
49 \psline[linestyle=dashed,linecolor=red,linewidth=
1.5pt
](c13)(c51)
50 \psSolid[object=cube
](
4.5,
0.5,
0.5)
51 \psSolid[object=cube
](
0.5,
4.5,
0.5)
52 \psSolid[object=cube
](
0.5,
0.5,
4.5)
53 \psSolid[object=cube
](
4.5,
4.5,
4.5)
54 \psSolid[object=cube
](
4.5,
0.5,
4.5)
55 \psSolid[object=cube
](
4.5,
4.5,
0.5)
56 \psSolid[object=cube
](
0.5,
4.5,
4.5)
}
57 \psSolid[object=grille,base=
0 5 0 5,action=draw,linecolor=blue!
70,linewidth=
1.2pt
](
0,
0,
5)
%
58 \psSolid[object=grille,base=
0 5 0 5,action=draw,linecolor=blue!
70,RotY=
90,linewidth=
1.2pt
](
5,
0,
5)
%
59 \psSolid[object=grille,base=
0 5 0 5,action=draw,RotX=-
90,linecolor=blue!
70,linewidth=
1.2pt
](
0,
5,
5)
%
63 \psset{fillcolor=yellow,mode=
3}
64 \psSolid[object=cube
](
0.5,
0.5,
0.5)
65 \psSolid[object=cube
](
4.5,
0.5,
0.5)
66 \psSolid[object=cube
](
0.5,
4.5,
0.5)
67 \psSolid[object=cube
](
0.5,
0.5,
4.5)
68 \psSolid[object=cube
](
4.5,
4.5,
4.5)
69 \psSolid[object=cube
](
4.5,
0.5,
4.5)
70 \psSolid[object=cube
](
4.5,
4.5,
0.5)
71 \psSolid[object=cube
](
0.5,
4.5,
4.5)
77 The
\Index{rotation
} is effected around the three axes $Ox$, $Oy$ and $Oz$. Let's take a cuboid as an example,
78 \begin{pspicture
}(-
1,-
0.2)(
1,
.5)
79 \psset{Decran=
40,viewpoint=
50 35 35 rtp2xyz,a=
2,b=
3,c=
1,lightsrc=
50 30 30}
80 \psset{fillcolor=yellow,unit=
0.5,
88 \psSolid[object=parallelepiped
](
0.5,
0.5,
0.5)
%
90 which will be rotated seperately around the axes $Ox$, $Oy$ and $Oz$.
93 \psset{Decran=
40,viewpoint=
50 35 35 rtp2xyz,a=
2,b=
3,c=
1}
102 object=parallelepiped
}
103 \setlength{\columnseprule}{1pt
}
105 \begin{pspicture
}(-
2.75,-
2.5)(
2.95,
2.5)
106 \psframe(-
2.75,-
2.5)(
2.95,
2.5)
108 \axesIIID(
1,
1.5,
1)(
3,
3,
2)
112 \begin{pspicture
}(-
2.75,-
2.5)(
2.95,
2.5)
113 \psframe(-
2.75,-
2.5)(
2.95,
2.5)
115 \psSolid[action=draw,linewidth=
0.5\pslinewidth]%%
116 \axesIIID(
1,
1.5,
1)(
2,
3,
2)
119 \centerline{\texttt{[RotZ=
60]}}
123 \begin{pspicture
}(-
2.75,-
2.5)(
2.95,
2.5))
124 \psframe(-
2.75,-
2.5)(
2.95,
2.5)
126 \psSolid[action=draw,linewidth=
0.5\pslinewidth]%%
127 \axesIIID(
1,
1.5,
1)(
2,
3,
2)
130 \centerline{\texttt{[RotX=
30]}}
134 \begin{pspicture
}(-
2.75,-
2.5)(
2.95,
2.5)
135 \psframe(-
2.75,-
2.5)(
2.95,
2.5)
137 \psSolid[action=draw,linewidth=
0.5\pslinewidth]%%
138 \axesIIID(
1,
1.5,
1)(
2,
3,
2)
141 \centerline{\texttt{[RotY=-
45]}}