source: trunk/source/geometry/solids/specific/test/README_TessellatedSolid@ 1350

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

update to last version 4.9.4

File size: 4.7 KB
RevLine 
[1350]1The following classes (.hh. icc and .cc) are related to the tessellated solid:
2
3 G4PolyhedronArbitrary
4 G4QuadrangularFacet
5 G4TessellatedSolid
6 G4TriangularFacet
7 G4VFacet
8
9
10
11How to contruct a G4TessellatedSolid
12
13 G4TessellatedSolid is a special Geant4 Solid defined by a number of
14 G4VFacet.It is important that the supplied facets shall form a fully
15 enclose space which is the solid.
16 At the moment only two types of facet can be used for the construction of
17 a G4TessellatedSolid, i.e. the G4TriangularFacet and G4QuadrangularFacet.
18
19 Example:
20
21 .....
22 First declare a tessellated solid
23 G4TessellatedSolid solidTarget = new G4TessellatedSolid("Solid_name");
24 Define the facets which form the solid
25
26 G4double targetSiz = 10*cm ;
27 G4TriangularFacet *facet1 = new
28 G4TriangularFacet (G4ThreeVector(-targetSize,-targetSize, 0.0),
29 G4ThreeVector(+targetSize,-targetSize, 0.0),
30 G4ThreeVector( 0.0, 0.0,+targetSize),
31 ABSOLUTE);
32 G4TriangularFacet *facet2 = new
33 G4TriangularFacet (G4ThreeVector(+targetSize,-targetSize, 0.0),
34 G4ThreeVector(+targetSize,+targetSize, 0.0),
35 G4ThreeVector( 0.0, 0.0,+targetSize),
36 ABSOLUTE);
37 G4TriangularFacet *facet3 = new
38 G4TriangularFacet (G4ThreeVector(+targetSize,+targetSize, 0.0),
39 G4ThreeVector(-targetSize,+targetSize, 0.0),
40 G4ThreeVector( 0.0, 0.0,+targetSize),
41 ABSOLUTE);
42 G4TriangularFacet *facet4 = new
43 G4TriangularFacet (G4ThreeVector(-targetSize,+targetSize, 0.0),
44 G4ThreeVector(-targetSize,-targetSize, 0.0),
45 G4ThreeVector( 0.0, 0.0,+targetSize),
46 ABSOLUTE);
47 G4QuadrangularFacet *facet5 = new
48 G4QuadrangularFacet (G4ThreeVector(-targetSize,-targetSize, 0.0),
49 G4ThreeVector(-targetSize,+targetSize, 0.0),
50 G4ThreeVector(+targetSize,+targetSize, 0.0),
51 G4ThreeVector(+targetSize,-targetSize, 0.0),
52 ABSOLUTE);
53 Noew add the facets to the solid
54 solidTarget->AddFacet((G4VFacet*) facet1);
55 solidTarget->AddFacet((G4VFacet*) facet2);
56 solidTarget->AddFacet((G4VFacet*) facet3);
57 solidTarget->AddFacet((G4VFacet*) facet4);
58 solidTarget->AddFacet((G4VFacet*) facet5);
59 Finally declare the solid is complete
60 solidTarget->SetSolidClosed(true);
61
62 ...............
63
64How to construct G4TriangularFacet:
65
66 The G4TriangularFacet class is used for the contruction of G4TessellatedSolid.
67 It is defined by three vertices, which shall be supplied
68 in anti-clockwise order looking from the outsider of the solid where
69 it belongs.Its constructor
70
71 G4TriangularFacet (const G4ThreeVector Pt0, const G4ThreeVector vt1,
72 const G4ThreeVector vt2, G4FacetVertexType);
73
74 takes 4 parameters to define the three vertices:
75 1) G4FacetvertexType = "ABSOLUTE": in this case Pt0, vt1 and vt2 are
76 the three vertices in anti-clockwise order looking from the outsider.
77 2) G4FacetvertexType = "RELATIVE": in this case the first vertex is Pt0,
78 the second vertex is Pt0+vt1 and the third vertex is Pt0+vt2, all
79 in anti-clockwise order when looking from the outsider.
80
81How to construct G4QuadrangularFacet
82
83 The G4QuadrangularFacet class is used for the contruction of G4TessellatedSolid.
84 It is defined by four vertices, which shall be in the same plane and be supplied
85 in anti-clockwise order looking from the outsider of the solid where
86 it belongs. Its constructor
87
88 G4QuadrangularFacet (const G4ThreeVector Pt0, const G4ThreeVector vt1,
89 const G4ThreeVector vt2, const G4ThreeVector vt3, G4FacetVertexType);
90
91 takes 5 parameters to define the four vertices
92:
93 1) G4FacetvertexType = "ABSOLUTE": in this case Pt0, vt1, vt2 and vt3 are
94 the four vertices required in anti-clockwise order when looking from
95 the outsider.
96 2) G4FacetvertexType = "RELATIVE": in this case the first vertex is Pt0,
97 the second vertex is Pt0+vt, the third vertex is Pt0+vt2 and
98 the fourth vertex is Pt0+vt3, in anti-clockwise order when looking
99 from the outsider.
Note: See TracBrowser for help on using the repository browser.