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

Rendering a compound made of multiple object types ignores labels and colors #125

Open
dalibor-frivaldsky opened this issue Nov 28, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@dalibor-frivaldsky
Copy link

The code below creates three compounds with build123d, but only the last two display the specified labels and colors of the shown objects. When combining multiple types of objects (e.g. Parts and Sketches), as is being done in the first compound, none of these properties are taken into account.

with BuildPart() as box:
    Box(10, 10, 10)

with BuildSketch() as rectangle:
    Rectangle(10, 10)

compound_multiple = Compound(
    label='Multiple object types',
    children=[
        Compound(box.part, label='Box', color=Color('red')),
        Compound(Pos(20, 0, 0) * rectangle.sketch, label='Rectangle', color=Color('green'))
    ]
)

with BuildPart() as box2:
    Box(10, 10, 10)

compound_parts_only = Compound(
    label='Boxes only',
    children=[
        Compound(box.part, label='Box', color=Color('red')),
        Compound(Pos(20, 0, 0) * box2.part, label='Box 2', color=Color('blue'))
    ]
)

with BuildSketch() as rectangle2:
    Rectangle(10, 10)

compound_sketches_only = Compound(
    label='Rectangle only',
    children=[
        Compound(rectangle.sketch, label='Rectangle', color=Color('green')),
        Compound(Pos(20, 0, 0) * rectangle2.sketch, label='Rectangle 2', color=Color('yellow'))
    ]
)

show(compound_multiple)
image

show(compound_parts_only)
image

show(compound_sketches_only)
image

@bernhard-42 bernhard-42 added the bug Something isn't working label Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants