|
1 | 1 | #!/usr/bin/env python3 |
2 | | - |
3 | | -# gemc api |
4 | 2 | from gconfiguration import autogeometry |
5 | | - |
6 | | -# build_geometry is in geometry.py |
7 | | -from geometry import build_geometry |
| 3 | +from gvolume import GVolume |
8 | 4 |
|
9 | 5 | cfg = autogeometry("examples", "b1") |
10 | | -build_geometry(cfg) |
11 | 6 |
|
| 7 | +gvolume = GVolume('root') |
| 8 | +gvolume.description = 'World' |
| 9 | +gvolume.make_box(1.2*100.0, 1.2*100.0, 1.2*150.0) |
| 10 | +gvolume.material = 'G4_AIR' |
| 11 | +gvolume.color = '889922' |
| 12 | +gvolume.style = 0 |
| 13 | +gvolume.publish(cfg) |
| 14 | + |
| 15 | +gvolume = GVolume('Envelope') |
| 16 | +gvolume.description = 'B1 Envelope' |
| 17 | +gvolume.make_box(100.0, 100.0, 150.0) |
| 18 | +gvolume.material = 'G4_WATER' |
| 19 | +gvolume.color = 'turquoise' |
| 20 | +gvolume.style = 0 |
| 21 | +gvolume.publish(cfg) |
| 22 | + |
| 23 | +shape1_rmina = 0.0 |
| 24 | +shape1_rmaxa = 20.0 |
| 25 | +shape1_rminb = 0.0 |
| 26 | +shape1_rmaxb = 40.0 |
| 27 | +shape1_hz = 30.0 |
| 28 | +shape1_phimin = 0.0 |
| 29 | +shape1_phimax = 360.0 |
| 30 | + |
| 31 | +gvolume = GVolume('Shape1') |
| 32 | +gvolume.mother = 'Envelope' |
| 33 | +gvolume.description = 'B1 Shape1' |
| 34 | +gvolume.make_cons(shape1_rmina, shape1_rmaxa, shape1_rminb, shape1_rmaxb, shape1_hz, shape1_phimin, shape1_phimax) |
| 35 | +gvolume.material = 'G4_A-150_TISSUE' |
| 36 | +gvolume.color = 'pink' |
| 37 | +gvolume.set_position(0, 20, -70) |
| 38 | +gvolume.publish(cfg) |
| 39 | + |
| 40 | +shape2_dxa = 120 |
| 41 | +shape2_dxb = 120 |
| 42 | +shape2_dya = 100 |
| 43 | +shape2_dyb = 160 |
| 44 | +shape2_dz = 60 |
| 45 | + |
| 46 | +gvolume = GVolume('Shape2') |
| 47 | +gvolume.mother = 'Envelope' |
| 48 | +gvolume.description = 'B1 Shape2' |
| 49 | +gvolume.make_trapezoid(shape2_dxa * 0.5, shape2_dxb * 0.5, shape2_dya * 0.5, shape2_dyb * 0.5, shape2_dz * 0.5) |
| 50 | +gvolume.material = 'G4_BONE_COMPACT_ICRU' |
| 51 | +gvolume.color = 'lightgray' |
| 52 | +gvolume.set_position(0, -10, 70) |
| 53 | +gvolume.digitization = 'dosimeter' # collects edep, dose |
| 54 | +gvolume.set_identifier('mydosimeter', 1) |
| 55 | +gvolume.opacity = 0.1 |
| 56 | +gvolume.publish(cfg) |
0 commit comments