mirror of
https://github.com/gumyr/build123d.git
synced 2025-12-06 02:30:55 -08:00
Avoid deepcopy'ing Shape.topo_parent.
Speeds up benchy example from 27s to 5.5s.
This commit is contained in:
parent
1c9cd019a2
commit
4d8dfe16a8
1 changed files with 4 additions and 1 deletions
|
|
@ -866,7 +866,10 @@ class Shape(NodeMixin, Generic[TOPODS]):
|
|||
if self.wrapped is not None:
|
||||
memo[id(self.wrapped)] = downcast(BRepBuilderAPI_Copy(self.wrapped).Shape())
|
||||
for key, value in self.__dict__.items():
|
||||
setattr(result, key, copy.deepcopy(value, memo))
|
||||
if key == 'topo_parent':
|
||||
result.topo_parent = value
|
||||
else:
|
||||
setattr(result, key, copy.deepcopy(value, memo))
|
||||
if key == "joints":
|
||||
for joint in result.joints.values():
|
||||
joint.parent = result
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue