Initialisation du projet pst-solides3d.git (SVN revision 142)
[pst-solides3d.git] / doc-en / par-positionnersolide-en.tex
1 \section{Positioning a solid}
2
3 \subsection{\Index{Translation}}
4
5 The following command~
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)}$.
8
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
14 \end{pspicture}
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.
18 \begin{center}
19 \begin{pspicture}(-4,-5)(5,5)
20 \psframe(-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)%
60 \end{pspicture}
61 \end{center}
62 \begin{verbatim}
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)
72 \end{verbatim}
73
74
75 \subsection{Rotation}
76
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,
81 fcol= 0 (Apricot)
82 1 (Lavender)
83 2 (SkyBlue)
84 3 (LimeGreen)
85 4 (OliveGreen)
86 5 (Yellow)
87 6 (Bittersweet)}
88 \psSolid[object=parallelepiped](0.5,0.5,0.5)%
89 \end{pspicture}
90 which will be rotated seperately around the axes $Ox$, $Oy$ and $Oz$.
91
92 \begin{multicols}{4}
93 \psset{Decran=40,viewpoint=50 35 35 rtp2xyz,a=2,b=3,c=1}
94 \psset{unit=0.5,
95 fcol= 0 (Apricot)
96 1 (Lavender)
97 2 (SkyBlue)
98 3 (LimeGreen)
99 4 (OliveGreen)
100 5 (Yellow)
101 6 (Bittersweet),
102 object=parallelepiped}
103 \setlength{\columnseprule}{1pt}
104 \centerline{
105 \begin{pspicture}(-2.75,-2.5)(2.95,2.5)
106 \psframe(-2.75,-2.5)(2.95,2.5)
107 \psSolid%%
108 \axesIIID(1,1.5,1)(3,3,2)
109 \end{pspicture}}
110 \columnbreak
111 \centerline{
112 \begin{pspicture}(-2.75,-2.5)(2.95,2.5)
113 \psframe(-2.75,-2.5)(2.95,2.5)
114 \psSolid[RotZ=60]%%
115 \psSolid[action=draw,linewidth=0.5\pslinewidth]%%
116 \axesIIID(1,1.5,1)(2,3,2)
117 \end{pspicture}}
118
119 \centerline{\texttt{[RotZ=60]}}
120
121 \columnbreak
122 \centerline{%
123 \begin{pspicture}(-2.75,-2.5)(2.95,2.5))
124 \psframe(-2.75,-2.5)(2.95,2.5)
125 \psSolid[RotX=30]%%
126 \psSolid[action=draw,linewidth=0.5\pslinewidth]%%
127 \axesIIID(1,1.5,1)(2,3,2)
128 \end{pspicture}}
129
130 \centerline{\texttt{[RotX=30]}}
131
132 \columnbreak
133 \centerline{%
134 \begin{pspicture}(-2.75,-2.5)(2.95,2.5)
135 \psframe(-2.75,-2.5)(2.95,2.5)
136 \psSolid[RotY=45]%%
137 \psSolid[action=draw,linewidth=0.5\pslinewidth]%%
138 \axesIIID(1,1.5,1)(2,3,2)
139 \end{pspicture}}
140
141 \centerline{\texttt{[RotY=-45]}}
142 \end{multicols}
143
144 \endinput

Licence Creative Commons Les fichiers de Syracuse sont mis à disposition (sauf mention contraire) selon les termes de la
Licence Creative Commons Attribution - Pas d’Utilisation Commerciale - Partage dans les Mêmes Conditions 4.0 International.