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

grouping bundled rectangles into same bin #26

Open
jeremyforan opened this issue Mar 15, 2019 · 1 comment
Open

grouping bundled rectangles into same bin #26

jeremyforan opened this issue Mar 15, 2019 · 1 comment

Comments

@jeremyforan
Copy link

I would like to add some constraints that will let me ensure some rectangles are guaranteed to be in the same bin.
bundled_rid = [["100023","100024","100142"],["73732","73785"]] packer.pack(groups=bundled_rid)

This would result in each bundle in the array of bundles being in the same bin.

Do you have any recommendations on how I might accomplish this using the existing code? Does this seem like a valid use case?

@secnot
Copy link
Owner

secnot commented Mar 15, 2019

Hi

The simplest way to accomplish what you want is to "pre-pack" each bundle into a single rectangle, pack that, and later substitute the rectangle by the rectangles on the bundle.

Other option is to handle each bin individually, start packing boundles until no more fit and then continue with single rectangles. Then continue with the next bin

If neither option is working for you, or the results are not good enough, you could use the algorithms directly dropping all the packing logic, and building something more custom.

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

No branches or pull requests

2 participants