Message: Problem with G4UnionSolid::DistanceToOut Not Logged In (login)

## Problem with G4UnionSolid::DistanceToOut

Keywords: Geometry, UnionSolid, DistanceToOut
Forum: Geometry
Date: 20 Oct, 2005
From: Dmitry A. Shtol <Dmitry A. Shtol>

 There is a problem with G4UnionSolid::DistanceToOut: for some start points and some directions is returnes too big, impossible distances like 9e+99. Here is a special test program to demonstrate the problem: ```#include "globals.hh" #include "G4Para.hh" #include "G4Tubs.hh" #include "G4UnionSolid.hh" #include "G4ThreeVector.hh" #include "G4Transform3D.hh" ``` ```int main () { const G4double dx=15.3125; const G4double dy=100; const G4double dz=3.75; const G4double theta=0.283794;``` ``` const G4double radius=2; const G4double length=200; // cm``` ``` // Building solid G4Para* para=new G4Para("Para",dx*cm,dy*cm,dz*cm,0,theta,0); G4Tubs* tube = new G4Tubs("Tube",0.0,radius*cm*0.99, length*cm/2.0, 0.0, 2*M_PI);``` ``` G4ThreeVector transv(-164.062,0,-17.5); // mm G4Transform3D trans1=G4Translate3D(transv*mm)*G4RotateX3D(M_PI/2);``` ` G4VSolid* solid=new G4UnionSolid("solid",para,tube,trans1);` ``` // Checking points G4ThreeVector point1(-142.188*mm,0,-0.5*mm); // mm G4ThreeVector point2(-142.188*mm,0,-1*mm); // mm G4ThreeVector direction(-1,0,0);``` ``` if (solid->Inside(point1)==kInside) { G4cout<<"Test point "<DistanceToOut(point1,direction);` ` G4cout<<"Distance is "<Inside(point2)==kInside) { G4cout<<"Test point "<DistanceToOut(point2,direction);` ` G4cout<<"Distance is "<

 Inline Depth: Outline Depth: Add message:

1 Re: Problem with G4UnionSolid::DistanceToOut   (Vladimir Grichine - 22 Oct, 2005)
3 Re: Problem with G4UnionSolid::DistanceToOut   (Vladimir Grichine - 23 Oct, 2005)
 to: "Problem with G4UnionSolid::DistanceToOut"
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 ]