Calculate quantity of shapes inside another shape

J

jlclyde

Hello,
I have been working on a formula that will calculate how many
rectangles will fit inside another rectangle. I am stuck. For
instance I have a rectange that is 29.125" X 36.125" and I need to
determine how many 4.875" X 7" rectangles I can fit inside to optomize
the original rectangle. Any help woudl be greatly appreciated.

Thanks,
Jay
 
G

GS

jlclyde presented the following explanation :
Hello,
I have been working on a formula that will calculate how many
rectangles will fit inside another rectangle. I am stuck. For
instance I have a rectange that is 29.125" X 36.125" and I need to
determine how many 4.875" X 7" rectangles I can fit inside to optomize
the original rectangle. Any help woudl be greatly appreciated.

Thanks,
Jay

It will depend on how you orient the smaller shapes. For example, if
you put the 4.875" (width) along the 29.125" (width) you can get 5.974
pieces by 5.161 pieces for a total of 25 with lots of left over space.
If you transvers the pieces so they're oriented length along width of
large rectangle, you'll get 28 pieces with little leftover space.

So with the following layout:

A1: 29.125
B1: 36.125
A2: 4.875
B2: 7
C1: =ROUNDDOWN(($A$1/$A$2),0)*ROUNDDOWN(($B$1/$B$2),0) (width/width)
C2: =ROUNDDOWN(($A$1/$B$2),0)*ROUNDDOWN(($B$1/$A$2),0)
(length/width)
 
J

jlclyde

jlclyde presented the following explanation :



It will depend on how you orient the smaller shapes. For example, if
you put the 4.875" (width) along the 29.125" (width) you can get 5.974
pieces by 5.161 pieces for a total of 25 with lots of left over space.
If you transvers the pieces so they're oriented length along width of
large rectangle, you'll get 28 pieces with little leftover space.

So with the following layout:

  A1:  29.125
  B1:  36.125
  A2:   4.875
  B2:   7
  C1:  =ROUNDDOWN(($A$1/$A$2),0)*ROUNDDOWN(($B$1/$B$2),0) (width/width)
  C2:  =ROUNDDOWN(($A$1/$B$2),0)*ROUNDDOWN(($B$1/$A$2),0)
(length/width)

--
Garry

Free usenet access athttp://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc

Garry,
thanks for the reply. I need to know what the maximum number I can
get out of the larger rectangle. The smaller shapes could be
orientated any direction. Is there a formula that could determine how
many go length wise and how many go width wise?

Thanks,
Jay
 
G

GS

jlclyde brought next idea :
Garry,
thanks for the reply. I need to know what the maximum number I can
get out of the larger rectangle. The smaller shapes could be
orientated any direction. Is there a formula that could determine how
many go length wise and how many go width wise?

Thanks,
Jay

I just gave you formulas for determining both orientations. You can
choose from the results which orientation to choose.

If you mean a mix/match of orientations (ie: some width, some length)
then I suggest using CAD software or hope someone who does shipping in
containers/trailers for some algorithms that you can use.
 
G

GS

Just so you understand why I suggest using CAD software...

Some CAD/CAM software have utilities for figuring out the maximum yield
from a given size of material stock for given component size envelopes.
These can even be mixed size envelopes, yield different parts from the
same material stock. For example, a 4 x 8 sheet of aluminum would be
plotted to yield n pieces of part#a and n pieces of part#b, or any
number of other pieces so as to effect minimum waste of material stock.

The most typical usage would be EDM or plasma/flame cutting apps,
followed by CNC part programming software.
 
J

jlclyde

Just so you understand why I suggest using CAD software...

Some CAD/CAM software have utilities for figuring out the maximum yield
from a given size of material stock for given component size envelopes.
These can even be mixed size envelopes, yield different parts from the
same material stock. For example, a 4 x 8 sheet of aluminum would be
plotted to yield n pieces of part#a and n pieces of part#b, or any
number of other pieces so as to effect minimum waste of material stock.

The most typical usage would be EDM or plasma/flame cutting apps,
followed by CNC part programming software.

--
Garry

Free usenet access athttp://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc

Gary,
Thanks again for the clarification, but I do need the shapes to go
both directions. we currently have a software program that does this,
I was just wondering what the formula would look like in Excel. We
often change the parent size, which is stored in excel. Then we have
to plug the numbers back into the program to get the new number out.
I was hoping I could have it make the one change and be done with it.

Thanks,
Jay
 
G

GS

jlclyde brought next idea :
Gary,
Thanks again for the clarification, but I do need the shapes to go
both directions. we currently have a software program that does this,
I was just wondering what the formula would look like in Excel. We
often change the parent size, which is stored in excel. Then we have
to plug the numbers back into the program to get the new number out.
I was hoping I could have it make the one change and be done with it.

Thanks,
Jay

Jay,
I guess, then, that whatever program you have that does this is what
I'm referring to. To reproduce what it does would require knowing what
algorithm it uses. I doubt the author would release that info and so
why bother trying to dupe in Excel what you already have dedicated
software to do (besides licensing restrictions).
 
J

jlclyde

jlclyde brought next idea :




Gary,
Thanks again for the clarification, but I do need the shapes to go
both directions.  we currently have a software program that does this,
I was just wondering what the formula would look like in Excel.  We
often change the parent size, which is stored in excel.  Then we have
to plug the numbers back into the program to get the new number out.
I was hoping I could have it make the one change and be done with it.
Thanks,
Jay

Jay,
I guess, then, that whatever program you have that does this is what
I'm referring to. To reproduce what it does would require knowing what
algorithm it uses. I doubt the author would release that info and so
why bother trying to dupe in Excel what you already have dedicated
software to do (besides licensing restrictions).

--
Garry

Free usenet access athttp://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc- Hide quoted text -

- Show quoted text -


Gary,
I want to do this in excel because I do not want to have to go back
out of excel to calculate how many I can get out a parent size stock.
Thanks for your comments.
Thanks,
Jay
 
G

GS

jlclyde explained :
I want to do this in excel because I do not want to have to go back
out of excel to calculate how many I can get out a parent size stock.

Jay,
Yeah, I can understand that. The software I use (SolidWorks) supports
'Design Tables' which are Excel spreadsheets, and so this is
integrated. I'll see what I can find out about how this is done...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top