void hexa() { gSystem->Load("libGeom"); TGeoManager *geom = new TGeoManager("geom", "irregular hexagone"); TGeoMaterial *mat = new TGeoMaterial("Al", 26.98,13,2.7); TGeoMedium *med = new TGeoMedium("MED",1,mat); TGeoVolume *top = geom->MakeBox("TOP",med,50,50,50); gGeoManager->SetTopVolume(top); TGeoArb8 *arb1 = new TGeoArb8("arb1",20); arb1->SetVertex(0,30,0); arb1->SetVertex(1,20,-25); arb1->SetVertex(2,-15,-35); arb1->SetVertex(3,-25,0); arb1->SetVertex(4,30,0); arb1->SetVertex(5,20,-25); arb1->SetVertex(6,-15,-35); arb1->SetVertex(7,-25,0); TGeoArb8 *arb2 = new TGeoArb8("arb2",20); arb2->SetVertex(0,30,0); arb2->SetVertex(1,-25,0); arb2->SetVertex(2,-5,20); arb2->SetVertex(3,10,15); arb2->SetVertex(4,30,0); arb2->SetVertex(5,-25,0); arb2->SetVertex(6,-5,20); arb2->SetVertex(7,10,15); TGeoCompositeShape *cs = new TGeoCompositeShape("hexa", "arb1+arb2"); TGeoVolume *vol = new TGeoVolume("HEXA", cs,med); vol->SetLineColor(kRed); top->AddNode(vol,1); geom->CloseGeometry(); top->Draw("ogl"); }