Skip to content

Latest commit

 

History

History
37 lines (29 loc) · 1.51 KB

g4cgalboolean.md

File metadata and controls

37 lines (29 loc) · 1.51 KB
layout
page

G4cgalboolean

Introduction

The Geant4 boolean processor often fails to compute a resulting mesh. There are other meshing tools available but many suffer from robustness issues. g4cgalboolean uses CGAL mesh boolean and refinement to perform boolean operations. The CGAL license is not compatible with Geant4 license and so is distributed separately from Geant4. If your Geant4 application is compatible with GPL then you are free to distribute g4cgal in accordance with that license.

Implementation

An virtual base class G4VBooleanProcessor can be implemented to provide the boolean processing functionality. In the case of g4cgalboolean this class is called G4BooleanProcessorCGAL and Geant4 can be informed to use it via a static method of G4Boolean so

...
#include "G4BooleanProcessorCGAL.hh"
...

int main(int argc, char** argv) {
  G4BooleanSolid::SetExternalBooleanProcessor(new G4BooleanProcessorCGAL());
  ...
  ...

Using g4cgalboolean in your project

  1. Copy the src and include code over to your geant4 application (G4BooleanProcessorCGAL, G4SurfaceMeshCGAL and G4VSurfaceMesh)
  2. Install CGAL using your package manager
  3. Add CGAL to your CMakeLists.txt see example in github repository
  4. Compile and enjoy

Examples