Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compound.do_children_intersect has side effects #888

Open
bernhard-42 opened this issue Jan 29, 2025 · 0 comments
Open

Compound.do_children_intersect has side effects #888

bernhard-42 opened this issue Jan 29, 2025 · 0 comments

Comments

@bernhard-42
Copy link
Collaborator

Compound.do_children_intersect seems to have a side effect.

I use build123d/docs/tutorial_joints.py and add two debug statements:

diff --git a/docs/tutorial_joints.py b/docs/tutorial_joints.py
index e6d2fd3..b45e0f0 100644
--- a/docs/tutorial_joints.py
+++ b/docs/tutorial_joints.py
@@ -331,9 +331,11 @@ m6_screw.parent = box_assembly
 print(box_assembly.show_topology())

 # [Check that the components in the assembly don't intersect]
+print("DEBUG(1)", box.joints["hinge_attachment"].parent.volume)
 child_intersect, children, volume = box_assembly.do_children_intersect(
     include_parent=False
 )
+print("DEBUG(2)", box.joints["hinge_attachment"].parent.volume)
 print(f"do children intersect: {child_intersect}")
 if child_intersect:
     print(f"{children} by {volume:0.3f} mm^3")

It leads to the output

DEBUG(1) 1940751.7699835314
DEBUG(2) 0
do children intersect: False
``´
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant