Skip to content

Commit

Permalink
Merge pull request #58 from HelgeGehring/speedup-_add_volume_with_holes
Browse files Browse the repository at this point in the history
speedup _add_volume_with_holes
  • Loading branch information
simbilod authored Feb 6, 2024
2 parents be469b9 + 4542b87 commit 382d198
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions meshwell/prism.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,12 +198,14 @@ def _add_volume_with_holes(self, entry: List[Tuple[float, Polygon]]) -> int:
for interior_index in range(len(entry[0][1].interiors))
]
if interiors:
for interior in interiors:
exterior = self.model.occ.cut(
[(3, exterior)], [(3, interior)], removeObject=True, removeTool=True
)
self.model.occ.synchronize()
exterior = exterior[0][0][1] # Parse `outDimTags', `outDimTagsMap'
exterior = self.model.occ.cut(
[(3, exterior)],
[(3, interior) for interior in interiors],
removeObject=True,
removeTool=True,
)
self.model.occ.synchronize()
exterior = exterior[0][0][1] # Parse `outDimTags', `outDimTagsMap'
return exterior

def instanciate(self) -> List[Tuple[int, int]]:
Expand Down

0 comments on commit 382d198

Please sign in to comment.