A manufacturer, who produces different sizes of regular 3D objects, purchased a machine that cuts connected carton surfaces and forms a square box when folded. The customer specifies the sizes of the objects in his order ; the manufacturer feeds the information to specific machines to produce the objects. The new machine needs to have the three dimensions of the box to be able to form it. In order to form the box and decrease the cost, a program code is required to determine the dimensions of the box suitable for each object.
One approach to the solution of the problem is to find the minimum size
of the square box that fits each object. This will certainly minimize the
cost, but will also be a very expensive task and time consuming. This approach
is beyond the scope of the project.
Another approach is to find the square box that fits each object in
a way that decreases the size of the box. If we find the maximum plain
surface of an object and assume that the object will rest on it on the
box base, the scope of the problem will narrow to become finding the other
five boundaries of the object that will determine the size of the square
box.
The only difference between the previous approach and the current one
is that the previous approach suggests that only the face of the largest
area can rest on the box base, whereas the current approach suggests that
any one of the faces can rest on the box base.
The algorithm of finding the box of the minimum size:
./pack
The user will be asked to enter:
1) The name of the file to read data.
2) A name of a file to save results.
3) The tolerance for box dimensions.
The file that contains the data about the object must have this format:
v x0 y0 z0
v x1 y1 z1
v x2 y2 z2
.
.
v xn yn zn
f i0 i3 i10 ....
f i1 i9 ....
.
.
The tolerance for box dimensions specifies the accuracy of the box dimensions.
In the real world, the program should be installed into the machine. That means there will be no user interface. The program will receive the data directly from the machines that produces the objects. Then the results will be used to form the needed box.