source: trunk/documents/UserDoc/UsersGuides/ForApplicationDeveloper/html/Detector/geomSolids.html

Last change on this file was 1208, checked in by garnier, 16 years ago

CVS update

File size: 61.6 KB
Line 
1<html>
2<head>
3<title>ADG: Geometry</title>
4<script language="JavaScript">
5function remote_win(urlnum)
6{
7 var url = "geometry.src/pic" + urlnum + ".html";
8 RemoteWin=window.open(url,"","resizable=no,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,copyhistory=0,width=520,height=520")
9 RemoteWin.creator=self
10}
11</script>
12</head>
13
14<!-- Changed by: Gabriele Cosmo, 18-Apr-2005 -->
15<!-- $Id: geomSolids.html,v 1.8 2006/11/23 16:36:33 gcosmo Exp $ -->
16<!-- $Name: $ -->
17<body>
18<table WIDTH="100%"><TR>
19<td>
20<a href="../../../../Overview/html/index.html">
21<IMG SRC="../../../../resources/html/IconsGIF/Overview.gif" ALT="Overview"></a>
22<a href="geometry.html">
23<IMG SRC="../../../../resources/html/IconsGIF/Contents.gif" ALT="Contents"></a>
24<a href="geomIntro.html">
25<IMG SRC="../../../../resources/html/IconsGIF/Previous.gif" ALT="Previous"></a>
26<a href="geomLogical.html">
27<IMG SRC="../../../../resources/html/IconsGIF/Next.gif" ALT="Next"></a>
28</td>
29<td ALIGN="Right">
30<font SIZE="-1" COLOR="#238E23">
31<b>Geant4 User's Guide</b>
32<br>
33<b>For Application Developers</b>
34<br>
35<b>Geometry</b>
36</font>
37</td>
38</tr></table>
39<br><br>
40
41<a name="4.1.2">
42<h2>4.1.2 Solids</h2></a>
43
44<p>
45The STEP standard supports multiple solid representations. Constructive
46Solid Geometry (CSG) representations and Boundary Represented Solids (BREPs)
47are available. Different representations are suitable for different
48purposes, applications, required complexity, and levels of detail.
49CSG representations are easy to use and normally give superior performance,
50but they cannot reproduce complex solids such as those used in CAD systems.
51BREP representations can handle more extended topologies and reproduce the
52most complex solids, thus allowing the exchange of models with CAD systems.
53<br>
54All constructed solids can stream out their contents via appropriate methods
55and streaming operators.
56</p>
57
58<p>
59For all solids it is possible to estimate the geometrical volume and the
60surface area by invoking the methods:
61<pre>
62 G4double GetCubicVolume()
63 G4double GetSurfaceArea()
64</pre>
65which return an estimate of the solid volume and total area in internal
66units respectively. For elementary solids the functions compute the exact
67geometrical quantities, while for composite or complex solids an estimate
68is made using Monte Carlo techniques.
69</p>
70
71<p>
72For all solids it is also possible to generate pseudo-random points lying
73on their surfaces, by invoking the method
74<pre>
75 G4ThreeVector GetPointOnSurface() const
76</pre>
77which returns the generated point in local coordinates relative to the solid.
78</p>
79
80<a name="4.1.2.1">
81<H4>4.1.2.1 Constructed Solid Geometry (CSG) Solids</H4></a>
82
83 CSG solids are defined directly as three-dimensional primitives. They are
84 described by a minimal set of parameters necessary to define the shape and
85 size of the solid. CSG solids are Boxes, Tubes and their sections, Cones
86 and their sections, Spheres, Wedges, and Toruses.
87<P>
88<HR width=40% align=center noshade>
89</P>
90 To create a <b>box</b> one can use the constructor:
91
92 <table border="0" width="100%" id="table1">
93 <tr>
94 <td width="480" valign="top">
95 <font face="Courier">
96 G4Box(const G4String&amp; pName,<br>
97 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
98 G4double&nbsp; pX,<br>
99 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
100 G4double&nbsp; pY,<br>
101 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
102 G4double&nbsp; pZ)
103 </font>
104 <P>
105 by giving the box a name and its half-lengths along the
106 X, Y and Z axis:
107 </P>
108 <P>
109 <table border=1 cellpadding=8>
110 <tr>
111 <td><tt>pX</tt><td>half length in X
112 <td><tt>pY</tt><td>half length in Y
113 <td><tt>pZ</tt><td>half length in Z
114 </tr>
115 </table>
116 </P>
117 <P>
118 This will create a box that extends from <tt>-pX</tt> to
119 <tt>+pX</tt> in X, from <tt>-pY</tt> to <tt>+pY</tt> in Y,
120 and from <tt>-pZ</tt> to <tt>+pZ</tt> in Z.
121 </P>
122 <P>&nbsp;</P><P>&nbsp;</P>
123 <P>
124 <div align="right"><font size=-1><I>
125 <U>In the picture</U>: pX = 30, pY = 40, pZ = 60
126 </I></font></div>
127 </P>
128 <P>
129 For example to create a box that is 2 by 6 by 10 centimeters
130 in full length, and called <tt>BoxA</tt> one should use the
131 following code:
132 </P>
133 </td>
134 <td>
135 <a href="javascript:remote_win(1)"
136 onMouseOver="window.status='Get alive picture...'; return true">
137 <img src="geometry.src/aBox.jpg" border=0></a>
138 </td>
139 </tr>
140</table>
141
142 <PRE>
143 G4Box* aBox = new G4Box("BoxA", 1.0*cm, 3.0*cm, 5.0*cm);
144 </PRE>
145</P>
146<P>
147<HR width=40% align=center noshade>
148</P>
149<P>
150 <table border="0" width="100%" id="table2">
151 <tr>
152 <td width="480" valign="top">
153 Similarly to create a <b>cylindrical section</b> or <b>tube</b>,
154 one would use the constructor:
155 <P>
156 <font face="Courier">
157 G4Tubs(const G4String&amp; pName,<br>
158 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
159 G4double&nbsp; pRMin,<br>
160 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
161 G4double&nbsp; pRMax,<br>
162 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
163 G4double&nbsp; pDz,<br>
164 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
165 G4double&nbsp; pSPhi,<br>
166 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
167 G4double&nbsp; pDPhi)
168 </font>
169 <P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P>
170 <P>
171 <div align="right"><font size=-1><I>
172 <U>In the picture</U>: pRMin = 10, pRMax = 15, pDz = 20<br>
173 pSPhi = 0*Degree, pDPhi = 90*Degree
174 </I></font></div>
175 </P>
176 </td>
177 <td>
178 <a href="javascript:remote_win(2)"
179 onMouseOver="window.status='Get alive picture...'; return true">
180 <img src="geometry.src/aTubs.jpg" border=0 height=380></a>
181 </td>
182 </tr>
183</table>
184
185giving its name <tt>pName</tt> and its parameters which are:</P>
186<p>
187 <table border=1 cellpadding=8>
188 <tr>
189 <td><tt>pRMin</tt> <td>Inner radius
190 <td><tt>pRMax</tt> <td>Outer radius
191 <tr>
192 <td><tt>pDz</tt> <td> half length in z
193 <td><tt>pSPhi</tt> <td>the starting phi angle in radians
194 <tr>
195 <td><tt>pDPhi</tt> <td>the angle of the segment in radians
196 <td>&nbsp;<td>&n&nbsp;
197 </table>
198</P>
199<P>
200<HR width=40% align=center noshade>
201</P>
202<P>
203<table border="0" width="100%" id="table3">
204 <tr>
205 <td width="480" valign="top">
206 Similarly to create a <b>cone</b>, or <b>conical section</b>,
207 one would use the constructor:
208 <P>
209 <font face="Courier">
210 G4Cons(const G4String&amp; pName,<br>
211 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
212 G4double&nbsp; pRmin1,<br>
213 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
214 G4double&nbsp; pRmax1,<br>
215 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
216 G4double&nbsp; pRmin2,<br>
217 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
218 G4double&nbsp; pRmax2,<br>
219 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
220 G4double&nbsp; pDz,<br>
221 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
222 G4double&nbsp; pSPhi,<br>
223 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
224 G4double&nbsp; pDPhi)
225 </font>
226 <P>
227 <div align="right"><font size=-1><I>
228 <U>In the picture</U>: pRmin1 = 5, pRmax1 = 10,<br>
229 pRmin2 = 20, pRmax2 = 25<br>
230 pDz = 40, pSPhi = 0, pDPhi = 4/3*Pi
231 </I></font></div>
232 </P>
233 </td>
234 <td><a href="javascript:remote_win(3)"
235 onMouseOver="window.status='Get alive picture...'; return true">
236 <img src="geometry.src/aCons.jpg" border="0"></a>
237 </td>
238 </tr>
239</table>
240
241giving its name <tt>pName</tt>, and its parameters which are:</P>
242<P>
243<table border=1 cellpadding=8>
244 <tr>
245 <TD><tt>pRmin1 <td>inside radius at <tt>-pDz</tt>
246 <TD><tt>pRmax1 <td>outside radius at <tt>-pDz</tt>
247 <tr>
248 <TD><tt>pRmin2 <td>inside radius at <tt>+pDz</tt>
249 <TD><tt>pRmax2 <td>outside radius at <tt>+pDz</tt>
250 <tr>
251 <TD><tt>pDz </tt> <td> half length in z
252 <TD><tt>pSPhi</tt> <td> starting angle of the segment in radians
253 <tr>
254 <TD><tt>pDPhi</tt> <td> the angle of the segment in radians
255 <td>&nbsp;<td>&nbsp;
256</table>
257</P>
258<P>
259<HR width=40% align=center noshade>
260</P>
261<P>
262<table border="0" width="100%" id="table4">
263 <tr>
264 <td width="480" valign="top">
265 A <b>parallelepiped</b> is constructed using:
266 <P>
267 <font face="Courier">
268 G4Para(const G4String&amp; pName,<br>
269 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
270 G4double&nbsp; dx,<br>
271 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
272 G4double&nbsp; dy,<br>
273 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
274 G4double&nbsp; dz,<br>
275 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
276 G4double&nbsp; alpha,<br>
277 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
278 G4double&nbsp; theta,<br>
279 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
280 G4double&nbsp; phi)
281 </font>
282 <P>
283 <div align="right"><font size=-1><I>
284 <U>In the picture</U>: dx = 30, dy = 40, dz = 60<br>
285 alpha = 10*Degree, theta = 20*Degree,<br>
286 phi = 5*Degree
287 </I></font></div>
288 </P>
289 </td>
290 <td><a href="javascript:remote_win(4)"
291 onMouseOver="window.status='Get alive picture...'; return true">
292 <img src="geometry.src/aPara.jpg" border="0"></a>
293 </td>
294 </tr>
295</table>
296
297giving its name <tt>pName</tt> and its parameters which are:</P>
298<P>
299<table border=1 cellpadding=8>
300 <tr>
301 <TD><tt>dx,dy,dz</tt> <td> Half-length in x,y,z
302 <tr>
303 <TD valign=top><tt>alpha</tt> <td>Angle formed by the y axis and by the
304 plane joining the centre of the faces <i>parallel</i> to
305 the z-x plane at -dy and +dy
306 <tr>
307 <TD valign=top><tt>theta</tt> <td>Polar angle of the line joining the
308 centres of the faces at -dz and +dz in z
309 <tr>
310 <TD valign=top><tt>phi</tt> <td>Azimuthal angle of the line joining the
311 centres of the faces at -dz and +dz in z
312 </table>
313</P>
314<P>
315<HR width=40% align=center noshade>
316</P>
317<P>
318<table border="0" width="100%" id="table5">
319 <tr>
320 <td width="480" valign="top">
321 To construct a <b>trapezoid</b> use:
322 <P>
323 <font face="Courier">
324 G4Trd(const G4String&amp; pName,<br>
325 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
326 G4double&nbsp; dx1,<br>
327 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
328 G4double&nbsp; dx2,<br>
329 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
330 G4double&nbsp; dy1,<br>
331 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
332 G4double&nbsp; dy2,<br>
333 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
334 G4double&nbsp; dz)
335 </font>
336 <P>&nbsp;</P><P>&nbsp;</P>
337 <P>
338 <div align="right"><font size=-1><I>
339 <U>In the picture</U>: dx1 = 30, dx2 = 10<br>
340 dy1 = 40, dy2 = 15<br>
341 dz = 60
342 </I></font></div>
343 </P>
344 </td>
345 <td><a href="javascript:remote_win(5)"
346 onMouseOver="window.status='Get alive picture...'; return true">
347 <img src="geometry.src/aTrd.jpg" border="0"></a>
348 </td>
349 </tr>
350</table>
351
352to obtain a solid with name <tt>pName</tt> and parameters</P>
353<P>
354 <table border=1 cellpadding=8>
355 <tr>
356 <TD><tt>dx1</tt> <td>Half-length along x at the surface positioned at <tt>-dz</tt>
357 <tr>
358 <TD><tt>dx2</tt> <td>Half-length along x at the surface positioned at <tt>+dz</tt>
359 <tr>
360 <TD><tt>dy1</tt> <td>Half-length along y at the surface positioned at <tt>-dz</tt>
361 <tr>
362 <TD><tt>dy2</tt> <td>Half-length along y at the surface positioned at <tt>+dz</tt>
363 <tr>
364 <TD><tt>dz</tt> <td>Half-length along z axis
365 </table>
366</P>
367<P>
368<HR width=40% align=center noshade>
369</P>
370<P>
371<table border="0" width="100%" id="table6">
372 <tr>
373 <td width="480" valign="top">
374 To build a <b>generic trapezoid</b>, the <tt>G4Trap</tt> class is provided.
375 Here are the two costructors for a Right Angular Wedge and for the general
376 trapezoid for it:
377 <P>
378 <font face="Courier">
379 G4Trap(const G4String&amp; pName,<br>
380 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
381 G4double&nbsp;&nbsp; pZ,<br>
382 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
383 G4double&nbsp;&nbsp; pY,<br>
384 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
385 G4double&nbsp;&nbsp; pX,<br>
386 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
387 G4double&nbsp;&nbsp; pLTX)
388 <P></P>
389 G4Trap(const G4String&amp; pName,<br>
390 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
391 G4double&nbsp; pDz,
392 G4double&nbsp; pTheta,<br>
393 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
394 G4double&nbsp; pPhi,
395 G4double&nbsp; pDy1,<br>
396 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
397 G4double&nbsp; pDx1,
398 G4double&nbsp; pDx2,<br>
399 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
400 G4double&nbsp; pAlp1,
401 G4double&nbsp; pDy2,<br>
402 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
403 G4double&nbsp; pDx3,
404 G4double&nbsp; pDx4,<br>
405 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
406 G4double&nbsp; pAlp2)
407 </font>
408 <P>
409 <div align="right"><font size=-1><I>
410 <U>In the picture</U>: pDx1 = 30, pDx2 = 40, pDy1 = 40<br>
411 pDx3 = 10, pDx4 = 14, pDy2 = 16<br>
412 pDz = 60, pTheta = 20*Degree<br>
413 pDphi = 5*Degree, pAlph1 = pAlph2 = 10*Degree
414 </I></font></div>
415 </P>
416 </td>
417 <td><a href="javascript:remote_win(6)"
418 onMouseOver="window.status='Get alive picture...'; return true">
419 <img src="geometry.src/aTrap.jpg" border="0"></a>
420 </td>
421 </tr>
422</table>
423
424to obtain a Right Angular Wedge with name <tt>pName</tt> and parameters:</P>
425<p>
426 <table border=1 cellpadding=8>
427 <tr>
428 <TD><tt>pZ</tt> <td>Length along z
429 <tr>
430 <TD><tt>pY</tt> <td>Length along y
431 <tr>
432 <TD><tt>pX</tt> <td>Length along x at the wider side
433 <tr>
434 <TD><tt>pLTX</tt> <td>Length along x at the narrower side (<tt>plTX<=pX</tt>)
435 </table>
436</P>
437<p>
438or to obtain the general trapezoid (see the Software Reference Manual):
439</p>
440 <table border=1 cellpadding=8 id="table31">
441 <tr>
442 <td><tt>pDx1</tt><td>Half x length at y=-pDy
443 <tr>
444 <td><tt>pDx2</tt><td>Half x length at y=+pDy
445 <tr>
446 <td><tt>pDy</tt><td>Half y length
447 <tr>
448 <td><tt>pDz</tt><td>Half z length
449 <tr>
450 <td><tt>pTheta</tt><td>Polar angle of the line joining the centres of the faces at -/+pDz
451 <tr>
452 <td><tt>pDy1</tt><td>Half y length at -pDz
453 <tr>
454 <td><tt>pDx1</tt><td>Half x length at -pDz, y=-pDy1
455 <tr>
456 <td><tt>pDx2</tt><td>Half x length at -pDz, y=+pDy1
457 <tr>
458 <td><tt>pDy2</tt><td>Half y length at +pDz
459 <tr>
460 <td><tt>pDx3</tt><td>Half x length at +pDz, y=-pDy2
461 <tr>
462 <td><tt>pDx4</tt><td>Half x length at +pDz, y=+pDy2
463 <tr>
464 <td><tt>pAlph1</tt><td>Angle with respect to the y axis from the centre of the side
465 (lower endcap)</tr>
466 <tr>
467 <td><tt>pAlph2</tt><td>Angle with respect to the y axis from the centre of the side
468 (upper endcap)</table>
469<P>
470 <B>Note on <tt>pAlph1/2</tt></B>:
471 the two angles have to be the same due to the planarity condition.
472</P>
473<P>
474<HR width=40% align=center noshade>
475</P>
476<P>
477<table border="0" width="100%" id="table7">
478 <tr>
479 <td width="480" valign="top">
480 To build a <b>sphere</b>, or a <b>spherical shell section</b>, use:
481 <P>
482 <font face="Courier">
483 G4Sphere(const G4String&amp; pName,<br>
484 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
485 G4double&nbsp; pRmin,<br>
486 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
487 G4double&nbsp; pRmax,<br>
488 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
489 G4double&nbsp; pSPhi,<br>
490 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
491 G4double&nbsp; pDPhi,<br>
492 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
493 G4double&nbsp; pSTheta,<br>
494 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
495 G4double&nbsp; pDTheta )
496 </font>
497 <P>
498 <div align="right"><font size=-1><I>
499 <U>In the picture</U>: pRmin = 100, pRmax = 120<br>
500 pSPhi = 0*Degree, pDPhi = 180*Degree<br>
501 pSTheta = 0 Degree, pDTheta = 180*Degree
502 </I></font>
503 </P>
504 </td>
505 <td><a href="javascript:remote_win(7)"
506 onMouseOver="window.status='Get alive picture...'; return true">
507 <img src="geometry.src/aSphere.jpg" border="0"></a>
508 </td>
509 </tr>
510</table>
511
512to obtain a solid with name <tt>pName</tt> and parameters:</P>
513<p>
514 <table border=1 cellpadding=8>
515 <tr>
516 <TD><tt>pRmin</tt> <td>Inner radius
517 <tr>
518 <TD><tt>pRmax</tt> <td>Outer radius
519 <tr>
520 <TD><tt>pSPhi</tt> <td>Starting Phi angle of the segment in radians
521 <tr>
522 <TD><tt>pDPhi</tt> <td>Delta Phi angle of the segment in radians
523 <tr>
524 <TD><tt>pSTheta</tt> <td>Starting Theta angle of the segment in radians
525 <tr>
526 <TD><tt>pDTheta</tt> <td>Delta Theta angle of the segment in radians
527 </table>
528</p>
529<P>
530<HR width=40% align=center noshade>
531</P>
532<P>
533<table border="0" width="100%" id="table29">
534 <tr>
535 <td width="480" valign="top">
536 To build a <b>full solid sphere</b> use:
537 <P>
538 <font face="Courier">
539 G4Orb(const G4String&amp; pName, <br>
540 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
541 G4double pRmax)
542 </font>
543 <P>
544 <div align="right"><font size=-1><I>
545 <U>In the picture</U>: pRmax = 100
546 </I></font></div>
547 </P>
548 <P>
549 The Orb can be obtained from a Sphere with:<br>
550 <tt>pRmin</tt> = 0, <tt>pSPhi</tt> = 0, <tt>pDPhi</tt> = 2*Pi,
551 <tt>pSTheta</tt> = 0, <tt>pDTheta</tt> = Pi.
552 </p>
553
554 <table border=1 cellpadding=8 id="table30">
555 <tr>
556 <TD><tt>pRmax</tt> <td>Outer radius
557 </tr>
558 </table>
559 </td>
560 <td><a href="javascript:remote_win(8)"
561 onMouseOver="window.status='Get alive picture...'; return true">
562 <img src="geometry.src/aOrb.jpg" border="0"></a>
563
564 </td>
565 </tr>
566</table>
567</P>
568<P>
569<HR width=40% align=center noshade>
570</P>
571<P>
572<table border="0" width="100%" id="table8">
573 <tr>
574 <td width="480" valign="top">
575 To build a <b>torus</b> use:
576 <P>
577 <font face="Courier">
578 G4Torus(const G4String&amp; pName,<br>
579 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
580 G4double&nbsp; pRmin,<br>
581 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
582 G4double&nbsp; pRmax,<br>
583 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
584 G4double&nbsp; pRtor,<br>
585 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
586 G4double&nbsp; pSPhi,<br>
587 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
588 G4double&nbsp; pDPhi)
589 </font>
590 <P>
591 <div align="right"><font size=-1><I>
592 <U>In the picture</U>: pRmin = 40, pRmax = 60, pRtor = 200<br>
593 pSPhi = 0, pDPhi = 90*Degree
594 </I></font></div>
595 </P>
596 </td>
597 <td><a href="javascript:remote_win(9)"
598 onMouseOver="window.status='Get alive picture...'; return true">
599 <img src="geometry.src/aTorus.jpg" border="0"></a>
600 </td>
601 </tr>
602</table>
603
604to obtain a solid with name <tt>pName</tt> and parameters:</P>
605<p>
606 <table border=1 cellpadding=8>
607 <tr>
608 <TD><tt>pRmin</tt> <td>Inside radius
609 <tr>
610 <TD><tt>pRmax</tt> <td>Outside radius
611 <tr>
612 <TD><tt>pRtor</tt> <td>Swept radius of torus
613 <tr>
614 <TD><tt>pSPhi</tt> <td>Starting Phi angle in radians
615 (<tt>fSPhi+fDPhi<=2PI</tt>, <tt>fSPhi>-2PI</tt>)
616 <tr>
617 <TD><tt>pDPhi</tt> <td>Delta angle of the segment in radians
618 </table>
619</P>
620<P>
621 In addition, the Geant4 Design Documentation shows in the Solids Class Diagram
622 the complete list of CSG classes, and the STEP documentation contains a
623 detailed EXPRESS description of each CSG solid.</P>
624
625<P></P>
626
627<b>Specific CSG Solids</b>
628<P>
629 <b>Polycons</b> (PCON) are implemented in Geant4 through the
630 <tt>G4Polycon</tt> class:
631</P>
632<table border="0" width="100%" id="table9">
633 <tr>
634 <td width="480" valign="top">
635 <font face="Courier">
636 G4Polycone(const G4String&amp; pName,<br>
637 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
638 G4double&nbsp; phiStart,<br>
639 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
640 G4double&nbsp; phiTotal,<br>
641 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
642 G4int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; numZPlanes,<br>
643 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
644 const G4double&nbsp; zPlane[],<br>
645 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
646 const G4double&nbsp; rInner[],<br>
647 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
648 const G4double&nbsp; rOuter[])<br>
649 <br>
650 G4Polycone(const G4String&amp; pName, <br>
651 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
652 G4double&nbsp; phiStart,<br>
653 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
654 G4double&nbsp; phiTotal,<br>
655 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
656 G4int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; numRZ,<br>
657 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
658 const G4double&nbsp; r[],<br>
659 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
660 const G4double&nbsp; z[])
661 </font>
662 <P>
663 <div align="right"><font size=-1><I>
664 <U>In the picture</U>: phiStart = 0*Degree, phiTotal = 2*Pi<br>
665 numZPlanes = 9<br>
666 rInner = { 0, 0, 0, 0, 0, 0, 0, 0, 0}<br>
667 rOuter = { 0, 10, 10, 5 , 5, 10 , 10 , 2, 2}<br>
668 z = { 5, 7, 9, 11, 25, 27, 29, 31, 35 }
669 </I></font></div>
670 </P>
671 </td>
672 <td><a href="javascript:remote_win(10)"
673 onMouseOver="window.status='Get alive picture...'; return true">
674 <img src="geometry.src/aBREPSolidPCone.jpg" border="0"></a>
675 </td>
676 </tr>
677</table>
678
679where:
680<p>
681 <table border=1 cellpadding=8>
682 <tr>
683 <TD><tt>phiStart</tt> <td>Initial Phi starting angle
684 <tr>
685 <TD><tt>phiTotal</tt> <td>Total Phi angle
686 <tr>
687 <TD><tt>numZPlanes</tt> <td>Number of z planes
688 <tr>
689 <TD><tt>numRZ</tt> <td>Number of corners in r,z space
690 <tr>
691 <TD><tt>zPlane</tt> <td>Position of z planes
692 <tr>
693 <TD><tt>rInner</tt> <td>Tangent distance to inner surface
694 <tr>
695 <TD><tt>rOuter</tt> <td>Tangent distance to outer surface
696 <tr>
697 <TD><tt>r</tt> <td>r coordinate of corners
698 <tr>
699 <TD><tt>z</tt> <td>z coordinate of corners
700 </table>
701</P>
702<P>
703<HR width=40% align=center noshade>
704</P>
705<P>
706 <b>Polyhedra</b> (PGON) are implemented through <tt>G4Polyhedra</tt>:
707</P>
708<table border="0" width="100%" id="table10">
709 <tr>
710 <td width="480" valign="top">
711 <font face="Courier">
712 G4Polyhedra(const G4String&amp; pName,<br>
713 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
714 G4double&nbsp;&nbsp; phiStart,<br>
715 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
716 G4double&nbsp;&nbsp; phiTotal,<br>
717 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
718 G4int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; numSide,<br>
719 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
720 G4int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; numZPlanes,<br>
721 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
722 const G4double&nbsp; zPlane[],<br>
723 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
724 const G4double&nbsp; rInner[],<br>
725 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
726 const G4double&nbsp; rOuter[]&nbsp;)<br>
727 <br>
728 G4Polyhedra(const G4String&amp; pName,<br>
729 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
730 G4double&nbsp;&nbsp; phiStart,<br>
731 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
732 G4double&nbsp;&nbsp; phiTotal,<br>
733 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
734 G4int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; numSide,<br>
735 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
736 G4int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; numRZ,<br>
737 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
738 const G4double&nbsp;&nbsp; r[],<br>
739 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
740 const G4double&nbsp;&nbsp; z[])
741 </font>
742 <P>
743 <div align="right"><font size=-1><I>
744 <U>In the picture</U>: phiStart = 0, phiTotal= 2 Pi<br>
745 numSide = 5, nunZPlanes = 7<br>
746 rInner = { 0, 0, 0, 0, 0, 0, 0 }<br>
747 rOuter = { 0, 15, 15, 4, 4, 10, 10 }<br>
748 z = { 0, 5, 8, 13 , 30, 32, 35 }
749 </I></font></div>
750 </P>
751 </td>
752 <td><a href="javascript:remote_win(11)"
753 onMouseOver="window.status='Get alive picture...'; return true">
754 <img src="geometry.src/aBREPSolidPolyhedra.jpg" border="0"></a>
755 </td>
756 </tr>
757</table>
758
759where:
760<p>
761 <table border=1 cellpadding=8>
762 <tr>
763 <TD><tt>phiStart</tt> <td>Initial Phi starting angle
764 <tr>
765 <TD><tt>phiTotal</tt> <td>Total Phi angle
766 <tr>
767 <TD><tt>numSide</tt> <td>Number of sides
768 <tr>
769 <TD><tt>numZPlanes</tt> <td>Number of z planes
770 <tr>
771 <TD><tt>numRZ</tt> <td>Number of corners in r,z space
772 <tr>
773 <TD><tt>zPlane</tt> <td>Position of z planes
774 <tr>
775 <TD><tt>rInner</tt> <td>Tangent distance to inner surface
776 <tr>
777 <TD><tt>rOuter</tt> <td>Tangent distance to outer surface
778 <tr>
779 <TD><tt>r</tt> <td>r coordinate of corners
780 <tr>
781 <TD><tt>z</tt> <td>z coordinate of corners
782 </table>
783</P>
784<P>
785<HR width=40% align=center noshade>
786</P>
787<P>
788
789<table border="0" width="100%" id="table11">
790 <tr>
791 <td width="480" valign="top">
792 A <b>tube with an elliptical cross section</b> (ELTU) can be defined
793 as follows:
794 <P>
795 <font face="Courier">
796 G4EllipticalTube(const G4String&amp; pName,<br>
797 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
798 G4double&nbsp; Dx,<br>
799 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
800 G4double&nbsp; Dy,<br>
801 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
802 G4double&nbsp; Dz)
803 </font>
804 <P>
805 The equation of the surface in x/y is
806 <tt>1.0 = (x/dx)**2 + (y/dy)**2</tt>
807 </P>
808 <P>
809 <table border=1 cellpadding=8 width="455" id="table23">
810 <tr>
811 <td><tt>Dx</tt><td>Half length X
812 <td><tt>Dy</tt><td>Half length Y
813 <td><tt>Dz</tt><td>Half length Z&nbsp;
814 </table></P>
815 <P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P>
816 <div align="right"><font size=-1><I>
817 <U>In the picture</U>: Dx = 5, Dy = 10, Dz = 20
818 </I></font></div>
819 </td>
820 <td><a href="javascript:remote_win(12)"
821 onMouseOver="window.status='Get alive picture...'; return true">
822 <img src="geometry.src/aEllipticalTube.jpg" border="0"></a>
823 </td>
824 </tr>
825</table>
826</P>
827<P>
828<HR width=40% align=center noshade>
829</P>
830<table border="0" width="100%" id="table17">
831 <tr>
832 <td width="480" valign="top">
833 The general <b>ellipsoid</b> with possible cut in <tt>Z</tt> can be
834 defined as follows:
835 <P>
836 <font face="Courier">
837 G4Ellipsoid(const G4String&amp; pName,<br>
838 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
839 G4double&nbsp; pxSemiAxis,<br>
840 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
841 G4double&nbsp; pySemiAxis,<br>
842 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
843 G4double&nbsp; pzSemiAxis,<br>
844 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
845 G4double&nbsp; pzBottomCut=0,<br>
846 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
847 G4double&nbsp; pzTopCut=0)
848 </font>
849 <P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P>
850 <div align="right"><font size=-1><I>
851 <U>In the picture</U>: pxSemiAxis = 10, pySemiAxis = 20, pzSemiAxis = 50<br>
852 pzBottomCut = -10, pzTopCut = 40
853 </I></font></div>
854 </td>
855 <td><a href="javascript:remote_win(13)"
856 onMouseOver="window.status='Get alive picture...'; return true">
857 <img src="geometry.src/aEllipsoid.jpg" border="0"></a>
858 </td>
859 </tr>
860</table>
861
862A general (or triaxial) ellipsoid is a quadratic surface which is given in
863Cartesian coordinates by:
864<p>
865&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
866<tt>1.0 = (x/pxSemiAxis)**2 + (y/pySemiAxis)**2&nbsp; +&nbsp; (z/pzSemiAxis)**2</tt>
867</p>
868where:
869<P>
870<table border=1 cellpadding=8 id="table26">
871 <tr>
872 <TD><tt>pxSemiAxis</tt><td>Semiaxis in X&nbsp;
873 <tr>
874 <TD><tt>pySemiAxis</tt> <td>Semiaxis in Y
875 <tr>
876 <TD><tt>pzSemiAxis</tt><td>Semiaxis in Z
877 <tr>
878 <TD><tt>pzBottomCut</tt> <td>lower cut plane level, z<tr>
879 <TD><tt>pzTopCut</tt><td>upper cut plane level, z&nbsp;
880</table>
881</P>
882<P>
883<HR width=40% align=center noshade>
884</P>
885<P>
886A <b>cone with an elliptical cross section</b> can be defined as follows:
887<P>
888<table border="0" width="100%" id="table24">
889 <tr>
890 <td width="480" valign="top">
891 <font face="Courier">
892 G4EllipticalCone(const G4String&amp; pName,<br>
893 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
894 G4double pxSemiAxis,<br>
895 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
896 G4double pySemiAxis,<br>
897 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
898 G4double zMax,<br>
899 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
900 G4double pzTopCut)
901 </font>
902 <P>&nbsp;</P>
903 <div align="right"><font size=-1><I>
904 <U>In the picture</U>: pxSemiAxis = 30, pySemiAxis = 60<br>
905 zMax = 50, pzTopCut = 25
906 </I></font></div>
907 </td>
908 <td><a href="javascript:remote_win(14)"
909 onMouseOver="window.status='Get alive picture...'; return true">
910 <img src="geometry.src/aEllipticalCone.jpg" border="0"></a>
911 </td>
912 </tr>
913</table>
914</P>
915
916where:
917<P>
918<table border=1 cellpadding=8 id="table25">
919 <tr>
920 <TD><tt>pxSemiAxis</tt><td>Semiaxis in X&nbsp;&nbsp;
921 <tr>
922 <TD><tt>pySemiAxis</tt> <td>Semiaxis in Y
923 <tr>
924 <TD><tt>zMax</tt> <td>Height&nbsp; of elliptical cone<tr>
925 <TD><tt>pzTopCut</tt> <td>upper cut plane level
926</table>
927</P>
928<P>
929 An elliptical cone of height <tt>zMax</tt>, semiaxis <tt>pxSemiAxis</tt>,
930 and semiaxis <tt>pySemiAxis</tt> is given by the parametric equations:
931 <P>
932 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
933 <tt>x = pxSemiAxis * ( zMax - u ) / u&nbsp; * Cos(v)</tt><br>
934 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
935 <tt>y = pySemiAxis * ( zMax - u ) / u * Sin(v)</tt><br>
936 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
937 <tt>z = u</tt>
938 </P>
939<P>
940 Where <tt>v</tt> is between <tt>0</tt> and <tt>2*Pi</tt>,
941 and <tt>u</tt> between <tt>0</tt> and <tt>h</tt> respectively.
942</P>
943<P>
944<HR width=40% align=center noshade>
945</P>
946<table border="0" width="100%" id="table12">
947 <tr>
948 <td width="480" valign="top">
949 A <b>tube with a hyperbolic profile</b> (HYPE) can be defined as follows:
950 <P>
951 <font face="Courier">
952 G4Hype(const G4String&amp; pName,<br>
953 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
954 G4double&nbsp; innerRadius,<br>
955 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
956 G4double&nbsp; outerRadius,<br>
957 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
958 G4double&nbsp; innerStereo,<br>
959 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
960 G4double&nbsp; outerStereo,<br>
961 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
962 G4double&nbsp; halfLenZ)
963 </font>
964 <div align="right"><font size=-1><I>
965 <U>In the picture</U>: innerStereo = 0.7, outerStereo = 0.7<br>
966 halfLenZ = 50<br>
967 innerRadius = 20, outerRadius = 30
968 </I></font></div>
969 </td>
970 <td><a href="javascript:remote_win(15)"
971 onMouseOver="window.status='Get alive picture...'; return true">
972 <img src="geometry.src/aHyperboloid.jpg" border="0"></a>
973 </td>
974 </tr>
975</table>
976<P>
977 <tt>G4Hype</tt> is shaped with curved sides parallel to the <tt>z</tt>-axis,
978 has a specified half-length along the <tt>z</tt> axis about which it is
979 centred, and a given minimum and maximum radius.<BR>
980 A minimum radius of <tt>0</tt> defines a filled Hype (with hyperbolic
981 inner surface), i.e. inner radius = 0 AND inner stereo angle = 0.<BR>
982 The inner and outer hyperbolic surfaces can have different
983 stereo angles. A stereo angle of <tt>0</tt> gives a cylindrical surface:</P>
984<P>
985 <table border=1 cellpadding=8>
986 <tr>
987 <td><tt>innerRadius</tt><td>Inner radius
988 <tr>
989 <td><tt>outerRadius</tt><td>Outer radius
990 <tr>
991 <td><tt>innerStereo</tt><td>Inner stereo angle in radians
992 <tr>
993 <td><tt>outerStereo</tt><td>Outer stereo angle in radians
994 <tr>
995 <td><tt>halfLenZ</tt><td>Half length in Z
996 </table>
997</P>
998<P>
999<HR width=40% align=center noshade>
1000</P>
1001<P>
1002<table border="0" width="100%" id="table27">
1003 <tr>
1004 <td width="480" valign="top">
1005 A <b>tetrahedra</b> solid can be defined as follows:
1006 <P>
1007 <font face="Courier">
1008 G4Tet(const G4String&amp; pName,<br>
1009 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
1010 G4ThreeVector anchor,<br>
1011 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
1012 G4ThreeVector p2,<br>
1013 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
1014 G4ThreeVector p3,<br>
1015 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
1016 G4ThreeVector p4,<br>
1017 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
1018 G4bool *degeneracyFlag=0)
1019 </font>
1020 <div align="right"><font size=-1><I>
1021 <U>In the picture</U>: anchor = {0, 0, sqrt(3)}<br>
1022 p2 = { 0, 2*sqrt(2/3), -1/sqrt(3) }<br>
1023 p3 = { -sqrt(2), -sqrt(2/3),-1/sqrt(3) }<br>
1024 p4 = { sqrt(2), -sqrt(2/3) , -1/sqrt(3) }
1025 </I></font></div>
1026 </td>
1027 <td><a href="javascript:remote_win(16)"
1028 onMouseOver="window.status='Get alive picture...'; return true">
1029 <img src="geometry.src/aTet.jpg" border="0"></a>
1030 </td>
1031 </tr>
1032</table>
1033
1034The solid is defined by 4 points in space:
1035<P>
1036 <table border=1 cellpadding=8 id="table28" width="292">
1037 <tr>
1038 <td><tt>anchor</tt><td>Anchor point
1039 <tr>
1040 <td><tt>p2</tt><td>Point 2
1041 <tr>
1042 <td><tt>p3</tt><td>Point 3<tr>
1043 <td><tt>p4</tt><td>Point 4<tr>
1044 <td><tt>degeneracyFlag</tt><td>Flag indicating degeneracy of points
1045 </table>
1046</P>
1047<P>
1048<HR width=40% align=center noshade>
1049</P>
1050<P>
1051<table border="0" width="100%" id="table13">
1052 <tr>
1053 <td width="480" valign="top">
1054 A <b>box twisted</b> along one axis can be defined as follows:
1055 <P>
1056 <font face="Courier">
1057 G4TwistedBox(const G4String&amp; pName,<br>
1058 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
1059 G4double&nbsp; twistedangle,<br>
1060 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
1061 G4double&nbsp; pDx,<br>
1062 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
1063 G4double&nbsp; pDy,<br>
1064 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
1065 G4double&nbsp; pDz)
1066 </font>
1067 <P>&nbsp;</P><P>&nbsp;</P>
1068 <div align="right"><font size=-1><I>
1069 <U>In the picture</U>: twistedangle = 30*Degree<br>
1070 pDx = 30, pDy =40, pDz = 60
1071 </I></font></div>
1072 </td>
1073 <td><a href="javascript:remote_win(17)"
1074 onMouseOver="window.status='Get alive picture...'; return true">
1075 <img src="geometry.src/aTwistedBox.jpg" border="0"></a>
1076 </td>
1077 </tr>
1078</table>
1079<P>
1080 <tt>G4TwistedBox</tt> is a box twisted along the z-axis.
1081 The twist angle cannot be greater than 90 degrees:</P>
1082<P>
1083 <table border=1 cellpadding=8>
1084 <tr>
1085 <td><tt>twistedangle</tt><td>Twist angle
1086 <tr>
1087 <td><tt>pDx</tt><td>Half x length
1088 <tr>
1089 <td><tt>pDy</tt><td>Half y length
1090 <tr>
1091 <td><tt>pDz</tt><td>Half z length
1092 </table>
1093</P>
1094<P>
1095<HR width=40% align=center noshade>
1096</P>
1097<p>
1098 A <b>trapezoid twisted</b> along one axis can be defined as follows:
1099<p>
1100<table border="0" width="100%" id="table14">
1101 <tr>
1102 <td width="480" valign="top">
1103 <font face="Courier">
1104 G4TwistedTrap(const G4String&amp; pName,<br>
1105 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
1106 G4double&nbsp; twistedangle,<br>
1107 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
1108 G4double&nbsp; pDxx1, G4double&nbsp; pDxx2,<br>
1109 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
1110 G4double&nbsp; pDy, G4double&nbsp; pDz)<br>
1111 <br>
1112 G4TwistedTrap(const G4String&amp; pName,<br>
1113 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
1114 G4double&nbsp; twistedangle,<br>
1115 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
1116 G4double&nbsp; pDz,<br>
1117 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
1118 G4double&nbsp; pTheta, G4double&nbsp; pPhi,<br>
1119 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
1120 G4double&nbsp; pDy1, G4double&nbsp; pDx1,<br>
1121 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
1122 G4double&nbsp; pDx2, G4double&nbsp; pDy2,<br>
1123 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
1124 G4double&nbsp; pDx3, G4double&nbsp; pDx4,<br>
1125 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
1126 G4double&nbsp; pAlph)
1127 </font>
1128 <div align="right"><font size=-1><I>
1129 <U>In the picture</U>: pDx1 = 30, pDx2 = 40, pDy1 = 40<br>
1130 pDx3 = 10, pDx4 = 14, pDy2 = 16<br>
1131 pDz = 60<br>
1132 pTheta = 20*Degree, pDphi = 5*Degree<br>
1133 pAlph = 10*Degree, twistedangle = 30*Degree
1134 </I></font></div>
1135 </td>
1136 <td><a href="javascript:remote_win(18)"
1137 onMouseOver="window.status='Get alive picture...'; return true">
1138 <img src="geometry.src/aTwistedTrap.jpg" border="0"></a>
1139 </td>
1140 </tr>
1141</table>
1142<P>
1143 The first constructor of <tt>G4TwistedTrap</tt> produces a regular trapezoid
1144 twisted along the <tt>z</tt>-axis, where the caps of the trapezoid are of the
1145 same shape and size.<br>
1146 The second constructor produces a generic trapezoid with
1147 polar, azimuthal and tilt angles.<br>
1148 The twist angle cannot be greater than 90 degrees:
1149</P>
1150<P>
1151 <table border=1 cellpadding=8>
1152 <tr>
1153 <td><tt>twistedangle</tt><td>Twisted angle
1154 <tr>
1155 <td><tt>pDx1</tt><td>Half x length at y=-pDy
1156 <tr>
1157 <td><tt>pDx2</tt><td>Half x length at y=+pDy
1158 <tr>
1159 <td><tt>pDy</tt><td>Half y length
1160 <tr>
1161 <td><tt>pDz</tt><td>Half z length
1162 <tr>
1163 <td><tt>pTheta</tt><td>Polar angle of the line joining the centres of the faces at -/+pDz
1164 <tr>
1165 <td><tt>pDy1</tt><td>Half y length at -pDz
1166 <tr>
1167 <td><tt>pDx1</tt><td>Half x length at -pDz, y=-pDy1
1168 <tr>
1169 <td><tt>pDx2</tt><td>Half x length at -pDz, y=+pDy1
1170 <tr>
1171 <td><tt>pDy2</tt><td>Half y length at +pDz
1172 <tr>
1173 <td><tt>pDx3</tt><td>Half x length at +pDz, y=-pDy2
1174 <tr>
1175 <td><tt>pDx4</tt><td>Half x length at +pDz, y=+pDy2
1176 <tr>
1177 <td><tt>pAlph</tt><td>Angle with respect to the y axis from the centre of the side
1178 </table>
1179</P>
1180<P>
1181<HR width=40% align=center noshade>
1182</P>
1183<p>
1184<table border="0" width="100%" id="table15">
1185 <tr>
1186 <td width="480" valign="top">
1187 A <b>twisted trapezoid</b> with the <tt>x</tt> and </tt>y</tt> dimensions
1188 <b>varying along <tt>z</tt></b> can be defined as follows:
1189 <P>
1190 <font face="Courier">
1191 G4TwistedTrd(const G4String&amp; pName,<br>
1192 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
1193 G4double&nbsp; pDx1,<br>
1194 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
1195 G4double&nbsp; pDx2,<br>
1196 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
1197 G4double&nbsp; pDy1,<br>
1198 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
1199 G4double&nbsp; pDy2,<br>
1200 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
1201 G4double&nbsp; pDz,<br>
1202 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
1203 G4double&nbsp; twistedangle)
1204 </font>
1205 <div align="right"><font size=-1><I>
1206 <U>In the picture</U>: dx1 = 30, dx2 = 10<br>
1207 dy1 = 40, dy2 = 15<br>
1208 dz = 60<br>
1209 twistedangle = 30*Degree
1210 </I></font></div>
1211 </td>
1212 <td><a href="javascript:remote_win(19)"
1213 onMouseOver="window.status='Get alive picture...'; return true">
1214 <img src="geometry.src/aTwistedTrd.jpg" border="0"></a>
1215 </td>
1216 </tr>
1217</table>
1218</p>
1219where:
1220<p>
1221 <table border=1 cellpadding=8>
1222 <tr>
1223 <td><tt>pDx1</tt><td>Half x length at the surface positioned at -dz
1224 <tr>
1225 <td><tt>pDx2</tt><td>Half x length at the surface positioned at +dz
1226 <tr>
1227 <td><tt>pDy1</tt><td>Half y length at the surface positioned at -dz
1228 <tr>
1229 <td><tt>pDy2</tt><td>Half y length at the surface positioned at +dz
1230 <tr>
1231 <td><tt>pDz</tt><td>Half z length
1232 <tr>
1233 <td><tt>twistedangle</tt><td>Twisted angle
1234 </table>
1235</P>
1236<P>
1237<HR width=40% align=center noshade>
1238</P>
1239<P>
1240<table border="0" width="100%" id="table16">
1241 <tr>
1242 <td width="480" valign="top">
1243 A <b>tube section twisted</b> along its axis can be defined as follows:
1244 <P>
1245 <font face="Courier">
1246 G4TwistedTubs(const G4String&amp; pName,<br>
1247 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
1248 G4double&nbsp; twistedangle,<br>
1249 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
1250 G4double&nbsp; endinnerrad,<br>
1251 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
1252 G4double&nbsp; endouterrad,<br>
1253 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
1254 G4double&nbsp; halfzlen,<br>
1255 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
1256 G4double&nbsp; dphi)
1257 </font>
1258 <P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P>
1259 <div align="right"><font size=-1><I>
1260 <U>In the picture</U>: endinnerrad = 10, endouterrad = 15<br>
1261 halfzlen = 20, dphi = 90*Degree<br>
1262 twistedangle = 60*Degree
1263 </I></font></div>
1264 </td>
1265 <td><a href="javascript:remote_win(20)"
1266 onMouseOver="window.status='Get alive picture...'; return true">
1267 <img src="geometry.src/aTwistedTubs.jpg" border="0"></a>
1268 </td>
1269 </tr>
1270</table>
1271</P>
1272<P>
1273 <tt>G4TwistedTubs</tt> is a sort of twisted cylinder which, placed along
1274 the <tt>z</tt>-axis and divided into <tt>phi</tt>-segments is shaped like an
1275 hyperboloid, where each of its segmented pieces can be tilted with a stereo
1276 angle.<br>
1277 It can have inner and outer surfaces with the same stereo angle:
1278</P>
1279<P>
1280 <table border=1 cellpadding=8>
1281 <tr>
1282 <td><tt>twistedangle</tt><td>Twisted angle
1283 <tr>
1284 <td><tt>endinnerrad</tt><td>Inner radius at endcap
1285 <tr>
1286 <td><tt>endouterrad</tt><td>Outer radius at endcap
1287 <tr>
1288 <td><tt>halfzlen</tt><td>Half z length
1289 <tr>
1290 <td><tt>dphi</tt><td>Phi angle of a segment
1291 </table>
1292</P>
1293<P>
1294 Additional constructors are provided, allowing the shape to be specified
1295 either as:
1296 <UL>
1297 <LI>the number of segments in <tt>phi</tt> and the total angle for all
1298 segments, or</LI>
1299 <LI>a combination of the above constructors providing instead the inner and
1300 outer radii at <TT>z=0</TT> with different <tt>z</tt>-lengths along
1301 negative and positive <tt>z</tt>-axis.</LI>
1302 </UL>
1303</P>
1304
1305<P> </P>
1306
1307<a name="4.1.2.2">
1308<H4>4.1.2.2 Solids made by Boolean operations</H4></a>
1309
1310 Simple solids can be combined using Boolean operations.
1311 For example, a cylinder and a half-sphere can be combined with the
1312 union Boolean operation.
1313<P>
1314 Creating such a new <i>Boolean</i> solid, requires:
1315 <UL>
1316 <LI>Two solids
1317 <LI>A Boolean operation: union, intersection or subtraction.
1318 <LI>Optionally a transformation for the second solid.
1319 </UL></P>
1320<P>
1321 The solids used should be either CSG solids (for examples a box, a
1322 spherical shell, or a tube) or another Boolean solid: the product of a
1323 previous Boolean operation.
1324 An important purpose of Boolean solids is to allow the description of
1325 solids with peculiar shapes in a simple and intuitive way, still allowing
1326 an efficient geometrical navigation inside them.</P>
1327<P>
1328 Note: The solids used can actually be of any type. However, in order to
1329 fully support the export of a Geant4 solid model via STEP to CAD
1330 systems, we restrict the use of Boolean operations to this subset of
1331 solids. But this subset contains all the most interesting use cases.</P>
1332<P>
1333 Note: The tracking cost for navigating in a Boolean solid in the
1334 current implementation, is proportional to the number of constituent
1335 solids. So care must be taken to avoid extensive, unecessary use of
1336 Boolean solids in performance-critical areas of a geometry description,
1337 where each solid is created from Boolean combinations of many other
1338 solids.</P>
1339<P>
1340 Examples of the creation of the simplest Boolean solids are given below:
1341
1342 <PRE>
1343 G4Box* box =
1344 new G4Box("Box",20*mm,30*mm,40*mm);
1345 G4Tubs* cyl =
1346 new G4Tubs("Cylinder",0,50*mm,50*mm,0,twopi); // r: 0 mm -&gt; 50 mm
1347 // z: -50 mm -&gt; 50 mm
1348 // phi: 0 -&gt; 2 pi
1349 G4UnionSolid* union =
1350 new G4UnionSolid("Box+Cylinder", box, cyl);
1351 G4IntersectionSolid* intersection =
1352 new G4IntersectionSolid("Box*Cylinder", box, cyl);
1353 G4SubtractionSolid* subtraction =
1354 new G4SubtractionSolid("Box-Cylinder", box, cyl);
1355 </PRE>
1356
1357 where the union, intersection and subtraction of a box and cylinder are
1358 constructed.</P>
1359<P>
1360 The more useful case where one of the solids is displaced from the
1361 origin of coordinates also exists. In this case the second solid is
1362 positioned relative to the coordinate system (and thus relative to the
1363 first). This can be done in two ways:
1364 <UL>
1365 <LI>Either by giving a rotation matrix and translation vector that
1366 are used to transform the coordinate system of the second solid to the
1367 coordinate system of the first solid. This is called the <I>passive</I>
1368 method.
1369 <LI>Or by creating a transformation that moves the second solid from
1370 its desired position to its standard position, e.g., a box's standard
1371 position is with its centre at the origin and sides parallel to the
1372 three axes. This is called the <I>active</I> method.
1373 </UL></P>
1374<P>
1375 In the first case, the translation is applied first to move the origin
1376 of coordinates. Then the rotation is used to rotate the
1377 coordinate system of the second solid to the coordinate system of the
1378 first.</P>
1379<P>
1380 <PRE>
1381 G4RotationMatrix* yRot = new G4RotationMatrix; // Rotates X and Z axes only
1382 yRot->rotateY(M_PI/4.*rad); // Rotates 45 degrees
1383 G4ThreeVector zTrans(0, 0, 50);
1384
1385 G4UnionSolid* unionMoved =
1386 new G4UnionSolid("Box+CylinderMoved", box, cyl, yRot, zTrans);
1387 //
1388 // The new coordinate system of the cylinder is translated so that
1389 // its centre is at +50 on the original Z axis, and it is rotated
1390 // with its X axis halfway between the original X and Z axes.
1391
1392 // Now we build the same solid using the alternative method
1393 //
1394 G4RotationMatrix invRot = *(yRot->invert());
1395 G4Transform3D transform(invRot, zTrans);
1396 G4UnionSolid* unionMoved =
1397 new G4UnionSolid("Box+CylinderMoved", box, cyl, transform);
1398 </PRE>
1399
1400 Note that the first constructor that takes a pointer to the rotation-matrix
1401 (<tt>G4RotationMatrix*</tt>), does NOT copy it.
1402 Therefore once used a rotation-matrix to construct a Boolean solid, it must
1403 NOT be modified.<BR>
1404 In contrast, with the alternative method shown, a <tt>G4Transform3D</tt> is
1405 provided to the constructor by value, and its transformation is stored by the
1406 Boolean solid. The user may modify the <tt>G4Transform3D</tt> and eventually
1407 use it again.</P>
1408<P>
1409 When positioning a volume associated to a Boolean solid, the relative center
1410 of coordinates considered for the positioning is the one related to the
1411 <i>first</i> of the two constituent solids.</P>
1412
1413<P> </P>
1414
1415<a name="4.1.2.3">
1416<H4>4.1.2.3 Boundary Represented (BREPS) Solids</H4></a>
1417
1418 BREP solids are defined via the description of their boundaries. The
1419 boundaries can be made of planar and second order surfaces.
1420 Eventually these can be trimmed and have holes.
1421 The resulting solids, such as polygonal, polyconical solids
1422 are known as Elementary BREPS.
1423<P>
1424 In addition, the boundary surfaces can be made of Bezier surfaces and B-Splines,
1425 or of NURBS (Non-Uniform-Rational-B-Splines) surfaces.
1426 The resulting solids are Advanced BREPS.<BR>
1427 <b>Note</b> - <i>Currently, the implementation for surfaces generated by Beziers, B-Splines
1428 or NURBS is only at the level of prototype and not fully functional</i>.<BR>
1429 Extensions are foreseen in the near future, also to allow exchange of geometrical
1430 models with CAD systems.</P>
1431<P>
1432 We have defined a few simple Elementary BREPS, that can be instantiated
1433 simply by a user in a manner similar to the construction of Constructed Solids
1434 (CSGs). We summarize their capabilities in the following section.</P>
1435<P>
1436 However most BREPS Solids are defined by creating each surface separately
1437 and tying them together. Though it is possible to do this using code, it is
1438 potentially error prone. So it is generally much more productive to utilize a tool
1439 to create these volumes, and the tools of choice are CAD systems. In future, it will
1440 be possible to import/export models created in CAD systems, utilizing the STEP standard.</P>
1441
1442<P> </P>
1443
1444<b>Specific BREP Solids</b>
1445<P>
1446 We have defined one polygonal and one polyconical shape using BREPS.
1447 The polycone provides a shape defined by a series of conical sections with the
1448 same axis, contiguous along it.</P>
1449<P>
1450 The polyconical solid <tt>G4BREPSolidPCone</tt> is a shape defined by a set
1451 of inner and outer conical or cylindrical surface sections and
1452 two planes perpendicular to the Z axis. Each conical surface is
1453 defined by its radius at two different
1454 planes perpendicular to the Z-axis. Inner and outer conical surfaces are
1455 defined using common Z planes.</P>
1456<P>
1457 <PRE>
1458 G4BREPSolidPCone( const G4String&amp; pName,
1459 G4double start_angle,
1460 G4double opening_angle,
1461 G4int num_z_planes, // sections,
1462 G4double z_start,
1463 const G4double z_values[],
1464 const G4double RMIN[],
1465 const G4double RMAX[] )
1466 </PRE>
1467 The conical sections do not need to fill 360 degrees, but can have a common
1468 start and opening angle.</P>
1469<P>
1470 <table border=1 cellpadding=8>
1471 <tr>
1472 <td><tt>start_angle</tt> <td>starting angle
1473 <tr>
1474 <td><tt>opening_angle</tt> <td>opening angle
1475 <tr>
1476 <td><tt>num_z_planes</tt> <td>number of planes perpendicular to the z-axis used.
1477 <tr>
1478 <td><tt>z_start</tt> <td>starting value of z
1479 <tr>
1480 <td><tt>z_values</tt> <td>z coordinates of each plane
1481 <tr>
1482 <td><tt>RMIN</tt> <td>radius of inner cone at each plane
1483 <tr>
1484 <td><tt>RMAX</tt> <td>radius of outer cone at each plane
1485 </table></P>
1486<P>
1487 The polygonal solid <tt>G4BREPSolidPolyhedra</tt> is a shape defined by an
1488 inner and outer polygonal surface and two planes perpendicular to the Z axis.
1489 Each polygonal surface is created by linking a series of polygons created at
1490 different planes perpendicular to the Z-axis. All these polygons all have the
1491 same number of sides (<tt>sides</tt>) and are defined at the same Z planes for
1492 both inner and outer polygonal surfaces.</P>
1493<P>
1494 The polygons do not need to fill 360 degrees, but have a start and
1495 opening angle.</P>
1496<P>
1497 The constructor takes the following parameters:
1498 <PRE>
1499 G4BREPSolidPolyhedra( const G4String&amp; pName,
1500 G4double start_angle,
1501 G4double opening_angle,
1502 G4int sides,
1503 G4int num_z_planes,
1504 G4double z_start,
1505 const G4double z_values[],
1506 const G4double RMIN[],
1507 const G4double RMAX[] )
1508 </PRE>
1509 which in addition to its name have the following meaning:</P>
1510<p>
1511 <table border=1 cellpadding=8>
1512 <tr>
1513 <td><tt>start_angle</tt> <td>starting angle
1514 <tr>
1515 <TD><tt>opening_angle</tt> <td>opening angle
1516 <tr>
1517 <TD><tt>sides</tt> <td>number of sides of each polygon in the x-y plane
1518 <tr>
1519 <TD><tt>num_z_planes</tt> <td>number of planes perpendicular to the z-axis used.
1520 <tr>
1521 <TD><tt>z_start</tt> <td>starting value of z
1522 <tr>
1523 <TD><tt>z_values</tt> <td>z coordinates of each plane
1524 <tr>
1525 <TD><tt>RMIN</tt> <td>radius of inner polygon at each corner
1526 <tr>
1527 <TD><tt>RMAX</tt> <td>radius of outer polygon at each corner
1528 </table></P>
1529<P>
1530 the shape is defined by the number of sides <tt>sides</tt> of the polygon
1531 in the plane perpendicular to the z-axis. </P>
1532
1533<a name="4.1.2.4">
1534<H4>4.1.2.4 Tessellated Solids</H4></a>
1535
1536In Geant4 it is also implemented a class <tt>G4TessellatedSolid</tt> which
1537can be used to generate a generic solid defined by a number of facets
1538(<tt>G4VFacet</tt>). Such constructs are especially important for conversion
1539of complex geometrical shapes imported from CAD systems bounded with generic
1540surfaces into an approximate description with facets of defined dimension
1541(see figure 4.1.1).
1542<P>
1543 <center>
1544 <table BORDER=1 CELLPADDING=8>
1545 <tr>
1546 <td><IMG SRC="geometry.src/cad-tess1.jpg"
1547 ALT="Tessellated imported geometry - 1" height=350 width=420>
1548 <IMG SRC="geometry.src/cad-tess2.jpg"
1549 ALT="Tessellated imported geometry - 2" height=350 width=420></td>
1550 <tr>
1551 <td ALIGN=center>
1552 Figure 4.1.1<br>
1553 Example of geometries imported from CAD system and converted
1554 to tessellated solids.</td>
1555 </tr>
1556 </table>
1557 </center>
1558</P>
1559<P>
1560They can also be used to generate a solid bounded with a generic surface made
1561of planar facets. It is important that the supplied facets shall form a fully
1562enclose space to represent the solid.<BR>
1563Two types of facet can be used for the construction of a
1564<tt>G4TessellatedSolid</tt>: a triangular facet (<tt>G4TriangularFacet</tt>)
1565and a quadrangular facet (<tt>G4QuadrangularFacet</tt>).</P>
1566<P>
1567An example on how to generate a simple tessellated shape is given below.</P>
1568<P>
1569Example:
1570 <center><table border=1 cellpadding=8>
1571 <tr><td>
1572 <PRE>
1573 // First declare a tessellated solid
1574 //
1575 G4TessellatedSolid solidTarget = new G4TessellatedSolid("Solid_name");
1576
1577 // Define the facets which form the solid
1578 //
1579 G4double targetSize = 10*cm ;
1580 G4TriangularFacet *facet1 = new
1581 G4TriangularFacet (G4ThreeVector(-targetSize,-targetSize, 0.0),
1582 G4ThreeVector(+targetSize,-targetSize, 0.0),
1583 G4ThreeVector( 0.0, 0.0,+targetSize),
1584 ABSOLUTE);
1585 G4TriangularFacet *facet2 = new
1586 G4TriangularFacet (G4ThreeVector(+targetSize,-targetSize, 0.0),
1587 G4ThreeVector(+targetSize,+targetSize, 0.0),
1588 G4ThreeVector( 0.0, 0.0,+targetSize),
1589 ABSOLUTE);
1590 G4TriangularFacet *facet3 = new
1591 G4TriangularFacet (G4ThreeVector(+targetSize,+targetSize, 0.0),
1592 G4ThreeVector(-targetSize,+targetSize, 0.0),
1593 G4ThreeVector( 0.0, 0.0,+targetSize),
1594 ABSOLUTE);
1595 G4TriangularFacet *facet4 = new
1596 G4TriangularFacet (G4ThreeVector(-targetSize,+targetSize, 0.0),
1597 G4ThreeVector(-targetSize,-targetSize, 0.0),
1598 G4ThreeVector( 0.0, 0.0,+targetSize),
1599 ABSOLUTE);
1600 G4QuadrangularFacet *facet5 = new
1601 G4QuadrangularFacet (G4ThreeVector(-targetSize,-targetSize, 0.0),
1602 G4ThreeVector(-targetSize,+targetSize, 0.0),
1603 G4ThreeVector(+targetSize,+targetSize, 0.0),
1604 G4ThreeVector(+targetSize,-targetSize, 0.0),
1605 ABSOLUTE);
1606
1607 // Now add the facets to the solid
1608 //
1609 solidTarget->AddFacet((G4VFacet*) facet1);
1610 solidTarget->AddFacet((G4VFacet*) facet2);
1611 solidTarget->AddFacet((G4VFacet*) facet3);
1612 solidTarget->AddFacet((G4VFacet*) facet4);
1613 solidTarget->AddFacet((G4VFacet*) facet5);
1614
1615 Finally declare the solid is complete
1616 //
1617 solidTarget->SetSolidClosed(true);
1618 </PRE>
1619 <tr>
1620 <td align=center>
1621 Source listing 4.1.1<BR>
1622 An example of a simple tessellated solid with <tt>G4TessellatedSolid</tt>.
1623 </table></center></P>
1624<P>
1625The <tt>G4TriangularFacet</tt> class is used for the contruction of
1626<tt>G4TessellatedSolid</tt>. It is defined by three vertices, which shall be
1627supplied in <I>anti-clockwise order</I> looking from the outside of the solid
1628where it belongs. Its constructor looks like:</P>
1629<P>
1630 <PRE>
1631 G4TriangularFacet ( const G4ThreeVector Pt0,
1632 const G4ThreeVector vt1,
1633 const G4ThreeVector vt2,
1634 G4FacetVertexType fType )
1635 </PRE>
1636i.e., it takes 4 parameters to define the three vertices:</P>
1637<P>
1638 <table border=1 cellpadding=8>
1639 <tr>
1640 <TD><tt>G4FacetVertexType</tt> <td><tt>ABSOLUTE</tt> in which case <tt>Pt0</tt>,
1641 <tt>vt1</tt> and <tt>vt2</tt> are the three vertices in anti-clockwise
1642 order looking from the outside.
1643 <tr>
1644 <TD><tt>G4FacetVertexType</tt> <td><tt>RELATIVE</tt> in which case the first
1645 vertex is <tt>Pt0</tt>, the second vertex is <tt>Pt0+vt1</tt> and the
1646 third vertex is <tt>Pt0+vt2</tt>, all in anti-clockwise order when
1647 looking from the outside.
1648 </table></P>
1649<P>
1650The <tt>G4QuadrangularFacet</tt> class can be used for the contruction of
1651<tt>G4TessellatedSolid</tt> as well. It is defined by four vertices, which
1652shall be in the same plane and be supplied in <I>anti-clockwise order</I>
1653looking from the outside of the solid where it belongs. Its constructor
1654looks like:</P>
1655<P>
1656 <PRE>
1657 G4QuadrangularFacet ( const G4ThreeVector Pt0,
1658 const G4ThreeVector vt1,
1659 const G4ThreeVector vt2,
1660 const G4ThreeVector vt3,
1661 G4FacetVertexType fType )
1662 </PRE>
1663i.e., it takes 5 parameters to define the four vertices:</P>
1664<P>
1665 <table border=1 cellpadding=8>
1666 <tr>
1667 <TD><tt>G4FacetVertexType</tt> <td><tt>ABSOLUTE</tt> in which case <tt>Pt0</tt>,
1668 <tt>vt1</tt>, <tt>vt2</tt> and <tt>vt3</tt> are the four vertices required
1669 in anti-clockwise order when looking from the outside.
1670 <tr>
1671 <TD><tt>G4FacetVertexType</tt> <td><tt>RELATIVE</tt> in which case the first
1672 vertex is <tt>Pt0</tt>, the second vertex is <tt>Pt0+vt</tt>, the third
1673 vertex is <tt>Pt0+vt2</tt> and the fourth vertex is <tt>Pt0+vt3</tt>, in
1674 anti-clockwise order when looking from the outside.
1675 </table>
1676</P>
1677
1678<hr><a href="../../../../Authors/html/subjectsToAuthors.html">
1679<i>About the authors</a></i> </P>
1680
1681</body>
1682</html>
Note: See TracBrowser for help on using the repository browser.