summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/generic/pst-solides3d/doc/par-cylindres-cones.tex
blob: b2339b1c3e7240d355f3cb57fe1c501ebc3a855d (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
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
\section{Généralisation de la notion de cylindre et de cône}
\subsection{Cylindre ou nappe cylindrique quelconque}
Cette partie généralise la notion de cylindre, ou de nappe cylindrique\footnote{Cette partie a été écrite à l'initiative de
Maxime Chupin, suite à une question sur la liste de diffusion de \url{http://melusine.eu.org/cgi-bin/mailman/listinfo/syracuse}}. Il faut définir une courbe \textit{directrice} par une fonction et la direction  de l'axe du \textit{cylindre}. Dans l'exemple ci-dessous la directrice est une sinusoïde, située dans le plan $z=-2$~:
\begin{gbar}
 \begin{verbatim}
\defFunction[algebraic]{G1}(t){t}{2*sin(t)}{-2}
 \end{verbatim}
\end{gbar}
La direction du cylindre est définie par les coordonnées d'un vecteur dans le paramètre \Cadre{axe=0 1 1}. Le dessin fait appel à  \Cadre{object=cylindre} qui en plus de ses paramètres usuels dont la hauteur \Cadre{h=4} -- il s'agit de la \textbf{longueur de la génératrice} et non de la distance entre les deux plans passant par les bases, est affecté de ceux définissant la directrice \Cadre{function=G1} et la plage de la variable $t$ \Cadre{range=-3 3}.
\begin{gbar}
 \begin{verbatim}
\psSolid[object=cylindre,
   h=4,function=G1,
   range=-3 3,
   ngrid=3 16,
   axe=0 1 1,
   incolor=green!50,
   fillcolor=yellow!50]
 \end{verbatim}
\end{gbar}

\begin{center}
\psset{unit=0.75}
\begin{pspicture}(-5,-4)(5,4)
\psset{lightsrc=viewpoint,viewpoint=100 10 20 rtp2xyz,Decran=100}
\psSolid[object=grille,base=-4 4 -6 6,linecolor={[rgb]{0.72 0.72 0.5}},action=draw](0,0,-2)
\defFunction[algebraic]{G1}(t){t}{2*sin(t)}{-2}
\defFunction[algebraic]{G2}(t){t}{2*sin(t)+4}{2}
\psSolid[object=courbe,function=G1,
   range=-3 3,r=0,
   linecolor=blue,
   linewidth=2pt]
\psSolid[object=cylindre,
   h=5.65685,function=G1,
   range=-3 3,
   ngrid=3 16,
   axe=0 1 1,
   incolor=green!50,
   fillcolor=yellow!50]
\psSolid[object=courbe,function=G2,
   range=-3 3,r=0,
   linecolor=blue,
   linewidth=2pt]
\psSolid[object=parallelepiped,
   a=8,b=12,c=4,action=draw](0,0,0)
\psSolid[object=plan,action=draw,
   definition=equation,
   args={[0 0 1 -2] 90},
   base=-6 6 -4 4,planmarks,showBase]
\psSolid[object=plan,action=draw,
   definition=equation,
   args={[0 1 0 -6] 180},
   base=-4 4 -2 2,planmarks,showBase]
\psSolid[object=plan,action=draw,
   definition=equation,
   args={[1 0 0 -4] 90},
   base=-6 6 -2 2,planmarks,showBase]
\psSolid[object=vecteur,
         linecolor=red,
         args=0 3 3]
\end{pspicture}
\end{center}

Dans cet exemple suivant, afin de représenter les deux plans horizontaux passant par les bases, on fait le calcul de la distance entre ces deux plans.
\begin{gbar}
 \begin{verbatim}
\pstVerb{/ladistance 2 sqrt 2 mul def}
 \end{verbatim}
\end{gbar}
{\psset{unit=0.75,lightsrc=viewpoint,viewpoint=100 -10 20 rtp2xyz,Decran=100}
\begin{LTXexample}[width=8cm]
\begin{pspicture}(-1.5,-3)(6.5,6)
\psSolid[object=grille,base=-3 3 -1 8,action=draw]
\pstVerb{/ladistance 2 sqrt 2 mul def}
\defFunction[algebraic]{G3}(t)
   {6*(cos(t))^3*sin(t)}
   {4*(cos(t))^2}
   {0}
\defFunction[algebraic]{G4}(t)
   {6*(cos(t))^3*sin(t)}
   {4*(cos(t))^2+ladistance}
   {ladistance}
\psSolid[object=courbe,function=G3,
   range=0 6.28,r=0,
   linecolor=blue,
   linewidth=2pt]
\psSolid[object=cylindre,
   range=0 -6.28,
   h=4,
   function=G3,
   axe=0 1 1,
   ngrid=3 36,
   fillcolor=green!50,
   incolor=yellow!50]
\psSolid[object=courbe,function=G4,
   range=0 6.28,r=0,
   linecolor=blue,
   linewidth=2pt]
\psSolid[object=vecteur,
         linecolor=red,
         args=0 ladistance dup]
\psSolid[object=plan,action=draw,
   definition=equation,
   args={[0 0 1 ladistance neg] 90},
   base=-1 8 -3 3,planmarks,showBase]
\axesIIID(0,4.5,0)(4,8,5)
\rput(0,-3){\texttt{axe=0 1 1}}
\end{pspicture}
\end{LTXexample}}


{\psset{unit=0.75,lightsrc=viewpoint,viewpoint=100 -10 20 rtp2xyz,Decran=100}
\begin{LTXexample}[width=8cm]
\begin{pspicture}(-1.5,-3)(6.5,6)
\psSolid[object=grille,base=-3 3 -1 6,action=draw]
\defFunction[algebraic]{G5}(t)
   {t}{0.5*t^2}{0}
\defFunction[algebraic]{G6}(t)
    {t}{0.5*t^2}{4}
\psSolid[object=courbe,function=G5,
   range=-3 2,r=0,
   linecolor=blue,
   linewidth=2pt]
\psSolid[object=cylindre,
   range=-3 2,
   h=4,
   function=G5,
   axe=0 0 1, %% valeur par défaut
   incolor=green!50,
   fillcolor=yellow!50,
   ngrid=3 8]
\psSolid[object=courbe,function=G6,
   range=-3 2,r=0,
   linecolor=blue,
   linewidth=2pt]
\axesIIID(0,4.5,0)(4,6,5)
\psSolid[object=vecteur,
         linecolor=red,
         args=0 0 4]
\psSolid[object=plan,action=draw,
   definition=equation,
   args={[0 0 1 -4] 90},
   base=-1 6 -3 3,planmarks,showBase]
\end{pspicture}
\end{LTXexample}}

{\psset{unit=0.75,lightsrc=viewpoint,viewpoint=100 -10 20 rtp2xyz,Decran=100}
\begin{LTXexample}[width=8cm]
\begin{pspicture}(-1.5,-3)(6.5,6)
\psset{lightsrc=viewpoint,viewpoint=100 45 45,Decran=100}
\psSolid[object=grille,base=-3 3 -2 7,fillcolor=gray!30]
\defFunction[algebraic]{G7}(t)
   {2*cos(t)}{2*sin(t)}{0}
\defFunction[algebraic]{G8}(t)
    {2*cos(t)}{2*sin(t)+4}{4}
\psSolid[object=courbe,function=G7,
   range=0 6.28,r=0,
   linecolor=blue,
   linewidth=2pt]
\psSolid[object=cylindre,
   range=0 6.28,
   h=5.65685,
   function=G7,
   axe=0 1 1,
   incolor=green!20,
   fillcolor=yellow!50,
   ngrid=3 36]
\psSolid[object=courbe,function=G8,
   range=0 6.28,r=0,
   linecolor=blue,
   linewidth=2pt]
\axesIIID(2,4.5,2)(4,8,5)
\psSolid[object=vecteur,
         linecolor=red,
         args=0 1 1](0,4,4)
\psSolid[object=plan,action=draw,
   definition=equation,
   args={[0 0 1 -4] 90},
   base=-2 7 -3 3,planmarks,showBase]
\end{pspicture}
\end{LTXexample}}


\encadre{La directrice peut être une courbe quelconque et n'est pas obligatoirement une courbe plane et horizontale.}

\begin{LTXexample}[width=8cm]
\begin{pspicture}(-1.5,-4)(4,6)
\psset{unit=0.75,lightsrc=viewpoint,viewpoint=100 -5 10 rtp2xyz,Decran=100}
\psSolid[object=grille,base=-4 4 -4 4,ngrid=8. 8.](0,0,-1)
\defFunction[algebraic]{G9}(t)
    {3*cos(t)}
    {3*sin(t)}
    {1*cos(5*t)}
\psSolid[object=cylindre,
   range=0 6.28,
   h=5,
   function=G9,
   axe=0 0 1,
   incolor=green!50,
   fillcolor=yellow!50,
   ngrid=4 72,grid]
\end{pspicture}
\end{LTXexample}

\subsection{Cône ou nappe conique quelconque}
Cette partie généralise la notion de cône et de nappe conique\footnote{Cette partie, comme la précédente, a été écrite à l'initiative de
Maxime Chupin, suite à une question sur la liste de diffusion de \url{http://melusine.eu.org/cgi-bin/mailman/listinfo/syracuse}}. Il faut définir une courbe \textit{directrice} par une fonction qui dessinera la base du cône, puis le sommet du \textit{cône} qui par défaut est \Cadre{origine=0 0 0}.  Les parties supérieure et inférieure du cône sont symétriques par rapport au sommet.  Dans l'exemple ci-dessous la directrice est un arc de parabole, situé dans le plan $z=-2$.

\begin{LTXexample}[width=7.5cm]
\begin{pspicture}(-3,-3)(4.5,5)
\psset{lightsrc=viewpoint,viewpoint=100 10 10 rtp2xyz,Decran=100}
\psSolid[object=grille,base=-4 4 -3 3,action=draw](0,0,-2)
\defFunction[algebraic]{G1}(t)
    {t}
    {0.25*t^2}
    {-2}
\defFunction[algebraic]{G2}(t)
    {-t}
    {-0.25*t^2}
    {2}
\psSolid[object=courbe,
   function=G1,
   range=-3.46 3,
   r=0,
   linecolor=blue,
   linewidth=2pt]
\psSolid[object=cone,
   function=G1,
   range=-3.46 3,
   ngrid=3 16,
   incolor=green!50,
   fillcolor=yellow!50,
   origine=0 0 0]
\psSolid[object=courbe,
   function=G2,
   range=-3.46 3,
   r=0,
   linecolor=blue,
   linewidth=2pt]
\psPoint(0,0,0){I}
\uput[l](I){\red$(0,0,0)$}
\psdot[linecolor=red](I)
\gridIIID[Zmin=-2,Zmax=2,spotX=r](-4,4)(-3,3)
\end{pspicture}
\end{LTXexample}

\begin{LTXexample}[width=7.5cm]
\begin{pspicture}(-3,-3)(4.5,5)
\psset{lightsrc=viewpoint,viewpoint=100 -10 20 rtp2xyz,Decran=100}
\psSolid[object=grille,base=-4 4 -3 3,linecolor={[rgb]{0.72 0.72 0.5}},action=draw](0,0,-2)
\defFunction[algebraic]{G1}(t)
    {t}
    {2*sin(t)}
    {-2}
\defFunction[algebraic]{G2}(t)
    {-t}
    {-2*sin(t)}
    {2}
\psSolid[object=courbe,
   function=G1,
   range=-3.14 3.14,
   r=0,
   linecolor=blue,
   linewidth=2pt]
\psSolid[object=cone,
   function=G1,
   range=-3.14 3.14,
   ngrid=3 16,
   incolor=green!50,
   fillcolor=yellow!50,
   origine=0 0 0]
\psSolid[object=courbe,
   function=G2,
   range=-3.14 3.14,
   r=0,
   linecolor=blue,
   linewidth=2pt]
\psPoint(0,0,0){I}
\uput[l](I){\red$(0,0,0)$}
\psdot[linecolor=red](I)
\gridIIID[Zmin=-2,Zmax=2,spotX=r](-4,4)(-3,3)
\end{pspicture}
\end{LTXexample}

\begin{LTXexample}[width=7.5cm]
\begin{pspicture}(-3,-3)(4.5,5)
\psset{lightsrc=viewpoint,viewpoint=100 -10 20 rtp2xyz,Decran=100}
\psSolid[object=grille,base=-4 4 -4 4,linecolor={[rgb]{0.72 0.72 0.5}},action=draw](0,0,-2)
\defFunction[algebraic]{G1}(t)
    {t}
    {2*sin(t)}
    {-2}
\defFunction[algebraic]{G2}(t)
    {-t}{-2*sin(t)-2}
    {2}
\psSolid[object=courbe,
   function=G1,
   range=-3.14 3.14,
   r=0,
   linecolor=blue,
   linewidth=2pt]
\psSolid[object=cone,
   function=G1,
   range=-3.14 3.14,
   ngrid=3 16,
   incolor=green!50,
   fillcolor=yellow!50,
   origine=0 -1 0]
\psSolid[object=courbe,
   function=G2,
   range=-3.14 3.14,
   r=0,
   linecolor=blue,
   linewidth=2pt]
\psPoint(0,-1,0){I}
\uput[l](I){\red$(0,-1,0)$}
\psdot[linecolor=red](I)
\gridIIID[Zmin=-2,Zmax=2,spotX=r](-4,4)(-4,4)
\end{pspicture}
\end{LTXexample}

\encadre{Pour les cônes aussi, la directrice peut être une courbe quelconque et n'est pas obligatoirement une courbe plane et horizontale, comme dans
l'exemple suivant écrit par Maxime Chupin.
\newline
\centerline{\url{http://melusine.eu.org/lab/bpst/pst-solides3d/cone/cone-dir_02.pst}}} 

\endinput