CAD to ROOT conversion


I’m having a hard time to find a tool to convert a CAD file containing a complex geometry to a GDML file, or any that is readable by GEANT4.

I’ve read that there is there is a tool in ROOT (TGeoCAD) to convert STEP files, but couldn’t find any tutorial or example.

Could someone hep me on this?

Thanks a lot.

// TGeoToStep Class                                                           //
// --------------------                                                       //
//                                                                            //
// This class is an interface to convert ROOT's geometry file                 //
// to STEP file. The TGeoToStep Class takes a gGeoManager pointer and gives   //
// back a STEP file. gGeoManager is the instance of TGeoManager class         //
// containing tree of geometries creating resulting geometry.                 //
// Standard for the Exchange of Product model data (STEP) is an international //
// standard for the exchange of industrial product data. It is typically used //
// to exchange data between various CAD, CAM and CAE applications.            //
// TGeoToStep Class is using RootOCC class to translate the root geometry     //
// in the corresponding OpenCascade geometry and  and TOCCToStep to write the //
// OpenCascade geometry to the step File.                                     //
// OpenCascade Technology (OCC) is a software development platform freely     //
// available in open source. It includes C++ components for 3D surface and    //
// solid modeling,visualization, data exchange and rapid application          //
// development. For more information about OCC see //
// Each object in ROOT is represented by an OCC TopoDS_Shape                  //
//                                                                            //
//   This class is needed to be instanciated and can be used calling the      //
//   CreateGeometry method:                                                   //
//   TGeoToStep * mygeom= new TGeoToStep(gGeoManager);                        //
//   mygeom->CreateGeometry();                                                //
//                                                                            //
// The resuling STEP file will be saved in the current directory and called   //
// geometry.stp                                                               //
// To compile the TGeoCad module on ROOT, OpenCascade must be installed!      //

Thank you for the answer!

As I understand, the TGeoToStep class converts a ROOT geometry file to a STEP file…is that right?

Actually, I need the contrary: a STEP to ROOT conversion.

Is that possible with the same class?

I think you better ask the authors of this tool. See:

My 5 cent.
I asked Cinzia Luzzi (author of mentioned paper) same question one month ago.
Answer was - NOT.


Thank you for both answers.

I found this software, for anyone who is interested on the sobject:

It seems to convert a STEP file into GDML, which in turn is readable by ROOT and GEANT4.

I’ll try to install on next few minutes.

Best Regards.

@lghizoni, did your efforts for STEP -> GDML conversion finally converge? I’m currently reviewing different CAD :left_right_arrow: ROOT conversion approaches. But all in all I think I’ll stick with scripting my geometries in a ROOT macro.


I understand this is from years ago, but apparently the TGeoCad interface, which contains the mentioned class TGeoToStep, is no longer supported by the current version of ROOT. I need to convert some ALICE ROOT geometries to STEP or STL for a project, and I was wondering what would be a way to do it. Or maybe how I could get the TGeoCad module working.
I’m using AliRoot’s version 5. Could someone help me?

Thank you!

You can always use a previous version of ROOT and do the conversion there. Let us know if that fails.

And please don’t revive years old topics but start a new one!

Cheers, Axel

1 Like