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

Automatic part layout #608

Open
shish opened this issue Nov 27, 2023 · 1 comment
Open

Automatic part layout #608

shish opened this issue Nov 27, 2023 · 1 comment

Comments

@shish
Copy link
Contributor

shish commented Nov 27, 2023

My laser cutter only supports boards up to 600x500mm, and sometimes boxes generates layouts larger than that, which I need to tweak by hand (which is fine when doing it once, but is a pain when trying to iterate on a design multiple times).

I would love to have a flag like --artboard=600x500, and then parts are automatically laid out inside that space (taking the artboard terminology from Illustrator, but page or pack or anything else is fine if there's a better term)

I have a non-functional proof-of-concept at master...shish:boxes:rectpack (the problem here is that calling move_to on a part that has already been laid out doesn't work like I had hoped)

Also FYI the rectpack library supports multiple boxes, so one can automatically split parts over several pieces of wood, though I'm not sure how this would be rendered if some output formats don't support the concept of multiple pages

@florianfesti
Copy link
Owner

For now the pieces of all generators are layed out "by hand". Given the parametric nature of Boxes.py the layout works better or worse depending on the values given. For now there is no easy way to make this more dynamic in a way you'd want here. It probably is easier to do that as a second step working on the finished drawing. So the right thing would be adding this into the Surface class so it can be done which you still have "Part" objects around and before rendering the drawing into the final format.
The backend was done as a drop-in replacement for libcairo. But if we want to add features like this we might improve some infrastructure there first. E.g. storing the size of parts and may be put them on a separate canvas getting rid of the need to pass the sizes in advance to move().

Overall this is a pretty challenging project to get done right.

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

No branches or pull requests

2 participants