Skip to content

Commit 57195d6

Browse files
committed
rename to cap_planar_holes
1 parent 30481b3 commit 57195d6

File tree

3 files changed

+40
-15
lines changed

3 files changed

+40
-15
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
### Added
1111

1212
* Added `Group` to `compas.scene`.
13-
* Added implementation of `make_solid` to `compas_rhino.geometry.RhinoBrep`.
13+
* Added `compas.geometry.Brep.cap_planar_holes`.
14+
* Added `compas_rhino.geometry.RhinoBrep.cap_planar_holes`.
1415

1516
### Changed
1617

src/compas/geometry/brep/brep.py

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -923,11 +923,6 @@ def make_solid(self):
923923
-------
924924
None
925925
926-
Raises
927-
------
928-
:class:`~compas.geometry.BrepInvalidError`
929-
If the operation fails.
930-
931926
"""
932927
raise NotImplementedError
933928

@@ -1144,3 +1139,23 @@ def overlap(self, other, deflection=None, tolerance=0.0):
11441139
11451140
"""
11461141
raise NotImplementedError
1142+
1143+
def cap_planar_holes(self, tolerance=None):
1144+
"""Cap all planar holes in the Brep.
1145+
1146+
Parameters
1147+
----------
1148+
tolerance : float, optional
1149+
The precision to use for the operation. Defaults to `TOL.absolute`.
1150+
1151+
Returns
1152+
-------
1153+
None
1154+
1155+
Raises
1156+
------
1157+
BrepError
1158+
If the operation fails.
1159+
1160+
"""
1161+
raise NotImplementedError

src/compas_rhino/geometry/brep/brep.py

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
from compas.geometry import Brep
1010
from compas.geometry import BrepError
1111
from compas.geometry import BrepFilletError
12-
from compas.geometry import BrepInvalidError
1312
from compas.geometry import BrepTrimmingError
1413
from compas.geometry import Frame
1514
from compas.geometry import Plane
@@ -676,17 +675,27 @@ def flip(self):
676675
"""
677676
self._brep.Flip()
678677

679-
def make_solid(self):
680-
"""Convert the current shape to a solid if it is a shell.
678+
def cap_planar_holes(self, tolerance=None):
679+
"""Cap all planar holes in the Brep.
680+
681+
Parameters
682+
----------
683+
tolerance : float, optional
684+
The precision to use for the operation. Defaults to `TOL.absolute`.
681685
682686
Returns
683687
-------
684688
None
685689
690+
Raises
691+
------
692+
BrepError
693+
If the operation fails.
694+
686695
"""
687-
if not self.is_solid:
688-
result = self._brep.CapPlanarHoles(TOL.absolute)
689-
if result:
690-
self._brep = result
691-
else:
692-
raise BrepInvalidError("Failed to convert Brep to solid")
696+
tolerance = tolerance or TOL.absolute
697+
result = self._brep.CapPlanarHoles(tolerance)
698+
if result:
699+
self._brep = result
700+
else:
701+
raise BrepError("Failed to cap planar holes")

0 commit comments

Comments
 (0)