Skip to content

Labels missing when using export_step on nested compounds. #954

Open
@jsmnbom

Description

@jsmnbom

When nesting compounds are used, the labels are lost when exporting.

Example:

cube = Box(1,1,1)
cube.label = 'Cube'

arm = Compound(
  label="Arm",
  children=[
    copy.copy(cube),
  ]
)

assembly = Compound(
  label="Root",
  children=[
    copy.copy(arm),
    copy.copy(arm).locate(Pos(10,0,0))
  ]
)

print(assembly.show_topology())
build123d.export_step(assembly, 'build/assembly.step')

Shows correct topology tree:

Root         Compound at 0x74cc4dde22b0, Location(p=(0.00, 0.00, 0.00), o=(-0.00, 0.00, -0.00))
├── Arm      Compound at 0x74cc4dde1db0, Location(p=(0.00, 0.00, 0.00), o=(-0.00, 0.00, -0.00))
│   └── Cube Box      at 0x74cc4de24a10, Location(p=(0.00, 0.00, 0.00), o=(-0.00, 0.00, -0.00))
└── Arm      Compound at 0x74cc4dde2850, Location(p=(10.00, 0.00, 0.00), o=(-0.00, 0.00, -0.00))
    └── Cube Box      at 0x74cc4de24ad0, Location(p=(0.00, 0.00, 0.00), o=(-0.00, 0.00, -0.00))

But if opened in any external program the step file looks more like this:

Image

Applying the fix in #953 gets us closer to the correct result:

Image

Unfortunately it still leaves the Solids unnamed which is not optimal.
Ideally it would end up like this:

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions