|Message: Problem with G4ExtrudedSolid and G4SubtractionSolid||Not Logged In (login)|
Click on the Forum title, e.g. on the "Forums by Category" page, to read a sequence of postings to the Forum and its threads all in one page. If you are only interested in one thread or the thread following a specific posting, click the thread or the posting, which takes you to a smaller page, which contains only the part you are interested in and may be easier to navigate.
Messages are "chained" if there are only replies at the first level, i.e. 1/1.html, 1/1/1.html etc. In case of "chained" messages the message number is replaced by the icon and there is no indentation.
Inline: Display the subject line only or also the text of the posting(s); for the choice "All" the "Outline" choices are switched off.
|1||0||1||no text / full text of posting|
|2||1||All||text for level 1 only / text for All postings|
Outline: Choose the depth of the posting thread, successive toggle controls provide increasing detail.
|1||2||1||2 levels / 1 level (original posting)|
|2||3||2||3 levels / 2 levels|
|3||3||All||3 levels / all levels (all postings)|
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 = G4TwoVector( 45.0*mm, 0.0*mm); cvtx = G4TwoVector( 45.0*mm, 25.0*mm); cvtx = G4TwoVector( 37.0*mm, 25.0*mm); cvtx = G4TwoVector( 37.0*mm, 10.0*mm); cvtx = G4TwoVector(-37.0*mm, 10.0*mm); cvtx = G4TwoVector(-37.0*mm, 25.0*mm); cvtx = G4TwoVector(-45.0*mm, 25.0*mm); cvtx = 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.y()-cvtx.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:||Outline Depth:||Add message:|