-
Notifications
You must be signed in to change notification settings - Fork 107
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
Rotate some rectangles #14
Comments
You can enable or disable rotation when the packer is created:
but it is an all or nothing proposition, all the rectangles can be rotated or none can, the algorithm decides which ones to rotate to obtain the best packing. The next release will allow to individually enable or disable rotation for each rectangle. |
Hello, |
Hi I'm currently working on a polygon packing library, and had planed to refactor and add a few of the missing functionalities to rectpack after that. Adding per rectangle rotation is easy, the cleaner solution would be to just disable or remove rotation from all the algorithms, and have Packer manage rotation (slower). The other option is to modify the algorithms as you have said. The problem is all the testing that is required before it can be marked as 'production ready' and then released. So I'm waiting to fix all in one go to pass testing only once. If there are no delays I expect to start working on rectpack on September, and to finish in a week or two after that. |
Thank you for the reply. |
Hi You could use one of the algorithms directly without all the packer logic, for each bin create an instance of the algorithm with rotation disabled, then when you place a rectangle check its fitness for the normal or the rotated version (when allowed) and place the lower one. If you have several rectangles you can get the fitness for all of them and place the best. About the global rotation being ignored, if you can provide a code snippet where it happens I will look into it. |
Thank you for the reply secnot. Actually I had discovered a small issue on my inputs which caused the bad rotation behaviour, once that was fixed everything worked well. |
How to specify which rectangles can rotate for best packing, and what cant?
The text was updated successfully, but these errors were encountered: