Polyhedra
A polyhedra can be constructed using C++ or some simple text:
:volu method1 POLYHEDRA
0 270 // start phi, dphi in degree
5 3 // # of sides, # of z planes
-20 2 10 // z0, R0in, R0out,
0 3 8 // z1, R1in, R1out,
20 5 10 // ...
G4_AIR // material
:volu method2 POLYHEDRA
0 270 // start phi, dphi in degree
5 6 // # of sides, # of rz points
2 -20 // r0, z0,
10 -20 // r1, z1,
8 0 // ...
10 20
5 20
3 0
G4_AIR // material
The full source code is in detector.tg, which can be visualized using the macro file mingle.mac or gears.mac, assuming an universal Geant4 application, such as MinGLE or GEARS, is available:
git clone https://github.com/jintonic/geant4
cd geant4/detector/CSG/polyhedra
# generate animated picture, polyhedra.gif
G4VIS_DEFAULT_DRIVER=TSG_FILE gears gears.mac