I have an issue pertaining to visualisation. I am new to Geant4 and so am looking for some advice as to what I should do. I wanted to construct a hollow “square-ring” in geometry. Initially I was looking at Boolean objects however in Boolean operation - subtract volumes, it is mentioned that a better system for tracking would be to place a box with a different material (like the world material) as the daughter volume of the outer box.
The implementation of this works well and even looks ok in wireframe, but this is not the case in solid view as the outer box’s colour inteferes with the inner box’s colour causing wierd artefacts. Is it possible to remove these artefacts in any way and make the inner box appear as its own colour without overlap from the outer one? Both boxes have the exact same thickiness but the outer box is wider than the inner one.
The transparency actually seems to solve the issue completely! Thank you so much for the help.
I realise that Boolean objects work for this case, but I found the daughter volume case was much easier to track in code which is quite helpful as I am still learning (I have made this as an example but in the actual case, I have multiple boxes within each other).
Lastly, for the G4Polyhedra case, I had noticed you had mentioned this in the linked forum post. However, I was not able to understand how to implement it. Would you be able to provide an example of such (or maybe link to an existing one?). It would be really helpful as there are certain usecases where I might prefer to use that instead.
G4Polyhedra is a body constructed by discrete rotation of a polygon around Z axis. If the polygon is a rectangle, and the rotation is done in 4 steps by 90 degrees, then the result will be a box with a hole, like yours:
Thank you so much for taking the time to help with the example. It really helps a lot! I don’t think performance has been an issue for me so far but it is definitely nice to know for the future. I was initially thinking about using Method 2 but found Method 1 just much nicer to implement.