4 This paragraph discusses the cylindric
\Index{rings
}. Within the macro
5 \Lcs{psSolid
}, this object is passed with the option:
6 \texttt{\Lkeyword{object
}=
\Lkeyval{anneau
}}, that comes with
3 parameters:
8 \item the inner radius
\texttt{\Lkeyword{r
}=
1.5} (value by default);
9 \item the outer radius
\texttt{\Lkeyword{R
}=
4} (value by default);
10 \item the height
\texttt{\Lkeyword{h
}=
6} (value by default).
13 The argument
\Lkeyword{ngrid
} defines the number of sections used to make a complete
14 rotation of $
360$~degrees. Its default value is $
24$.
16 The section of the ring, whose shape is
\textit{rectangular
} was chosen as default,
17 and can be redesigned by the user.
18 We will discuss different examples of sections for rings.
20 \subsection{Predefined command: the ring with a rectangular section
}
22 This section is defined in the plane $Oyz$, it is parameterized with the
23 triple $(r, R, h)$. The values of the outer radius $R$, inner radius $r$ and the
24 height $h$ are passed in the macro
\Lcs{psSolid
}. By default, one has a ring with
25 a variable rectangular section, and the definition takes place at the time
26 of the transmission of the values $(r, R, h)$ into the options of
\Lcs{psSolid
}.
28 If the user redefines the
\TeX {} macro
\verb+
\Section+ with some numeric values
29 instead of the parameters $r$, $R$ and $h$, then
30 the ring won't be variable anymore and it is not necessary to transmit the
31 values $r$, $R$, and $h$ into the options of
\Lcs{psSolid
}.
33 \begin{minipage
}{0.45\linewidth}
37 R h
2 div neg
% sommet 1
43 r h
2 div neg
% sommet 4
49 \begin{minipage
}{0.45\linewidth}
51 \begin{pspicture
}(-
5,-
3)(
5,
3)
52 \pstVerb{/R
4 def /r
2 def /h
2 def
}%
53 \newcommand\RectangularSection{%
54 \pspolygon[fillstyle=vlines,linewidth=
2\pslinewidth]%
55 (!R h
2 div neg)(!R h
2 div)(!r h
2 div)(!r h
2 div neg)
}
56 \rput(
0,
0)
{\RectangularSection}\rput(-
6,
0)
{\RectangularSection}
57 \psline(-
2,
1)(
2,
1)
\psline(-
2,-
1)(
2,-
1)
58 \psline[linestyle=dashed,dash=
1 0.2 0.05 0.2]{->
}(
0,-
3)(
0,
3)
59 \psline[linestyle=dashed
]{->
}(-
4,
0)(
4.2,
0)
60 \uput[u
](
0,
3)
{$z$
}\uput[r
](
4.1,
0)
{$y$
}\uput[dl
](
0,
0)
{$O$
}
61 \psline{->
}(
0,
1.5)(
2,
1.5)
\uput[u
](
1,
1.5)
{$r$
}
62 \psline{->
}(
0,
2.5)(
4,
2.5)
\uput[u
](
2,
2.5)
{$R$
}
63 \psline{<->
}(
5,-
1)(
5,
1)
\uput[r
](
5,
0)
{$h$
}
64 \uput[dr
](!R h
2 div neg)
{1}
65 \uput[ur
](!R h
2 div )
{2}
66 \uput[ul
](!r h
2 div )
{3}
67 \uput[dl
](!r h
2 div neg)
{4}
71 \begin{LTXexample
}[width=
6cm
]
73 \begin{pspicture
}(-
5,-
4)(
5,
4)
74 \psset[pst-solides3d
]{viewpoint=
50 20 40 rtp2xyz,
75 Decran=
25,lightsrc=
10 20 20}
76 \psSolid[object=anneau,fillcolor=cyan,
77 h=
3,R=
8,r=
6,ngrid=
4,RotX=
10](
0,
0,
0)
79 \begin{pspicture
}(-
5,-
4)(
5,
4)
80 \psset[pst-solides3d
]{viewpoint=
50 -
20 -
40 rtp2xyz,
81 Decran=
25,lightsrc=-
10 -
20 -
20}
82 \psSolid[object=anneau,
83 fillcolor=yellow,h=
3,R=
8,r=
6,
84 RotX=
90,RotZ=
10](
0,
0,
0)
90 \subsection{Example
1: a simple ring with a triangular section
}
92 Below is a very simple ring with a fixed triangular section.
93 The section is defined by $
3$~points $(
6, -
2)$, $(
10,
0)$
94 and $(
6,
2)$ within the option
\Lkeyword{section
} of
\Lcs{psSolid
}.
96 \begin{LTXexample
}[width=
6cm
]
98 \begin{pspicture
}(-
5,-
6)(
5,
6)
99 \psset[pst-solides3d
]{viewpoint=
50 20 40 rtp2xyz,Decran=
25,
101 \psSolid[object=anneau,
102 section=
6 -
2 10 0 6 2,
103 fillcolor=cyan,RotX=
10]%
109 \subsection{Example
2: a ring with a variable triangular section
}
111 \newcommand\SectionTriangulaire{
112 R h
2 div neg
% sommet 1
113 R r add
2 div h
2 div
% sommet 2
114 r h
2 div neg
% sommet 3
117 \begin{minipage
}{0.45\linewidth}
119 \newcommand\SectionTriangulaire{
123 R r add
2 div h
2 div
131 \begin{minipage
}{0.45\linewidth}
133 \begin{pspicture
}(-
5,-
3)(
5,
3)
135 \pstVerb{/R
4 def /r
2 def /h
2 def
}%
136 \newcommand\TriangularSection{%
137 \pspolygon[fillstyle=vlines,linewidth=
2\pslinewidth]%
138 (!R h
2 div neg)(!R r add
2 div h
2 div)(!r h
2 div neg)
}
139 \rput(
0,
0)
{\TriangularSection}\rput(-
6,
0)
{\TriangularSection}
140 \psline(-
3,
1)(
3,
1)
\psline(-
4,-
1)(
4,-
1)
141 \psline[linestyle=dashed,dash=
1 0.2 0.05 0.2]{->
}(
0,-
3)(
0,
3)
142 \uput[u
](
0,
3)
{$z$
}\uput[r
](
4.1,
0)
{$y$
}\uput[dl
](
0,
0)
{$O$
}
143 \psline[linestyle=dashed
](
2,-
1)(
2,
1.5)
144 \psline[linestyle=dashed
](
4,-
1)(
4,
2.5)
145 \psline[linestyle=dashed
]{->
}(-
4,
0)(
4.2,
0)
146 \psline{->
}(
0,
1.5)(
2,
1.5)
\uput[u
](
1,
1.5)
{$r$
}
147 \psline{->
}(
0,
2.5)(
4,
2.5)
\uput[u
](
2,
2.5)
{$R$
}
148 \psline{<->
}(
5,-
1)(
5,
1)
\uput[r
](
5,
0)
{$h$
}
149 \uput[dr
](!R h
2 div neg)
{1}
150 \uput[u
](!R r add
2 div h
2 div)
{2}
151 \uput[dl
](!r h
2 div neg)
{3}
157 \begin{pspicture
}(-
5,-
6)(
5,
6)
159 \psset[pst-solides3d
]{viewpoint=
50 20 40 rtp2xyz,Decran=
25,lightsrc=
10 20 20}
160 \psSolid[object=anneau,section=
\SectionTriangulaire,fillcolor=cyan,h=
3,R=
8,r=
4,RotX=
10]%
163 \begin{pspicture
}(-
5,-
6)(
5,
5)
165 \psset[pst-solides3d
]{viewpoint=
50 -
20 -
40 rtp2xyz,Decran=
25,lightsrc=-
10 -
20 -
20}
166 \psSolid[object=anneau,section=
\SectionTriangulaire,fillcolor=yellow,h=
3,R=
8,r=
4,RotX=-
90,RotZ=
10]%
171 \psSolid[object=anneau,section=
\SectionTriangulaire,
%
172 fillcolor=cyan,h=
3,R=
8,r=
4,RotX=
10](
0,
0,
0)
173 \psSolid[object=anneau,section=
\SectionTriangulaire,
%
174 fillcolor=yellow,h=
3,R=
8,r=
4,RotX=-
90,RotZ=
10](
0,
0,
0)
179 \newcommand\SectionPneu{
180 /m
{90 4 div
} bind def
181 /Scos
{m cos
2 m mul cos add
3 m mul cos add
} bind def
182 /Z0
{h
4 div
} bind def
183 /c
{Z0 Scos div
} bind def
184 /Z1
{Z0 c m cos mul add
} bind def
185 /Z2
{Z1 c m
2 mul cos mul add
} bind def
186 /R1
{R c m sin mul sub
} bind def
187 /R2
{R1 c m
2 mul sin mul sub
} bind def
188 /R3
{R2 c m
3 mul sin mul sub
} bind def
201 \subsection{Example
3: a ring with a``tyre''-like section: cylindric ring with chamfered edges
}
203 \begin{minipage
}{0.45\linewidth}
206 \renewcommand\SectionPneu{
207 /m
{90 4 div
} bind def
208 /Scos
{m cos
2 m mul cos add
3 m mul cos add
} bind def
209 /Z0
{h
4 div
} bind def
210 /c
{Z0 Scos div
} bind def
211 /Z1
{Z0 c m cos mul add
} bind def
212 /Z2
{Z1 c m
2 mul cos mul add
} bind def
213 /R1
{R c m sin mul sub
} bind def
214 /R2
{R1 c m
2 mul sin mul sub
} bind def
215 /R3
{R2 c m
3 mul sin mul sub
} bind def
230 \begin{minipage
}{0.45\linewidth}
232 \begin{pspicture
}(-
2,-
3)(
5,
6)
234 \pstVerb{/R
4 def /r
2 def /h
2 def
}%
235 \pstVerb{/m
{90 4 div
} bind def
236 /Scos
{m cos
2 m mul cos add
3 m mul cos add
} bind def
237 /Z0
{h
4 div
} bind def
238 /c
{Z0 Scos div
} bind def
239 /Z1
{Z0 c m cos mul add
} bind def
240 /Z2
{Z1 c m
2 mul cos mul add
} bind def
241 /R1
{R c m sin mul sub
} bind def
242 /R2
{R1 c m
2 mul sin mul sub
} bind def
243 /R3
{R2 c m
3 mul sin mul sub
} bind def
}%
244 \pnode(!R h
4 div neg)
{S1
}
245 \pnode(!R h
4 div)
{S2
}
248 \pnode(!R3 h
2 div)
{S5
}
249 \pnode(!r h
2 div)
{S6
}
250 \pnode(!r h
2 div neg)
{S7
}
251 \pnode(!R3 h
2 div neg)
{S8
}
252 \pnode(!R2 Z2 neg)
{S9
}
253 \pnode(!R1 Z1 neg)
{S10
}
254 \newcommand\pneuSection{\pspolygon[fillstyle=vlines,linewidth=
2\pslinewidth]%
255 (S1)(S2)(S3)(S4)(S5)(S6)(S7)(S8)(S9)(S10)
}
256 \rput(
0,
0)
{\pneuSection}\rput{180}{\pspolygon[fillstyle=vlines,linewidth=
2\pslinewidth]%
257 (!R h
4 div neg)(!R h
4 div)(!R1 Z1)(!R2 Z2)(!R3 h
2 div)(!r h
2 div)(!r h
2 div neg)(!R3 h
2 div neg)(!R2 Z2 neg)(!R1 Z1 neg)
}
258 \psline(-
3,
1)(
3,
1)
\psline(-
3,-
1)(
3,-
1)
259 \psline[linestyle=dashed,dash=
1 0.2 0.05 0.2]{->
}(
0,-
3)(
0,
3)
260 \uput[u
](
0,
3)
{$z$
}\uput[r
](
4.1,
0)
{$y$
}\uput[dl
](
0,
0)
{$O$
}
261 \psline[linestyle=dashed
](
2,-
1)(
2,
1.5)
262 \psline[linestyle=dashed
](
4,-
1)(
4,
2.5)
263 \psline[linestyle=dashed
]{->
}(-
4,
0)(
4.2,
0)
264 \psline{->
}(
0,
1.5)(
2,
1.5)
\uput[u
](
1,
1.5)
{$r$
}
265 \psline{->
}(
0,
2.5)(
4,
2.5)
\uput[u
](
2,
2.5)
{$R$
}
266 \psline{<->
}(
5,-
1)(
5,
1)
\uput[r
](
5,
0)
{$h$
}
277 \psdots[linecolor=red
](S1)(S2)(S3)(S4)(S5)(S6)(S7)(S8)(S9)(S10)
284 \begin{pspicture
}(-
5,-
5)(
5,
4)
286 \psset[pst-solides3d
]{viewpoint=
50 20 40 rtp2xyz,Decran=
25,lightsrc=
10 20 20}
287 \psSolid[object=anneau,section=
\SectionPneu,fillcolor=cyan,h=
3,R=
8,r=
4,RotX=
10]%
290 \begin{pspicture
}(-
5,-
5)(
5,
4)
292 \psset[pst-solides3d
]{viewpoint=
50 -
20 -
40 rtp2xyz,Decran=
25,lightsrc=-
10 -
20 -
20}
293 \psSolid[object=anneau,section=
\SectionPneu,fillcolor=yellow,h=
3,R=
8,r=
4,RotX=-
90,RotZ=
10]%
299 \psSolid[object=anneau,section=
\SectionPneu,
%
300 fillcolor=cyan,h=
3,R=
8,r=
4,RotX=
10](
0,
0,
0)
301 \psSolid[object=anneau,section=
\SectionPneu,
%
302 fillcolor=yellow,h=
3,R=
8,r=
4,RotX=-
90,RotZ=
10]%
308 \subsection{Example
4: an empty bobbin
}
310 \newcommand\SectionBobine{
315 R h
4 div sub h
3 div neg
% 5
316 R h
4 div sub h
3 div
% 6
321 \begin{minipage
}{0.45\linewidth}
323 \newcommand\SectionBobine{
328 R h
4 div sub h
3 div neg
% 5
329 R h
4 div sub h
3 div
% 6
336 \begin{minipage
}{0.45\linewidth}
337 \begin{pspicture
}(-
2,-
2)(
5,
2)
338 \pstVerb{/RB
4 def /rB
2 def /hB
3 def
}%
339 \pnode(!rB hB
2 div)
{S1
}
340 \pnode(!rB hB
2 div neg)
{S2
}
341 \pnode(!RB hB
2 div neg)
{S3
}
342 \pnode(!RB hB
3 div neg)
{S4
}
343 \pnode(!RB hB
4 div sub hB
3 div neg)
{S5
}
344 \pnode(!RB hB
4 div sub hB
3 div)
{S6
}
345 \pnode(!RB hB
3 div)
{S7
}
346 \pnode(!RB hB
2 div)
{S8
}
347 \newcommand\pneuSection{\pspolygon[fillstyle=vlines,linewidth=
2\pslinewidth]%
348 (S1)(S2)(S3)(S4)(S5)(S6)(S7)(S8)
}
349 \rput(
0,
0)
{\pneuSection}\rput{180}{\pspolygon[fillstyle=vlines,linewidth=
2\pslinewidth]%
350 (!rB hB
2 div)(!rB hB
2 div neg)(!RB hB
2 div neg)(!RB hB
3 div neg)(!RB hB
4 div sub hB
3 div neg)(!RB hB
4 div sub hB
3 div)(!RB hB
3 div)(!RB hB
2 div)
}
351 \psline(-
3,
1.5)(
3,
1.5)
\psline(-
3,-
1.5)(
3,-
1.5)
352 \psline[linestyle=dashed,dash=
1 0.2 0.05 0.2]{->
}(
0,-
3)(
0,
3)
353 \uput[u
](
0,
3)
{$z$
}\uput[r
](
4.1,
0)
{$y$
}\uput[dl
](
0,
0)
{$O$
}
354 \psline[linestyle=dashed
](
2,-
1)(
2,
1.5)
355 \psline[linestyle=dashed
](
4,-
1)(
4,
2.5)
356 \psline[linestyle=dashed
](-
4,-
1)(
4,-
1)
357 \psline[linestyle=dashed
](-
4,
1)(
4,
1)
358 \psline[linestyle=dashed
]{->
}(-
4,
0)(
4.2,
0)
359 \psline{->
}(
0,
1.8)(
2,
1.8)
\uput[u
](
1,
1.8)
{$r$
}
360 \psline{->
}(
0,
2.5)(
4,
2.5)
\uput[u
](
2,
2.5)
{$R$
}
361 \psline{<->
}(
5,-
1.5)(
5,
1.5)
\uput[r
](
5,
0)
{$h$
}
370 \psdots[linecolor=red
](S1)(S2)(S3)(S4)(S5)(S6)(S7)(S8)
374 \begin{pspicture
}(-
5,-
6)(
5,
5)
375 \psframe*
[linecolor=blue!
50](-
5,-
5)(
5,
4)
376 \psset[pst-solides3d
]{viewpoint=
70 40 10 rtp2xyz,Decran=
25,lightsrc=
0 30 100}
377 \psSolid[object=grille,base=-
15 15 -
15 15,fillcolor=yellow!
30!black!
10](
0,
0,-
8)
378 %\psSolid[object=prisme,h=2,base=-15 1 -15 -1 15 -1 15 1](0,0,-8)
379 \psSolid[object=anneau,section=
\SectionBobine,fillcolor=gray!
50,h=
6,R=
8,r=
4,RotX=
90,linecolor=gray
]%
383 \psSolid[object=grille,base=-
15 15 -
15 15,fillcolor=yellow!
30](
0,
0,-
8)
384 \psSolid[object=anneau,section=
\SectionBobine,
%
385 fillcolor=gray!
50,h=
6,R=
8,r=
4,RotX=
90,linecolor=gray
]%
390 \subsection{Some other rings
}
392 Three other examples are available on the website:
394 \centerline{\url{http://syracuse.eu.org/lab/bpst/pst-solides3d/anneaux
}}