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

[FR] Packer free expanding in one dimension #51

Open
JohannesHoffmann opened this issue Mar 7, 2023 · 4 comments
Open

[FR] Packer free expanding in one dimension #51

JohannesHoffmann opened this issue Mar 7, 2023 · 4 comments

Comments

@JohannesHoffmann
Copy link

I tried different width and heights of a packer like 1500 or 800. But each bins width and height is reduced to the closest number of bineric like 800 is down to 512 and 1500 down to 1024.

Maybe it is not the purpose of this library but i need an option to force the algorithm to use the complete width or the complete height. Is this possible?

Enhancement despide if yes or no: describe this behavior in the readme.

Thanks!

@JohannesHoffmann
Copy link
Author

After a bit of research i understand it more clearly. The main use for this library is to pack rects into a bigger square rect to use this as a textrue or something.

My usecase is very different. I need material utilization. Have a roll of paper with a width of 1500mm. Whats the minimum length i need to set X rects, each rect in different size. I need to fill the complete width and the height results on how many rects can be packed.

Maybe i am the only one needing this behavior?

@soimy
Copy link
Owner

soimy commented Mar 8, 2023

This is because the default packing options are:

  • options.smart packing with smallest possible size. (default is true)
  • options.pot bin size round up to smallest power of 2. (default is true)

For your user case, only fix one dimension of a packer is not implemented, but doable.

@JohannesHoffmann
Copy link
Author

Do you accept PRs? If yes i would implement this feature. Ideas of the option naming?

@soimy
Copy link
Owner

soimy commented Mar 8, 2023

Of course, Feel free to submit PRs. we can discuss more in the commits

@soimy soimy changed the title Packer not using full width or height [FR] Packer free expanding in one dimension Mar 8, 2023
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