SubtractionSolid of G4Tubs from G4Box

Hi, I am noticing odd visualisation behaviour with:

/vis/viewer/set/style s
/vis/viewer/set/hiddenEdge 0

when you subtract a G4Tubs from a G4Box, when their depths are the same (i.e. square subtracting a cylinder). When this happens you can still see a surface that remains on the box. On the other hand, when the depth of the cylinder is > the depth of the box it is fully removed and this is shown in visualisation. I don’t think this quirky behaviour affects the simulation as I have tried using:

/vis/viewer/set/style cloud

and it appears that there the cylindrical hole is present. I was just wondering why this may be occurring.

_Geant4 Version:_geant4-11-00-patch-02
_Operating System:_macOS Monterey 12.7.4
_Compiler/Version:_GNU Make 4.4
_CMake Version:_3.22.5


Hi Edward

Always glad to get user feedback about visualisation!

Yes, it does not affect tracking.

But the issue is, the G4Tubs and G4Box are the same depth. There remains a very thin “skin” where the surfaces are identical. Make the subtractor (G4Tubs) deeper. The result, logically and for tracking, is the same. In any case, we advise not to have identical surfaces for Boolean operations - it gives the BooleanProcessor (for visualisation) a headache.

What, exactly is your use case? Do you want to put something in the hole? Could you not simply place the G4Tubs as a daughter of the G4Box? (Actually, then, they would have to be the same depth and you would get the same visualisation artifact.) But it could be more efficient for tracking.

John