View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
GS[_2_] GS[_2_] is offline
external usenet poster
 
Posts: 3,514
Default Calculate quantity of shapes inside another shape

jlclyde brought next idea :
On Jul 5, 8:38*pm, GS wrote:
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)

--
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


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.

--
Garry

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