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
Packing result is worse when rotation allowed #14
Comments
I don't think so... Could you please give me you test assets and pack options? |
I'm also seeing this, not always but often. Using MaxRectsPacker and Smart method. Can supply assets if needed privately |
@odrick Sorry I can't supply assets because it's private assets, and currently have no time to give a minimal test case. |
Here is one example of the gitlab diff for such a case: Tagging @qtiki to see if he may be able to shed any light. |
i've emailed source assets |
Thanks. I will investigate this problem next week. |
Any update here? |
Ok, this is a maxrects-packer bug. Reported: soimy/maxrects-packer#14 |
Sorry guys for the radio silence, I've been quite busy with other stuff. I don't think this is a bug as such. The way that these packing algorithms work is that they sort the bins based on some arbitrary rules and then try to guess the best fit locally (first-fit) to any given area. The problem is that while the guess might be a good thing locally it might cause problems later on in the packing. If the algorithm were to try all the possible combinations to find the "perfect" match it would become exponentially slower. If you're interested in more details I recommend reading the Wikipedia page Bin packing problem. In regards to the |
Ok. OptimalPacker now check all combos with/without rotation. |
This PR #6 fixed options not passing through.
However, after allowing rotation, my packing result needs more area. (Can't fit in original constraint size)
I have to manually disable rotation to ensure my result the same as before.
Is this a normal case?
The text was updated successfully, but these errors were encountered: