Skip to content

Commit

Permalink
moved sync to try except
Browse files Browse the repository at this point in the history
  • Loading branch information
shimwell committed Oct 14, 2024
1 parent 3f13a8a commit 0d3f580
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/cad_to_dagmc/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,15 +193,16 @@ def get_volumes(gmsh, assembly):
try:
# try in memory import
volumes = gmsh.model.occ.importShapesNativePointer(assembly.wrapped._address())
gmsh.model.occ.synchronize()
except Exception as e:
# fall back to writing file and reading it back in
from cadquery import exporters

exporters.export(assembly, "temp.step")
exporters.export(assembly, "temp.step") # TODO see if brep file is possible

volumes = gmsh.model.occ.importShapes("temp.step")

gmsh.model.occ.synchronize()
gmsh.model.occ.synchronize()

return gmsh, volumes

Expand Down

0 comments on commit 0d3f580

Please sign in to comment.