Skip to content

Commit 8f416a3

Browse files
committed
brep native copy
1 parent 02e5fc4 commit 8f416a3

File tree

1 file changed

+13
-0
lines changed
  • src/compas_rhino/geometry/brep

1 file changed

+13
-0
lines changed

src/compas_rhino/geometry/brep/brep.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ def __init__(self, brep=None):
6565
super(RhinoBrep, self).__init__()
6666
self._brep = brep or Rhino.Geometry.Brep()
6767

68+
def __deepcopy__(self, *args, **kwargs):
69+
return self.copy()
70+
6871
# ==============================================================================
6972
# Data
7073
# ==============================================================================
@@ -88,6 +91,16 @@ def data(self, data):
8891
RhinoBrepFace.from_data(f_data, builder)
8992
self._brep = builder.result
9093

94+
def copy(self, cls=None):
95+
"""Creates a copy of this Brep using the native Rhino.Geometry.Brep copying mechanism.
96+
97+
Returns
98+
-------
99+
:class:`~compas_rhino.geometry.RhinoBrep`
100+
101+
"""
102+
return RhinoBrep.from_native(self._brep.DuplicateBrep())
103+
91104
# ==============================================================================
92105
# Properties
93106
# ==============================================================================

0 commit comments

Comments
 (0)