Loading Patterns of Boxes Within a Volume
Lee R. Partin
23 December 2007
lpartin@chartertn.net
Copyright 2007, L R Partin
The model calculates potential loading patterns of boxes within a volume (a larger box). It places the boxes within a given orderly pattern for the main filling of the volume. It then tries to place more boxes in the remaining open spaces. More boxes may be manually added by the user if sufficient free space remains after the automated filling process. Several orientations are tested.
Restart
Restart the Maple kernel to prepare for the model calculations.
Application Coding
Miscellaneous Code
Pattern Module
The programming for the box filling pattern calculations is done within a module called Pattern.
Application of Model
Data / Dimensions
The length, width and height of the box and the fill volume are required. The orientation of the fill volume remains fixed for the calculations. The boxes are assumed to lay flat on one of the sides. They are packed within the volume in orderly structures.
Packing Calculations
Upper Bound on Boxes within the Volume
The upper bound on the amount of boxes that will fit into the volume is calculated by a simple ratio of their volumes.
Trial Packing Patterns
The packing patterns are calculated 6 times since there are six potential orientations of the box for the initial packing structure. Most of the boxes are placed in the initial orientation. The program then tries to fit more boxes with the extra x-axis space. Next, it tries to fit more boxes within the extra y-axis space. Finally, it tries to fit more boxes into the extra z-axis space.
The Initialize routine of the Pattern module has 10 arguments:
arg[1] = name for the series of pattern fits to the volume
arg[2] = box length along the x-axis dimension
arg[3] = box length along the y-axis dimension
arg[4] = box length along the z-axis dimension
arg[5] = volume x dimension
arg[6] = volume y dimension
arg[7] = volume z dimension
arg[8] = x, y or z to set which extra space to 1st try fitting extra boxes
arg[9] = x, y or z to set which extra space to 2nd try fitting extra boxes arg[10] = x, y or z to set which extra space to 3rd try fitting extra boxes
The resulting box loading patterns and the total number of boxes loaded are stored within the Result variable.
Plot a Packing Pattern
The Plot routine of the Pattern module plots the loading patterns that define a given way of filling the volume. The list of loading patterns for a given volume filling was returned as the first element in the solution from Pattern:-Initialize. Enter your desired volume filling number as the variable i. It can be 1 through 6.
The first volume filling has 4 different patterns of box placement. You may view a single box pattern as follows:
Adding More Boxes to a Pattern
The volume filling routine may not find all of the feasible locations to place boxes. You may add more box patterns manually through the Add routine. The Coordinates routine help in determining data needed in the Add routine. Here is an example.
Result 2 did not fill all of the available space as shown in the plot below. More boxes may be placed into the volume.
The Coordinates routine provides data on the individual box patterns within a Result from above. It gives the name, starting coordinate [x,y,z] and ending coordinate [x,y,z] for each of the individual patterns. The starting coordinate is where the first box is placed. The next boxes are placed at increasing values of [x,y,z]. The ending coordinate is the point in the individual fill volume that is diagonal and furthest from the starting coordinate.
The filling pattern from Result 2 has free volume from [0,12,12] to [11,13,14]. It also has a small cavity from [10,12,0] to [11,13,14] that is not big enough to have more boxes. A new filling pattern is now added for the free volume. The Add routine is applied. It has three arguments:
arg[1], the base name of the volume filling (P1, P2, P3, P4, P5 and P6 were used above. It is one of these values.) arg[2], starting coordinate as [x1,y1,z1] (the first box is placed here with more boxes added in increasing [x,y,z]
directions)
arg[3], ending coordinate as [x2,y2,z2] (the ending coordinate defines the volume of the fill box; therefore, x2>x1,
y2>y1, and z2>z1)
Here is a plot of the new set of filling patterns:
Legal Notice: The copyright for this application is owned by the author. Neither Maplesoft nor the author are responsible for any errors contained within and are not liable for any damages resulting from the use of this material. This application is intended for non-commercial, non-profit use only. Contact the author for permission if you wish to use this application in for-profit activities.