Dear all,
I have been cracking my head for the last couple of days with this issue. Finally gave up and trying to ask here:
I have a bunch of parts in .obj format, and I’m using TGeoTessellated::ImportFromObjFormat
to upload them to TGeoManager. All the information for each part (name, mother, type [assembly or part], colors, translation, rotation) is contained in a text file that I read inside my code. My rationale for adding each to the geometry is the following:
TGeoVolume *volume;
if(type == "ASSEMBLY"){
volume = new TGeoVolume(part, shape, Vacuum);
volume->SetVisibility(kFALSE);
}
else if(type == "PART"){
volume = new TGeoVolume(part, shape, Aluminium);
volume->SetFillColor(colorIndex);
}
if(mother == "NONE"){
world->AddNode(volume, 1, new TGeoTranslation(0.0, 0.0, 0.0));
}
else{
gGeoManager->GetVolume(mother)->AddNode(
volume, 1, TGeoTranslation(0.0, 0.0, 0.0));
}
I’m not adding any translation or rotation as it seems that each of the obj files has it’s transformations embedded (they do not show up in the origin of the geometry). The thing is that the geometry ends up getting completely scrambled. I do have the translation and rotation elements of the parts (global values i.e. values in “world”), but when I add them in TGeoTranslation or TGeoCombiTrans, it’s all scrambled again.
The things that I’m not sure of are:
- When I’m creating a volume that is an assembly for other parts, should I still create it with TGeoVolume? Or TGeoVolumeAssembly?
- For a given volume, maybe I should add another transformation in regard to its mother so I get the correct positioning?
Super thanks in advance.
_ROOT Version: 6.26
_Platform: GNU/Linux - conda env
_Compiler: 10.4.0-19