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

BuildPart.add() doesn't work properly with deeply nested Compounds #607

Open
cyberhuman opened this issue Apr 10, 2024 · 0 comments
Open

Comments

@cyberhuman
Copy link

from ocp_vscode import show
from build123d import *

box = Box(10, 10, 10)
comp_box = Compound(children=[box])

sphere = Sphere(6.5)
comp_sphere = Compound(children=[Compound(children=[Compound(children=[sphere])])])

with BuildPart() as nested:
    add(comp_box)
    add(comp_sphere, mode=Mode.SUBTRACT)

with BuildPart() as nested_workaround:
    add(comp_box)
    add(comp_sphere.solids(), mode=Mode.SUBTRACT)

show(
    comp_box.cut(comp_sphere).moved(Pos(-11)),
    nested.part,
    nested_workaround.part.moved(Pos(+11)),
)

image

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