diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f18b41ca405..1dbcda8a5ea9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added * Added `Group` to `compas.scene`. +* Added `compas.geometry.Brep.cap_planar_holes`. +* Added `compas_rhino.geometry.RhinoBrep.cap_planar_holes`. ### Changed diff --git a/src/compas/geometry/brep/brep.py b/src/compas/geometry/brep/brep.py index 017c6c3ab39c..fc52571a2154 100644 --- a/src/compas/geometry/brep/brep.py +++ b/src/compas/geometry/brep/brep.py @@ -1139,3 +1139,23 @@ def overlap(self, other, deflection=None, tolerance=0.0): """ raise NotImplementedError + + def cap_planar_holes(self, tolerance=None): + """Cap all planar holes in the Brep. + + Parameters + ---------- + tolerance : float, optional + The precision to use for the operation. Defaults to `TOL.absolute`. + + Returns + ------- + None + + Raises + ------ + BrepError + If the operation fails. + + """ + raise NotImplementedError diff --git a/src/compas_rhino/geometry/brep/brep.py b/src/compas_rhino/geometry/brep/brep.py index f42502de874e..09fc5618dc1d 100644 --- a/src/compas_rhino/geometry/brep/brep.py +++ b/src/compas_rhino/geometry/brep/brep.py @@ -674,3 +674,28 @@ def flip(self): """ self._brep.Flip() + + def cap_planar_holes(self, tolerance=None): + """Cap all planar holes in the Brep. + + Parameters + ---------- + tolerance : float, optional + The precision to use for the operation. Defaults to `TOL.absolute`. + + Returns + ------- + None + + Raises + ------ + BrepError + If the operation fails. + + """ + tolerance = tolerance or TOL.absolute + result = self._brep.CapPlanarHoles(tolerance) + if result: + self._brep = result + else: + raise BrepError("Failed to cap planar holes")