From 37aa015de657f014e68e2481a447917f1f51463b Mon Sep 17 00:00:00 2001
From: Erik B Knudsen <erik.knudsen@copenhagenatomics.com>
Date: Mon, 9 Oct 2023 17:04:16 +0200
Subject: [PATCH] simplify gmsh import (as suggested by akoen)

related to #59
---
 src/CAD_to_OpenMC/assemblymesher_gmsh.py | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/src/CAD_to_OpenMC/assemblymesher_gmsh.py b/src/CAD_to_OpenMC/assemblymesher_gmsh.py
index df87065..2b076eb 100644
--- a/src/CAD_to_OpenMC/assemblymesher_gmsh.py
+++ b/src/CAD_to_OpenMC/assemblymesher_gmsh.py
@@ -97,10 +97,7 @@ def _cq_solids_to_gmsh(self):
       #create a compund cq solid from entities
       solids=[e.solid for e in self.gmsh_mesher_entities]
       compound=cq.Compound.makeCompound(solids)
-      with tempfile.TemporaryDirectory() as td:
-        outpath=os.path.join(td,'export.'+self.IntermediateLayer)
-        compound.exportBrep(outpath)
-        vols=gmsh.model.occ.importShapes(outpath)
+      vols = gmsh.model.occ.importShapesNativePointer(compound)
       gmsh.model.occ.synchronize()
       self._reorder()