G4SubtractionSolid Not Working

Hi!

I’m trying to implement a subtraction solid for the first time. I’m trying with the below code but the expected subtraction is not working, is there something clearly wrong with the code that I am misunderstanding?

  G4Box * BoxTest = new G4Box("TestBox", 10*cm, 10*cm, 2*cm);
    G4Box * Hole = new G4Box("BoxHole", 5*cm, 5*cm, 2*cm);
    
    G4SubtractionSolid* Holey = new G4SubtractionSolid("Holey",
                                   BoxTest,
                                   Hole,
                                   0,
                                   G4ThreeVector(0 *cm,0 *cm, 0*cm));
    
    G4LogicalVolume* logicHoley = new G4LogicalVolume(Holey, Steel,
                                  "logicHoley",
                                  0, 0, 0);

    HoleyPhysical = new G4PVPlacement(0,    //rotation
                                                                    G4ThreeVector(0,0,-10*cm), //location
                                                                    logicHoley, //logic volume
                                                                    "HoleyPhys", //name
                                                                    worldLogic, //mother volume
                                                                    false,
                                                                    0, //copy number
                                                                    true); //check overlaps

Thank you!

Nevermind fixed it - I think it was just the hole thickness matching the material thickness meant the hole was not a ‘hole’ all the way through!

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