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

None Re: Problem with G4ExtrudedSolid and G4SubtractionSolid 

Forum: Geometry
Re: Question Problem with G4ExtrudedSolid and G4SubtractionSolid (Emanuele Leonardi)
Date: 25 Nov, 2010
From: John Allison <John Allison>

On Thu, 25 Nov 2010 12:52:43 GMT, Emanuele Leonardi wrote:

> BooleanProcessor: corrapted input polyhedron

This is just from the visualisation system. It does not necessarily mean that there is any problem in the tracking.

The problem is shared surfaces. This does not matter for tracking - the transportation process can handle it - but for visualisation there are problems. See comments below...

> 
>   //------------------------------ 
>   // 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());

There is always a logical problem if the subtracting solid shares a surface with the subtractee. Logically, it does not matter if the subtracting solid is larger, e.g.,

> G4double cshHoleHalfHeight = 0.5*fabs(cvtx[3].y()-cvtx[0].y()) + 1.*um;

This avoids shared surfaces. Please try it.

>   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   (John Allison - 26 Nov, 2010)
 Add Message Add Message
to: "Re: 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 ]