Skip to content

Optical Support

Keith Sloan edited this page Sep 7, 2022 · 7 revisions

Optical Support

The workbench now supports GDML properties

  • GDML OpticalSurface definitions
  • Setting SkinSurface
  • Setting BorderSurface

Suggested workflows either :-

  • Import a GDML file with Optical property definitions

  • Create a GDML structure

    • Activate GDML workbench
    • File | New - to create basic GDML structure
    • Import an XML with basic optical definitions (see Resources/optical.xml)
      • Matrix
      • Opticalsurface

With at least one opticalsurface definition one can then set surfaces accordingly.

SkinSurface

  • For Volumes (FreeCAD Parts) you can set the property SkinSurface or select the Volume and use the Set_SkinSurface icon

BorderSurface

  • You can set a bordersurface by selecting in TreeView

    • A single surface ( Opticals | Surfaces | <surface>)
    • Two Volumes (FreeCAD Parts)

Then clicking on the Set_BorderSurface icon. There may well be a delay whilst a check for a common face is performed. If no common face is found then a warning is issued with an option to over ride the result of the check.

BorderSurface objects now have a boolean property CheckCommonFaces that determines if a common face check is performed on export. The property can be changed in the Objects Property Window. If no common faces is found with the option set a message that no common face was found will be in the Report View.

If the Parts involved in the Border Surface are in a GDML Assembly then Geant4 will generate the physical volume names. On export the workbench also creates the physical volume names so that the file will successfully import in Geant4. The implication of the generated physical volume names is that the file cannot then be successfully re-imported into FreeCAD.

Basic Optical definitions from an existing GDML file.

If you select the Optical Group then File | Export and select the filetype as xml then this will create an XML with the current Optical definitions, this can then be imported in a new GDML structure.

Setting surfaces when creating GDML objects using FreeCAD sketches.

If you want to set optical properties for GDML objects created using FreeCAD sketches then it is suggested that you

  • Export the GDML file with the objects created using Sketches.
  • Import the exported GDML file, this expands the booleans that were used to create the GDML object from a sketch.
  • You should then be able to set GDML opticalsurface properties on the expanded volumes.