Message: Problem with G4ExtrudedSolid and G4SubtractionSolid Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question Problem with G4ExtrudedSolid and G4SubtractionSolid 

Forum: Geometry
Date: 25 Nov, 2010
From: Emanuele Leonardi <Emanuele Leonardi>

I am having a problem with the creation of a simple G4ExtrudedSolid on which I want to drill a hole.

After defining the G4ExtrudedSolid (two identical parallel surfaces shaped as a C), I create a G4Tubs for the hole and then define a G4SubtractionSolid which removes the hole from the G4ExtrudedSolid.

While both the extruded solid and the hole look OK at inspection, and the positioning is correct, when I start the simulation (see below for the code) I get the message

  BooleanProcessor: corrapted input polyhedron

Where is the problem with this setup?

I am using G4 v.9.3.p02 on 32bit and 64bit Scientific Linux CERN 5 machines.

Thank you, Emanuele Leonardi

This is the code I use (tested inside standard example N02 for simplicity):

  //------------------------------ 
  // C-Shape
  //------------------------------ 

  // Create extruded solid for main c-shape
  G4int nCVtx = 8;
  std::vector<G4TwoVector> cvtx(nCVtx);
  cvtx[0] = G4TwoVector( 45.0*mm,  0.0*mm);
  cvtx[1] = G4TwoVector( 45.0*mm, 25.0*mm);
  cvtx[2] = G4TwoVector( 37.0*mm, 25.0*mm);
  cvtx[3] = G4TwoVector( 37.0*mm, 10.0*mm);
  cvtx[4] = G4TwoVector(-37.0*mm, 10.0*mm);
  cvtx[5] = G4TwoVector(-37.0*mm, 25.0*mm);
  cvtx[6] = G4TwoVector(-45.0*mm, 25.0*mm);
  cvtx[7] = G4TwoVector(-45.0*mm,  0.0*mm);
  G4double cshHalfHeight = 35.0*mm;
  G4ExtrudedSolid* cShapeFullS =
    new G4ExtrudedSolid("CShapeFull",cvtx,cshHalfHeight,G4TwoVector(0.,0.),1.,G4TwoVector(0.,0.),1.);

  // Create tubs solid for hole
  G4double cshHoleRadius = 10.0*mm;
  G4double cshHoleHalfHeight = 0.5*fabs(cvtx[3].y()-cvtx[0].y());
  G4Tubs* cShapeHoleS =
    new G4Tubs("CShapeHole",0.,cshHoleRadius,cshHoleHalfHeight,0.,2.*M_PI*rad);

  // Subtract hole from c-shape
  G4RotationMatrix* rotHole = new G4RotationMatrix;
  rotHole->rotateX(90.*deg);
  G4ThreeVector transHole = G4ThreeVector(0.,cshHoleHalfHeight,0.); // Hole is at center of C-Shape's back face
  G4SubtractionSolid* cShapeS =
    new G4SubtractionSolid("CShape",cShapeFullS,cShapeHoleS,rotHole,transHole);

  // Create and position final c-shape logical volume
  G4LogicalVolume* cShapeLV = new G4LogicalVolume(cShapeS,Pb,"CShape",0,0,0);
  new G4PVPlacement(0,0,cShapeLV,"CShape",logicWorld,false,0);

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

1 None: Re: Problem with G4ExtrudedSolid and G4SubtractionSolid   (Vladimir Grichine - 25 Nov, 2010)
2 None: Re: Problem with G4ExtrudedSolid and G4SubtractionSolid   (John Allison - 25 Nov, 2010)
1 None: Re: Problem with G4ExtrudedSolid and G4SubtractionSolid   (John Allison - 26 Nov, 2010)
 Add Message Add Message
to: "Problem with G4ExtrudedSolid and G4SubtractionSolid"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]