Skip to content

Commit 13d98c7

Browse files
authored
Merge branch 'main' into surface_types
2 parents 169ecd1 + 5a688ac commit 13d98c7

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1717

1818
* Updated workflows to v2.
1919
* Fixed attribute error in `compas_rhino.conversions.ellipse_to_compas`.
20+
* Changed deepcopy of `RhinoBrep` to use the native `Rhino.Geometry` mechanism.
21+
* The normal of the cutting plane is no longer flipped in `compas_rhino.geometry.RhinoBrep`.
2022

2123
### Removed
2224

src/compas_rhino/geometry/brep/brep.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ def __init__(self, brep=None):
6666
super(RhinoBrep, self).__init__()
6767
self._brep = brep or Rhino.Geometry.Brep()
6868

69+
def __deepcopy__(self, *args, **kwargs):
70+
return self.copy()
71+
6972
# ==============================================================================
7073
# Data
7174
# ==============================================================================
@@ -89,6 +92,17 @@ def data(self, data):
8992
RhinoBrepFace.from_data(f_data, builder)
9093
self._brep = builder.result
9194

95+
def copy(self, cls=None):
96+
"""Creates a deep-copy of this Brep using the native Rhino.Geometry.Brep copying mechanism.
97+
98+
Returns
99+
-------
100+
:class:`~compas_rhino.geometry.RhinoBrep`
101+
102+
"""
103+
# Avoid reconstruction when just copying. for sake of efficiency and stability
104+
return RhinoBrep.from_native(self._brep.DuplicateBrep())
105+
92106
# ==============================================================================
93107
# Properties
94108
# ==============================================================================
@@ -237,7 +251,7 @@ def trim(self, trimming_plane, tolerance=TOLERANCE):
237251
Parameters
238252
----------
239253
trimming_plane : :class:`~compas.geometry.Frame` or :class:`~compas.geometry.Plane`
240-
The frame or plane to use when trimming.
254+
The frame or plane to use when trimming. The discarded bit is in the direction of the frame's normal.
241255
242256
tolerance : float
243257
The precision to use for the trimming operation.

0 commit comments

Comments
 (0)