CAD to GEANT4 model converter

A bridge between CAD software and GEANT4

It is never an easy task to define geometries of complex detectors with c++ which is the default way of GEANT4. The tools introduced on this page allow you to import models from CAD files and then convert them into gdml files which are supported by GEANT4. We have developed two versions: web version and FreeCAD version.


Online version

The web tool enables users to view step files using web browsers available for Windows, OS X, Linux, Android, iOS and Windows Phone and convert them to GEANT4 gdml files. Features:

  • Import models from your uploaded step files
  • Convert the models to to GEANT4 GDML files
Note that the default material for all components will be aluminum. You still need to add material information manually with the current online version. The functions have been implemented in the FreeCAD version.

G4cad - A FreeCAD Workbench for converting cad files to gdml

FreeCAD is a general purpose free parametric 3D CAD modeler. The converter has already integrated with FreeCAD as a workbench.

The workbench Itself as well as FreeCAD allows you:

  • Import models from most CAD formats (e.g. step, iges, iv, stl, ...)
  • Boolean operations between parts
  • Add/Update materials in the SQL database
  • Attach material for each individual component
  • Create simple Geant4 CGS models
  • Set tessellation precision for each individual component
  • Export models to GEANT4 gdml files
  • Run simulations inside FreeCAD

The source code can be found on the github repo https://github.com/drhlxiao/g4cad

Contact us

Dr. Hualin Xiao
OBBA/008
Paul Scherrer Institute
CH-5232 Villigen PSI
Switzerland
Tel: +41-0563105348
Email: hualin.xiao@psi.ch

Dr. Wojtek Hajdas
OBBA/010
Paul Scherrer Institute
CH-5232 Villigen PSI
Switzerland
Tel.: +41 (0)56 310 4212
Email: Wojtek.Hajdas@psi.ch