Planes of TGeoXtru not shown in TEve

Hi,

(ROOT 5.26.00/b)

I am trying to use TEve as an event-display. I’ve stumbled over the following problems:

What I want to do finally is, I’d like to draw subdetectors which are “extruded” polygons or circles outside and/or inside. Where I want to be able to change the number of edges of the polygon.

For pure cylinders it’s easy, there is the MakeTube functionality in TGeoManager. For the polygonal shape I found the TGeoXtru shape. To start with I created an TGeoExtru and display this with the TEveManager (code is attached, myGeoEve.C). Interestingly, the planes of the extruded volume are only drawn if one looks at them “from the outside”, not if one looks at them from the inside (missing_edges.png). I tried to overcome this by defining 5 sections for the TGeoXtru instead of only two where I basically extrude into one direction first, and then with a slightly smaller scaling factor I’m extruding backwards again (can be seen by commenting in the additional xtru->DefineSection commands).

When doing this I get some strange visibility effects in my “full geometry” (see red_part_visible.png and red_part_strangely_hidden.png), … they show the same geometry with just a slight change of the camera position.

What do I do wrong?

An additional question: I’d like to be able to turn on and off the different parts of the detector from the menu in TEveManager. How can I make the TEveManager aware of the different subdetectors I have drawn with the TGeoManager?

thanks,
Peter









myGeoEve.C (4.1 KB)

Hi,

I found the bug, … I “closed” the polygon (last vertex== first vertex). This caused this error.

But I am still interested in solving the last question of how to make TEveManager aware of the different subdetectors I have drawn with the TGeoManager.

cheers,
Peter

Hi,

The output tells you that the xtru shapes that you create is wrong (see below)
Fix that first and try again.

=============================
root [1] myGeoEve()
Info in TGeoManager::TGeoManager: Geometry GeomTest, test drawing simple detector created
Info in TGeoManager::SetTopVolume: Top volume is TOP. Master volume is TOP
Error in TGeoPolygon::IsIllegalCheck: Illegal crossing of segment 0 vs. segment 7
Error in TGeoXtru::DefinePolygon: Shape TGeoXtru of type XTRU has an illegal polygon.
Error in TGeoPolygon::IsIllegalCheck: Illegal crossing of segment 0 vs. segment 11
Error in TGeoXtru::DefinePolygon: Shape TGeoXtru of type XTRU has an illegal polygon.
Info in TGeoManager::CheckGeometry: Fixing runtime shapes…
Info in TGeoManager::CheckGeometry: …Nothing to fix
Info in TGeoManager::CloseGeometry: Counting nodes…
Info in TGeoManager::Voxelize: Voxelizing…
Info in TGeoManager::CloseGeometry: Building cache…
Info in TGeoNavigator::BuildCache: — Maximum geometry depth set to 100
Info in TGeoManager::CloseGeometry: 4 nodes/ 5 volume UID’s in test drawing simple detector
Info in TGeoManager::CloseGeometry: ----------------modeler ready----------------

Hi,

The reason why things disappear is that we only draw front facing polygons in GL. I think TGeoXtru should actually be closed and the “endcap” disks should be drawn.

Maybe Andrei can advise you a different shape to use.

How about composing you shape for a set of TGeoBBox-es?

To view components, double-click on Scenes, then open Geometry-scene … there you’ll see representation of your objects.

Cheers,
Matevz

Hi Matevz,
The polygon gets automatically closed, so one should never define lastpoint=firstpoint. But after this fix it should be fine, isn’t it ?

Yes, with the fix it works perfect!

thanks!