Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
20 changes: 20 additions & 0 deletions src/compas/geometry/brep/brep.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
25 changes: 25 additions & 0 deletions src/compas_rhino/geometry/brep/brep.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Loading