FreeCAD GDML Workbench & Geant Workbench

I have a FreeCAD GDML workbench that I would be grateful if people could try out and evaluate. It still needs further work but in its current state one can load all be it very slowly the sample file lhcbvelo.gdml which I believe originally came from CERN.

Rather than convert GDML solids to FreeCAD BREP objects FreeCADs ability to implement objects as Python features is used to implement GDML solids. So by activating the workbench one is offered a number of icons. Selecting one of the icons means a GDML solid is created. One can then change the solids attributes which are the same as in the GDML User Manual via fhe FreeCAD facility to change an objects properties. At present only a subset of GDML solids is implemented, basically all those used in the lhcvelo.gdml file. The plan is to implement more if people think the workbench might prove to be useful. I would like to get some feedback before pressing on.

There is also a sister workbench that uses the ability to call Geant4 from Python. If the plain GDML workbench proves useful then the plan is to look at running simulations under FreeCAD.

For further details of workbenches please see

For further details of FreeCAD please see


I see that a couple of people have liked the application - Thanks.

Do you have any GDML solids that you would like to see implemented in the shortish term?

Do you have any sample GDML files that the current version does not completely handle?

Thanks “keith at

By the way is there a way to message users in the forum? Have not found one so far.

Have found a number of sample GDML files at which have shown up a number of bugs. Will start trying to address these in a week or so’s time


Seems to now be okay with
remoll / geometry_Mainz / detector_Mainz.gdml
remoll / geometry_Mainz / detector_Mainz.v2.gdml

Going to start work testing
remoll / geometry_sculpt / hybridDaughter_merged.gdml

which needs tessellated function to be added at least.

Latest version should now support loading of a default GDML file and export should create GDML definitions for constants, isotopes, elements, materials the same as imported either from the Default or selected GDML file.

Okay assuming people create a GDML file to allow Monte Carlo simulations via ROOT or Geant4. Is there any mileage in being able to output a STEP or FreeCAD file?

With the workbench implementing GDML solids as FreeCAD Python Objects the created solids therefore have a FreeCAD shape (i.e. OCC shape) for display as well as the GDML solid details. It would therefore not be hard to add the facility to export a STEP or non GDML FreeCAD file. If you think this would be useful please could I trouble you to like this post, so I can gauge response.

1 Like

Like to think code is in reasonable shape to be able to import/open gdml
and use standard FreeCAD export to save STEP file.

If somebody could try and report back.


First of all I think this is really nice project and I am definitely following this!
I tried to import some of my handmade GDML files, but it crashes on Nist materials definition. I tried also to make few solids, export and import again, but it does not work at all.
Is there some specific thing I should test for now?

Thanks for your interest.
Are using the latest version on github?

Please could you send some of your handmade files, also exports of the few solids you have tried and do not import correctly. email is at the bottom of the readme.

In SampleFiles you should find

Subdirectory GDML_Solids of SampleFiles should load or report unsupported solid.

Subdirectory CERN has a file lhcbvelo should load although it does take sometime and you have to click on the first wait.

The ones in Alice subdirectory are very large and I have yet to manage to load.

Other files in SampleFiles should load.

If you try at

and file detector_Mainz geometry_v2.gdml in geometry_Mainz that should load okay.

When exporting as GDML are you using export, selecting file type as GDML and adding gdml as file extension i.e. test.gdml

[quote] I tried also to make few solids, export and import again, but it does not work at all.

When I added use of App::Part to facilitate STEP export I broke Export :frowning:
Sorry about that. In the process of fixing.

Okay Changing to use FreeCAD Part for Volumes so that hopefully STEP export would retain structure broke a lot of things.

Hopefully they have now been fixed, so if somebody has a small GDML design that they could check if it exports to STEP okay, then that would be appreciated.