maxrects-packer icon indicating copy to clipboard operation
maxrects-packer copied to clipboard

[FR] Packer free expanding in one dimension

Open JohannesHoffmann opened this issue 2 years ago • 5 comments
trafficstars

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 avatar Mar 07 '23 15:03 JohannesHoffmann

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?

JohannesHoffmann avatar Mar 07 '23 20:03 JohannesHoffmann

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.

soimy avatar Mar 08 '23 00:03 soimy

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

JohannesHoffmann avatar Mar 08 '23 07:03 JohannesHoffmann

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

soimy avatar Mar 08 '23 09:03 soimy