-
Notifications
You must be signed in to change notification settings - Fork 17
Home
!!!! ***** UNDER CONSTRUCTION ***** !!!!
Geometry Description Markup Language (GDML) is a specialized XML-based language used to specify
Geometries for Monte Carlo Simulation software such as ROOT, Geant4, etc see GDML Manual.
It defines a rich set of Solid Computer Graphic Objects for details of GDML Solids
The GDML Workbench lets the user
- Import
- View
- Edit
- Create
- Export
Such Geometries.
From the FreeCAD command bar select View | Workbench then select GDML
It is recommended that when you have the GDML workbench active that the following Toolbars are viewable
- Workbench
- Structure
- GDMLTools
- GDML Part Tools
So Icons displayed should look similar to the following
To make a Toolbar viewable, from the FreeCAD command bar select View | Toolbars
GDML Solids are implemented as FreeCAD Python Objects and have the same properties as defined by GDML. By selecting an Object the properties can be changed via the FreeCAD properties windows and the resulting changes displayed.
Short decription
Short decription
Short decription
Short decription
Short decription
Short decription
Short decription
Given a lot more solids are supported for import, it is not too difficult to add more, so if you feel you need a particular solid to be added please contact me.
Select two Parts/Logical Volumes and then click on the appropriate boolean icon
- Import GDML file
- Scan GDML file - Facility for dealing with large GDML files
When creating a new file from the GDML workbench the file Defaults.gdml is read from the Resources directory, this may or may not have material definitions, as supplied there are none.
A Materials Group called Geant4 is created by reading the file Geant4Materials.xml from the Resources directory which define all the materials that GEANT4 implicitly defines by default.
When a file is exported the the materials in the geant4 group are ignored as GEANT4 implicitly defines these.
If you need the Geant4 materials for use in a none GEANT4 situation, for example ROOT, then one option is to
- Select the geant4 group.
- export as an xml file
- import the xml file
This should add the materials in the main materials definitions which should be exported in any subsequent GDML exports
In addition to the GDML solids, the GDML Workbench supports the export of a subset of the solids one can create in the FreeCAD Parts Workbench. These are documented below. For those shapes not directly supported for export, the recommended way to proceed is to take the resulting BREP (Boundary Representation) Shape and then translate it to a GDML Tessellate, or use some software like McCad to decompose the BREP Shapes into GDML Objects.
The GDML Workbench provides a number of facilities to
-
Export FreeCAD(BREP) shapes as GDML Tessellated Objects.
-
Allocate a GDML Material and directly Convert a FreeCAD(BREP) Shape to a GDML Tessellated Object
using a number of different algorithms- Standard FreeCAD mesh facilties
- Gmsh
- Tetrahedron (This does not directly translate to GDML, but to a GDML Assembly of GDML Tetra)
(Note some of these are currently only supported in the Beta2 branch)
Shapes created by the Sketch Workbench and extruded via the Part Extrude command can be exported to GDML. The exrusion must be added to a Part under the worldVol tree. Currently extrusion exports have the following limitations: (1) only extrusions along the z-axis are supported (i.e., the sketches must be in the x-y plane). Note that this does not pose a real limitation, since the extrusion object itself can be rotated or translated to any desired orientation or location. (2) Arcs/elliptical whose chords are crossed by lines (or other arcs) cannot currently be processed. Arcs/lines that are completely inside or outside other arcs, are supported, though. Examples of Extruded sketches are in Extruded sketches examples
To export a GDML file, select the root Part ( GDML World Volume ) then use the standard FreeCAD export facility ( File | Export )
If a filetype of lowercase gdml is selected a single GDML file is produced.
If a filetype of uppercase GDML is selected then the following files are created in a directory derived from the path name less the GDML file extension.
- A [Name].gdml with imbeds for the following xml files
- setup.xml
- constants.xml
- defines.xml
- materials.xml
- [Name]-solids.xml
- [Name]-structure.xml
Note: Provided you have the lxml python library installed, you should be able to successfully open the [Name].gdml file
ROOT only supports GDML defined in a single file, as it does not support the required DOCTYPE !ENTITIES.
There are two options
-
Open the multi file with the workbench and then export with as a single GDML file.
-
Use the standalone python program supplied in Utils
combineGDML.py [input file with imbeds] [output single file]
Such multi files are supported by Geant4.
When exporting STEP files that include GDML objects set the FreeCAD Preference for Export to use legacy exporter