Debian Codegraph @

texmf-dist/doc/generic/pst-solides3d/text/par-positionnersolide-en.tex

raw
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 \subsection{Default sequence xyz}
78
79 The \Index{rotation} is effected around the three axes $Ox$, $Oy$ and $Oz$. Let's take a cuboid as an example,
80 \begin{pspicture}(-1,-0.2)(1,.5)
81 \psset{Decran=40,viewpoint=50 35 35 rtp2xyz,a=2,b=3,c=1,lightsrc=50 30 30}
82 \psset{fillcolor=yellow,unit=0.5,
83 fcol= 0 (red)
84 1 (Lavender)
85 2 (SkyBlue)
86 3 (LimeGreen)
87 4 (OliveGreen)
88 5 (Yellow)
89 6 (Bittersweet)}
90 \psSolid[object=parallelepiped](0.5,0.5,0.5)%
91 \end{pspicture}
92 which will be rotated seperately around the axes $Ox$, $Oy$ and $Oz$.
93
94 \begin{multicols}{4}
95 \psset{Decran=40,viewpoint=50 35 35 rtp2xyz,a=2,b=3,c=1}
96 \psset{unit=0.5,
97 fcol= 0 (red)
98 1 (Lavender)
99 2 (SkyBlue)
100 3 (LimeGreen)
101 4 (OliveGreen)
102 5 (Yellow)
103 6 (Bittersweet),
104 object=parallelepiped}
105 \setlength{\columnseprule}{1pt}
106 \centerline{
107 \begin{pspicture}(-2.75,-2.5)(2.95,2.5)
108 \psframe(-2.75,-2.5)(2.95,2.5)
109 \psSolid%%
110 \axesIIID(1,1.5,1)(3,3,2)
111 \end{pspicture}}
112 \columnbreak
113 \centerline{
114 \begin{pspicture}(-2.75,-2.5)(2.95,2.5)
115 \psframe(-2.75,-2.5)(2.95,2.5)
116 \psSolid[RotZ=60]%%
117 \psSolid[action=draw,linewidth=0.5\pslinewidth]%%
118 \axesIIID(1,1.5,1)(2,3,2)
119 \end{pspicture}}
120
121 \centerline{\texttt{[RotZ=60]}}
122
123 \columnbreak
124 \centerline{%
125 \begin{pspicture}(-2.75,-2.5)(2.95,2.5))
126 \psframe(-2.75,-2.5)(2.95,2.5)
127 \psSolid[RotX=30]%%
128 \psSolid[action=draw,linewidth=0.5\pslinewidth]%%
129 \axesIIID(1,1.5,1)(2,3,2)
130 \end{pspicture}}
131
132 \centerline{\texttt{[RotX=30]}}
133
134 \columnbreak
135 \centerline{%
136 \begin{pspicture}(-2.75,-2.5)(2.95,2.5)
137 \psframe(-2.75,-2.5)(2.95,2.5)
138 \psSolid[RotY=45]%%
139 \psSolid[action=draw,linewidth=0.5\pslinewidth]%%
140 \axesIIID(1,1.5,1)(2,3,2)
141 \end{pspicture}}
142
143 \centerline{\texttt{[RotY=-45]}}
144 \end{multicols}
145
146
147 \subsection{Rotations Sequence}
148
149 \newpsstyle{sol}{fillstyle=crosshatch,hatchcolor=green,hatchwidth=0.25\pslinewidth,hatchsep=5\pslinewidth}
150 \makeatletter
151 \def\Die#1#2#3#4{
152 \pstVerb{/posP \pst@solides@a\space 0.3 mul def
153 /rP \pst@solides@a\space 0.1 mul def
154 /dP \pst@solides@a\space 2 div neg def
155 /a_2 \pst@solides@a\space 2 div def}%
156 \psset{solidmemory}
157 %\psset{visibility=false}
158 \psSolid[action=draw**,
159 object=cube,
160 RotX=#2,RotY=#3,RotZ=#4,RotSequence=#1,
161 fontsize=15,
162 trunccoeff=.1,
163 trunc=all,
164 % fillcolor=yellow,
165 fcol=6 1 13 { (rouge) } for,
166 name=A
167 ](0,0,0)%
168 \psSolid[object=plan,action=none,
169 definition=solidface,args=A 0,name=P0]
170 \psset{plan=P0}
171 \psProjection[object=cercle,fillstyle=solid,fillcolor=black,
172 args=0 0 rP,
173 range=0 360]
174 \psSolid[object=plan,action=none,
175 definition=solidface,args=A 1,name=P1]
176 \psset{plan=P1}
177 \psProjection[object=cercle,fillstyle=solid,fillcolor=black,
178 args=0 0 rP,
179 range=0 360]
180 \psProjection[object=cercle,fillstyle=solid,fillcolor=black,
181 args=posP posP rP,
182 range=0 360]
183 \psProjection[object=cercle,fillstyle=solid,fillcolor=black,
184 args=posP neg posP neg rP,
185 range=0 360]
186 \psSolid[object=plan,action=none,
187 definition=solidface,args=A 2,name=P2]
188 \psset{plan=P2}
189 \psProjection[object=cercle,fillstyle=solid,fillcolor=black,
190 args=posP posP rP,
191 range=0 360]
192 \psProjection[object=cercle,fillstyle=solid,fillcolor=black,
193 args=posP neg posP neg rP,
194 range=0 360]
195 \psSolid[object=plan,action=none,
196 definition=solidface,args=A 3,name=P3]
197 \psset{plan=P3}
198 \psProjection[object=cercle,fillstyle=solid,fillcolor=black,
199 args=posP posP rP,
200 range=0 360]
201 \psProjection[object=cercle,fillstyle=solid,fillcolor=black,
202 args=posP posP neg rP,
203 range=0 360]
204 \psProjection[object=cercle,fillstyle=solid,fillcolor=black,
205 args=posP neg posP rP,
206 range=0 360]
207 \psProjection[object=cercle,fillstyle=solid,fillcolor=black,
208 args=posP neg posP neg rP,
209 range=0 360]
210 \psSolid[object=plan,action=none,
211 definition=solidface,args=A 4,name=P4]
212 \psset{plan=P4}
213 \psProjection[object=cercle,fillstyle=solid,fillcolor=black,
214 args=0 0 rP,
215 range=0 360]
216 \psProjection[object=cercle,fillstyle=solid,fillcolor=black,
217 args=posP posP rP,
218 range=0 360]
219 \psProjection[object=cercle,fillstyle=solid,fillcolor=black,
220 args=posP neg posP neg rP,
221 range=0 360]
222 \psProjection[object=cercle,fillstyle=solid,fillcolor=black,
223 args=posP posP neg rP,
224 range=0 360]
225 \psProjection[object=cercle,fillstyle=solid,fillcolor=black,
226 args=posP neg posP rP,
227 range=0 360]
228 \psSolid[object=plan,action=none,
229 definition=solidface,args=A 5,name=P5]
230 \psset{plan=P5}
231 \psProjection[object=cercle,fillstyle=solid,fillcolor=black,
232 args=0 posP rP,
233 range=0 360]
234 \psProjection[object=cercle,fillstyle=solid,fillcolor=black,
235 args=0 posP neg rP,
236 range=0 360]
237 \psProjection[object=cercle,fillstyle=solid,fillcolor=black,
238 args=posP posP rP,
239 range=0 360]
240 \psProjection[object=cercle,fillstyle=solid,fillcolor=black,
241 args=posP neg posP neg rP,
242 range=0 360]
243 \psProjection[object=cercle,fillstyle=solid,fillcolor=black,
244 args=posP posP neg rP,
245 range=0 360]
246 \psProjection[object=cercle,fillstyle=solid,fillcolor=black,
247 args=posP neg posP rP,
248 range=0 360]
249 \psSolid[object=vecteur,
250 args=4 0 0,
251 linecolor=green](a_2,0,0)%
252 \psSolid[object=vecteur,
253 args=0 4 0,
254 linecolor=red](0,a_2,0)
255 \psSolid[object=vecteur,
256 args=0 0 4,
257 linecolor=blue](0,0,a_2)
258 \rput(0,-2.5){\texttt{RotSequence=#1}}
259 }
260 \makeatother
261
262 \begin{center}
263 \psset{viewpoint=50 60 25 rtp2xyz,Decran=25,lightsrc=viewpoint,a=4,solidmemory}%
264 \begin{pspicture}(-3,-3)(3,3)
265 \psframe(-3,-3)(3,3)
266 \Die{xyz}{0}{0}{0}
267 \rput(0,-2){\texttt{RotX=0,RotY=0,RotZ=0}}
268 \end{pspicture}
269
270 \begin{pspicture}(-3,-3)(3,3)
271 \psframe(-3,-3)(3,3)
272 \Die{xyz}{90}{90}{90}
273 \rput(0,-2){\texttt{RotX=90,RotY=90,RotZ=90}}
274 \end{pspicture}
275 \begin{pspicture}(-3,-3)(3,3)
276 \psframe(-3,-3)(3,3)
277 \Die{xzy}{90}{90}{90}
278 \rput(0,-2){\texttt{RotX=90,RotY=90,RotZ=90}}
279 \end{pspicture}
280
281 \begin{pspicture}(-3,-3)(3,3)
282 \psframe(-3,-3)(3,3)
283 \Die{yxz}{90}{90}{90}
284 \rput(0,-2){\texttt{RotX=90,RotY=90,RotZ=90}}
285 \end{pspicture}
286 \begin{pspicture}(-3,-3)(3,3)
287 \psframe(-3,-3)(3,3)
288 \Die{yzx}{90}{90}{90}
289 \rput(0,-2){\texttt{RotX=90,RotY=90,RotZ=90}}
290 \end{pspicture}
291
292 \begin{pspicture}(-3,-3)(3,3)
293 \psframe(-3,-3)(3,3)
294 \Die{zxy}{90}{90}{90}
295 \rput(0,-2){\texttt{RotX=90,RotY=90,RotZ=90}}
296 \end{pspicture}
297 \begin{pspicture}(-3,-3)(3,3)
298 \psframe(-3,-3)(3,3)
299 \Die{zyx}{90}{90}{90}
300 \rput(0,-2){\texttt{RotX=90,RotY=90,RotZ=90}}
301 \end{pspicture}
302 \end{center}
303
304
305 \endinput