summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/generic/pst-solides3d/doc-en/par-positionnersolide_en_corr.tex
blob: 1ec2d1d05a367ad8ac50dacdf07bc879bef32115 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
\section{Positioning a solid}
\subsection{Translation}
The following command
\Cadre{\textbackslash psSolid[object=cube,+\textit{options}](x,y,z)} shifts the 
center of the cube to the point with the coordinates $\mathtt{(x,y,z)}$.

The next example will copy the cube with edge length of 1
\begin{pspicture}(-0.5,-0.5)(.5,.5)
\psset{Decran=40,viewpoint=50 35 35 rtp2xyz,a=1,lightsrc=50 30 20}
\psset{fillcolor=yellow,mode=3}
\psSolid[object=cube](0.5,0.5,0.5)% c1
\end{pspicture} 
to the points with the coordinates $\mathtt{(0.5,0.5,0.5)}$, 
 $\mathtt{(4.5,0.5,0.5)}$ etc. so that the copied cubes setup the vertices 
 of a new cube with the edge length 5.
\begin{center}
\begin{pspicture}(-4,-5)(5,5)
\psframe(-4,-5)(5,5)
%\psset{SphericalCoor,Decran=3,viewpoint=10 35 35,a=1,lightsrc=50 20 10}
\psset{Decran=40,viewpoint=50 35 35 rtp2xyz,a=1,lightsrc=50 30 20}
\psSolid[object=grille,base=0 6 0 6,fillcolor=gray!40]%%
\psSolid[object=grille,base=0 6 0 6,RotY=90,fillcolor=gray!30](0,0,6)%
\psSolid[object=grille,base=0 6 0 6,RotX=-90,fillcolor=gray!20](0,0,6)%
\psPoint(1,0.5,0.5){c11}
\psPoint(0.5,0.5,1){c12}
\psPoint(0.5,1,0.5){c13}
\psPoint(4.5,4.5,1){c21}
\psPoint(4,4.5,0.5){c22}
\psPoint(4.5,4,0.5){c23}
\psPoint(4,0.5,0.5){c41}
\psPoint(4.5,0.5,1){c42}
\psPoint(4.5,1,0.5){c43}
\psPoint(0.5,4,0.5){c51}
\psPoint(0.5,4.5,1){c52}
\psPoint(1,4.5,0.5){c53}
\psPoint(0.5,0.5,4){c61}
\psPoint(0.5,1,4.5){c62}
\psPoint(1,0.5,4.5){c63}
\psPoint(4,0.5,4.5){c71}
\psPoint(4.5,1,4.5){c72}
\psPoint(4.5,0.5,4){c73}
\axesIIID(1,1,1)(6,6,6)
{\psset{fillcolor=yellow,mode=3}
\psSolid[object=cube](0.5,0.5,0.5)% c1
\psline[linestyle=dashed,linecolor=red,linewidth=1.5pt](c11)(c41)
\psline[linestyle=dashed,linecolor=red,linewidth=1.5pt](c12)(c61)
\psline[linestyle=dashed,linecolor=red,linewidth=1.5pt](c13)(c51)
\psSolid[object=cube](4.5,0.5,0.5)
\psSolid[object=cube](0.5,4.5,0.5)
\psSolid[object=cube](0.5,0.5,4.5)
\psSolid[object=cube](4.5,4.5,4.5)
\psSolid[object=cube](4.5,0.5,4.5)
\psSolid[object=cube](4.5,4.5,0.5)
\psSolid[object=cube](0.5,4.5,4.5)}
\psSolid[object=grille,base=0 5 0 5,action=draw,linecolor=blue!70,linewidth=1.2pt](0,0,5)%
\psSolid[object=grille,base=0 5 0 5,action=draw,linecolor=blue!70,RotY=90,linewidth=1.2pt](5,0,5)%
\psSolid[object=grille,base=0 5 0 5,action=draw,RotX=-90,linecolor=blue!70,linewidth=1.2pt](0,5,5)%
\end{pspicture}
\end{center}
\begin{verbatim}
\psset{fillcolor=yellow,mode=3}
\psSolid[object=cube](0.5,0.5,0.5)
\psSolid[object=cube](4.5,0.5,0.5)
\psSolid[object=cube](0.5,4.5,0.5)
\psSolid[object=cube](0.5,0.5,4.5)
\psSolid[object=cube](4.5,4.5,4.5)
\psSolid[object=cube](4.5,0.5,4.5)
\psSolid[object=cube](4.5,4.5,0.5)
\psSolid[object=cube](0.5,4.5,4.5)
\end{verbatim}


\subsection{Rotation}

The rotation is effected around the three axes $Ox$, $Oy$ and $Oz$. Let's take a cuboid as an example,
\begin{pspicture}(-1,-0.2)(1,.5)
\psset{Decran=40,viewpoint=50 35 35 rtp2xyz,a=2,b=3,c=1,lightsrc=50 30 30}
\psset{fillcolor=yellow,unit=0.5,
  fcol= 0 (Apricot)
        1 (Lavender)
        2 (SkyBlue)
        3 (LimeGreen)
        4 (OliveGreen)
        5 (Yellow)
        6 (Bittersweet)}
\psSolid[object=parallelepiped](0.5,0.5,0.5)%
\end{pspicture}
which will be rotated seperately around the axes $Ox$, $Oy$ and $Oz$.

\begin{multicols}{4}
\psset{Decran=40,viewpoint=50 35 35 rtp2xyz,a=2,b=3,c=1}
\psset{unit=0.5,
  fcol= 0 (Apricot)
        1 (Lavender)
        2 (SkyBlue)
        3 (LimeGreen)
        4 (OliveGreen)
        5 (Yellow)
        6 (Bittersweet),
  object=parallelepiped}
\setlength{\columnseprule}{1pt}
\centerline{
\begin{pspicture}(-2.75,-2.5)(2.95,2.5)
\psframe(-2.75,-2.5)(2.95,2.5)
\psSolid%%
\axesIIID(1,1.5,1)(3,3,2)
\end{pspicture}}
\columnbreak
\centerline{
\begin{pspicture}(-2.75,-2.5)(2.95,2.5)
\psframe(-2.75,-2.5)(2.95,2.5)
\psSolid[RotZ=60]%%
\psSolid[action=draw,linewidth=0.5\pslinewidth]%%
\axesIIID(1,1.5,1)(2,3,2)
\end{pspicture}}

\centerline{\texttt{[RotZ=60]}}

\columnbreak
\centerline{%
\begin{pspicture}(-2.75,-2.5)(2.95,2.5))
\psframe(-2.75,-2.5)(2.95,2.5)
\psSolid[RotX=30]%%
\psSolid[action=draw,linewidth=0.5\pslinewidth]%%
\axesIIID(1,1.5,1)(2,3,2)
\end{pspicture}}

\centerline{\texttt{[RotX=30]}}

\columnbreak
\centerline{%
\begin{pspicture}(-2.75,-2.5)(2.95,2.5)
\psframe(-2.75,-2.5)(2.95,2.5)
\psSolid[RotY=45]%%
\psSolid[action=draw,linewidth=0.5\pslinewidth]%%
\axesIIID(1,1.5,1)(2,3,2)
\end{pspicture}}

\centerline{\texttt{[RotY=-45]}}
\end{multicols}

\endinput