Message: Complex volume creation Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Complex volume creation 

Keywords: union volume
Forum: Geometry
Date: 15 Nov, 2006
From: Frédéric Guillaume <Frédéric Guillaume>

Hi,

I want to create a quite complex volume exactly as in the hadrontherapy example (file "HadrontherapyModulator.cc"; image available here: http://www.ge.infn.it/geant4/examples/hadrontherapy/images/modulator.jpg). I would like to treat it as a whole volume and not having a volume for each subcomponent... For that purpose i tried to use the union boolean operation in order to obtain one quarter of the modulator... But i found out that i could not visualize the results because of opengl issues... The volume definition seems correct (it works for 3 subvolumes but with more opengl make some "infinte loop" or "too small contours" errors that have already been discussed in previous threads...

Here is my quarter volume definition:

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
 void ProtonDetectorConstruction::ConstructHelice(G4LogicalVolume* VolumeMereLog)
 { 

  G4double innerRadius = 0.*mm;
  G4double rayon=20*mm;
  G4double epaisseur=0.4*mm;
  G4double angleZero=0.;
  G4double angle=0.;
  G4int pas;

  G4double xPosition = 0.*mm;
  G4double yPosition = 0.*mm; 
  G4double zPosition = 50.*mm;

  G4RotationMatrix* rot = new G4RotationMatrix();
 //  rot -> rotateZ(90.*deg);
  G4ThreeVector translation(0,0,0);

  pas=8;
  angle=7.498*deg;
  G4Tubs* pas8 = new G4Tubs("pas8", innerRadius, rayon, epaisseur*pas, angleZero, angle);

  pas=7;
  angle+=7.101*deg;
  G4Tubs* pas7 = new G4Tubs("pas7", innerRadius, rayon, epaisseur*pas, angleZero, angle);

  rot -> rotateZ((7.101/2.)*deg);
  G4UnionSolid* helice = new G4UnionSolid ("Helice", pas8, pas7, rot, translation);

  pas=6;
  angle+=7.092*deg;
  G4Tubs* pas6 = new G4Tubs("pas6", innerRadius, rayon, epaisseur*pas, angleZero, angle);

  rot -> rotateZ((7.092/2.)*deg);
  helice = new G4UnionSolid ("Helice", helice, pas6, rot, translation);

  pas=5;
  angle+=7.144*deg;
  G4Tubs* pas5 = new G4Tubs("pas5", innerRadius, rayon, epaisseur*pas, angleZero, angle);

  rot -> rotateZ((7.144/2.)*deg);
  helice = new G4UnionSolid ("Helice", helice, pas5, rot, translation);

  pas=4;
  angle+=7.613*deg;
  G4Tubs* pas4 = new G4Tubs("pas4", innerRadius, rayon, epaisseur*pas, angleZero, angle);

  rot -> rotateZ((7.613/2.)*deg);
  helice = new G4UnionSolid ("Helice", helice, pas4, rot, translation);

  pas=3;
  angle+=8.144*deg;
  G4Tubs* pas3 = new G4Tubs("pas3", innerRadius, rayon, epaisseur*pas, angleZero, angle);

  rot -> rotateZ((8.144/2.)*deg);
  helice = new G4UnionSolid ("Helice", helice, pas3, rot, translation);

  pas=2;
  angle+=8.719*deg;
  G4Tubs* pas2 = new G4Tubs("pas2", innerRadius, rayon, epaisseur*pas, angleZero, angle);

  rot -> rotateZ((8.719/2.)*deg);
  helice = new G4UnionSolid ("Helice", helice, pas2, rot, translation );

  pas=1;
  angle+=10.796*deg;
  G4Tubs* pas1 = new G4Tubs("pas1", innerRadius, rayon, epaisseur*pas, angleZero, angle);

  rot -> rotateZ((10.796/2.)*deg);
  helice = new G4UnionSolid ("Helice", helice, pas1, rot, translation);

  G4LogicalVolume* HeliceLogical = new G4LogicalVolume(helice, air, "HeliceLogical");

  new G4PVPlacement(0, G4ThreeVector(0.,0.,0.), HeliceLogical,
		    "HelicePhysical", VolumeMereLog, false, 0);
 }
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

My questions are: is there a way to vizualise such a complex volume obtained with boolean union operation ???

Is there an other way to create this unique volume without the using boolean operators ???

Best Regards, Frederic Guillaume.

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

1 None: Re: Complex volume creation   (John Allison - 15 Nov, 2006)
 Add Message Add Message
to: "Complex volume creation"

 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 ]