Getting a cross section view of geometry?

Hi everyone,

Is it possible to get the half section view of detector geometry in geant4, that is visualising the detector geometry cut at plane ?
Like in the image https://www.researchgate.net/profile/G-Lichti/publication/241418151/figure/fig1/AS:298603202531328@1448203959066/Cross-section-view-of-the-GEANT4-NaI-detector-model_W640.jpg

One brute force way is to probably just render the geometry with half dimensions when constructing solid volumes but I was wondering of there is more efficient feature for that?

Thanks a lot!

Have a look at the /vis/viewer commands - use help or ls. Or look on the Guide under Built-in Commands. There are commands for cutaway and section. Even /vis/drawVolume has some options. Even better, you can get interactive cutaways with Vtk if you can build Geant4 with that.

1 Like

Thanks a lot for your solution!

Could you export your detector as a gdml file?

We have a FreeCAD GDML workbench that you could view, manipulate, create sections through, export as a STEP file ( Basically all CAD programs can read a STEP file)

see GitHub - KeithSloan/GDML: FreeCAD GDML Workbench - AddonManager Installable

Zheng Lei (realthunder) has a experimental developmental version of FreeCAD and this has a feature to dynamically show cross sections. I have not tested it for a while as the place where workbenches are stored diverged between his and the main FreeCAD code. He has not updated his version for some time as he is heavily involved in have a number of the experimental features he developed incorporated into the main FreeCAD code. https://www.patreon.com/posts/2023-01-14-77257673

1 Like

Thanks a lot !
I’ll try that and share how it goes.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.