summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/generic/pst-solides3d/doc/par-anneaux.tex
blob: f8f44dfb3b234172334c2c05c6bf1f9f7a331756 (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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
\section {Solide anneau}

Cette partie traite des anneaux cylindriques. Dans la commande
\verb+\psSolid+, cet objet est tracé avec l'option :
\verb+[object=anneau]+, dont il faut fixer 3 paramètres :
\begin{itemize}
  \item le rayon intérieur \verb+[r=1.5]+ (valeur par défaut) ;
  \item le rayon extérieur \verb+[R=4]+ (valeur par défaut)
  \item la hauteur \verb+[h=6]+ (valeur par défaut).
\end{itemize}

En option, l'argument \verb+ngrid+ permet de définir le nombre de
sections utilisées pour faire une rotation complète de
$360$~degrés. Sa valeur par défaut est $24$.

La section de l'anneau dont la forme \texttt{rectangulaire} a été
choisie par défaut, peut être redessinée par l'utilisateur.
Nous allons détailler différents exemples de section.

\subsection{Commande pré-définie~: l'anneau à section rectangulaire.}

Cette section est définie dans le plan $Oyz$, elle est paramétrée par le
triplet $(r, R, h)$. Les valeurs du rayon
extérieur $R$, du rayon intérieur $r$ et de la hauteur $h$ sont
passées dans les options de \verb+\psSolid+. Par défaut, on a donc un
anneau à section rectangulaire variable, et la définition se fait au
moment de la transmission des valeurs pour $(r, R, h)$ dans les
options de \verb+\psSolid+.

Si l'utilisateur redéfinit la macro \TeX{} \verb+\Section+ avec des
valeurs numériques plutôt que les paramètres $r$, $R$ et $h$, alors
l'anneau n'est plus variable et il n'est plus besoin de transmettre
des valeurs pour $r$, $R$, et $h$ dans les options de \verb+\psSolid+.

%\begin{minipage}{0.45\linewidth}
\begin{lstlisting}[basicstyle=\footnotesize\ttfamily]
\def\Section{% y z
  Rad1 height 2 div neg  % S1 (R,-h/2) sommet 1
  Rad1 height 2 div      % S2 (r,h/2)  sommet 2
  rad2 height 2 div      % S3 (r,h/2)  sommet 3
  rad2 height 2 div neg }% S4 (r,-h/2) sommet 4
\end{lstlisting}

\begin{LTXexample}[width=5cm]
\psset{unit=0.5}\begin{pspicture}(-5,-3)(5,3)
\pstVerb{/Rad1 4 def /rad2 2 def /height 2 def}%
\def\RectangularSection{%
   \pspolygon[fillstyle=vlines,linewidth=2\pslinewidth]%
   (!Rad1 height 2 div neg)(!Rad1 height 2 div)%
   (!rad2 height 2 div)(!rad2 height 2 div neg)}
\rput(0,0){\RectangularSection}\rput(-6,0){\RectangularSection}
\psline(-2,1)(2,1)\psline(-2,-1)(2,-1)
\psline[linestyle=dashed,dash=1 0.2 0.05 0.2]{->}(0,-3)(0,3)
\psline[linestyle=dashed]{->}(-4,0)(4.2,0)
\uput[u](0,3){$z$}\uput[r](4.1,0){$y$}\uput[dl](0,0){$O$}
\psline{->}(0,1.5)(2,1.5)\uput[u](1,1.5){$r$}
\psline{->}(0,2.5)(4,2.5)\uput[u](2,2.5){$R$}
\psline{<->}(5,-1)(5,1)\uput[r](5,0){$h$}
\uput[dr](!Rad1 height 2 div neg){1}\uput[ur](!Rad1 height 2 div ){2}
\uput[ul](!rad2 height 2 div ){3}   \uput[dl](!rad2 height 2 div neg){4}
\end{pspicture}
\end{LTXexample}


\begin{center}
\begingroup
\psset{unit=0.5cm}
\begin{pspicture}(-5,-4)(5,4)
\psframe(-5,-4)(5,4)
\psset{viewpoint=50 20 40 rtp2xyz,Decran=25,lightsrc=10 20 20}
\psSolid[object=anneau,fillcolor=cyan,h=3,R=8,r=6,ngrid=4,RotX=10](0,0,0)
\end{pspicture}
\qquad
\begin{pspicture}(-5,-4)(5,4)
\psframe(-5,-4)(5,4)
\psset{viewpoint=50 -20 -40 rtp2xyz,Decran=25,lightsrc=-10 -20 -20}
\psSolid[object=anneau,fillcolor=yellow,h=3,R=8,r=6,RotX=90,RotZ=10](0,0,0)
\end{pspicture}
\endgroup
\end{center}

\begin{lstlisting}[basicstyle=\footnotesize\ttfamily]
\psSolid[object=anneau,fillcolor=cyan,h=3,R=8,r=6,ngrid=4,RotX=10](0,0,0)
\psSolid[object=anneau,fillcolor=yellow,h=3,R=8,r=6,RotX=90,RotZ=10](0,0,0)
\end{lstlisting}

\subsection{Un simple anneau à section triangulaire}

Ci-dessous un anneau très simple, à section triangulaire fixe. La
section est définie par la donnée des $3$~points $(6, -2)$, (10, 0)
et $(6, 2)$ dans l'option \texttt{section} de \verb+\psSolid+.

\begin{LTXexample}[width=5cm]
\psset{unit=0.5cm}
\begin{pspicture}(-5,-4)(5,4)
\psframe(-5,-4)(5,4)
\psset{viewpoint=50 20 40 rtp2xyz,Decran=25,
   lightsrc=10 20 20}
\psSolid[object=anneau,section=6 -2 10 0 6 2,
   fillcolor=cyan,RotX=10]
\end{pspicture}
\end{LTXexample}


\subsection{Un anneau variable à section triangulaire}

\begin{lstlisting}[basicstyle=\footnotesize\ttfamily]
\newcommand\SectionTriangulaire{% y <----z---->
  Rad1 height 2 div neg            % S1 (R,-h/2)
  Rad1 rad2 add 2 div height 2 div % S2 ((R+r)/2,h/2)
  rad2 height 2 div neg }          % S3 (r,-h/2)
\end{lstlisting}

\def\TriangularSection{%
  \pspolygon[fillstyle=vlines,linewidth=1.5pt](!Rad1 height 2 div neg)%
    (!Rad1 rad2 add 2 div height 2 div)(!rad2 height 2 div neg)}
\begin{LTXexample}[width=5cm]
\psset{unit=0.5cm}\pstVerb{/Rad1 4 def /rad2 2 def /height 2 def }%
\begin{pspicture}(-5,-3)(5,3)
\rput(0,0){\TriangularSection}\rput(-6,0){\TriangularSection}
\psline(-3,1)(3,1)\psline(-4,-1)(4,-1)
\psline[linestyle=dashed,dash=1 0.2 0.05 0.2]{->}(0,-3)(0,3)
\uput[u](0,3){$z$}\uput[r](4.1,0){$y$}\uput[dl](0,0){$O$}
\psline{->}(0,1.5)(2,1.5)\uput[u](1,1.5){$r$}
\psline{->}(0,2.5)(4,2.5)\uput[u](2,2.5){$R$}
\psline{<->}(5,-1)(5,1)\uput[r](5,0){$h$}
\uput[dr](! Rad1 height 2 div neg){1}
\uput[u](! Rad1 rad2 add 2 div height 2 div){2}
\uput[dl](! rad2 height 2 div neg){3}\psset{linestyle=dashed}
\psline(2,-1)(2,1.5)\psline(4,-1)(4,2.5)\psline{->}(-4,0)(4.2,0)
\end{pspicture}
\end{LTXexample}


\begin{center}
\psset{unit=0.5cm}
\def\SectionTriangulaire{
 R h 2 div neg         % sommet 1
 R r add 2 div h 2 div % sommet 2
 r h 2 div neg }       % sommet 3
\begin{pspicture}(-5,-6)(5,6)
\psframe(-5,-4)(5,4)
\psset{viewpoint=50 20 40 rtp2xyz,Decran=25,lightsrc=10 20 20}
\psSolid[object=anneau,section=\SectionTriangulaire,fillcolor=cyan,h=3,R=8,r=4,RotX=10]%
\end{pspicture}
\qquad
\begin{pspicture}(-5,-6)(5,5)
\psframe(-5,-4)(5,4)
\psset{viewpoint=50 -20 -40 rtp2xyz,Decran=25,lightsrc=-10 -20 -20}
\psSolid[object=anneau,section=\SectionTriangulaire,fillcolor=yellow,h=3,R=8,r=4,RotX=-90,RotZ=10]%
\end{pspicture}
\end{center}


\begin{lstlisting}[basicstyle=\footnotesize\ttfamily]
\psSolid[object=anneau,section=\SectionTriangulaire,
    fillcolor=cyan,h=3,R=8,r=4,RotX=10](0,0,0)
\psSolid[object=anneau,section=\SectionTriangulaire,
    fillcolor=yellow,h=3,R=8,r=4,RotX=-90,RotZ=10](0,0,0)
\end{lstlisting}

\clearpage
\subsection[L'anneau à section ``pneu'']%
  {L'anneau à section ``pneu'' : anneau cylindrique à arêtes chanfreinées.}


\begin{minipage}{0.45\linewidth}
\begin{lstlisting}[basicstyle=\footnotesize\ttfamily]
\def\SectionPneu{
  /MM { 90 4 div} bind def
  /Scos {MM cos 2 MM mul cos add 3 MM mul cos add} bind def
  /Z0 {h 4 div} bind def
  /c {Z0 Scos div} bind def
  /Z1 {Z0 c MM cos mul add} bind def
  /Z2 {Z1 c MM 2 mul cos mul add} bind def
  /R1 {R c MM sin mul sub} bind def
  /R2 {R1 c MM 2 mul sin mul sub} bind def
  /R3 {R2 c MM 3 mul sin mul sub} bind def
  R h 4 div neg % 1
  R h 4 div % 2
  R1 Z1 % 3
  R2 Z2 % 4
  R3 h 2 div % 5
  r h 2 div  % 6
  r h 2 div neg  % 7
  R3 h 2 div neg % 8
  R2 Z2 neg % 9
  R1 Z1 neg % 10
}
\end{lstlisting}
\end{minipage}
\hfill
\begin{minipage}{0.45\linewidth}
\psset{unit=0.7cm}
\begin{pspicture}(-2,-3)(5,6)
\pstVerb{/Rad1 4 def /rad2 2 def /height 2 def
  /MM {90 4 div} bind def
  /Scos {MM cos 2 MM mul cos add 3 MM mul cos add} bind def
  /Z0 {height 4 div} bind def
  /c {Z0 Scos div} bind def
  /Z1 {Z0 c MM cos mul add} bind def
  /Z2 {Z1 c MM 2 mul cos mul add} bind def
  /R1 {Rad1 c MM sin mul sub} bind def
  /R2 {R1 c MM 2 mul sin mul sub} bind def
  /R3 {R2 c MM 3 mul sin mul sub} bind def}%
\pnode(!Rad1 height 4 div neg){S1}\pnode(!Rad1 height 4 div){S2}
\pnode(!R1 Z1){S3}                \pnode(!R2 Z2){S4}
\pnode(!R3 height 2 div){S5}      \pnode(!rad2 height 2 div){S6}
\pnode(!rad2 height 2 div neg){S7}\pnode(!R3 height 2 div neg){S8}
\pnode(!R2 Z2 neg){S9}            \pnode(!R1 Z1 neg){S10}
\newcommand\pneuSection{\pspolygon[fillstyle=vlines,linewidth=2\pslinewidth]%
 (S1)(S2)(S3)(S4)(S5)(S6)(S7)(S8)(S9)(S10)}
\rput(0,0){\pneuSection}\rput{180}{\pspolygon[fillstyle=vlines,linewidth=2\pslinewidth]%
  (!Rad1 height 4 div neg)(!Rad1 height 4 div)(!R1 Z1)(!R2 Z2)%
  (!R3 height 2 div)(!rad2 height 2 div)(!rad2 height 2 div neg)(!R3 height 2 div neg)(!R2 Z2 neg)(!R1 Z1 neg)}
\psline(-3,1)(3,1)\psline(-3,-1)(3,-1)
\psline[linestyle=dashed,dash=1 0.2 0.05 0.2]{->}(0,-3)(0,3)
\uput[u](0,3){$z$}\uput[r](4.1,0){$y$}\uput[dl](0,0){$O$}
\psline[linestyle=dashed](2,-1)(2,1.5)\psline[linestyle=dashed](4,-1)(4,2.5)
\psline[linestyle=dashed]{->}(-4,0)(4.2,0)\psline{->}(0,1.5)(2,1.5)\uput[u](1,1.5){$r$}
\psline{->}(0,2.5)(4,2.5)\uput[u](2,2.5){$R$}\psline{<->}(5,-1)(5,1)\uput[r](5,0){$h$}
\uput[r](S1){1}\uput[r](S2){2}\uput[u](S3){3}\uput[u](S4){4}
\uput[u](S5){5}\uput[ul](S6){6}\uput[dl](S7){7}\uput[dl](S8){8}
\uput[dr](S9){9}\uput[r](S10){10}
\psdots[linecolor=red](S1)(S2)(S3)(S4)(S5)(S6)(S7)(S8)(S9)(S10)
\end{pspicture}
\end{minipage}

\begin{center}
\def\SectionPneu{
   /MM { 90 4 div } def
   /Scos { MM cos 2 MM mul cos add 3 MM mul cos add } def
   /Z0 { h 4 div } def
   /c {Z0 Scos div} def
   /Z1 { Z0 c MM cos mul add } def
   /Z2 { Z1 c MM 2 mul cos mul add } def
   /R1 { R c MM sin mul sub } def
   /R2 { R1 c MM 2 mul sin mul sub } def
   /R3 { R2 c MM 3 mul sin mul sub } def
   R h 4 div neg % 1
   R h 4 div % 2
   R1 Z1 % 3
   R2 Z2 % 4
   R3 h 2 div % 5
   r h 2 div  % 6
   r h 2 div neg  % 7
   R3 h 2 div neg % 8
   R2 Z2 neg % 9
   R1 Z1 neg % 10
}
\psset{unit=0.7cm}
\begin{pspicture}(-5,-5)(5,4)
\psframe(-5,-4)(5,4)
\psset{viewpoint=50 20 40 rtp2xyz,Decran=25,lightsrc=10 20 20}
\psSolid[object=anneau,section=\SectionPneu,fillcolor=cyan,h=3,R=8,r=4,RotX=10]%
\end{pspicture}
\qquad
\begin{pspicture}(-5,-5)(5,4)
\psframe(-5,-4)(5,4)
\psset{viewpoint=50 -20 -40 rtp2xyz,Decran=25,lightsrc=-10 -20 -20}
\psSolid[object=anneau,section=\SectionPneu,fillcolor=yellow,h=3,R=8,r=4,RotX=-90,RotZ=10]%
\end{pspicture}
\end{center}


\begin{verbatim}
\psSolid[object=anneau,section=\SectionPneu,fillcolor=cyan,h=3,R=8,r=4,RotX=10](0,0,0)
\psSolid[object=anneau,section=\SectionPneu,fillcolor=yellow,h=3,R=8,r=4,RotX=-90,RotZ=10]
\end{verbatim}



\endinput