source: trunk/documents/UserDoc/DocBookUsersGuides/ForApplicationDeveloper/xml/Detector/geomSolids.xml

Last change on this file was 1211, checked in by garnier, 15 years ago

CVS update

File size: 76.0 KB
Line 
1<!-- ******************************************************** -->
2<!--                                                          -->
3<!--  [History]                                               -->
4<!--    Converted to DocBook: Katsuya Amako, Aug-2006         -->
5<!--    Changed by: Gabriele Cosmo, 18-Apr-2005               -->
6<!--                                                          -->
7<!-- ******************************************************** -->
8
9
10<!-- ******************* Section (Level#2) ****************** -->
11<sect2 id="sect.Geom.Solids">
12<title>
13Solids
14</title>
15
16<para>
17The STEP standard supports multiple solid representations.
18Constructive Solid Geometry (CSG) representations and Boundary
19Represented Solids (BREPs) are available. Different representations
20are suitable for different purposes, applications, required
21complexity, and levels of detail. CSG representations are easy to
22use and normally give superior performance, but they cannot
23reproduce complex solids such as those used in CAD systems. BREP
24representations can handle more extended topologies and reproduce
25the most complex solids.
26</para>
27
28<para>
29All constructed solids can stream out their contents via
30appropriate methods and streaming operators.
31</para>
32
33<para>
34For all solids it is possible to estimate the geometrical volume and the
35surface area by invoking the methods:
36
37<informalexample>
38<programlisting>
39   G4double GetCubicVolume()
40   G4double GetSurfaceArea()
41</programlisting>
42</informalexample>
43
44which return an estimate of the solid volume and total area in internal
45units respectively. For elementary solids the functions compute the exact
46geometrical quantities, while for composite or complex solids an estimate
47is made using Monte Carlo techniques.
48</para>
49
50<para>
51For all solids it is also possible to generate pseudo-random
52points lying on their surfaces, by invoking the method
53
54<informalexample>
55<programlisting>
56   G4ThreeVector GetPointOnSurface() const
57</programlisting>
58</informalexample>
59
60which returns the generated point in local coordinates relative to
61the solid.
62</para>
63
64
65<!-- ******************* Section (Level#3) ****************** -->
66<sect3 id="sect.Geom.Solids.CSG">
67<title>
68Constructed Solid Geometry (CSG) Solids
69</title>
70
71<para>
72CSG solids are defined directly as three-dimensional primitives.
73They are described by a minimal set of parameters necessary to
74define the shape and size of the solid. CSG solids are Boxes, Tubes
75and their sections, Cones and their sections, Spheres, Wedges, and
76Toruses.
77</para>
78
79<!-- ******* Bridgehead ******* -->
80<bridgehead renderas='sect4'>
81Box:
82</bridgehead>
83
84<para> 
85To create a <emphasis role="bold">box</emphasis> one can use the constructor:
86
87<informaltable frame="none" pgwide="0">
88<tgroup cols="2" colsep="0">
89<tbody>
90<row>
91  <entry valign="top" align="left">
92    <informalexample>
93    <programlisting>
94   G4Box(const G4String&amp; pName,                         
95               G4double  pX,
96               G4double  pY,
97               G4double  pZ)
98    </programlisting> 
99    </informalexample>
100  </entry>
101  <entry valign="top" align="center">
102    <mediaobject>
103    <imageobject  role="fo">
104      <imagedata fileref="./AllResources/Detector/geometry.src/aBox.jpg"
105                 format="JPG" contentwidth="3.5cm" />
106    </imageobject>
107    <imageobject  role="html">
108      <imagedata fileref="./AllResources/Detector/geometry.src/aBox.jpg"
109                 format="JPG" />
110    </imageobject>
111    </mediaobject>
112
113    <?JavaScript pic1.html ?>
114    <emphasis role="underline">In the picture</emphasis>:
115    <literal>
116    <para>
117    pX = 30, pY = 40, pZ = 60                                                       
118    </para>
119    </literal>
120  </entry>
121</row>
122</tbody>
123</tgroup>
124</informaltable>
125</para>
126
127<para>
128by giving the box a name and its half-lengths along the X, Y and
129Z axis:
130<informaltable pgwide="0">
131<tgroup cols="6">
132<tbody>
133<row>
134  <entry>
135    <literal>pX</literal>
136  </entry>
137  <entry>
138    half length in X
139  </entry>
140  <entry>
141    <literal>pY</literal>
142  </entry>
143  <entry>
144    half length in Y
145  </entry>
146  <entry>
147    <literal>pZ</literal>
148  </entry>
149  <entry>
150    half length in Z
151  </entry>
152</row>
153</tbody>
154</tgroup>
155</informaltable>
156</para>
157   
158<para>
159This will create a box that extends from <literal>-pX</literal> to
160<literal>+pX</literal> in X, from <literal>-pY</literal> to
161<literal>+pY</literal> in Y, and from
162<literal>-pZ</literal> to <literal>+pZ</literal> in Z.
163</para>
164
165<para>
166For example to create a box that is 2 by 6 by 10 centimeters in
167full length, and called <literal>BoxA</literal> one should use the following
168code:
169<informalexample>
170<programlisting> 
171   G4Box* aBox = new G4Box("BoxA", 1.0*cm, 3.0*cm, 5.0*cm);
172</programlisting>
173</informalexample>
174</para>
175
176<!-- ******* Bridgehead ******* -->
177<bridgehead renderas='sect4'>
178Cylindrical Section or Tube:
179</bridgehead>
180
181<para> 
182Similarly to create a <emphasis role="bold">cylindrical section</emphasis> 
183or <emphasis role="bold">tube</emphasis>, one would use the constructor:
184
185<informaltable frame="none" pgwide="0">
186<tgroup cols="2" colsep="0">
187<tbody>
188<row>
189  <entry valign="top" align="left">
190    <informalexample>
191    <programlisting> 
192   G4Tubs(const G4String&amp; pName,                       
193                G4double  pRMin,
194                G4double  pRMax,
195                G4double  pDz,
196                G4double  pSPhi,
197                G4double  pDPhi)
198    </programlisting> 
199    </informalexample>
200  </entry>
201  <entry valign="top" align="center">
202    <mediaobject>
203    <imageobject role="fo">
204      <imagedata fileref="./AllResources/Detector/geometry.src/aTubs.jpg"
205                 format="JPG" contentwidth="3.5cm" />
206    </imageobject>
207    <imageobject role="html">
208      <imagedata fileref="./AllResources/Detector/geometry.src/aTubs.jpg"
209                 format="JPG" />
210    </imageobject>
211    </mediaobject>
212
213    <?JavaScript pic2.html ?>
214    <emphasis role="underline">In the picture</emphasis>:
215    <literal>
216    <para>
217    pRMin = 10, pRMax = 15, pDz = 20
218    </para>
219    </literal>
220  </entry>
221</row>
222</tbody>
223</tgroup>
224</informaltable>
225</para>
226
227<para>
228giving its name <literal>pName</literal> and its parameters which are:
229<informaltable pgwide="0">
230<tgroup cols="4">
231<tbody>
232<row>
233  <entry>
234    <literal>pRMin</literal>
235  </entry>
236  <entry>
237    Inner radius
238  </entry>
239  <entry>
240    <literal>pRMax</literal>
241  </entry>
242  <entry>
243    Outer radius
244  </entry>
245</row>
246<row>
247  <entry>
248    <literal>pDz</literal>
249  </entry>
250  <entry>
251    half length in z
252  </entry>
253  <entry>
254    <literal>pSPhi</literal>
255  </entry>
256  <entry>
257    the starting phi angle in radians
258  </entry>
259</row>
260<row>
261  <entry>
262    <literal>pDPhi</literal>
263  </entry>
264  <entry>
265    the angle of the segment in radians
266  </entry>
267</row>
268</tbody>
269</tgroup>
270</informaltable>
271</para>
272
273<!-- ******* Bridgehead ******* -->
274<bridgehead renderas='sect4'>
275Cone or Conical section:
276</bridgehead>
277
278<para> 
279Similarly to create a <emphasis role="bold">cone</emphasis>, or
280<emphasis role="bold">conical section</emphasis>, one would use the constructor
281
282<informaltable frame="none" pgwide="0">
283<tgroup cols="2" colsep="0">
284<tbody>
285<row>
286  <entry valign="top" align="left">
287    <informalexample>
288    <programlisting> 
289   G4Cons(const G4String&amp; pName,                       
290                G4double  pRmin1,
291                G4double  pRmax1,
292                G4double  pRmin2,
293                G4double  pRmax2,
294                G4double  pDz,
295                G4double  pSPhi,
296                G4double  pDPhi)
297    </programlisting>
298    </informalexample>
299  </entry>
300  <entry valign="top" align="center">
301    <mediaobject>
302    <imageobject  role="fo">
303      <imagedata fileref="./AllResources/Detector/geometry.src/aCons.jpg"
304                 format="JPG" contentwidth="3.5cm" />
305    </imageobject>
306    <imageobject  role="html">
307      <imagedata fileref="./AllResources/Detector/geometry.src/aCons.jpg"
308                 format="JPG" />
309    </imageobject>
310    </mediaobject>
311
312    <?JavaScript pic3.html ?>
313    <emphasis role="underline">In the picture</emphasis>:
314    <literal>
315    <para>
316    pRmin1 = 5, pRmax1 = 10,
317    pRmin2 = 20, pRmax2 = 25,
318    pDz = 40, pSPhi = 0, pDPhi = 4/3*Pi
319    </para>
320    </literal>
321  </entry>
322</row>
323</tbody>
324</tgroup>
325</informaltable>
326</para>
327
328<para>
329giving its name <literal>pName</literal>, and its parameters which are:
330<informaltable pgwide="0">
331<tgroup cols="4">
332<tbody>
333<row>
334  <entry>
335    <literal>pRmin1</literal>
336  </entry>
337  <entry>
338    inside radius at <literal>-pDz</literal>
339  </entry>
340  <entry>
341    <literal>pRmax1</literal>
342  </entry>
343  <entry>
344    outside radius at <literal>-pDz</literal>
345  </entry>
346</row>
347<row>
348  <entry>
349    <literal>pRmin2</literal>
350  </entry>
351  <entry>
352    inside radius at <literal>+pDz</literal>
353  </entry>
354  <entry>
355    <literal>pRmax2</literal>
356  </entry>
357  <entry>
358    outside radius at <literal>+pDz</literal>
359  </entry>
360</row>
361<row>
362  <entry>
363    <literal>pDz</literal>
364  </entry>
365  <entry>
366    half length in z
367  </entry>
368  <entry>
369    <literal>pSPhi</literal>
370  </entry>
371  <entry>
372    starting angle of the segment in radians
373  </entry>
374</row>
375<row>
376  <entry>
377    <literal>pDPhi</literal>
378  </entry>
379  <entry>
380    the angle of the segment in radians
381  </entry>
382</row>
383</tbody>
384</tgroup>
385</informaltable>
386</para>
387   
388<!-- ******* Bridgehead ******* -->
389<bridgehead renderas='sect4'>
390Parallelepiped:
391</bridgehead>
392
393<para> 
394A <emphasis role="bold">parallelepiped</emphasis> is constructed
395using:
396
397<informaltable frame="none" pgwide="0">
398<tgroup cols="2" colsep="0">
399<tbody>
400<row>
401  <entry valign="top" align="left">
402    <informalexample>
403    <programlisting> 
404   G4Para(const G4String&amp; pName,                                 
405                G4double   dx,
406                G4double   dy,
407                G4double   dz,
408                G4double   alpha,
409                G4double   theta,
410                G4double   phi)
411    </programlisting> 
412    </informalexample>
413  </entry>
414  <entry valign="top" align="center">
415    <mediaobject>
416    <imageobject  role="fo">
417      <imagedata fileref="./AllResources/Detector/geometry.src/aPara.jpg"
418                 format="JPG" contentwidth="3.5cm" />
419    </imageobject>
420    <imageobject  role="html">
421      <imagedata fileref="./AllResources/Detector/geometry.src/aPara.jpg"
422                 format="JPG" />
423    </imageobject>
424    </mediaobject>
425
426    <?JavaScript pic4.html ?>
427    <emphasis role="underline">In the picture</emphasis>:
428    <literal>
429    <para>
430    dx = 30, dy = 40, dz = 60
431    </para>
432    </literal>
433  </entry>
434</row>
435</tbody>
436</tgroup>
437</informaltable>
438</para>
439
440<para>
441giving its name <literal>pName</literal> and its parameters which are:
442<informaltable pgwide="0">
443<tgroup cols="2">
444<tbody>
445<row>
446  <entry>
447    <literal>dx,dy,dz</literal>   
448  </entry>
449  <entry>
450    Half-length in x,y,z
451  </entry>
452</row>
453<row>
454  <entry>
455    <literal>alpha</literal>
456  </entry>
457  <entry>
458    Angle formed by the y axis and by the plane joining the centre
459    of the faces <emphasis>parallel</emphasis> to the z-x plane at -dy and +dy
460  </entry>
461</row>
462<row>
463  <entry>
464    <literal>theta</literal>
465  </entry>
466  <entry>
467    Polar angle of the line joining the centres of the faces at -dz
468    and +dz in z
469  </entry>
470</row>
471<row>
472  <entry>
473    <literal>phi</literal>
474  </entry>
475  <entry>
476    Azimuthal angle of the line joining the centres of the faces at
477    -dz and +dz in z
478  </entry>
479</row>
480</tbody>
481</tgroup>
482</informaltable>
483</para>
484
485<!-- ******* Bridgehead ******* -->
486<bridgehead renderas='sect4'>
487Trapezoid:
488</bridgehead>
489
490<para> 
491To construct a <emphasis role="bold">trapezoid</emphasis> use:
492
493<informaltable frame="none" pgwide="0">
494<tgroup cols="2" colsep="0">
495<tbody>
496<row>
497  <entry valign="top" align="left">
498    <informalexample>
499    <programlisting> 
500   G4Trd(const G4String&amp; pName,                           
501               G4double  dx1,
502               G4double  dx2,
503               G4double  dy1,
504               G4double  dy2,
505               G4double  dz)
506    </programlisting> 
507    </informalexample>
508  </entry>
509  <entry valign="top" align="center">
510    <mediaobject>
511    <imageobject  role="fo">
512      <imagedata fileref="./AllResources/Detector/geometry.src/aTrd.jpg"
513                 format="JPG" contentwidth="3.5cm" />
514    </imageobject>
515    <imageobject  role="html">
516      <imagedata fileref="./AllResources/Detector/geometry.src/aTrd.jpg"
517                 format="JPG" />
518    </imageobject>
519    </mediaobject>
520
521    <?JavaScript pic5.html ?>
522    <emphasis role="underline">In the picture</emphasis>:
523    <literal>
524    <para>
525    dx1 = 30, dx2 = 10,
526    dy1 = 40, dy2 = 15,
527    dz = 60
528    </para>
529    </literal>
530  </entry>
531</row>
532</tbody>
533</tgroup>
534</informaltable>
535</para>
536
537<para>
538to obtain a solid with name <literal>pName</literal> and parameters
539
540<informaltable pgwide="0">
541<tgroup cols="2">
542<tbody>
543<row>
544  <entry>
545    <literal>dx1</literal>
546  </entry>
547  <entry>
548    Half-length along x at the surface positioned at <literal>-dz</literal>
549  </entry>
550</row>
551<row>
552  <entry>
553    <literal>dx2</literal>
554  </entry>
555  <entry>
556    Half-length along x at the surface positioned at <literal>+dz</literal>
557  </entry>
558</row>
559<row>
560  <entry>
561    <literal>dy1</literal>
562  </entry>
563  <entry>
564    Half-length along y at the surface positioned at <literal>-dz</literal>
565  </entry>
566</row>
567<row>
568  <entry>
569    <literal>dy2</literal>
570  </entry>
571  <entry>
572    Half-length along y at the surface positioned at <literal>+dz</literal>
573  </entry>
574</row>
575<row>
576  <entry>
577    <literal>dz</literal>
578  </entry>
579  <entry>
580    Half-length along z axis
581  </entry>
582</row>
583</tbody>
584</tgroup>
585</informaltable>
586</para>
587   
588<!-- ******* Bridgehead ******* -->
589<bridgehead renderas='sect4'>
590Generic Trapezoid:
591</bridgehead>
592
593<para> 
594To build a <emphasis role="bold">generic trapezoid</emphasis>,
595the <literal>G4Trap</literal> class is provided. Here are the two costructors
596for a Right Angular Wedge and for the general trapezoid for it:
597
598<informaltable frame="none" pgwide="0">
599<tgroup cols="2" colsep="0">
600<tbody>
601<row>
602  <entry valign="top" align="left">
603    <informalexample>
604    <programlisting> 
605 G4Trap(const G4String&amp; pName,                       
606              G4double   pZ,
607              G4double   pY,
608              G4double   pX,
609              G4double   pLTX)
610
611 G4Trap(const G4String&amp; pName,                         
612              G4double   pDz,   G4double   pTheta,
613              G4double   pPhi,  G4double   pDy1,
614              G4double   pDx1,  G4double   pDx2,
615              G4double   pAlp1, G4double   pDy2,
616              G4double   pDx3,  G4double   pDx4,
617              G4double   pAlp2)
618    </programlisting> 
619    </informalexample>
620  </entry>
621  <entry valign="top" align="center">
622    <mediaobject>
623    <imageobject  role="fo">
624      <imagedata fileref="./AllResources/Detector/geometry.src/aTrap.jpg"
625                 format="JPG" contentwidth="3.5cm" />
626    </imageobject>
627    <imageobject  role="html">
628      <imagedata fileref="./AllResources/Detector/geometry.src/aTrap.jpg"
629                 format="JPG" />
630    </imageobject>
631    </mediaobject>
632
633    <?JavaScript pic6.html ?>
634    <emphasis role="underline">In the picture</emphasis>:
635    <literal>
636    <para>
637    pDx1 = 30, pDx2 = 40, pDy1 = 40,
638    pDx3 = 10, pDx4 = 14, pDy2 = 16,
639    pDz = 60, pTheta = 20*Degree,
640    pPhi = 5*Degree, pAlp1 = pAlp2 = 10*Degree
641    </para>
642    </literal>
643  </entry>
644</row>
645</tbody>
646</tgroup>
647</informaltable>
648</para>
649
650<para>
651to obtain a Right Angular Wedge with name <literal>pName</literal> and
652parameters:
653<informaltable pgwide="0">
654<tgroup cols="2">
655<tbody>
656<row>
657  <entry>
658    <literal>pZ</literal>
659  </entry>
660  <entry>
661    Length along z
662  </entry>
663</row>
664<row>
665  <entry>
666    <literal>pY</literal>
667  </entry>
668  <entry>
669    Length along y
670  </entry>
671</row>
672<row>
673  <entry>
674    <literal>pX</literal>
675  </entry>
676  <entry>
677    Length along x at the wider side
678  </entry>
679</row>
680<row>
681  <entry>
682    <literal>pLTX</literal>
683  </entry>
684  <entry>
685    Length along x at the narrower side (<literal>plTX&lt;=pX</literal>)
686  </entry>
687</row>
688</tbody>
689</tgroup>
690</informaltable>
691</para>
692
693<para>
694or to obtain the general trapezoid (see the Software Reference
695Manual):
696</para>
697   
698<para>
699<informaltable pgwide="0">
700<tgroup cols="2">
701<tbody>
702<row>
703  <entry>
704   <literal>pDx1</literal> 
705  </entry>
706  <entry>
707    Half x length of the side at y=-pDy1 of the face at -pDz
708  </entry>
709</row>
710<row>
711  <entry>
712    <literal>pDx2</literal>
713  </entry>
714  <entry>
715    Half x length of the side at y=+pDy1 of the face at -pDz
716  </entry>
717</row>
718<row>
719  <entry>
720    <literal>pDz</literal>
721  </entry>
722  <entry>
723    Half z length
724  </entry>
725</row>
726<row>
727  <entry>
728    <literal>pTheta</literal>
729  </entry>
730  <entry>
731    Polar angle of the line joining the centres of the faces at -/+pDz
732  </entry>
733</row>
734<row>
735  <entry>
736    <literal>pPhi</literal>
737  </entry>
738  <entry>
739    Azimuthal angle of the line joining the centre of the face at -pDz to the centre of the face at +pDz
740  </entry>
741</row>
742<row>
743  <entry>
744    <literal>pDy1</literal>
745  </entry>
746  <entry>
747    Half y length at -pDz
748  </entry>
749</row>
750<row>
751  <entry>
752    <literal>pDy2</literal>
753  </entry>
754  <entry>
755    Half y length at +pDz
756  </entry>
757</row>
758<row>
759  <entry>
760    <literal>pDx3</literal>
761  </entry>
762  <entry>
763    Half x length of the side at y=-pDy2 of the face at +pDz
764  </entry>
765</row>
766<row>
767  <entry>
768    <literal>pDx4</literal>
769  </entry>
770  <entry>
771    Half x length of the side at y=+pDy2 of the face at +pDz
772  </entry>
773</row>
774<row>
775  <entry>
776    <literal>pAlp1</literal>
777  </entry>
778  <entry>
779    Angle with respect to the y axis from the centre of the side
780    (lower endcap)
781  </entry>
782</row>
783<row>
784  <entry>
785    <literal>pAlp2</literal>
786  </entry>
787  <entry>
788    Angle with respect to the y axis from the centre of the side
789    (upper endcap)
790  </entry>
791</row>
792</tbody>
793</tgroup>
794</informaltable>
795</para>
796   
797<para>
798<emphasis role="bold">Note on <literal>pAlph1/2</literal></emphasis>: the
799two angles have to be the
800same due to the planarity condition.
801</para>
802
803<!-- ******* Bridgehead ******* -->
804<bridgehead renderas='sect4'>
805Sphere or Spherical Shell Section:
806</bridgehead>
807
808<para> 
809To build a <emphasis role="bold">sphere</emphasis>, or a
810<emphasis role="bold">spherical shell section</emphasis>, use:
811
812<informaltable frame="none" pgwide="0">
813<tgroup cols="2" colsep="0">
814<tbody>
815<row>
816  <entry valign="top" align="left">
817    <informalexample>
818    <programlisting> 
819   G4Sphere(const G4String&amp; pName,                     
820                  G4double   pRmin,
821                  G4double   pRmax,
822                  G4double   pSPhi,
823                  G4double   pDPhi,
824                  G4double   pSTheta,
825                  G4double   pDTheta )
826    </programlisting> 
827    </informalexample>
828  </entry>
829  <entry valign="top" align="center">
830    <mediaobject>
831    <imageobject  role="fo">
832      <imagedata fileref="./AllResources/Detector/geometry.src/aSphere.jpg"
833                 format="JPG" contentwidth="3.5cm" />
834    </imageobject>
835    <imageobject  role="html">
836      <imagedata fileref="./AllResources/Detector/geometry.src/aSphere.jpg"
837                 format="JPG" />
838    </imageobject>
839    </mediaobject>
840
841    <?JavaScript pic7.html ?>
842    <emphasis role="underline">In the picture</emphasis>:
843    <literal>
844    <para>
845      pRmin = 100, pRmax = 120,
846      pSPhi = 0*Degree, pDPhi = 180*Degree,
847      pSTheta = 0 Degree, pDTheta = 180*Degree
848    </para>
849    </literal>
850  </entry>
851</row>
852</tbody>
853</tgroup>
854</informaltable>
855</para>
856
857<para>
858to obtain a solid with name <literal>pName</literal> and parameters:
859
860<informaltable pgwide="0">
861<tgroup cols="2">
862<tbody>
863<row>
864  <entry>
865    pRmin
866  </entry>
867  <entry>
868    Inner radius
869  </entry>
870</row>
871<row>
872  <entry>
873    pRmax
874  </entry>
875  <entry>
876    Outer radius
877  </entry>
878</row>
879<row>
880  <entry>
881    pSPhi
882  </entry>
883  <entry>
884    Starting Phi angle of the segment in radians
885  </entry>
886</row>
887<row>
888  <entry>
889    pDPhi
890  </entry>
891  <entry>
892    Delta Phi angle of the segment in radians
893  </entry>
894</row>
895<row>
896  <entry>
897    pSTheta
898  </entry>
899  <entry>
900    Starting Theta angle of the segment in radians
901  </entry>
902</row>
903<row>
904  <entry>
905    pDTheta
906  </entry>
907  <entry>
908    Delta Theta angle of the segment in radians
909  </entry>
910</row>
911</tbody>
912</tgroup>
913</informaltable>
914</para>
915   
916<!-- ******* Bridgehead ******* -->
917<bridgehead renderas='sect4'>
918Full Solid Sphere:
919</bridgehead>
920
921<para> 
922To build a <emphasis role="bold">full solid sphere</emphasis>
923use:
924
925<informaltable frame="none" pgwide="0">
926<tgroup cols="2" colsep="0">
927<tbody>
928<row>
929  <entry valign="top" align="left">
930    <informalexample>
931    <programlisting> 
932   G4Orb(const G4String&amp; pName,                                   
933               G4double  pRmax)
934    </programlisting> 
935    </informalexample>
936  </entry>
937  <entry valign="top" align="center">
938    <mediaobject>
939    <imageobject  role="fo">
940      <imagedata fileref="./AllResources/Detector/geometry.src/aOrb.jpg"
941                 format="JPG" contentwidth="3.5cm" />
942    </imageobject>
943    <imageobject  role="html">
944      <imagedata fileref="./AllResources/Detector/geometry.src/aOrb.jpg"
945                 format="JPG" />
946    </imageobject>
947    </mediaobject>
948
949    <?JavaScript pic8.html ?>
950    <emphasis role="underline">In the picture</emphasis>:
951    <literal>
952    <para>
953      pRmax = 100
954    </para>
955    </literal>
956  </entry>
957</row>
958</tbody>
959</tgroup>
960</informaltable>
961</para>
962
963<para>
964The Orb can be obtained from a Sphere with:
965<literal>pRmin</literal> = 0, <literal>pSPhi</literal> = 0,
966<literal>pDPhi</literal> = 2*Pi,
967<literal>pSTheta</literal> = 0, <literal>pDTheta</literal> = Pi
968
969<informaltable pgwide="0">
970<tgroup cols="2">
971<tbody>
972<row>
973  <entry>
974    pRmax
975  </entry>
976  <entry>
977    Outer radius
978  </entry>
979</row>
980</tbody>
981</tgroup>
982</informaltable>
983</para>
984   
985<!-- ******* Bridgehead ******* -->
986<bridgehead renderas='sect4'>
987Torus:
988</bridgehead>
989
990<para> 
991To build a <emphasis role="bold">torus</emphasis> use:
992
993<informaltable frame="none" pgwide="0">
994<tgroup cols="2" colsep="0">
995<tbody>
996<row>
997  <entry valign="top" align="left">
998    <informalexample>
999    <programlisting> 
1000   G4Torus(const G4String&amp; pName,                       
1001                 G4double   pRmin,
1002                 G4double   pRmax,
1003                 G4double   pRtor,
1004                 G4double   pSPhi,
1005                 G4double   pDPhi)
1006    </programlisting> 
1007    </informalexample>
1008  </entry>
1009  <entry valign="top" align="center">
1010    <mediaobject>
1011    <imageobject  role="fo">
1012      <imagedata fileref="./AllResources/Detector/geometry.src/aTorus.jpg"
1013                 format="JPG" contentwidth="3.5cm" />
1014    </imageobject>
1015    <imageobject  role="html">
1016      <imagedata fileref="./AllResources/Detector/geometry.src/aTorus.jpg"
1017                 format="JPG" />
1018    </imageobject>
1019    </mediaobject>
1020
1021    <?JavaScript pic9.html ?>
1022    <emphasis role="underline">In the picture</emphasis>:
1023    <literal>
1024    <para>
1025      pRmin = 40, pRmax = 60, pRtor = 200,
1026      pSPhi = 0, pDPhi = 90*Degree
1027    </para>
1028    </literal>
1029  </entry>
1030</row>
1031</tbody>
1032</tgroup>
1033</informaltable>
1034</para>
1035
1036<para>
1037to obtain a solid with name <literal>pName</literal> and parameters:
1038
1039<informaltable pgwide="0">
1040<tgroup cols="2">
1041<tbody>
1042<row>
1043  <entry>
1044    pRmin
1045  </entry>
1046  <entry>
1047    Inside radius
1048  </entry>
1049</row>
1050<row>
1051  <entry>
1052    pRmax
1053  </entry>
1054  <entry>
1055    Outside radius
1056  </entry>
1057</row>
1058<row>
1059  <entry>
1060    pRtor
1061  </entry>
1062  <entry>
1063    Swept radius of torus
1064  </entry>
1065</row>
1066<row>
1067  <entry>
1068    pSPhi
1069  </entry>
1070  <entry>
1071    Starting Phi angle in radians (<literal>fSPhi+fDPhi&lt;=2PI</literal>,
1072    <literal>fSPhi&gt;-2PI</literal>)
1073  </entry>
1074</row>
1075<row>
1076  <entry>
1077    pDPhi
1078  </entry>
1079  <entry>
1080    Delta angle of the segment in radians
1081  </entry>
1082</row>
1083</tbody>
1084</tgroup>
1085</informaltable>
1086</para>
1087   
1088<para>
1089In addition, the Geant4 Design Documentation shows in the Solids
1090Class Diagram the complete list of CSG classes, and the STEP
1091documentation contains a detailed EXPRESS description of each CSG
1092solid.
1093</para>
1094
1095
1096
1097<!-- ******* Bridgehead ******* -->
1098<bridgehead renderas='sect3'>
1099Specific CSG Solids
1100</bridgehead>
1101
1102<!-- ******* Bridgehead ******* -->
1103<bridgehead renderas='sect4'>
1104Polycons:
1105</bridgehead>
1106
1107<para> 
1108<emphasis role="bold">Polycons</emphasis> (PCON) are implemented in Geant4 through the
1109<literal>G4Polycon</literal> class:
1110
1111<informaltable frame="none" pgwide="0">
1112<tgroup cols="2" colsep="0">
1113<tbody>
1114<row>
1115  <entry valign="top" align="left">
1116    <informalexample>
1117    <programlisting> 
1118   G4Polycone(const G4String&amp; pName,                   
1119                    G4double   phiStart,
1120                    G4double   phiTotal,
1121                    G4int      numZPlanes,
1122                    const G4double   zPlane[],
1123                    const G4double   rInner[],
1124                    const G4double   rOuter[])
1125
1126   G4Polycone(const G4String&amp; pName,                     
1127                    G4double   phiStart,
1128                    G4double   phiTotal,
1129                    G4int      numRZ,
1130                    const G4double  r[],
1131                    const G4double  z[])
1132    </programlisting> 
1133    </informalexample>
1134  </entry>
1135  <entry valign="top" align="center">
1136    <mediaobject>
1137    <imageobject  role="fo">
1138      <imagedata fileref="./AllResources/Detector/geometry.src/aBREPSolidPCone.jpg"
1139                 format="JPG" contentwidth="3.5cm" />
1140    </imageobject>
1141    <imageobject  role="html">
1142      <imagedata fileref="./AllResources/Detector/geometry.src/aBREPSolidPCone.jpg"
1143                 format="JPG" />
1144    </imageobject>
1145    </mediaobject>
1146
1147    <?JavaScript pic10.html ?>
1148    <emphasis role="underline">In the picture</emphasis>:
1149    <literal>
1150    <para>
1151      phiStart = 1/4*Pi, phiTotal = 3/2*Pi, numZPlanes = 9,
1152      rInner = { 0, 0, 0, 0, 0, 0, 0, 0, 0},
1153      rOuter = { 0, 10, 10, 5 , 5, 10 , 10 , 2, 2},
1154      z = { 5, 7, 9, 11, 25, 27, 29, 31, 35 }
1155    </para>
1156    </literal>
1157  </entry>
1158</row>
1159</tbody>
1160</tgroup>
1161</informaltable>
1162</para>
1163
1164<para>
1165where:
1166
1167<informaltable pgwide="0">
1168<tgroup cols="2">
1169<tbody>
1170<row>
1171  <entry>
1172    phiStart
1173  </entry>
1174  <entry>
1175    Initial Phi starting angle
1176  </entry>
1177</row>
1178<row>
1179  <entry>
1180    phiTotal
1181  </entry>
1182  <entry>
1183    Total Phi angle
1184  </entry>
1185</row>
1186<row>
1187  <entry>
1188    numZPlanes
1189  </entry>
1190  <entry>
1191    Number of z planes
1192  </entry>
1193</row>
1194<row>
1195  <entry>
1196    numRZ
1197  </entry>
1198  <entry>
1199    Number of corners in r,z space
1200  </entry>
1201</row>
1202<row>
1203  <entry>
1204    zPlane
1205  </entry>
1206  <entry>
1207    Position of z planes
1208  </entry>
1209</row>
1210<row>
1211  <entry>
1212    rInner
1213  </entry>
1214  <entry>
1215    Tangent distance to inner surface
1216  </entry>
1217</row>
1218<row>
1219  <entry>
1220    rOuter
1221  </entry>
1222  <entry>
1223    Tangent distance to outer surface
1224  </entry>
1225</row>
1226<row>
1227  <entry>
1228    r
1229  </entry>
1230  <entry>
1231    r coordinate of corners
1232  </entry>
1233</row>
1234<row>
1235  <entry>
1236    z
1237  </entry>
1238  <entry>
1239    z coordinate of corners
1240  </entry>
1241</row>
1242</tbody>
1243</tgroup>
1244</informaltable>
1245</para>
1246   
1247<!-- ******* Bridgehead ******* -->
1248<bridgehead renderas='sect4'>
1249Polyhedra (PGON):
1250</bridgehead>
1251
1252<para> 
1253<emphasis role="bold">Polyhedra</emphasis> (PGON) are implemented through
1254<literal>G4Polyhedra</literal>:
1255
1256<informaltable frame="none" pgwide="0">
1257<tgroup cols="2" colsep="0">
1258<tbody>
1259<row>
1260  <entry valign="top" align="left">
1261    <informalexample>
1262    <programlisting> 
1263   G4Polyhedra(const G4String&amp; pName,                   
1264                     G4double  phiStart,
1265                     G4double  phiTotal,
1266                     G4int     numSide,
1267                     G4int     numZPlanes,
1268               const G4double  zPlane[],
1269               const G4double  rInner[],
1270               const G4double  rOuter[] )
1271
1272   G4Polyhedra(const G4String&amp; pName,
1273                     G4double  phiStart,
1274                     G4double  phiTotal,
1275                     G4int     numSide,
1276                     G4int     numRZ,
1277               const G4double  r[],
1278               const G4double  z[] )
1279    </programlisting> 
1280    </informalexample>
1281  </entry>
1282  <entry valign="top" align="center">
1283    <mediaobject>
1284    <imageobject  role="fo">
1285      <imagedata fileref="./AllResources/Detector/geometry.src/aBREPSolidPolyhedra.jpg"
1286                 format="JPG" contentwidth="3.5cm" />
1287    </imageobject>
1288    <imageobject  role="html">
1289      <imagedata fileref="./AllResources/Detector/geometry.src/aBREPSolidPolyhedra.jpg"
1290                 format="JPG" />
1291    </imageobject>
1292    </mediaobject>
1293
1294    <?JavaScript pic11.html ?>
1295    <emphasis role="underline">In the picture</emphasis>:
1296    <literal>
1297    <para>
1298    phiStart = -1/4*Pi, phiTotal= 5/4*Pi,
1299    numSide = 3, nunZPlanes = 7,
1300    rInner = { 0, 0, 0, 0, 0, 0, 0 },
1301    rOuter = { 0, 15, 15, 4, 4, 10, 10 },
1302    z = { 0, 5, 8, 13 , 30, 32, 35 }
1303    </para>
1304    </literal>
1305  </entry>
1306</row>
1307</tbody>
1308</tgroup>
1309</informaltable>
1310</para>
1311
1312<para>
1313where:
1314<informaltable pgwide="0">
1315<tgroup cols="2">
1316<tbody>
1317<row>
1318  <entry>
1319    <literal>phiStart</literal>
1320  </entry>
1321  <entry>
1322    Initial Phi starting angle
1323  </entry>
1324</row>
1325<row>
1326  <entry>
1327    <literal>phiTotal</literal>
1328  </entry>
1329  <entry>
1330    Total Phi angle
1331  </entry>
1332</row>
1333<row>
1334  <entry>
1335    <literal>numSide</literal>
1336  </entry>
1337  <entry>
1338    Number of sides
1339  </entry>
1340</row>
1341<row>
1342  <entry>
1343    <literal>numZPlanes</literal>
1344  </entry>
1345  <entry>
1346    Number of z planes
1347  </entry>
1348</row>
1349<row>
1350  <entry>
1351    <literal>numRZ</literal>
1352  </entry>
1353  <entry>
1354    Number of corners in r,z space
1355  </entry>
1356</row>
1357<row>
1358  <entry>
1359    zPlane
1360  </entry>
1361  <entry>
1362    Position of z planes
1363  </entry>
1364</row>
1365<row>
1366  <entry>
1367    <literal>rInner</literal>
1368  </entry>
1369  <entry>
1370    Tangent distance to inner surface
1371  </entry>
1372</row>
1373<row>
1374  <entry>
1375    rOuter
1376  </entry>
1377  <entry>
1378    Tangent distance to outer surface
1379  </entry>
1380</row>
1381<row>
1382  <entry>
1383    <literal>r</literal>
1384  </entry>
1385  <entry>
1386    r coordinate of corners
1387  </entry>
1388</row>
1389<row>
1390  <entry>
1391    <literal>z</literal>
1392  </entry>
1393  <entry>
1394    z coordinate of corners
1395  </entry>
1396</row>
1397</tbody>
1398</tgroup>
1399</informaltable>
1400</para>
1401
1402<!-- ******* Bridgehead ******* -->
1403<bridgehead renderas='sect4'>
1404Tube with an elliptical cross section:
1405</bridgehead>
1406
1407<para> 
1408A <emphasis role="bold">tube with an elliptical cross
1409section</emphasis> (ELTU) can be defined as follows:
1410
1411<informaltable frame="none" pgwide="0">
1412<tgroup cols="2" colsep="0">
1413<tbody>
1414<row>
1415  <entry valign="top" align="left">
1416    <informalexample>
1417    <programlisting> 
1418   G4EllipticalTube(const G4String&amp; pName,                   
1419                          G4double  Dx,
1420                          G4double  Dy,
1421                          G4double  Dz)
1422    </programlisting> 
1423    </informalexample>
1424
1425    The equation of the surface in x/y is <literal>1.0 = (x/dx)**2 +(y/dy)**2</literal>
1426  </entry>
1427  <entry valign="top" align="center">
1428    <mediaobject>
1429    <imageobject  role="fo">
1430      <imagedata fileref="./AllResources/Detector/geometry.src/aEllipticalTube.jpg"
1431                 format="JPG" contentwidth="3.5cm" />
1432    </imageobject>
1433    <imageobject  role="html">
1434      <imagedata fileref="./AllResources/Detector/geometry.src/aEllipticalTube.jpg"
1435                 format="JPG" />
1436    </imageobject>
1437    </mediaobject>
1438
1439    <?JavaScript pic12.html ?>
1440    <emphasis role="underline">In the picture</emphasis>:
1441    <literal>
1442    <para>
1443    Dx = 5, Dy = 10, Dz = 20
1444    </para>
1445    </literal>
1446  </entry>
1447</row>
1448</tbody>
1449</tgroup>
1450</informaltable>
1451</para>
1452
1453<para>
1454<informaltable pgwide="0">
1455<tgroup cols="6">
1456<tbody>
1457<row>
1458  <entry>
1459    Dx
1460  </entry>
1461  <entry>
1462    Half length X
1463  </entry>
1464  <entry>
1465    Dy
1466  </entry>
1467  <entry>
1468    Half length Y
1469  </entry>
1470  <entry>
1471    Dz
1472  </entry>
1473  <entry>
1474    Half length Z
1475  </entry>
1476</row>
1477</tbody>
1478</tgroup>
1479</informaltable>
1480</para>
1481   
1482<!-- ******* Bridgehead ******* -->
1483<bridgehead renderas='sect4'>
1484General Ellipsoid:
1485</bridgehead>
1486
1487<para> 
1488The general <emphasis role="bold">ellipsoid</emphasis> with
1489possible cut in <literal>Z</literal> can be defined as follows:
1490
1491<informaltable frame="none" pgwide="0">
1492<tgroup cols="2" colsep="0">
1493<tbody>
1494<row>
1495  <entry valign="top" align="left">
1496    <informalexample>
1497    <programlisting> 
1498   G4Ellipsoid(const G4String&amp; pName,                   
1499                     G4double  pxSemiAxis,
1500                     G4double  pySemiAxis,
1501                     G4double  pzSemiAxis,
1502                     G4double  pzBottomCut=0,
1503                     G4double  pzTopCut=0)
1504    </programlisting> 
1505    </informalexample>
1506  </entry>
1507  <entry valign="top" align="center">
1508    <mediaobject>
1509    <imageobject  role="fo">
1510      <imagedata fileref="./AllResources/Detector/geometry.src/aEllipsoid.jpg"
1511                 format="JPG" contentwidth="3.5cm" />
1512    </imageobject>
1513    <imageobject  role="html">
1514      <imagedata fileref="./AllResources/Detector/geometry.src/aEllipsoid.jpg"
1515                 format="JPG" />
1516    </imageobject>
1517    </mediaobject>
1518
1519    <?JavaScript pic13.html ?>
1520    <emphasis role="underline">In the picture</emphasis>:
1521    <literal>
1522    <para>
1523    pxSemiAxis = 10, pySemiAxis = 20, pzSemiAxis = 50,
1524    pzBottomCut = -10, pzTopCut = 40
1525    </para>
1526    </literal>
1527  </entry>
1528</row>
1529</tbody>
1530</tgroup>
1531</informaltable>
1532</para>
1533
1534<para>
1535A general (or triaxial) ellipsoid is a quadratic surface which is
1536given in Cartesian coordinates by:
1537
1538<informalexample>
1539<programlisting>
1540   1.0 = (x/pxSemiAxis)**2 + (y/pySemiAxis)**2 + (z/pzSemiAxis)**2
1541</programlisting>
1542</informalexample>
1543
1544where:
1545
1546<informaltable pgwide="0">
1547<tgroup cols="2">
1548<tbody>
1549<row>
1550  <entry>
1551    <literal>pxSemiAxis</literal>
1552  </entry>
1553  <entry>
1554    Semiaxis in X
1555  </entry>
1556</row>
1557<row>
1558  <entry>
1559    pySemiAxis
1560  </entry>
1561  <entry>
1562    Semiaxis in Y
1563  </entry>
1564</row>
1565<row>
1566  <entry>
1567    pzSemiAxis
1568  </entry>
1569  <entry>
1570    Semiaxis in Z
1571  </entry>
1572</row>
1573<row>
1574  <entry>
1575    pzBottomCut
1576  </entry>
1577  <entry>
1578    lower cut plane level, z
1579  </entry>
1580</row>
1581<row>
1582  <entry>
1583    pzTopCut
1584  </entry>
1585  <entry>
1586    upper cut plane level, z
1587  </entry>
1588</row>
1589</tbody>
1590</tgroup>
1591</informaltable>
1592</para>
1593   
1594<!-- ******* Bridgehead ******* -->
1595<bridgehead renderas='sect4'>
1596Cone with Elliptical Cross Section:
1597</bridgehead>
1598
1599<para> 
1600A <emphasis role="bold">cone with an elliptical cross section</emphasis> 
1601can be defined as follows:
1602
1603<informaltable frame="none" pgwide="0">
1604<tgroup cols="2" colsep="0">
1605<tbody>
1606<row>
1607  <entry valign="top" align="left">
1608    <informalexample>
1609    <programlisting> 
1610   G4EllipticalCone(const G4String&amp; pName,             
1611                          G4double  pxSemiAxis,
1612                          G4double  pySemiAxis,
1613                          G4double  zMax,
1614                          G4double  pzTopCut)
1615    </programlisting> 
1616    </informalexample>
1617  </entry>
1618  <entry valign="top" align="center">
1619    <mediaobject>
1620    <imageobject  role="fo">
1621      <imagedata fileref="./AllResources/Detector/geometry.src/aEllipticalCone.jpg"
1622                 format="JPG" contentwidth="3.5cm" />
1623    </imageobject>
1624    <imageobject  role="html">
1625      <imagedata fileref="./AllResources/Detector/geometry.src/aEllipticalCone.jpg"
1626                 format="JPG" />
1627    </imageobject>
1628    </mediaobject>
1629
1630    <?JavaScript pic14.html ?>
1631    <emphasis role="underline">In the picture</emphasis>:
1632    <literal>
1633    <para>
1634    pxSemiAxis = 30/75, pySemiAxis = 60/75, zMax = 50, pzTopCut = 25
1635    </para>
1636    </literal>
1637  </entry>
1638</row>
1639</tbody>
1640</tgroup>
1641</informaltable>
1642</para>
1643
1644<para>
1645where:
1646
1647<informaltable pgwide="0">
1648<tgroup cols="2">
1649<tbody>
1650<row>
1651  <entry>
1652    pxSemiAxis
1653  </entry>
1654  <entry>
1655    Semiaxis in X
1656  </entry>
1657</row>
1658<row>
1659  <entry>
1660    pySemiAxis
1661  </entry>
1662  <entry>
1663    Semiaxis in Y
1664  </entry>
1665</row>
1666<row>
1667  <entry>
1668    zMax
1669  </entry>
1670  <entry>
1671    Height of elliptical cone
1672  </entry>
1673</row>
1674<row>
1675  <entry>
1676    pzTopCut
1677  </entry>
1678  <entry>
1679    upper cut plane level
1680  </entry>
1681</row>
1682</tbody>
1683</tgroup>
1684</informaltable>
1685</para>
1686   
1687<para>
1688An elliptical cone of height <literal>zMax</literal>, semiaxis
1689<literal>pxSemiAxis</literal>, and semiaxis <literal>pySemiAxis</literal> 
1690is given by the parametric equations:
1691
1692<informalexample>
1693<programlisting> 
1694   x = pxSemiAxis * ( zMax - u ) / u * Cos(v)
1695   y = pySemiAxis * ( zMax - u ) / u * Sin(v)
1696   z = u
1697</programlisting>
1698</informalexample> 
1699
1700Where <literal>v</literal> is between <literal>0</literal> and
1701<literal>2*Pi</literal>, and
1702<literal>u</literal> between <literal>0</literal> and
1703<literal>h</literal> respectively.
1704</para>
1705
1706
1707<!-- ******* Bridgehead ******* -->
1708<bridgehead renderas='sect4'>
1709Paraboloid, a solid with parabolic profile:
1710</bridgehead>
1711
1712<para> 
1713A <emphasis role="bold">solid with parabolic profile</emphasis> and possible cuts along
1714the <literal>Z</literal> axis can be defined as follows:
1715
1716<informaltable frame="none" pgwide="0">
1717<tgroup cols="2" colsep="0">
1718<tbody>
1719<row>
1720  <entry valign="top" align="left">
1721    <informalexample>
1722    <programlisting> 
1723   G4Paraboloid(const G4String&amp; pName,                   
1724                     G4double  Dz,
1725                     G4double  R1,
1726                     G4double  R2)
1727    </programlisting> 
1728    </informalexample>
1729
1730    The equation for the solid is:
1731<informalexample>
1732<programlisting> 
1733   rho**2 &lt;= k1 * z + k2;
1734       -dz &lt;= z &lt;= dz
1735   r1**2 = k1 * (-dz) + k2
1736   r2**2 = k1 * ( dz) + k2
1737</programlisting>
1738</informalexample> 
1739
1740  </entry>
1741  <entry valign="top" align="center">
1742    <mediaobject>
1743    <imageobject  role="fo">
1744      <imagedata fileref="./AllResources/Detector/geometry.src/aParaboloid.jpg"
1745                 format="JPG" contentwidth="3.5cm" />
1746    </imageobject>
1747    <imageobject  role="html">
1748      <imagedata fileref="./AllResources/Detector/geometry.src/aParaboloid.jpg"
1749                 format="JPG" />
1750    </imageobject>
1751    </mediaobject>
1752
1753    <?JavaScript pic21.html ?>
1754    <emphasis role="underline">In the picture</emphasis>:
1755    <literal>
1756    <para>
1757    R1 = 20, R2 = 35, Dz = 20
1758    </para>
1759    </literal>
1760  </entry>
1761</row>
1762</tbody>
1763</tgroup>
1764</informaltable>
1765</para>
1766
1767<para>
1768<informaltable pgwide="0">
1769<tgroup cols="6">
1770<tbody>
1771<row>
1772  <entry>
1773    Dz
1774  </entry>
1775  <entry>
1776    Half length Z
1777  </entry>
1778  <entry>
1779    R1
1780  </entry>
1781  <entry>
1782    Radius at -Dz
1783  </entry>
1784  <entry>
1785    R2
1786  </entry>
1787  <entry>
1788    Radius at +Dz greater than R1
1789  </entry>
1790</row>
1791</tbody>
1792</tgroup>
1793</informaltable>
1794</para>
1795   
1796<!-- ******* Bridgehead ******* -->
1797<bridgehead renderas='sect4'>
1798Tube with Hyperbolic Profile:
1799</bridgehead>
1800
1801<para> 
1802A <emphasis role="bold">tube with a hyperbolic
1803profile</emphasis> (HYPE) can be defined as follows:
1804
1805<informaltable frame="none" pgwide="0">
1806<tgroup cols="2" colsep="0">
1807<tbody>
1808<row>
1809  <entry valign="top" align="left">
1810    <informalexample>
1811    <programlisting> 
1812   G4Hype(const G4String&amp; pName,                       
1813                G4double  innerRadius,
1814                G4double  outerRadius,
1815                G4double  innerStereo,
1816                G4double  outerStereo,
1817                G4double  halfLenZ)
1818    </programlisting> 
1819    </informalexample>
1820  </entry>
1821  <entry valign="top" align="center">
1822    <mediaobject>
1823    <imageobject  role="fo">
1824      <imagedata fileref="./AllResources/Detector/geometry.src/aHyperboloid.jpg"
1825                 format="JPG" contentwidth="3.5cm" />
1826    </imageobject>
1827    <imageobject  role="html">
1828      <imagedata fileref="./AllResources/Detector/geometry.src/aHyperboloid.jpg"
1829                 format="JPG" />
1830    </imageobject>
1831    </mediaobject>
1832
1833    <?JavaScript pic15.html ?>
1834    <emphasis role="underline">In the picture</emphasis>:
1835    <literal>
1836    <para>
1837    innerStereo = 0.7, outerStereo = 0.7,
1838    halfLenZ = 50,
1839    innerRadius = 20, outerRadius = 30
1840    </para>
1841    </literal>
1842  </entry>
1843</row>
1844</tbody>
1845</tgroup>
1846</informaltable>
1847</para>
1848
1849<para>
1850<literal>G4Hype</literal> is shaped with curved sides parallel to the
1851<literal>z</literal>-axis, has a specified half-length along the <literal>z</literal>
1852axis about which it is centred, and a given minimum and maximum
1853radius.
1854</para>
1855
1856<para>
1857A minimum radius of <literal>0</literal> defines a filled Hype (with
1858hyperbolic inner surface), i.e. inner radius = 0 AND inner stereo
1859angle = 0.
1860</para>
1861
1862<para>
1863The inner and outer hyperbolic surfaces can have different stereo
1864angles. A stereo angle of <literal>0</literal> gives a cylindrical
1865surface:
1866
1867<informaltable pgwide="0">
1868<tgroup cols="2">
1869<tbody>
1870<row>
1871  <entry>
1872    <literal>innerRadius</literal>
1873  </entry>
1874  <entry>
1875    Inner radius
1876  </entry>
1877</row>
1878<row>
1879  <entry>
1880    <literal>outerRadius</literal>
1881  </entry>
1882  <entry>
1883    Outer radius
1884  </entry>
1885</row>
1886<row>
1887  <entry>
1888    <literal>innerStereo</literal>
1889  </entry>
1890  <entry>
1891    Inner stereo angle in radians
1892  </entry>
1893</row>
1894<row>
1895  <entry>
1896    <literal>outerStereo</literal>
1897  </entry>
1898  <entry>
1899    Outer stereo angle in radians
1900  </entry>
1901</row>
1902<row>
1903  <entry>
1904    <literal>halfLenZ</literal>
1905  </entry>
1906  <entry>
1907    Half length in Z
1908  </entry>
1909</row>
1910</tbody>
1911</tgroup>
1912</informaltable>
1913</para>
1914   
1915
1916<!-- ******* Bridgehead ******* -->
1917<bridgehead renderas='sect4'>
1918Tetrahedra:
1919</bridgehead>
1920
1921<para> 
1922A <emphasis role="bold">tetrahedra</emphasis> solid can be
1923defined as follows:
1924
1925<informaltable frame="none" pgwide="0">
1926<tgroup cols="2" colsep="0">
1927<tbody>
1928<row>
1929  <entry valign="top" align="left">
1930    <informalexample>
1931    <programlisting> 
1932   G4Tet(const G4String&amp; pName,                         
1933               G4ThreeVector  anchor,
1934               G4ThreeVector  p2,
1935               G4ThreeVector  p3,
1936               G4ThreeVector  p4,
1937               G4bool         *degeneracyFlag=0)
1938    </programlisting> 
1939    </informalexample>
1940  </entry>
1941  <entry valign="top" align="center">
1942    <mediaobject>
1943    <imageobject  role="fo">
1944      <imagedata fileref="./AllResources/Detector/geometry.src/aTet.jpg"
1945                 format="JPG" contentwidth="3.5cm" />
1946    </imageobject>
1947    <imageobject  role="html">
1948      <imagedata fileref="./AllResources/Detector/geometry.src/aTet.jpg"
1949                 format="JPG" />
1950    </imageobject>
1951    </mediaobject>
1952
1953    <?JavaScript pic16.html ?>
1954    <emphasis role="underline">In the picture</emphasis>:
1955    <literal>
1956    <para>
1957    anchor = {0, 0, sqrt(3)},
1958    p2 = { 0, 2*sqrt(2/3), -1/sqrt(3) },
1959    p3 = { -sqrt(2), -sqrt(2/3),-1/sqrt(3) },
1960    p4 = { sqrt(2), -sqrt(2/3) , -1/sqrt(3) }
1961    </para>
1962    </literal>
1963  </entry>
1964</row>
1965</tbody>
1966</tgroup>
1967</informaltable>
1968</para>
1969
1970<para>
1971The solid is defined by 4 points in space:
1972
1973<informaltable pgwide="0">
1974<tgroup cols="2">
1975<tbody>
1976<row>
1977  <entry>
1978    <literal>anchor</literal>
1979  </entry>
1980  <entry>
1981    Anchor point
1982  </entry>
1983</row>
1984<row>
1985  <entry>
1986    <literal>p2</literal>
1987  </entry>
1988  <entry>
1989    Point 2
1990  </entry>
1991</row>
1992<row>
1993  <entry>
1994    <literal>p3</literal>
1995  </entry>
1996  <entry>
1997    Point 3
1998  </entry>
1999</row>
2000<row>
2001  <entry>
2002    <literal>p4</literal>
2003  </entry>
2004  <entry>
2005    Point 4
2006  </entry>
2007</row>
2008<row>
2009  <entry>
2010    degeneracyFlag
2011  </entry>
2012  <entry>
2013    Flag indicating degeneracy of points
2014  </entry>
2015</row>
2016<row>
2017  <entry>
2018   
2019  </entry>
2020  <entry>
2021   
2022  </entry>
2023</row>
2024</tbody>
2025</tgroup>
2026</informaltable>
2027</para>
2028
2029
2030<!-- ******* Bridgehead ******* -->
2031<bridgehead renderas='sect4'>
2032Extruded Polygon:
2033</bridgehead>
2034
2035<para>
2036The extrusion of an arbitrary polygon
2037(<emphasis role="bold">extruded solid</emphasis>) with fixed outline
2038in the defined <literal>Z</literal> sections can be defined as follows
2039(in a general way, or as special construct with two <literal>Z</literal>
2040sections):
2041
2042<informaltable frame="none" pgwide="0">
2043<tgroup cols="2" colsep="0">
2044<tbody>
2045<row>
2046  <entry valign="top" align="left">
2047    <informalexample>
2048    <programlisting> 
2049   G4ExtrudedSolid(const G4String&amp;                pName,
2050                         std::vector&lt;G4TwoVector&gt; polygon,
2051                         std::vector&lt;ZSection&gt;    zsections)
2052
2053   G4ExtrudedSolid(const G4String&amp;                pName,
2054                         std::vector&lt;G4TwoVector&gt; polygon,
2055                         G4double                 hz,
2056                         G4TwoVector off1, G4double scale1,
2057                         G4TwoVector off2, G4double scale2)
2058    </programlisting> 
2059    </informalexample>
2060  </entry>
2061  <entry valign="top" align="center">
2062    <mediaobject>
2063    <imageobject  role="fo">
2064      <imagedata fileref="./AllResources/Detector/geometry.src/aExtrudedSolid.jpg"
2065                 format="JPG" contentwidth="3.5cm" />
2066    </imageobject>
2067    <imageobject  role="html">
2068      <imagedata fileref="./AllResources/Detector/geometry.src/aExtrudedSolid.jpg"
2069                 format="JPG" />
2070    </imageobject>
2071    </mediaobject>
2072
2073    <?JavaScript pic22.html ?>
2074    <emphasis role="underline">In the picture</emphasis>:
2075    <literal>
2076    <para>
2077    poligon = {-30,-30},{-30,30},{30,30},{30,-30},
2078              {15,-30},{15,15},{-15,15},{-15,-30}</para>
2079    <para>
2080    zsections = [-60,{0,30},0.8], [-15, {0,-30},1.],
2081                [10,{0,0},0.6], [60,{0,30},1.2]</para>
2082    </literal>
2083  </entry>
2084</row>
2085</tbody>
2086</tgroup>
2087</informaltable>
2088</para>
2089
2090<para>
2091The z-sides of the solid are the scaled versions of the same polygon.
2092
2093<informaltable pgwide="0">
2094<tgroup cols="2">
2095<tbody>
2096<row>
2097  <entry>
2098    <literal>polygon</literal>
2099  </entry>
2100  <entry>
2101    the vertices of the outlined polygon defined in clock-wise order
2102  </entry>
2103</row>
2104<row>
2105  <entry>
2106    <literal>zsections</literal>
2107  </entry>
2108  <entry>
2109     the z-sections defined by z position in increasing order
2110  </entry>
2111</row>
2112<row>
2113  <entry>
2114    <literal>hz</literal>
2115  </entry>
2116  <entry>
2117    Half length in Z
2118  </entry>
2119</row>
2120<row>
2121  <entry>
2122    <literal>off1, off2</literal>
2123  </entry>
2124  <entry>
2125    Offset of the side in -hz and +hz respectively
2126  </entry>
2127</row>
2128<row>
2129  <entry>
2130    <literal>scale1, scale2</literal>
2131  </entry>
2132  <entry>
2133    Scale of the side in -hz and +hz respectively
2134  </entry>
2135</row>
2136</tbody>
2137</tgroup>
2138</informaltable>
2139</para>
2140
2141
2142<!-- ******* Bridgehead ******* -->
2143<bridgehead renderas='sect4'>
2144Box Twisted:
2145</bridgehead>
2146
2147<para> 
2148A <emphasis role="bold">box twisted</emphasis> along one axis
2149can be defined as follows:
2150
2151<informaltable frame="none" pgwide="0">
2152<tgroup cols="2" colsep="0">
2153<tbody>
2154<row>
2155  <entry valign="top" align="left">
2156    <informalexample>
2157    <programlisting> 
2158   G4TwistedBox(const G4String&amp; pName,                 
2159                      G4double  twistedangle,
2160                      G4double  pDx,
2161                      G4double  pDy,
2162                      G4double  pDz)
2163    </programlisting> 
2164    </informalexample>
2165  </entry>
2166  <entry valign="top" align="center">
2167    <mediaobject>
2168    <imageobject  role="fo">
2169      <imagedata fileref="./AllResources/Detector/geometry.src/aTwistedBox.jpg"
2170                 format="JPG" contentwidth="3.5cm" />
2171    </imageobject>
2172    <imageobject  role="html">
2173      <imagedata fileref="./AllResources/Detector/geometry.src/aTwistedBox.jpg"
2174                 format="JPG" />
2175    </imageobject>
2176    </mediaobject>
2177
2178    <?JavaScript pic17.html ?>
2179    <emphasis role="underline">In the picture</emphasis>:
2180    <literal>
2181    <para>
2182    twistedangle = 30*Degree, pDx = 30, pDy =40, pDz = 60
2183    </para>
2184    </literal>
2185  </entry>
2186</row>
2187</tbody>
2188</tgroup>
2189</informaltable>
2190</para>
2191
2192<para>
2193<literal>G4TwistedBox</literal> is a box twisted along the z-axis. The
2194twist angle cannot be greater than 90 degrees:
2195
2196<informaltable pgwide="0">
2197<tgroup cols="2">
2198<tbody>
2199<row>
2200  <entry>
2201    <literal>twistedangle</literal>
2202  </entry>
2203  <entry>
2204    Twist angle
2205  </entry>
2206</row>
2207<row>
2208  <entry>
2209    <literal>pDx</literal>
2210  </entry>
2211  <entry>
2212    Half x length
2213  </entry>
2214</row>
2215<row>
2216  <entry>
2217    <literal>pDy</literal>
2218  </entry>
2219  <entry>
2220    Half y length
2221  </entry>
2222</row>
2223<row>
2224  <entry>
2225    <literal>pDz</literal>
2226  </entry>
2227  <entry>
2228    Half z length
2229  </entry>
2230</row>
2231</tbody>
2232</tgroup>
2233</informaltable>
2234</para>
2235   
2236
2237<!-- ******* Bridgehead ******* -->
2238<bridgehead renderas='sect4'>
2239Trapezoid Twisted along One Axis:
2240</bridgehead>
2241
2242<para> 
2243<emphasis>trapezoid twisted</emphasis> along one axis can be defined as
2244follows:
2245
2246<informaltable frame="none" pgwide="0">
2247<tgroup cols="2" colsep="0">
2248<tbody>
2249<row>
2250  <entry valign="top" align="left">
2251    <informalexample>
2252    <programlisting> 
2253   G4TwistedTrap(const G4String&amp; pName,                 
2254                       G4double  twistedangle,
2255                       G4double  pDxx1,
2256                       G4double  pDxx2,
2257                       G4double  pDy,
2258                       G4double   pDz)
2259 
2260   G4TwistedTrap(const G4String&amp; pName,
2261                       G4double  twistedangle,
2262                       G4double  pDz,
2263                       G4double  pTheta,
2264                       G4double  pPhi,
2265                       G4double  pDy1,
2266                       G4double  pDx1,
2267                       G4double  pDx2,
2268                       G4double  pDy2,
2269                       G4double  pDx3,
2270                       G4double  pDx4,
2271                       G4double  pAlph)
2272    </programlisting> 
2273    </informalexample>
2274  </entry>
2275  <entry valign="top" align="center">
2276    <mediaobject>
2277    <imageobject  role="fo">
2278      <imagedata fileref="./AllResources/Detector/geometry.src/aTwistedTrap.jpg"
2279                 format="JPG" contentwidth="3.5cm" />
2280    </imageobject>
2281    <imageobject  role="html">
2282      <imagedata fileref="./AllResources/Detector/geometry.src/aTwistedTrap.jpg"
2283                 format="JPG" />
2284    </imageobject>
2285    </mediaobject>
2286
2287    <?JavaScript pic18.html ?>
2288    <emphasis role="underline">In the picture</emphasis>:
2289    <literal>
2290    <para>
2291    pDx1 = 30, pDx2 = 40, pDy1 = 40,
2292    pDx3 = 10, pDx4 = 14, pDy2 = 16,
2293    pDz = 60,
2294    pTheta = 20*Degree, pDphi = 5*Degree,
2295    pAlph = 10*Degree, twistedangle = 30*Degree
2296    </para>
2297    </literal>
2298  </entry>
2299</row>
2300</tbody>
2301</tgroup>
2302</informaltable>
2303</para>
2304
2305<para>
2306The first constructor of <literal>G4TwistedTrap</literal> produces a
2307regular trapezoid twisted along the <literal>z</literal>-axis, where the caps
2308of the trapezoid are of the same shape and size.
2309</para>
2310
2311<para>
2312The second constructor produces a generic trapezoid with polar,
2313azimuthal and tilt angles.
2314</para>
2315
2316<para>
2317The twist angle cannot be greater than 90 degrees:
2318
2319<informaltable pgwide="0">
2320<tgroup cols="2">
2321<tbody>
2322<row>
2323  <entry>
2324    <literal>twistedangle</literal>
2325  </entry>
2326  <entry>
2327    Twisted angle
2328  </entry>
2329</row>
2330<row>
2331  <entry>
2332    <literal>pDx1</literal>
2333  </entry>
2334  <entry>
2335    Half x length at y=-pDy
2336  </entry>
2337</row>
2338<row>
2339  <entry>
2340    <literal>pDx2</literal>
2341  </entry>
2342  <entry>
2343    Half x length at y=+pDy
2344  </entry>
2345</row>
2346<row>
2347  <entry>
2348    <literal>pDy</literal>
2349  </entry>
2350  <entry>
2351    Half y length
2352  </entry>
2353</row>
2354<row>
2355  <entry>
2356    <literal>pDz</literal>
2357  </entry>
2358  <entry>
2359    Half z length
2360  </entry>
2361</row>
2362<row>
2363  <entry>
2364    <literal>pTheta</literal>
2365  </entry>
2366  <entry>
2367    Polar angle of the line joining the centres of the faces at -/+pDz
2368  </entry>
2369</row>
2370<row>
2371  <entry>
2372    <literal>pDy1</literal>
2373  </entry>
2374  <entry>
2375    Half y length at -pDz
2376  </entry>
2377</row>
2378<row>
2379  <entry>
2380    <literal>pDx1</literal>
2381  </entry>
2382  <entry>
2383    Half x length at -pDz, y=-pDy1
2384  </entry>
2385</row>
2386<row>
2387  <entry>
2388    <literal>pDx2</literal>
2389  </entry>
2390  <entry>
2391    Half x length at -pDz, y=+pDy1
2392  </entry>
2393</row>
2394<row>
2395  <entry>
2396    <literal>pDy2</literal>
2397  </entry>
2398  <entry>
2399    Half y length at +pDz
2400
2401  </entry>
2402</row>
2403<row>
2404  <entry>
2405    <literal>pDx3</literal>
2406  </entry>
2407  <entry>
2408    Half x length at +pDz, y=-pDy2
2409  </entry>
2410</row>
2411<row>
2412  <entry>
2413    <literal>pDx4</literal>
2414  </entry>
2415  <entry>
2416    Half x length at +pDz, y=+pDy2
2417  </entry>
2418</row>
2419<row>
2420  <entry>
2421    <literal>pAlph</literal>
2422  </entry>
2423  <entry>
2424    Angle with respect to the y axis from the centre of the side
2425  </entry>
2426</row>
2427</tbody>
2428</tgroup>
2429</informaltable>
2430</para>
2431
2432<!-- ******* Bridgehead ******* -->
2433<bridgehead renderas='sect4'>
2434Twisted Trapezoid with <literal>x</literal> and <literal>y</literal> dimensions
2435varying along <literal>z</literal>:
2436</bridgehead>
2437
2438<para> 
2439A <emphasis role="bold">twisted trapezoid</emphasis> with the
2440<literal>x</literal> and <literal>y</literal> dimensions
2441<emphasis role="bold">varying along <literal>z</literal></emphasis> can be
2442defined as follows:
2443
2444<informaltable frame="none" pgwide="0">
2445<tgroup cols="2" colsep="0">
2446<tbody>
2447<row>
2448  <entry valign="top" align="left">
2449    <informalexample>
2450    <programlisting> 
2451   G4TwistedTrd(const G4String&amp; pName,                 
2452                      G4double  pDx1,
2453                      G4double  pDx2,
2454                      G4double  pDy1,
2455                      G4double  pDy2,
2456                      G4double  pDz,
2457                      G4double  twistedangle)
2458    </programlisting> 
2459    </informalexample>
2460  </entry>
2461  <entry valign="top" align="center">
2462    <mediaobject>
2463    <imageobject  role="fo">
2464      <imagedata fileref="./AllResources/Detector/geometry.src/aTwistedTrd.jpg"
2465                 format="JPG" contentwidth="3.5cm" />
2466    </imageobject>
2467    <imageobject  role="html">
2468      <imagedata fileref="./AllResources/Detector/geometry.src/aTwistedTrd.jpg"
2469                 format="JPG" />
2470    </imageobject>
2471    </mediaobject>
2472
2473    <?JavaScript pic19.html ?>
2474    <emphasis role="underline">In the picture</emphasis>:
2475    <literal>
2476    <para>
2477    dx1 = 30, dx2 = 10,
2478    dy1 = 40, dy2 = 15,
2479    dz = 60, twistedangle = 30*Degree
2480    </para>
2481    </literal>
2482  </entry>
2483</row>
2484</tbody>
2485</tgroup>
2486</informaltable>
2487</para>
2488
2489<para>
2490where:
2491<informaltable pgwide="0">
2492<tgroup cols="2">
2493<tbody>
2494<row>
2495  <entry>
2496    <literal>pDx1</literal>
2497  </entry>
2498  <entry>
2499    Half x length at the surface positioned at -dz
2500  </entry>
2501</row>
2502<row>
2503  <entry>
2504    <literal>pDx2</literal>
2505  </entry>
2506  <entry>
2507    Half x length at the surface positioned at +dz
2508  </entry>
2509</row>
2510<row>
2511  <entry>
2512    <literal>pDy1</literal>
2513  </entry>
2514  <entry>
2515    Half y length at the surface positioned at -dz
2516  </entry>
2517</row>
2518<row>
2519  <entry>
2520    <literal>pDy2</literal>
2521  </entry>
2522  <entry>
2523    Half y length at the surface positioned at +dz
2524  </entry>
2525</row>
2526<row>
2527  <entry>
2528    <literal>pDz</literal>
2529  </entry>
2530  <entry>
2531    Half z length
2532  </entry>
2533</row>
2534<row>
2535  <entry>
2536    <literal>twistedangle</literal>
2537  </entry>
2538  <entry>
2539    Twisted angle
2540  </entry>
2541</row>
2542</tbody>
2543</tgroup>
2544</informaltable>
2545</para>
2546   
2547<!-- ******* Bridgehead ******* -->
2548<bridgehead renderas='sect4'>
2549Tube Section Twisted along Its Axis:
2550</bridgehead>
2551
2552<para> 
2553A <emphasis role="bold">tube section twisted</emphasis> along
2554its axis can be defined as follows:
2555
2556<informaltable frame="none" pgwide="0">
2557<tgroup cols="2" colsep="0">
2558<tbody>
2559<row>
2560  <entry valign="top" align="left">
2561    <informalexample>
2562    <programlisting> 
2563   G4TwistedTubs(const G4String&amp; pName,                 
2564                       G4double  twistedangle,
2565                       G4double  endinnerrad,
2566                       G4double  endouterrad,
2567                       G4double  halfzlen,
2568                       G4double  dphi)
2569    </programlisting> 
2570    </informalexample>
2571  </entry>
2572  <entry valign="top" align="center">
2573    <mediaobject>
2574    <imageobject  role="fo">
2575      <imagedata fileref="./AllResources/Detector/geometry.src/aTwistedTubs.jpg"
2576                 format="JPG" contentwidth="3.5cm" />
2577    </imageobject>
2578    <imageobject  role="html">
2579      <imagedata fileref="./AllResources/Detector/geometry.src/aTwistedTubs.jpg"
2580                 format="JPG" />
2581    </imageobject>
2582    </mediaobject>
2583
2584    <?JavaScript pic20.html ?>
2585    <emphasis role="underline">In the picture</emphasis>:
2586    <literal>
2587    <para>
2588    endinnerrad = 10, endouterrad = 15,
2589    halfzlen = 20, dphi = 90*Degree,
2590    twistedangle = 60*Degree
2591    </para>
2592    </literal>
2593  </entry>
2594</row>
2595</tbody>
2596</tgroup>
2597</informaltable>
2598</para>
2599
2600<para>
2601<literal>G4TwistedTubs</literal> is a sort of twisted cylinder which,
2602placed along the <literal>z</literal>-axis and divided into
2603<literal>phi</literal>-segments is shaped like an hyperboloid, where each of
2604its segmented pieces can be tilted with a stereo angle.
2605</para>
2606
2607<para>
2608It can have inner and outer surfaces with the same stereo angle:
2609<informaltable pgwide="0">
2610<tgroup cols="2">
2611<tbody>
2612<row>
2613  <entry>
2614    <literal>twistedangle</literal>
2615  </entry>
2616  <entry>
2617    Twisted angle
2618  </entry>
2619</row>
2620<row>
2621  <entry>
2622    <literal>endinnerrad</literal>
2623  </entry>
2624  <entry>
2625    Inner radius at endcap
2626  </entry>
2627</row>
2628<row>
2629  <entry>
2630    <literal>endouterrad</literal>
2631  </entry>
2632  <entry>
2633    Outer radius at endcap
2634  </entry>
2635</row>
2636<row>
2637  <entry>
2638    <literal>halfzlen</literal>
2639  </entry>
2640  <entry>
2641    Half z length
2642  </entry>
2643</row>
2644<row>
2645  <entry>
2646    <literal>dphi</literal>
2647  </entry>
2648  <entry>
2649    Phi angle of a segment
2650  </entry>
2651</row>
2652</tbody>
2653</tgroup>
2654</informaltable>
2655</para>
2656   
2657<para>
2658Additional constructors are provided, allowing the shape to be
2659specified either as:
2660
2661<itemizedlist spacing="compact">
2662  <listitem><para>
2663    the number of segments in <literal>phi</literal> and the total angle for
2664    all segments, or
2665  </para></listitem>
2666  <listitem><para>
2667    a combination of the above constructors providing instead the
2668    inner and outer radii at <literal>z=0</literal> with different
2669    <literal>z</literal>-lengths along negative and positive
2670    <literal>z</literal>-axis.
2671  </para></listitem>
2672</itemizedlist>
2673</para>
2674
2675</sect3>
2676
2677
2678<!-- ******************* Section (Level#3) ****************** -->
2679<sect3 id="sect.Geom.Solids.BoolOp">
2680<title>
2681Solids made by Boolean operations
2682</title>
2683
2684<para>
2685Simple solids can be combined using Boolean operations. For
2686example, a cylinder and a half-sphere can be combined with the
2687union Boolean operation.
2688</para>
2689
2690<para>
2691Creating such a new <emphasis>Boolean</emphasis> solid, requires:
2692
2693<itemizedlist spacing="compact">
2694  <listitem><para>
2695    Two solids
2696  </para></listitem>
2697  <listitem><para>
2698    A Boolean operation: union, intersection or subtraction.
2699  </para></listitem>
2700  <listitem><para>
2701    Optionally a transformation for the second solid.
2702  </para></listitem>
2703</itemizedlist>
2704</para>
2705
2706<para>
2707The solids used should be either CSG solids (for examples a box,
2708a spherical shell, or a tube) or another Boolean solid: the product
2709of a previous Boolean operation. An important purpose of Boolean
2710solids is to allow the description of solids with peculiar shapes
2711in a simple and intuitive way, still allowing an efficient
2712geometrical navigation inside them.
2713</para>
2714
2715<note><title></title>
2716<para>
2717The solids used can actually be of any type. However, in
2718order to fully support the export of a Geant4 solid model via STEP
2719to CAD systems, we restrict the use of Boolean operations to this
2720subset of solids. But this subset contains all the most interesting
2721use cases.
2722</para>
2723</note>
2724
2725<note><title></title>
2726<para>
2727The constituent solids of a Boolean operation should possibly
2728<emphasis>avoid</emphasis> be composed by sharing all or part of
2729their surfaces. This precaution is necessary in order to avoid the
2730generation of 'fake' surfaces due to precision loss, or errors in
2731the final visualization of the Boolean shape. Moreover, the final
2732Boolean solid should represent a single 'closed' solid, i.e. a Boolean
2733operation between two solids which are disjoint or far apart each
2734other, is <emphasis>not</emphasis> a valid Boolean composition.
2735</para>
2736</note>
2737
2738<note><title></title>
2739<para>
2740The tracking cost for navigating in a Boolean solid in the
2741current implementation, is proportional to the number of
2742constituent solids. So care must be taken to avoid extensive,
2743unecessary use of Boolean solids in performance-critical areas of a
2744geometry description, where each solid is created from Boolean
2745combinations of many other solids.
2746</para>
2747</note>
2748
2749<para>
2750Examples of the creation of the simplest Boolean solids are
2751given below:
2752
2753<informalexample>
2754<programlisting>
2755  G4Box*  box =
2756    new G4Box("Box",20*mm,30*mm,40*mm);
2757  G4Tubs* cyl =
2758    new G4Tubs("Cylinder",0,50*mm,50*mm,0,twopi);  // r:     0 mm -&gt; 50 mm
2759                                                   // z:   -50 mm -&gt; 50 mm
2760                                                   // phi:   0 -&gt;  2 pi
2761  G4UnionSolid* union =
2762    new G4UnionSolid("Box+Cylinder", box, cyl);
2763  G4IntersectionSolid* intersection =
2764    new G4IntersectionSolid("Box*Cylinder", box, cyl);
2765  G4SubtractionSolid* subtraction =
2766    new G4SubtractionSolid("Box-Cylinder", box, cyl);
2767 </programlisting>
2768</informalexample>
2769
2770where the union, intersection and subtraction of a box and cylinder
2771are constructed.
2772</para>
2773
2774<para>
2775The more useful case where one of the solids is displaced from
2776the origin of coordinates also exists. In this case the second
2777solid is positioned relative to the coordinate system (and thus
2778relative to the first). This can be done in two ways:
2779
2780<itemizedlist spacing="compact">
2781  <listitem><para>
2782    Either by giving a rotation matrix and translation vector that
2783    are used to transform the coordinate system of the second solid to
2784    the coordinate system of the first solid. This is called the
2785    <emphasis>passive</emphasis> method.
2786  </para></listitem>
2787  <listitem><para>
2788    Or by creating a transformation that moves the second solid
2789    from its desired position to its standard position, e.g., a box's
2790    standard position is with its centre at the origin and sides
2791    parallel to the three axes. This is called the
2792    <emphasis>active</emphasis> method.
2793  </para></listitem>
2794</itemizedlist>
2795</para>
2796
2797<para>
2798In the first case, the translation is applied first to move the
2799origin of coordinates. Then the rotation is used to rotate the
2800coordinate system of the second solid to the coordinate system of
2801the first.
2802
2803<informalexample>
2804<programlisting>
2805    G4RotationMatrix* yRot = new G4RotationMatrix;  // Rotates X and Z axes only
2806    yRot-&gt;rotateY(M_PI/4.*rad);                     // Rotates 45 degrees
2807    G4ThreeVector zTrans(0, 0, 50);
2808
2809    G4UnionSolid* unionMoved =
2810      new G4UnionSolid("Box+CylinderMoved", box, cyl, yRot, zTrans);
2811    //
2812    // The new coordinate system of the cylinder is translated so that
2813    // its centre is at +50 on the original Z axis, and it is rotated
2814    // with its X axis halfway between the original X and Z axes.
2815
2816    // Now we build the same solid using the alternative method
2817    //
2818    G4RotationMatrix invRot = *(yRot-&gt;invert());
2819    G4Transform3D transform(invRot, zTrans); 
2820    G4UnionSolid* unionMoved =
2821      new G4UnionSolid("Box+CylinderMoved", box, cyl, transform);
2822</programlisting>
2823</informalexample>
2824</para>
2825
2826<para>
2827Note that the first constructor that takes a pointer to the
2828rotation-matrix (<literal>G4RotationMatrix*</literal>), does NOT copy it.
2829Therefore once used a rotation-matrix to construct a Boolean solid,
2830it must NOT be modified.
2831</para>
2832
2833<para>
2834In contrast, with the alternative method shown, a
2835<literal>G4Transform3D</literal> is provided to the constructor by value, and
2836its transformation is stored by the Boolean solid. The user may
2837modify the <literal>G4Transform3D</literal> and eventually use it again.
2838</para>
2839
2840<para>
2841When positioning a volume associated to a Boolean solid, the
2842relative center of coordinates considered for the positioning is
2843the one related to the <emphasis>first</emphasis> of the two constituent
2844solids.
2845</para>
2846
2847</sect3>
2848
2849
2850<!-- ******************* Section (Level#3) ****************** -->
2851<sect3 id="sect.Geom.Solids.BREPS">
2852<title>
2853Boundary Represented (BREPS) Solids
2854</title>
2855
2856<para>
2857BREP solids are defined via the description of their boundaries.
2858The boundaries can be made of planar and second order surfaces.
2859Eventually these can be trimmed and have holes. The resulting
2860solids, such as polygonal, polyconical solids are known as
2861Elementary BREPS.
2862</para>
2863
2864<para>
2865In addition, the boundary surfaces can be made of Bezier
2866surfaces and B-Splines, or of NURBS
2867(Non-Uniform-Rational-B-Splines) surfaces. The resulting solids are
2868Advanced BREPS.
2869</para>
2870
2871<para>
2872
2873<note><title></title>
2874<para>
2875Currently, the implementation for surfaces
2876generated by Beziers, B-Splines or NURBS is only at the level of
2877prototype and not fully functional.
2878</para>
2879
2880<para>
2881Extensions in this area are foreseen in future.
2882</para>
2883</note>
2884
2885<para>
2886A few elementary BREPS are provided in the BREPS module as
2887examples on how to assemble a BREP shap; these can be
2888instantiated in the same manner as for the Constructed
2889Solids (CSGs).
2890We summarize their capabilities in the following section.
2891</para>
2892
2893<para>
2894Most BREPS Solids are however defined by creating each surface
2895separately and tying them together.
2896</para>
2897
2898<!-- ******* Bridgehead ******* -->
2899<bridgehead renderas='sect4'>
2900Specific BREP Solids:
2901</bridgehead>
2902
2903<para>
2904We have defined one polygonal and one polyconical shape using
2905BREPS. The polycone provides a shape defined by a series of conical
2906sections with the same axis, contiguous along it.
2907</para>
2908
2909<para>
2910The polyconical solid <literal>G4BREPSolidPCone</literal> is a shape
2911defined by a set of inner and outer conical or cylindrical surface
2912sections and two planes perpendicular to the Z axis. Each conical
2913surface is defined by its radius at two different planes
2914perpendicular to the Z-axis. Inner and outer conical surfaces are
2915defined using common Z planes.
2916</para>
2917
2918<informalexample>
2919<programlisting> 
2920  G4BREPSolidPCone( const G4String&amp; pName,
2921                          G4double  start_angle,
2922                          G4double  opening_angle,                   
2923                          G4int     num_z_planes,    // sections,
2924                          G4double  z_start,                   
2925                    const G4double  z_values[],
2926                    const G4double  RMIN[],
2927                    const G4double  RMAX[]  )
2928</programlisting>
2929</informalexample> 
2930
2931<para>
2932The conical sections do not need to fill 360 degrees, but can have
2933a common start and opening angle.
2934</para>
2935
2936<informaltable pgwide="0">
2937<tgroup cols="2">
2938<tbody>
2939<row>
2940  <entry>
2941    <literal>start_angle</literal>
2942  </entry>
2943  <entry>
2944    starting angle
2945  </entry>
2946</row>
2947<row>
2948  <entry>
2949    <literal>opening_angle</literal>
2950  </entry>
2951  <entry>
2952    opening angle
2953  </entry>
2954</row>
2955<row>
2956  <entry>
2957    <literal>num_z_planes</literal>
2958  </entry>
2959  <entry>
2960    number of planes perpendicular to the z-axis used.
2961  </entry>
2962</row>
2963<row>
2964  <entry>
2965    <literal>z_start</literal>
2966  </entry>
2967  <entry>
2968    starting value of z
2969  </entry>
2970</row>
2971<row>
2972  <entry>
2973    <literal>z_values</literal>
2974  </entry>
2975  <entry>
2976    z coordinates of each plane
2977  </entry>
2978</row>
2979<row>
2980  <entry>
2981    <literal>RMIN</literal>
2982  </entry>
2983  <entry>
2984    radius of inner cone at each plane
2985  </entry>
2986</row>
2987<row>
2988  <entry>
2989    <literal>RMAX</literal>
2990  </entry>
2991  <entry>
2992    radius of outer cone at each plane
2993  </entry>
2994</row>
2995</tbody>
2996</tgroup>
2997</informaltable>
2998</para>
2999   
3000<para>
3001The polygonal solid <literal>G4BREPSolidPolyhedra</literal> is a shape
3002defined by an inner and outer polygonal surface and two planes
3003perpendicular to the Z axis. Each polygonal surface is created by
3004linking a series of polygons created at different planes
3005perpendicular to the Z-axis. All these polygons all have the same
3006number of sides (<literal>sides</literal>) and are defined at the same Z
3007planes for both inner and outer polygonal surfaces.
3008</para>
3009
3010<para>
3011The polygons do not need to fill 360 degrees, but have a start
3012and opening angle.
3013</para>
3014
3015<para>
3016The constructor takes the following parameters:
3017
3018<informalexample>
3019<programlisting> 
3020  G4BREPSolidPolyhedra( const G4String&amp; pName,
3021                              G4double  start_angle,
3022                              G4double  opening_angle,
3023                              G4int     sides,
3024                              G4int     num_z_planes,     
3025                              G4double  z_start,
3026                        const G4double  z_values[],
3027                        const G4double  RMIN[],
3028                        const G4double  RMAX[]  )
3029</programlisting>
3030</informalexample> 
3031
3032which in addition to its name have the following meaning:
3033
3034<informaltable pgwide="0">
3035<tgroup cols="2">
3036<tbody>
3037<row>
3038  <entry>
3039    <literal>start_angle</literal>
3040  </entry>
3041  <entry>
3042    starting angle
3043  </entry>
3044</row>
3045<row>
3046  <entry>
3047    <literal>opening_angle</literal>
3048  </entry>
3049  <entry>
3050    opening angle
3051  </entry>
3052</row>
3053<row>
3054  <entry>
3055    <literal>sides</literal>
3056  </entry>
3057  <entry>
3058    number of sides of each polygon in the x-y plane
3059  </entry>
3060</row>
3061<row>
3062  <entry>
3063    <literal>num_z_planes</literal>
3064  </entry>
3065  <entry>
3066    number of planes perpendicular to the z-axis used.
3067  </entry>
3068</row>
3069<row>
3070  <entry>
3071    <literal>z_start</literal>
3072  </entry>
3073  <entry>
3074    starting value of z
3075  </entry>
3076</row>
3077<row>
3078  <entry>
3079    <literal>z_values</literal>
3080  </entry>
3081  <entry>
3082    z coordinates of each plane
3083  </entry>
3084</row>
3085<row>
3086  <entry>
3087    <literal>RMIN</literal>
3088  </entry>
3089  <entry>
3090    radius of inner polygon at each corner
3091  </entry>
3092</row>
3093<row>
3094  <entry>
3095    <literal>RMAX</literal>
3096  </entry>
3097  <entry>
3098    radius of outer polygon at each corner
3099  </entry>
3100</row>
3101</tbody>
3102</tgroup>
3103</informaltable>
3104   
3105the shape is defined by the number of sides <literal>sides</literal> of
3106the polygon in the plane perpendicular to the z-axis.
3107</para>
3108
3109</sect3>
3110
3111
3112<!-- ******************* Section (Level#3) ****************** -->
3113<sect3 id="sect.Geom.Solids.Tessel">
3114<title>
3115Tessellated Solids
3116</title>
3117
3118<para>
3119In Geant4 it is also implemented a class
3120<literal>G4TessellatedSolid</literal> which can be used to generate a generic
3121solid defined by a number of facets (<literal>G4VFacet</literal>). Such
3122constructs are especially important for conversion of complex
3123geometrical shapes imported from CAD systems bounded with generic
3124surfaces into an approximate description with facets of defined
3125dimension (see <xref linkend="fig.Geom.Solid_1" />).
3126
3127<figure id="fig.Geom.Solid_1">
3128<title>
3129  Example of geometries imported from CAD system and converted to
3130  tessellated solids.
3131</title>
3132
3133<mediaobject>
3134  <imageobject role="fo">
3135    <imagedata fileref="./AllResources/Detector/geometry.src/cad-tess-combined.jpg" 
3136               format="JPG" width="12.0cm" align="center" />
3137  </imageobject>
3138  <imageobject role="html">
3139    <imagedata fileref="./AllResources/Detector/geometry.src/cad-tess-combined.jpg" 
3140               format="JPG" align="center" />
3141  </imageobject>
3142</mediaobject>
3143</figure>
3144</para>
3145
3146<para>
3147They can also be used to generate a solid bounded with a generic
3148surface made of planar facets. It is important that the supplied
3149facets shall form a fully enclose space to represent the solid.
3150</para>
3151
3152<para>
3153Two types of facet can be used for the construction of a
3154<literal>G4TessellatedSolid</literal>: a triangular facet
3155(<literal>G4TriangularFacet</literal>) and a quadrangular facet
3156(<literal>G4QuadrangularFacet</literal>).
3157</para>
3158
3159<para>
3160An example on how to generate a simple tessellated shape is
3161given below.
3162
3163<example id="programlist_Geom_1">
3164<title>
3165An example of a simple tessellated solid with
3166<literal>G4TessellatedSolid</literal>.
3167</title>
3168
3169<programlisting>
3170        // First declare a tessellated solid
3171        //
3172        G4TessellatedSolid solidTarget = new G4TessellatedSolid("Solid_name");
3173
3174        // Define the facets which form the solid
3175        //
3176        G4double targetSize = 10*cm ;
3177        G4TriangularFacet *facet1 = new
3178        G4TriangularFacet (G4ThreeVector(-targetSize,-targetSize,        0.0),
3179                           G4ThreeVector(+targetSize,-targetSize,        0.0),
3180                           G4ThreeVector(        0.0,        0.0,+targetSize),
3181                           ABSOLUTE);
3182        G4TriangularFacet *facet2 = new
3183        G4TriangularFacet (G4ThreeVector(+targetSize,-targetSize,        0.0),
3184                           G4ThreeVector(+targetSize,+targetSize,        0.0),
3185                           G4ThreeVector(        0.0,        0.0,+targetSize),
3186                           ABSOLUTE);
3187        G4TriangularFacet *facet3 = new
3188        G4TriangularFacet (G4ThreeVector(+targetSize,+targetSize,        0.0),
3189                           G4ThreeVector(-targetSize,+targetSize,        0.0),
3190                           G4ThreeVector(        0.0,        0.0,+targetSize),
3191                           ABSOLUTE);
3192        G4TriangularFacet *facet4 = new
3193        G4TriangularFacet (G4ThreeVector(-targetSize,+targetSize,        0.0),
3194                           G4ThreeVector(-targetSize,-targetSize,        0.0),
3195                           G4ThreeVector(        0.0,        0.0,+targetSize),
3196                           ABSOLUTE);
3197        G4QuadrangularFacet *facet5 = new
3198        G4QuadrangularFacet (G4ThreeVector(-targetSize,-targetSize,        0.0),
3199                             G4ThreeVector(-targetSize,+targetSize,        0.0),
3200                             G4ThreeVector(+targetSize,+targetSize,        0.0),
3201                             G4ThreeVector(+targetSize,-targetSize,        0.0),
3202                             ABSOLUTE);
3203
3204        // Now add the facets to the solid
3205        //
3206        solidTarget-&gt;AddFacet((G4VFacet*) facet1);
3207        solidTarget-&gt;AddFacet((G4VFacet*) facet2);
3208        solidTarget-&gt;AddFacet((G4VFacet*) facet3);
3209        solidTarget-&gt;AddFacet((G4VFacet*) facet4);
3210        solidTarget-&gt;AddFacet((G4VFacet*) facet5);
3211
3212        Finally declare the solid is complete
3213        //
3214        solidTarget-&gt;SetSolidClosed(true);
3215</programlisting>
3216</example>
3217</para>
3218
3219<para>
3220The <literal>G4TriangularFacet</literal> class is used for the contruction
3221of <literal>G4TessellatedSolid</literal>. It is defined by three vertices,
3222which shall be supplied in <emphasis>anti-clockwise order</emphasis> looking from
3223the outside of the solid where it belongs. Its constructor looks
3224like:
3225
3226<informalexample>
3227<programlisting>
3228        G4TriangularFacet ( const G4ThreeVector     Pt0,
3229                            const G4ThreeVector     vt1,
3230                            const G4ThreeVector     vt2,
3231                                  G4FacetVertexType fType )
3232</programlisting>
3233</informalexample> 
3234
3235i.e., it takes 4 parameters to define the three vertices:
3236
3237<informaltable pgwide="0">
3238<tgroup cols="2">
3239<tbody>
3240<row>
3241  <entry>
3242    <literal>G4FacetVertexType</literal>
3243  </entry>
3244  <entry>
3245    <literal>ABSOLUTE</literal> in which case <literal>Pt0</literal>,
3246    <literal>vt1</literal> and <literal>vt2</literal> 
3247    are the three vertices in anti-clockwise order looking from the outside.
3248  </entry>
3249</row>
3250<row>
3251  <entry>
3252    <literal>G4FacetVertexType</literal>
3253  </entry>
3254  <entry>
3255    <literal>RELATIVE</literal> in which case the first vertex is
3256    <literal>Pt0</literal>, the second vertex is <literal>Pt0+vt1</literal> and
3257    the third vertex is <literal>Pt0+vt2</literal>, all in anti-clockwise order
3258    when looking from the outside.
3259</entry>
3260</row>
3261</tbody>
3262</tgroup>
3263</informaltable>
3264</para>
3265
3266<para>
3267The <literal>G4QuadrangularFacet</literal> class can be used for the
3268contruction of <literal>G4TessellatedSolid</literal> as well. It is defined
3269by four vertices, which shall be in the same plane and be supplied
3270in <emphasis>anti-clockwise order</emphasis> looking from the outside of the
3271solid where it belongs. Its constructor looks like:
3272
3273<informalexample>
3274<programlisting>
3275        G4QuadrangularFacet ( const G4ThreeVector     Pt0,
3276                              const G4ThreeVector     vt1,
3277                              const G4ThreeVector     vt2,
3278                              const G4ThreeVector     vt3,
3279                                    G4FacetVertexType fType )
3280</programlisting>
3281</informalexample>
3282
3283i.e., it takes 5 parameters to define the four vertices:
3284
3285<informaltable pgwide="0">
3286<tgroup cols="2">
3287<tbody>
3288<row>
3289  <entry>
3290    <literal>G4FacetVertexType</literal>
3291  </entry>
3292  <entry>
3293    <literal>ABSOLUTE</literal> in which case <literal>Pt0</literal>,
3294    <literal>vt1</literal>, <literal>vt2</literal> and <literal>vt3</literal> 
3295    are the four vertices required in anti-clockwise order when looking
3296    from the outside.
3297  </entry>
3298</row>
3299<row>
3300  <entry>
3301    <literal>G4FacetVertexType</literal>
3302  </entry>
3303  <entry>
3304    <literal>RELATIVE</literal> in which case the first vertex is
3305    <literal>Pt0</literal>, the second vertex is <literal>Pt0+vt</literal>,
3306    the third vertex is <literal>Pt0+vt2</literal> and the fourth vertex is
3307    <literal>Pt0+vt3</literal>, in anti-clockwise order when looking from the
3308    outside.
3309  </entry>
3310</row>
3311</tbody>
3312</tgroup>
3313</informaltable>
3314</para>
3315
3316<!-- ******* Bridgehead ******* -->
3317<bridgehead renderas='sect4'>
3318Importing CAD models as tessellated shapes
3319</bridgehead>
3320
3321<para>
3322Tessellated solids can also be used to import geometrical models from CAD
3323systems (see <xref linkend="fig.Geom.Solid_1" />). In order to do this, it
3324is required to convert first the CAD shapes into tessellated surfaces. A
3325way to do this is to save the shapes in the geometrical model as STEP files
3326and convert them to tessellated (faceted surfaces) solids, using a tool which
3327allows such conversion. At the time of writing, at least two tools are
3328available for such purpose:
3329<ulink url="http://www.steptools.com/products/stviewer/">STViewer</ulink>
3330(part of the STEP-Tools development suite) or
3331<ulink url="http://www.trad.fr/en/">FASTRAD</ulink>.
3332This strategy allows to import any shape with some degree of approximation;
3333the converted CAD models can then be imported through
3334<ulink url="http://cern.ch/gdml/">GDML (Geometry Description
3335Markup Language)</ulink> into Geant4 and be represented as
3336<literal>G4TessellatedSolid</literal> shapes.
3337</para>
3338
3339</sect3>
3340</sect2>
Note: See TracBrowser for help on using the repository browser.