Skip to content

g4edge/g4cgalboolean

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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());
  ...
  ...

NOTE The external processor interface in only available in Geant4 11.2.0 and later

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published