Making a 3D TGeoVolume solid

Hi Forum,

I am trying to make a solid rendering of a simple shape. Everything seems to work, but I always get a wireframe, not a filled solid object. Is SetFillStyle(4100) the correction function? Code attached below, run with .x puzzleBox.C

Peter

void makeDrawing(TCanvas* myCan)
{
   TGeoManager *geom = new TGeoManager("geom","2LIT");
// Materials
   TGeoMaterial *Vacuum = new TGeoMaterial("vacuum",0,0,0);
   TGeoMaterial *C = new TGeoMaterial("C",12.1,6,2.26);
// Media
   TGeoMedium *Air = new TGeoMedium("Air",0,Vacuum);
   TGeoMedium *Wood = new TGeoMedium("Wood",0,C);
// Volume      
   TGeoVolume *pBox = geom->MakeBox("top",Air,150,150,150);
   geom->SetTopVolume(pBox);
   geom->SetTopVisible(0);
   // If you want to see the boundary, please input the number, 1 instead of 0.
   // Like this, geom->SetTopVisible(1);

   TGeoVolume *mCube;
   char cubeName[100];
   //
   // Offsets
   Int_t nCubeMax=4;
   Double_t xOffset[4]={0,1,1,2};
   Double_t yOffset[4]={0,0,1,1};
   Double_t zOffset[4]={0,0,0,0};
   
   for(Int_t iCube=0;iCube<nCubeMax;iCube++)
     {
       sprintf(cubeName,"Cube%d",iCube);
       std::cout << "cubeName " << cubeName << std::endl;
       mCube=geom->MakeBox(cubeName,Wood,0.5,0.5,0.5);
       mCube->SetLineColor(kRed);
       mCube->SetFillStyle(4100);
       mCube->SetFillColor(kRed);
       mCube->SetTransparency(0);
       pBox->AddNodeOverlap(mCube,1,new TGeoTranslation(xOffset[iCube],yOffset[iCube],zOffset[iCube]));
     }
// Los Endos
   geom->CloseGeometry();
////////////////////////// Draw
   pBox->SetVisibility(0);
   pBox->Draw("pad");

}

ROOT Version: 6.25/01
Platform: Devuan GNU/Linux ascii/ceres
Compiler: GCC 10.2.1.20210110 (Debian 10.2.1-6)


I guess @agheata can help.

Hi,
TGeoVolume does not use fill attributes, the only relevant setting is SetLineColor. Drawing geometry in the pad only supports wire-frame mode. To get a solid mode, either use pBox->Draw("ogl") if you have opengl support in ROOT, or pBox->Raytrace() to get a ray-traced image.