Trapezoid with Rectangular Bases
A trapezoid that has 2 rectangular bases on the top and bottom as shown in the right figure can be constructed using C++ or some simple text:
:volu wedge TRD
30 // half x in mm @-z/2
10 // half x in mm @ z/2
45 // half y in mm @-z/2
15 // half y in mm @ z/2
60 // half z in mm
G4_Pb // 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/trd
# generate animated picture, trd.gif
G4VIS_DEFAULT_DRIVER=TSG_FILE gears gears.mac