Re: [ROOT] gGeoManager->CheckOverlaps

From: Andrei Gheata (Andrei.Gheata@cern.ch)
Date: Thu Jul 10 2003 - 18:02:23 MEST


Hi Kiril,

There are no overlaps/extrusions in your example. Due to limitations of 
x3d you sometime see surfaces that dissapear or change color - this has 
nothing to do with the overlaps. Your "Arrow" volume is OK (sphere with 
R=10 in the origin and three cones with half-length 45 positioned at 55 
along X, Y and Z. The content of "KeepIn" is also non-overlapping. If 
you still think your geometry has overlaps, please point out where you 
think they are (which volume/daughter(s)).

Best regards,
Andrei


Kirill Shileev wrote:
> On Thu, 10 Jul 2003, Andrei Gheata wrote:
> 
> Hi Andrei,
> Please find the example in attachment.
> 
> 
> 
>>Hi Kirill,
>>
>>There is no limitation. Could you send me your example ?
>>
>>Regards,
>>Andrei
>>
>>Kirill Shileev wrote:
>>
>>>Hi rooters,
>>>
>>>Is there any limitations on using of the subj? 
>>>Is it possible that the subj does not check clashes for some particular 
>>>shapes? In my case it gives me no overlaps while there are in, and clearly 
>>>visible in x3d.
>>>I'm on 3.05.05 on Mandrake 9.0
>>>
>>
>>
>>
> 
> 
> ------------------------------------------------------------------------
> 
> void TofinoGeo()
> {
>   if(gClassTable->GetID("TGeoManager")<0) gSystem->Load("libGeom");
>   new TGeoManager("GM", "Simple geometry");
>   MakeMediums();
>   MakeMotherAndArrow();
> //  if (gPad) gPad->x3d();
>   gGeoManager->CheckOverlaps(0.00001);
> }
> 
> void MakeMediums()
> {  
>   
>   int medID;
>   Double_t a,z,den;
>   p=new TGeoMedium("vacuum",medID=1,new TGeoMaterial("vacuum",a=0,z=0,den=0));
> 
> }
> 
> 
> const Double_t g2r=TMath::Pi()/180;
> const Double_t r2g=180/TMath::Pi();
> const Double_t deg=TMath::Pi()/180;
> const Double_t rad=1;
> const Double_t mm=0.1;
> const Double_t cm=1;
> const Double_t m=100;
> 
> void MakeMotherAndArrow()
> {
>   if(gClassTable->GetID("TGeoManager")<0) gSystem->Load("libGeom");
>   
>   Double_t dx,dy,dz,dxmin,dxmax,rmin,rmin1,rmin2,rmax,rmax1,rmax2;
>   Int_t copy;
>   
> //make mother   
>   TGeoVolume *pMother=gGeoManager->MakeBox("MOTHER",gGeoManager->GetMedium("vacuum"),
>                                                    dx=10*m,dy=10*m,dz=30*m);
> 
>   gGeoManager->SetTopVolume(pMother);
>   
> //CS  
>   Double_t arrowLen=1*m;        
>   TGeoVolume *pCS=gGeoManager->MakeBox("Arrow",gGeoManager->GetMedium("vacuum"),
>                             dx=arrowLen,dy=arrowLen,dz=arrowLen);
>   pCS->SetVisibility(kFALSE);
>   pMother->AddNode(pCS,copy=1);
>   TGeoVolume *pZero=gGeoManager->MakeSphere("Zero",gGeoManager->GetMedium("vacuum"),
>             rmin=0,rmax=0.1*arrowLen);//10% zero point
>   pZero->SetLineColor(kMagenta);
>   pCS->AddNode(pZero,copy=1);          
>   TGeoVolume *pAxisX=gGeoManager->MakeCone("AxisX",gGeoManager->GetMedium("vacuum"),
>         dz=0.9*arrowLen/2,rmin1=0,rmax1=0.1*arrowLen,rmin2=0,rmax2=0);//10% zero point
>   pAxisX->SetLineColor(kRed);
>   pCS->AddNode(pAxisX,copy=1,new TGeoCombiTrans(0.55*arrowLen,0,0, new TGeoRotation("rot1",0,90,0)));          
>   TGeoVolume *pAxisY=gGeoManager->MakeCone("AxisY",gGeoManager->GetMedium("vacuum"),
>         dz=0.9*arrowLen/2,rmin1=0,rmax1=0.1*arrowLen,rmin2=0,rmax2=0);//10% zero point
>   pAxisY->SetLineColor(kGreen);
>   pCS->AddNode(pAxisY,copy=1,new TGeoCombiTrans(0,0.55*arrowLen,0, new TGeoRotation("rot1",90,90,0)));          
>   TGeoVolume *pAxisZ=gGeoManager->MakeCone("AxisZ",gGeoManager->GetMedium("vacuum"),
>         dz=0.9*arrowLen/2,rmin1=0,rmax1=0.1*arrowLen,rmin2=0,rmax2=0);//10% zero point
>   pAxisZ->SetLineColor(kBlue);
>   pCS->AddNode(pAxisZ,copy=1,new TGeoTranslation(0,0,0.55*arrowLen));          
> //______________________________________________________________________________
>    
>   const Double_t largeKeepInLenMin=274.21*2*mm; //old
>   const Double_t largeKeepInLenMax=784.15*2*mm; //old  
> 
>   //const Double_t largeKeepInLenMin=(274.21+0.816)*2*mm; //new
>   //const Double_t largeKeepInLenMax=(784.15+0.816)*2*mm; //new  
> 
>   const Double_t largeKeepInHeight=(758.58+694.34)*mm;
>   const Double_t largeKeepInThickness=10*mm;  
>   const Double_t shift=largeKeepInHeight/2-758.58*mm;
>   
>   
>   const Double_t smallKeepIn23LenMin=100.02*2*mm;
>   const Double_t smallKeepIn23LenMax=179.83*2*mm;   
>   const Double_t smallKeepIn23Height=(686.95+693.05)*mm;
>   const Double_t smallKeepIn23Thickness=10*mm;  
> 
>   const Double_t smallKeepIn23X=369.46*mm; //old
>   const Double_t smallKeepIn23Y=-64.86*mm-shift; //old
> 
>   //const Double_t smallKeepIn23X=370.276*mm; //new
>   //const Double_t smallKeepIn23Y=-64.951*mm-shift; //new
> 
>   const Double_t smallKeepIn23Phi=16.03; 
>   
>   const Double_t smallKeepIn24LenMin=41.23*2*mm;
>   const Double_t smallKeepIn24LenMax=195.05*2*mm;   
>   const Double_t smallKeepIn24Height=(689.94+690.06)*mm;
>   const Double_t smallKeepIn24Thickness=10*mm;  
> 
>   //const Double_t smallKeepIn24X=117.4*mm; //no shift
>   //const Double_t smallKeepIn24Y=-13.09*mm-shift; //no shift
> 
>   const Double_t smallKeepIn24X=116.14*mm; //old shift
>   const Double_t smallKeepIn24Y=-24.86*mm-shift; //old shift
> 
>   //const Double_t smallKeepIn24X=117.4*mm; //new shift
>   //const Double_t smallKeepIn24Y=-20.05*mm-shift; //new shift
> 
>   const Double_t smallKeepIn24Phi=6.36;
>   
>   const Double_t trdIns24LenMin=41.23*2*mm;
>   const Double_t trdIns24LenMax=321*mm;   
>   const Double_t trdIns24Height=(1380-239.91)*mm;
>   const Double_t trdIns24Thickness=10*mm;  
>   
>   const Double_t boxIns24Len=321*mm;
>   const Double_t boxIns24Height=119.955*2*mm;
>   const Double_t boxIns24Thickness=10*mm;  
>   
>   TGeoVolume *pLargeKeepIn=gGeoManager->MakeTrd1("KeepIn",gGeoManager->GetMedium("vacuum"),
>            dxmin=largeKeepInLenMin/2,
>            dxmax=largeKeepInLenMax/2,
>            dy=largeKeepInThickness/2,
>            dz=largeKeepInHeight/2);  
>   pLargeKeepIn->SetLineColor(kRed);
>   pMother->AddNode(pLargeKeepIn,copy=1,new TGeoTranslation(0,0,3*m));
>   
>   TGeoVolume *pSmallKeepIn23=gGeoManager->MakeTrd1("SmallKeepIn1",gGeoManager->GetMedium("vacuum"),
>            dxmin=smallKeepIn23LenMin/2,
>            dxmax=smallKeepIn23LenMax/2,
>            dy=smallKeepIn23Thickness/2,
>            dz=smallKeepIn23Height/2); 
>   pSmallKeepIn23->SetLineColor(kGreen); 
>   pLargeKeepIn->AddNode(pSmallKeepIn23,copy=1,
>       new TGeoCombiTrans(smallKeepIn23X,0,smallKeepIn23Y,
>                         new TGeoRotation("rot1",0,smallKeepIn23Phi,0)));
>   pLargeKeepIn->AddNode(pSmallKeepIn23,copy=2,
>       new TGeoCombiTrans(-smallKeepIn23X,0,smallKeepIn23Y,
>                         new TGeoRotation("rot1",180,smallKeepIn23Phi,0)));
> 
>   TGeoVolume *pSmallKeepIn24=gGeoManager->MakeTrd1("SmallKeepIn2",gGeoManager->GetMedium("vacuum"),
>            dxmin=smallKeepIn24LenMin/2,
>            dxmax=smallKeepIn24LenMax/2,
>            dy=smallKeepIn24Thickness/2,
>            dz=smallKeepIn24Height/2); 
>   pSmallKeepIn24->SetLineColor(kBlue); 
>   pLargeKeepIn->AddNode(pSmallKeepIn24,copy=1,
>       new TGeoCombiTrans(smallKeepIn24X,0,smallKeepIn24Y,
>                  new TGeoRotation("rot10",0,smallKeepIn24Phi,0)));  
>   pLargeKeepIn->AddNode(pSmallKeepIn24,copy=2,
>       new TGeoCombiTrans(-smallKeepIn24X,0,smallKeepIn24Y,
>                  new TGeoRotation("rot11",180,smallKeepIn24Phi,0)));
>   
>    TGeoVolume *pTrdIns24=gGeoManager->MakeTrd1("TrdIns2",gGeoManager->GetMedium("vacuum"),
>             dxmin=trdIns24LenMin/2,
>             dxmax=trdIns24LenMax/2,
>             dy=trdIns24Thickness/2,
>             dz=trdIns24Height/2); 
>    pTrdIns24->SetLineColor(kRed); 
>    pSmallKeepIn24->AddNode(pTrdIns24,copy=1,
>        new TGeoTranslation(0,0,-(smallKeepIn24Height/2-trdIns24Height/2)));
>    
>    TGeoVolume *pBoxIns24=gGeoManager->MakeBox("BoxIns2",gGeoManager->GetMedium("vacuum"),
>             dx=boxIns24Len/2,
>             dy=boxIns24Thickness/2,
>             dz=boxIns24Height/2); 
>    pBoxIns24->SetLineColor(kMagenta); 
>    pSmallKeepIn24->AddNode(pBoxIns24,copy=1,
>        new TGeoTranslation(0,0,boxIns24Height/2+trdIns24Height-smallKeepIn24Height/2));
>   
>   gGeoManager->SetTopVolume(pMother);
>   
>   gGeoManager->CloseGeometry();   
>   pMother->Draw();
>   
> }//void MakeArrow(TGeoVolume *pMother)



This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:13 MET