1 \section{Généralisation de la notion de cylindre et de cône
}
2 \subsection{Cylindre ou nappe cylindrique quelconque
}
3 Cette partie généralise la notion de cylindre, ou de nappe cylindrique
\footnote{Cette partie a été écrite à l'initiative de
4 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$~:
7 \defFunction[algebraic
]{G1
}(t)
{t
}{2*sin(t)
}{-
2}
10 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}.
13 \psSolid[object=cylindre,
25 \begin{pspicture
}(-
5,-
4)(
5,
4)
26 \psset{lightsrc=viewpoint,viewpoint=
100 10 20 rtp2xyz,Decran=
100}
27 \psSolid[object=grille,base=-
4 4 -
6 6,linecolor=
{[rgb
]{0.72 0.72 0.5}},action=draw
](
0,
0,-
2)
28 \defFunction[algebraic
]{G1
}(t)
{t
}{2*sin(t)
}{-
2}
29 \defFunction[algebraic
]{G2
}(t)
{t
}{2*sin(t)+
4}{2}
30 \psSolid[object=courbe,function=G1,
34 \psSolid[object=cylindre,
35 h=
5.65685,function=G1,
41 \psSolid[object=courbe,function=G2,
45 \psSolid[object=parallelepiped,
46 a=
8,b=
12,c=
4,action=draw
](
0,
0,
0)
47 \psSolid[object=plan,action=draw,
50 base=-
6 6 -
4 4,planmarks,showBase
]
51 \psSolid[object=plan,action=draw,
53 args=
{[0 1 0 -
6] 180},
54 base=-
4 4 -
2 2,planmarks,showBase
]
55 \psSolid[object=plan,action=draw,
58 base=-
6 6 -
2 2,planmarks,showBase
]
59 \psSolid[object=vecteur,
65 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.
68 \pstVerb{/ladistance
2 sqrt
2 mul def
}
71 {\psset{unit=
0.75,lightsrc=viewpoint,viewpoint=
100 -
10 20 rtp2xyz,Decran=
100}
72 \begin{LTXexample
}[width=
8cm
]
73 \begin{pspicture
}(-
1.5,-
3)(
6.5,
6)
74 \psSolid[object=grille,base=-
3 3 -
1 8,action=draw
]
75 \pstVerb{/ladistance
2 sqrt
2 mul def
}
76 \defFunction[algebraic
]{G3
}(t)
80 \defFunction[algebraic
]{G4
}(t)
82 {4*(cos(t))^
2+ladistance
}
84 \psSolid[object=courbe,function=G3,
88 \psSolid[object=cylindre,
96 \psSolid[object=courbe,function=G4,
100 \psSolid[object=vecteur,
102 args=
0 ladistance dup
]
103 \psSolid[object=plan,action=draw,
105 args=
{[0 0 1 ladistance neg
] 90},
106 base=-
1 8 -
3 3,planmarks,showBase
]
107 \axesIIID(
0,
4.5,
0)(
4,
8,
5)
108 \rput(
0,-
3)
{\texttt{axe=
0 1 1}}
113 {\psset{unit=
0.75,lightsrc=viewpoint,viewpoint=
100 -
10 20 rtp2xyz,Decran=
100}
114 \begin{LTXexample
}[width=
8cm
]
115 \begin{pspicture
}(-
1.5,-
3)(
6.5,
6)
116 \psSolid[object=grille,base=-
3 3 -
1 6,action=draw
]
117 \defFunction[algebraic
]{G5
}(t)
119 \defFunction[algebraic
]{G6
}(t)
121 \psSolid[object=courbe,function=G5,
125 \psSolid[object=cylindre,
129 axe=
0 0 1,
%% valeur par défaut
133 \psSolid[object=courbe,function=G6,
137 \axesIIID(
0,
4.5,
0)(
4,
6,
5)
138 \psSolid[object=vecteur,
141 \psSolid[object=plan,action=draw,
143 args=
{[0 0 1 -
4] 90},
144 base=-
1 6 -
3 3,planmarks,showBase
]
148 {\psset{unit=
0.75,lightsrc=viewpoint,viewpoint=
100 -
10 20 rtp2xyz,Decran=
100}
149 \begin{LTXexample
}[width=
8cm
]
150 \begin{pspicture
}(-
1.5,-
3)(
6.5,
6)
151 \psset{lightsrc=viewpoint,viewpoint=
100 45 45,Decran=
100}
152 \psSolid[object=grille,base=-
3 3 -
2 7,fillcolor=gray!
30]
153 \defFunction[algebraic
]{G7
}(t)
154 {2*cos(t)
}{2*sin(t)
}{0}
155 \defFunction[algebraic
]{G8
}(t)
156 {2*cos(t)
}{2*sin(t)+
4}{4}
157 \psSolid[object=courbe,function=G7,
161 \psSolid[object=cylindre,
169 \psSolid[object=courbe,function=G8,
173 \axesIIID(
2,
4.5,
2)(
4,
8,
5)
174 \psSolid[object=vecteur,
177 \psSolid[object=plan,action=draw,
179 args=
{[0 0 1 -
4] 90},
180 base=-
2 7 -
3 3,planmarks,showBase
]
185 \encadre{La directrice peut être une courbe quelconque et n'est pas obligatoirement une courbe plane et horizontale.
}
187 \begin{LTXexample
}[width=
8cm
]
188 \begin{pspicture
}(-
1.5,-
4)(
4,
6)
189 \psset{unit=
0.75,lightsrc=viewpoint,viewpoint=
100 -
5 10 rtp2xyz,Decran=
100}
190 \psSolid[object=grille,base=-
4 4 -
4 4,ngrid=
8.
8.
](
0,
0,-
1)
191 \defFunction[algebraic
]{G9
}(t)
195 \psSolid[object=cylindre,
206 \subsection{Cône ou nappe conique quelconque
}
207 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
208 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$.
210 \begin{LTXexample
}[width=
7.5cm
]
211 \begin{pspicture
}(-
3,-
3)(
4.5,
5)
212 \psset{lightsrc=viewpoint,viewpoint=
100 10 10 rtp2xyz,Decran=
100}
213 \psSolid[object=grille,base=-
4 4 -
3 3,action=draw
](
0,
0,-
2)
214 \defFunction[algebraic
]{G1
}(t)
218 \defFunction[algebraic
]{G2
}(t)
222 \psSolid[object=courbe,
228 \psSolid[object=cone,
235 \psSolid[object=courbe,
242 \uput[l
](I)
{\red$(
0,
0,
0)$
}
243 \psdot[linecolor=red
](I)
244 \gridIIID[Zmin=-
2,Zmax=
2,spotX=r
](-
4,
4)(-
3,
3)
248 \begin{LTXexample
}[width=
7.5cm
]
249 \begin{pspicture
}(-
3,-
3)(
4.5,
5)
250 \psset{lightsrc=viewpoint,viewpoint=
100 -
10 20 rtp2xyz,Decran=
100}
251 \psSolid[object=grille,base=-
4 4 -
3 3,linecolor=
{[rgb
]{0.72 0.72 0.5}},action=draw
](
0,
0,-
2)
252 \defFunction[algebraic
]{G1
}(t)
256 \defFunction[algebraic
]{G2
}(t)
260 \psSolid[object=courbe,
266 \psSolid[object=cone,
273 \psSolid[object=courbe,
280 \uput[l
](I)
{\red$(
0,
0,
0)$
}
281 \psdot[linecolor=red
](I)
282 \gridIIID[Zmin=-
2,Zmax=
2,spotX=r
](-
4,
4)(-
3,
3)
286 \begin{LTXexample
}[width=
7.5cm
]
287 \begin{pspicture
}(-
3,-
3)(
4.5,
5)
288 \psset{lightsrc=viewpoint,viewpoint=
100 -
10 20 rtp2xyz,Decran=
100}
289 \psSolid[object=grille,base=-
4 4 -
4 4,linecolor=
{[rgb
]{0.72 0.72 0.5}},action=draw
](
0,
0,-
2)
290 \defFunction[algebraic
]{G1
}(t)
294 \defFunction[algebraic
]{G2
}(t)
297 \psSolid[object=courbe,
303 \psSolid[object=cone,
310 \psSolid[object=courbe,
317 \uput[l
](I)
{\red$(
0,-
1,
0)$
}
318 \psdot[linecolor=red
](I)
319 \gridIIID[Zmin=-
2,Zmax=
2,spotX=r
](-
4,
4)(-
4,
4)
323 \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
324 l'exemple suivant écrit par Maxime Chupin.
326 \centerline{\url{http://melusine.eu.org/lab/bpst/pst-solides3d/cone/cone-dir_02.pst
}}}