Sergio, this is still an open question to me as well when I am trying to represent an arbitrary geometry of materials. More in general, I am still looking for a way to import, e.g. survey or topographic maps
For “simple” cases I hacked my way through using data cards which I can easily modify/script and then read into Geant4. Since - in my case - we are not necessarily talking about combinations of cubes, trapezoids and other basic 3D shapes, I ended up using extruded volumes. In this way I can generate a 2.5D geometry, which is often good enough in my case since my problem is usually “infinite” along at least one axis, but with more work this could be made fully 3D.
So my approach is somewhere between approach 1) and 5). It seems to work however, it turns out that preparing the input data cards can be quite some work (which I still do “by hand”)
I hope the snapshot below of my data card is useful. This is building two trapezoids stacked onto each other but the approach is more general. You can PM if you want more details. Note this is my very first c++ project so when I say “hack” I really mean it… I have yet to learn about GDML and I hope to find an entry level but hands-on tutorial.
