i currently got trouble when i want to view a composite shape with the root GL-viewer.
i’ve build a composite shape by using:
TGeoBBox *ApertureBox = new TGeoBBox("ApertureBox", 12.5, 12.5, 0.25);
TGeoTube *ApertureHole = new TGeoTube("ApertureHole", 2.5, 2.5, 0.25);
TGeoCompositeShape *ApertureCS = new TGeoCompositeShape("ApertureCS", "ApertureBox-ApertureHole");
TGeoVolume *Aperture = new TGeoVolume("Aperture", ApertureCS, medTa);
Aperture -> SetLineColor(34);
TGeoTranslation *ApTr = new TGeoTranslation(0, 0, 80);
World -> AddNode(Aperture, 2, ApTr);
TCanvas *c1 = new TCanvas("c1", "c1", 800, 600);
c1 -> Draw();
geom -> CloseGeometry();
geom -> SetNsegments(120);
World -> Draw("ogl");
It should be a box with a hole in it, i can see the hole when i don’t use ogl an only use the Draw command.
But i want to see it also within the GL Viewer.
What i am doing wrong?
Your example is not complete and does not run. Here’s output I get with trunk:
Info in <TGeoManager::TGeoManager>: Geometry Geometry, default geometry created
Error in <TGeoTube::SetTubeDimensions>: In shape ApertureHole wrong rmin=2.5 rmax=2.5
Error: Symbol medTa is not defined in current scope sabo.C:5:
*** Interpreter error recovered ***
Try setting rmin to 0.
I don’t think you actually see a hole with std viewer … it’s just a tubular sheet of zero thickness.
If it still doesn’t work please attach a code that actually runs
youre right, i’ve only posted a code snippet where i create my composite shape.
I actual try to get used to the the use of the geo class.
I’ve attached the the code which should run.
thanks for reply, but this doens’t solve the problem which i have with composite geometrys.
The apertures hole isn’t showing up and also the lids (top and bottom) of my scattering chamber aren’t there, when i take a look of my setup in the open gl viewer.
The SetTransparency thing works but this is something which i will most probably need when the composite geometries where shown in the right manner.
Yes of course, but there isn’t realy a change within the code.
I’ve tried to follow the advise of Wile E. Coyote.
But i don’t want to make things transparent, i want that when i create composite shape like an aperture with an hole in the middle that this will be shown correctly within the gl-viewer.
At the moment the hole is invisible, but you can see it in the wire construction.
Also the scattering chamber should have lids. These are correctly shown within the wire construction but within the gl-viewer you can only see the main body (a tube with a certain inner diamter > 0).
Attached you’ll find the actual code.
The aperture hole had to small dz so you got rounding errors produce a “covered hole”. I increased the dz to 0.3 and it shows up fine:
TGeoTube *ApertureHole = new TGeoTube(“ApertureHole”, 0., 2.5, 0.3);
Actually, it is sufficient to increase the “dz” of the “ApertureHole” to “0.25 + 1.E-16” or to decrease the “dz” of the “ApertureBox” to “0.25 - 1.E-16”.
Ah,
Thanks to both of you, i don’t know why i haven’t fiddle around with dz.
Ok but still, there is the “problem”, that the lids of the scattering chamber won’t show up.
Any idea on that.
I think we both claim that we see both lids. If I “remove” any one of them from the “ScatteringChamberMain + ScatteringChamberLid:LidTr1 + ScatteringChamberLid:LidTr2”, I can immediately see the difference (no lid on one side).
Um, ok.
could you please be so kind and post an screenshot of that?
Because i realy see nothing within the OpenGL viewer.
Maybe there is something else going wrong on my system…
yes at the moment i even don’t know where to look.
At the moment i update my root version to the latest and will try again.
Could you please be so kind to upload the exact code with which you get the output you’ve uploaded?
Maybe i’ve done something stupid with my code in the meanwhile.