Auto determine containers? #47
HeavenCore
started this conversation in
General
Replies: 1 comment 2 replies
-
You can calculate that number a priori, but the number is worthless. especially when you have multiple size packs. What you need to do is to make an "inventory" of what you have available to pack after each pass. If you started with 5 items and packed 3, recalculate the number of items to pack (and any other relevant variable) at the end, then start all over again with the remaining 2 items as if nothing happened. Just remember to keep each packing somewhere (memory, file, etc.) and append each new packing to it. Your code will end when there's no more items to pack and you will had created a multi-pass packer. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
How can we determine the required number of containers?
e.g. Create an item to pack as follows: L=550, W=400, H=100
Next create a container of L=600, W=300, H=300
3DContainerPacking correctly determines that 3 of these items can fit in the container and shows how 2 items "unpacked"
Now imagine multiple size packs, i may need any number of containers to pack all the items, right now, especially with the MVC example, i cant see any way of doing that? If i add a 2nd container with the same dimensions the MVC example just duplicates 3 packed, 2 not packed for both containers - which is not what i was expecting. I was expecting the 1st container to be allocated 3 and the 2nd container to be allocated the remaining 2.
Does the library not support this?
Beta Was this translation helpful? Give feedback.
All reactions