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

Unable to access bin_algo #24

Open
virsto opened this issue Oct 26, 2018 · 6 comments
Open

Unable to access bin_algo #24

virsto opened this issue Oct 26, 2018 · 6 comments

Comments

@virsto
Copy link

virsto commented Oct 26, 2018

I have download and installed this package but found that I could not change bin_algo and sort_algo. I did get sort_algo to work (able to change it) by moving the lamba functions to the main program; but have been uable to access/change bin_algo.

@secnot
Copy link
Owner

secnot commented Oct 26, 2018

Most probably is an import problem, could you provide a simple code snippet where it fails?

Thank you

@virsto
Copy link
Author

virsto commented Oct 27, 2018

Yes, Secnot
Here is some code that used for a simple box (without a top). I plan to construct such a box from an arcrylic sheet and thought it would be interesting to see how rectpack would arrange them on the sheet. And thanks very much for putting your package into GitHub.
RectanglePack_02.txt

@virsto virsto closed this as completed Oct 27, 2018
@virsto
Copy link
Author

virsto commented Oct 27, 2018

I should not have closed this!!

@virsto virsto reopened this Oct 27, 2018
@secnot
Copy link
Owner

secnot commented Oct 27, 2018

It ran without problems.

I removed all the SORT_NONE, SORT_AREA definitions, then imported the full package with:

from rectpack import *

If it doesn't work for you probably it isn't installed correctly, try using virtualenv and pip3 it should work flawlessly.

mkvirtualenv -p /usr/bin/python3 --no-site-packages rectangle_env
pip3 install matplotlib numpy rectpack pillow

@virsto
Copy link
Author

virsto commented Oct 27, 2018

Yes! My import was rather limited --- I should have seen this. Keep up the good work. It would be interesting to know more about how to use rectpack to make guillotine cuts.

@secnot
Copy link
Owner

secnot commented Oct 30, 2018

The guillotine algorithm implementation doesn't track the start and end of each cut.

You can deduce them using the packing result, or patch the algorithm to store the cut each time a rectangle is placed.

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