Best box
Best box
(OP)
Thanks for any help in advance!!
I'm fairly new to using VBA, and hope you guys can help me. I work for a manufacturing facility, and I'm trying to update our estimating spreadsheet by supplying some automated functions.
We use eight different box sizes for packaging our product, all at various costs. I'm trying to supply an input area for the estimator to enter the three dimensions of the part to be packaged, then have the software calculate the total number of pieces than can fit in each box size, then the most cost-effective box to use.
I've managed to get it to work, to a point. My problem is, this is only with the part turned one way from four possible positions within the box. This leaves empty space in the box, in which a few more parts might be packaged (turned in a different direction). It's a bit like packing books. A row fits fine lined vertically along the bottom, but you can always fit two-three across the top horizontally.
Can anyone think of a way to calculate that empty space, and determine how many pieces can fit? Or is there an easier way of doing all this that I've completely missed?
Thanks!!
I'm fairly new to using VBA, and hope you guys can help me. I work for a manufacturing facility, and I'm trying to update our estimating spreadsheet by supplying some automated functions.
We use eight different box sizes for packaging our product, all at various costs. I'm trying to supply an input area for the estimator to enter the three dimensions of the part to be packaged, then have the software calculate the total number of pieces than can fit in each box size, then the most cost-effective box to use.
I've managed to get it to work, to a point. My problem is, this is only with the part turned one way from four possible positions within the box. This leaves empty space in the box, in which a few more parts might be packaged (turned in a different direction). It's a bit like packing books. A row fits fine lined vertically along the bottom, but you can always fit two-three across the top horizontally.
Can anyone think of a way to calculate that empty space, and determine how many pieces can fit? Or is there an easier way of doing all this that I've completely missed?
Thanks!!





RE: Best box
Not much help but a thought.
Alan M. Etzkorn
Hoffco/Comet Industries Inc.
http://www.hoffcocomet.com
RE: Best box
RE: Best box
Alan M. Etzkorn
Hoffco/Comet Industries Inc.
http://www.hoffcocomet.com
RE: Best box
I've got another idea, though, I'm working on it now.. I should know something within a day or three.
RE: Best box
Let me know how it works out.
Alan M. Etzkorn
Hoffco/Comet Industries Inc.
http://www.hoffcocomet.com
RE: Best box
I don't know how to attach a file to the forum, though.
RE: Best box
Alan M. Etzkorn
Hoffco/Comet Industries Inc.
http://www.hoffcocomet.com
RE: Best box
If I had to start programming (but it's not my intention) I would try first a brute force algorithm, that is the program tries many combinations, chosen in a given sequence or randomly generated, stopping when a sufficiently good result is obtained or a given maximum time has elapsed.
An easier approach would be an extension of what already done by Morglisn:
first fill the box as much as possible with boxes turned into one of (three or four?) possible positions, then for each of these tentatives continue by filling the remaining (three) spaces, taken one at a time as if it was a box, with more (or zero) boxes.
These procedure is not perfect, as the pieces could be alternately turned into different positions to get the best packing density. However it is also possible to determine the maximum possible number of pieces that could fit (by a simple ratio of volumes) so as to decide whether the result obtained so far is sufficiently good.
prex
http://www.xcalcs.com
Online tools for structural design
RE: Best box
Just a thought.
Flores
RE: Best box
Is only for 4 boxes at moment but easily extended to 8 or more.
Have mercy if you see logic bugs!! Was a quickie programme.
I would be interested to know how compared to morlisns answers and if my answers are actually correct by testing in reality!
RE: Best box
Your problem is called a " 3 dimensional bin packing problem"
The "bin packing problem" may also be 1-dimensional (e.g. for pipe cutting which I was after in my thread) or 2 dimensional (e.g. for cutting shapes out of a plate)
Here's the reply I got:
"What you are referring to is a very common problem and referred as "one dimensional bin packing problem/ algorithm". Do an internet search, you will fing both the algorithm as well as some programs. This name apparently came from packing industry where they wanted to optimise number of differenly sized bins for packing odd sized pipes and this is very relevent for you also.
Hope it helps.
flame"
I also hope this helps
Regards
Mogens