Skip to content

Commit

Permalink
ensure parents of joints are handled properly during deep copy
Browse files Browse the repository at this point in the history
  • Loading branch information
bernhard-42 committed Dec 8, 2023
1 parent 0bdaabb commit 376a165
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/build123d/topology.py
Original file line number Diff line number Diff line change
Expand Up @@ -2312,6 +2312,9 @@ def __deepcopy__(self, memo) -> Self:
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 == "joints":
for joint in result.joints.values():
joint.parent = result

Check warning on line 2317 in src/build123d/topology.py

View check run for this annotation

Codecov / codecov/patch

src/build123d/topology.py#L2317

Added line #L2317 was not covered by tests
return result

def __copy__(self) -> Self:
Expand Down

0 comments on commit 376a165

Please sign in to comment.