Creating a G4UnionSolid with 10 different components

I am trying to make a volume using mulitple individual parts (3 cylindrical rods and 7 circular rings). I know I can put 2 parts together using G4UnionSolid but I am not sure how to place all 7 rings and the 3 rods in the parameters of G4UnionSolid class.

Hello,

Combine part 1 and part 2 to part “A”.
Combine part A and part 3 to part “B”.
Combine part B and part 4 to part “C”.
… and so on …

As far as i know G4UnionSolid can only take two parts to combine.

Regards
Max

That’s what I thought. But I wondered if there is a smart way of doing it

Take a look at G4MultiUnion.hh. It let’s you supply a whole list of solids which all get unioned together in one step. That avoids the significant performance loss from cascaded boolean solids.

1 Like