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

Empty leaf node in assembly STEP export #1170

Closed
lorenzncode opened this issue Oct 4, 2022 · 1 comment · Fixed by #1157
Closed

Empty leaf node in assembly STEP export #1170

lorenzncode opened this issue Oct 4, 2022 · 1 comment · Fixed by #1157
Labels

Comments

@lorenzncode
Copy link
Member

This is a follow up to #993.

The following results in a STEP with empty leaf node "toplevel" due to the empty top/root object.

import cadquery as cq

box = cq.Workplane().box(1, 2, 3)

assy = cq.Assembly(name="toplevel")
assy.add(box, name="box1")
assy.add(box, name="box2", loc=cq.Location((4, 0, 0)))

assy.save("boxes.step")

image

I think this leaf node can be considered extraneous. Is there a use case for the empty leaf node? If not, I'd suggest to remove it.

Compare with the toVTK based export formats where there is a conditional check on shapes:

if assy.shapes:

@adam-urbanczyk
Copy link
Member

AFAIR it represents a Location - nodes always have a transformation but not always shapes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants