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

Relative locations of objects in an assembly are not respected #8

Open
lenianiva opened this issue Jul 20, 2024 · 1 comment
Open
Labels
enhancement New feature or request

Comments

@lenianiva
Copy link
Contributor

lenianiva commented Jul 20, 2024

Consider this:

import cadquery as cq

def makeBox():
    return (
        cq.Solid.makeBox(1, 1, 1)
    )
def makeCylinder():
    return (
        cq.Solid.makeCylinder(height=5, radius=0.2)
    )
result = (
    cq.Assembly()
    .add(makeBox(), name="b")
    .add(makeCylinder(), name="c", loc=cq.Location((0, 0, 3)))
)

When you put this into Blender, the relative locations of these two objects are not respected.

bug

I think we can get this solved along with introducing per member material for each object in an assembly. If the author is fine with this I can write a patch.

@uki-dev
Copy link
Owner

uki-dev commented Oct 13, 2024

Thank you for writing up on this issue.

We could address it by reverting to an internal Assembly -> Compound method, such as assembly.toCompound() or cadquery.exporters.utils.toCompound(assembly). However, this would flatten the assembly into a single shape, reducing flexibility and preventing changes like assigning materials to individual members, as you mentioned.

I’d be happy for you to explore an approach that extends the current system, where each child of the assembly is parsed like any other object 👍

@uki-dev uki-dev added the enhancement New feature or request label Oct 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants