Skip to content

Commit

Permalink
Merge pull request #96 from fusion-energy/brep-export-instead-of-step
Browse files Browse the repository at this point in the history
exportBrep instead of step (faster save and read)
  • Loading branch information
shimwell authored Nov 18, 2024
2 parents 212ae43 + 02da9cc commit 61ddaf2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/cad_to_dagmc/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,11 @@ def get_volumes(gmsh, assembly, method="file", scale_factor=1.0):
volumes = gmsh.model.occ.importShapesNativePointer(assembly.wrapped._address())

elif method == "file":
with tempfile.NamedTemporaryFile(suffix=".step") as temp_file:
exporters.export(assembly, temp_file.name)
with tempfile.NamedTemporaryFile(suffix=".brep") as temp_file:
if isinstance(assembly, cq.Assembly):
assembly.toCompound().exportBrep(temp_file.name)
else:
assembly.exportBrep(temp_file.name)
volumes = gmsh.model.occ.importShapes(temp_file.name)

# updating the model to ensure the entities in the geometry are found
Expand Down

0 comments on commit 61ddaf2

Please sign in to comment.