a moment based metric for 2d and 3d packinga moment based metric for 2d and 3d packing john k....

17
Page 1 of 17 A moment based metric for 2D and 3D packing John K. Dickinson and George K. Knopf Department of Mechanical and Materials Engineering, Faculty of Engineering Science, University of Western Ontario, London, Ontario, N6A 5B9, Canada Abstract The most common metric used today to evaluate the effectiveness of a packing technique is the percentage of space used. An inherent limitation of this metric is its inability to differentiate between two different packing arrangements of the same set of objects. This paper proposes an alternative metric for both the 2D and 3D cases, called the point moment metric, and expands on the theory behind the proposed metric. The metric is based on evaluating the compactness of the remaining free space in a packing arrangement. This measure is the ratio of a defined moment calculated for the current free space and the initial free packing space. The developed metric can be extended to N- dimensional packing problems where N = {1, 2, ...}. The arbitrary 3D shape packing problem is used as an illustration of an application of the metric. The point moment metric has not been developed to replace the measurement of the percentage of volume used but rather to complement it by allowing efficient comparison of apparently equivalent packing arrangements using the same volume of space. It is not suited for comparing two packing arrangements occupying different volumes. Keywords: Multi-dimensional packing; optimization; packing metrics. 1. Introduction Rapid prototyping, also known as solid freeform fabrication, is a recent addition to modern manufacturing techniques. What distinguishes rapid prototyping from the more conventional manufacturing processes is that arbitrarily shaped parts are formed directly from the geometric models generated by a CAD (computer aided design) system. Layered manufacturing, the most common approach to rapid prototyping builds a physical prototype of an object by forming or stacking layers, or slices, of material on previous layers until the object’s form is completed. Although several commercial layered manufacturing methods exist, they are all limited to working within a fixed volume, called the “build volume”. In general, a large portion of the build volume remains unused when creating only one object. As well, the time required to produce each layer is fairly constant and thus independent of a layer’s surface area or boundary details. Thus, the overall efficiency of the manufacturing process can be greatly improved by packing several objects in the same build volume. Two-dimensional (2D) and three-dimensional (3D) packing problems have been investigated for over twenty years and are reviewed by Dowsland [4], Dudzinski and Walukiewicz [6], Dowsland and Dowsland [5], Dyckhoff [7], and Li [10]. Research interest in spatial packing has not been limited to the field of operational research. Packing problems

Upload: others

Post on 19-Mar-2020

8 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: A moment based metric for 2D and 3D packingA moment based metric for 2D and 3D packing John K. Dickinson and George K. Knopf ... The arbitrary 3D shape packing problem is used as an

Page 1 of 17

A moment based metric for 2D and 3D packing

John K. Dickinson and George K. KnopfDepartment of Mechanical and Materials Engineering, Faculty of Engineering Science,

University of Western Ontario, London, Ontario, N6A 5B9, Canada

Abstract

The most common metric used today to evaluate the effectiveness of a packing technique is the percentage of space

used. An inherent limitation of this metric is its inabilit y to differentiate between two different packing arrangements

of the same set of objects. This paper proposes an alternative metric for both the 2D and 3D cases, called the point

moment metric, and expands on the theory behind the proposed metric. The metric is based on evaluating the

compactness of the remaining free space in a packing arrangement. This measure is the ratio of a defined moment

calculated for the current free space and the initial free packing space. The developed metric can be extended to N-

dimensional packing problems where N = { 1, 2, ...} . The arbitrary 3D shape packing problem is used as an ill ustration

of an application of the metric. The point moment metric has not been developed to replace the measurement of the

percentage of volume used but rather to complement it by allowing eff icient comparison of apparently equivalent

packing arrangements using the same volume of space. It is not suited for comparing two packing arrangements

occupying different volumes.

Keywords: Multi-dimensional packing; optimization; packing metrics.

1. Introduction

Rapid prototyping, also known as solid freeform fabrication, is a recent addition to modern manufacturing

techniques. What distinguishes rapid prototyping from the more conventional manufacturing processes is that arbitrarily

shaped parts are formed directly from the geometric models generated by a CAD (computer aided design) system.

Layered manufacturing, the most common approach to rapid prototyping builds a physical prototype of an object by

forming or stacking layers, or slices, of material on previous layers until the object’s form is completed. Although

several commercial layered manufacturing methods exist, they are all li mited to working within a fixed volume, called

the “build volume”. In general, a large portion of the build volume remains unused when creating only one object. As

well , the time required to produce each layer is fairly constant and thus independent of a layer’s surface area or boundary

details. Thus, the overall eff iciency of the manufacturing process can be greatly improved by packing several objects

in the same build volume.

Two-dimensional (2D) and three-dimensional (3D) packing problems have been investigated for over twenty years

and are reviewed by Dowsland [4], Dudzinski and Walukiewicz [6], Dowsland and Dowsland [5], Dyckhoff [7], and

Li [10]. Research interest in spatial packing has not been limited to the field of operational research. Packing problems

Page 2: A moment based metric for 2D and 3D packingA moment based metric for 2D and 3D packing John K. Dickinson and George K. Knopf ... The arbitrary 3D shape packing problem is used as an

Page 2 of 17

Figure 1: Example of packing problems in 1D, 2D and 3D environments. In each case, of thetwo packing arrangements ill ustrated, the second arrangement is “ intuitively” better since theremaining free space or material is more useful.

are viewed as multidimensional extensions of the bin packing and backpack/knapsack problems found in the fields of

computer science and physics [6, 9, 8]. Packing problems which are evaluated solely on the eff icient use of the available

space, such as the stock cutting problem [7], can be considered “pure” packing problems. The objective is to minimize

the amount of material wasted when cutting parts from fixed stock pieces such as sheet metal, tubing or cloth.

When pure packing problems are evaluated based solely on the percentage of space used it is not possible to

differentiate between different packing arrangements of the same objects as depicted in Figure 1. In each example, the

second packing or cutting arrangement is “ intuitively” more eff icient than the first. The reason for this is that the second

arrangement allows a greater variety of object shapes and sizes to be added at a later time to the packing arrangements.

This ill ustrates why it makes more sense to arrange objects so that the remaining space or material is as compact as

possible.

In the 1D case, simply pushing each segment to be cut end to end as shown in the second arrangement leaves a single

piece of material behind instead of several small unusable bits. For the 1D case the packing arrangement which

maximizes the usefulness and compactness of the remaining material is easily found. Human beings attempt to do the

same for 2D and 3D situations. When a human being packs the trunk of a car they typically pack one object at a time,

placing each object in the container as “best as possible” before adding the next. To perform packing in a similar

fashion, a computer requires some way of picking the “best” position for an object from numerous potential positions

in the container. A measure of compactness of the remaining free space in the container could be used to differentiate

between potential object positions.

This paper briefly reviews the notions of compactness and continuity and then presents the point moment as a

measure of compactness for N-dimensional (ND) space. The paper goes on to develop a metric for comparing two

different packing arrangements of the same objects based on this moment. The mathematical properties that make the

Page 3: A moment based metric for 2D and 3D packingA moment based metric for 2D and 3D packing John K. Dickinson and George K. Knopf ... The arbitrary 3D shape packing problem is used as an

Page 3 of 17

Figure 2: White region is an example of a continuous but notvery compact region of space. Subregions a and b are connectedby a narrow neck.

point moment and derivative metric useful for packing algorithms are then discussed. An algorithm is then presented

to calculate the metric and its computational costs are shown to be small. Finally, the metric is illustrated in use in the

arbitrary 3D shape packing problem.

2. Concepts of continuity and compactness

If it were possible to know ahead of time what particular shape would need to be packed at the last moment, then

the best packing would leave a perfectly shaped space for the object while filling in the rest of the container. This

information is not usually available as in the case when packing for effective use of build volumes in rapid prototyping.

Rapid prototyping bureaus typically take orders for prototypes from a large variety of industries including the

automotive, toy, medical and packaging industries. No study has yet been done to identify any trends in shapes or

dimensions of parts produced by an average rapid prototyping bureau. Similarly, no statistical information is available

on the sorts of shapes used in industries that employ die stamps to cut parts from sheet metal, or from the average

industry involved in cutting cloth materials or plastics sheets into parts. While lacking this a priori knowledge, the

usability of the remaining free space in a packing can only be measured by assessing its continuity and compactness.

Continuity can be defined as the property of being uninterrupted or unbroken. In more rigorous mathematical terms

a region of space, R, is continuous if for every two points within the region, there exists a path entirely in the region R

that connects the two points. Without continuity, the remaining free space maybe subdivided into small regions, each

being too small to contain a part on its own. Unfortunately continuity, in a purely mathematical sense, is not a very

useful criterion for real world packing applications since having a very narrow connection between two subsections of

a region (e.g. subregions a and b in Figure 2) is in general, no better than having two separate regions. Checking for

continuity is also computationally intensive as the only way to know if two subregions of space are continuously

Page 4: A moment based metric for 2D and 3D packingA moment based metric for 2D and 3D packing John K. Dickinson and George K. Knopf ... The arbitrary 3D shape packing problem is used as an

Page 4 of 17

connected is by making a path through free space between them. Checks would have to be made to ensure each segment

of any generated path does not pass through any packed objects.

The term compact is defined as “having parts or units closely packed or joined” and “occupying a small volume

by reason of efficient use of space” [11]. Keeping the remaining free space compact helps ensure that the free space

is not a long set of connected but slender spatial regions within which no reasonable object could possibly fit (see Figure

2). An added benefit is that as a region becomes more compact it is less likely to be discontinuous. Hence, regions of

high compactness provide a reasonable assurance of continuity as well. A proposed measure of the compactness of a

region of ND space is discussed below.

3. The point moment metric (� �

)

In 1D space, a continuous line segment is the most compact region possible. In 2D space, the disc is the most

compact region and in 3D space, the sphere is the most compact region. In higher dimensions, the most compact regions

are described as hyper-spheres. Correspondingly, a measure of the “spherity” of the remaining free space can provide

a good assessment of the compactness of the free space. Moments of areas, also known as area moments of inertia, are

a common concept in engineering and can be used to develop the theory supporting the proposed metric for measuring

the compactness of a region of space. Since moments of areas are defined for 2D spaces, the theory for the metric

proposed for 2D problems will be developed first and then extended an arbitrary number of dimensions.

3.1 Development of the 2D point moment metric (� �

)

Moments of areas (area moments of inertia) are part of the theoretical foundation of mechanics of materials and

are used to determine deflections under load [1]. For an area, A, defined in the x-y plane, as shown in Figure 3, the

second moment of an area with respect to the x axis (Ix) is defined to be;

(1)I d AAx y= ∫ 2

and with respect to the y axis (Iy);

. (2)I dAAy x= ∫ 2

The polar moment of inertia around the origin, i.e. with respect to both axes at once, in given by;

(3)J d A I Io A= = +∫ ρ 2

x y

where is the radius.ρ = +x y2 2

To facilitate extending the metric to multiple dimensions the polar moment can be rewritten in a vector notation.

Let x be a vector describing a point in the N-dimensional space in question. In this case, x is a 2-dimensional vector x

= [x, y]. The length of x is represented by � . The distance squared from any point to the origin can be expressed as the

dot product of the vector representing the point; i.e. � 2 = x � � x . Thus, the polar moment of inertia around the origin

can be written as

Page 5: A moment based metric for 2D and 3D packingA moment based metric for 2D and 3D packing John K. Dickinson and George K. Knopf ... The arbitrary 3D shape packing problem is used as an

Page 5 of 17

Figure 3: An illustration showing each term found inthe formulas for moments of areas or area moments ofinertia.

. (4)J dAo A= ⋅∫ ( )x x

The location of the region under consideration relative to the origin will have a great impact on the value of the

moment of inertia around the origin (Jo). To eliminate this effect it is possible to take the moment, Jc , about the

area’s centroid xc . Note that xc is currently a 2-dimensional vector but will later be extended to an N-dimensional

vector. The moment about xc is given by

(5)J dAc c cA= − ⋅ −∫ ( ) ( )x x x x

Given regions of the same area but of different shapes, the polar moments of inertia around the centroids of the

various regions (Jc) is smallest for the region that most closely resembles a disc. In fact, Jc, will monotonically decrease

as a region with a fixed area becomes more compact. This will be discussed in Section 4. Consequently, Jc, can be used

to evaluate and compare the compactness of several possible regions of the remaining free space. Since Jc

monotonically decreases as the region gets more compact it is useful for optimization routines that seek to rearrange

packing layouts such that the remaining free space is in the most compact form possible. However, Jc has units of length

raised to the power of four (e.g. m4, in4) and its range of values could be from thousandths of a unit to thousands of

units. Working with a ratio of Jc for the remaining free space divided by Jc for the initial empty packing volume

provides a simple solution to these dimensional difficulties.

Now define the point moment metric (� �

) for the 2D case as being;

(6)� �

= J Jcfree a rea

co r ig a rea_ _

where is the centroid polar moment of inertia for the remaining free area available for packing and isJ cfree a rea_ J c

o rig a rea_

Page 6: A moment based metric for 2D and 3D packingA moment based metric for 2D and 3D packing John K. Dickinson and George K. Knopf ... The arbitrary 3D shape packing problem is used as an

Page 6 of 17

the centroid polar moment of inertia for the initial empty packing space.

The point moment metric � �

has several useful properties. First, when the packing space is completely unused � �

= 1. Second, when the entire packing area is occupied � � = 0. Third, the metric is dimensionless and, therefore,

independent of the length of the unit used to describe the packing arrangement. Fourth and most importantly, � � will

monotonically decrease as the remaining free space becomes more compact just as does the measure Jc. Section 4

discusses the properties of the metric in more detail.

3.2 Development of the general ND point moment metric (� � �

The 2D metric was developed based on area moments of inertia that were determined around an axis perpendicular

to the plane of the region and passing through the centroid of the area. This moment, Jc, cannot be defined for regions

which are not areas such as regions that occur in 1D, 3D and ND spaces (not including 2D spaces). However, the

integral evaluated in the 2D case to get the moment is basically the integral of the distance from every point in the area

to the centroid. Define the point moment � � as a similar integral for ND spaces instead of area moment of inertia.

Calling the integral the point moment captures the nature of the moment as being around the centroid point no matter

how many dimensions the region has. The integral is no longer being taken over an area A but rather over an ND region

R. Define x as being the ND vector describing any point in the ND space and xc as being the ND vector defining the

region R’s centroid. Thus the point moment � � is defined as:

(7)� �

= − • −∫ ( ) ( )x x x xc cRd R

where R is the ND region in question, whether it is a length, area, volume, or hyper-volume. Good estimates of point

moments can be readily calculated for 3D regions from voxel or faceted B-Rep descriptions (Section 4).

Note that � � is equivalent to Jc for the 2D case. Now define the point moment metric � �

as:

(8)� � � � � �

= free space orig space_ _

where � � free_space is the moment for the remaining free ND space available for packing and � � orig_space is the initial

empty ND packing space. This definition is viable for ND spaces and keeps all the properties mentioned earlier for

the 2D case.

4. Point moment and metric properties

Several properties have been built into the point moment � � and point moment metric � �

by design. This section

expands on each of these properties and discusses their importance for use in packing algorithms. The theorems and

proofs referred to here appear in Appendix A.

Page 7: A moment based metric for 2D and 3D packingA moment based metric for 2D and 3D packing John K. Dickinson and George K. Knopf ... The arbitrary 3D shape packing problem is used as an

Page 7 of 17

Though the following discussion applies to the metric in all dimensional cases, unless explicitly stated, it is easier

to refer to everything in common 3D terms. “Region” will be used to refer to a sub-set of the ND-space and is thus a

term specifying the geometry or the entity of the sub-set of space. “Volume” will be used to refer to the size of the ND-

space a region occupies (e.g. length for 1D spaces, area for 2D spaces, volume for 3D spaces or ND-hyper volume for

ND spaces) and is thus a scalar measure of the size of the region.

The first significant property is that the metric � � has a limited range, starting at 1 when the packing space is entirely

empty (free) and ending at 0 when no free space remains. This is the simple result of defining the metric as the ratio

of two point moments � � . The denominator of the ratio, the point moment of initially free space, remains as a positive

constant while the numerator, the point moment of the remaining free space, starts as equal to the denominator and drops

towards zero. The second significant property is that the metric is continuous as shown in Theorem 1 (Appendix A).

These properties are important since many common optimization routines perform best on functions with defined value

ranges or rely on the gradients of continuous functions to converge.

Note that � � will not have a unique value for every possible packing configuration. � � decreases as the free packing

space is used up and also as the remaining free space becomes more compact. Thus two different packing arrangements

of the same set of objects can have the same � � value (e.g. symmetric arrangements), as well as two arrangements of

different sets of objects. In fact, it is possible that the � � value for a packing that uses more volume but leaves the free

space more scattered can be larger than for a packing occupying less volume but leaving the remaining space more

compact. What can be shown is that the � � value will monotonically decrease as the existing free space is re-arranged

to be more compact (see Theorem 3, Appendix A) and this is the third significant property. Though not a necessary

for good performance of some optimization algorithms, monotonic reduction of the function is still highly desirable.

The fourth significant property is that the point moment of objects modeled in modern CAD packages can be easily

estimated from information supplied by the packages. Modern CAD packages can estimate or accurately calculate

standard mass moments of inertia (see reference [12] for a definition) for any solid modeled in them. Theorem 4

(Appendix A) shows that the point moment in 3D cases is simply half the sum of the three principle moments of inertia.

The fifth significant property is that point moment � � can be calculated for a region R made up of the union of non-

overlapping smaller regions {R1, R2, ... Rm}. This is because the defining integral can be broken into integrals over the

smaller regions as shown in Theorem 2. The point moment becomes the sum of the moments of each component region,

Ri, about the centroid for the combined region R. In other words, knowing the moment � � i , the location of the centroid

xi , and the ND volume Vi for each of the m component regions making up the combined region, the combined region’s

centroid x , volume V and point moment � � can be found by following Algorithm 1 below:

Page 8: A moment based metric for 2D and 3D packingA moment based metric for 2D and 3D packing John K. Dickinson and George K. Knopf ... The arbitrary 3D shape packing problem is used as an

Page 8 of 17

Algorithm 1:

1) find the combined volume of the region: ,V V i

i

m

==

∑1

2) determine the new center of volume: ,V V i ii

m

x x==∑

1

3) calculate the magnitude of the distance (di) from the new center of volume to each region’s center of volume,

4) and sum the contribution of each region Ri to the point moment: .( )33 33a ll i i ii

m

V d= +=

∑ 2

1

This approach is convenient when the moments are known for sub-regions but not for the combined region as is

commonly the case when a larger region is made up of a combination of more primitive regions such as blocks and

spheres, or rectangles and triangles. The same methodology can be used to recalculate the point moment after removing

a portion of the region by using the algorithm above with negative volumes and negative point moments for any regions

being removed. The most important implication of this is that the point moment for the free space in a packing can be

found knowing only the point moments for each object packed, their centroids and volumes as well as the same

information for the initial packing space. Instead of having to re-evaluate the defining integral, updating the point

moment value becomes a simple case of a few arithmetic operations.

Another consequence of this is that it is easy to calculate the moment for 3D objects described using voxel

representation. Voxel representations of objects describe the object as the union of lots of little cubes arranged in a 3D

grid. As mentioned above, the point moment of a cube can be found by taking half the sum of its principle moments

of inertia as found in any dynamics text (e.g. reference [12]). Given that the point moments, volumes, and centroids

of each contributing cube are known the point moment for the object can quickly be determined.

Finally, it is also worth noting that the point moment � � is orientation and position independent because the distance

from any point in the region to its centroid remains the same no matter what orientation or position of the region is in.

5. Computational costs of object position optimization

When building a possible packing solution in a serial fashion, the computer places each object to be packed into the

available space one after the other. Each object should be placed in the best possible position before the next object

is added to the packing arrangement. As mentioned earlier, if no information is available about the sort of objects still

to be packed the “best” partial packing is assumed here to be the packing that leaves the remaining free space as compact

as possible. One measure of this compactness can be found using the point moment metric � � developed above.

Optimization routines can be used to minimize the metric as each object is added to the work space so that the remaining

Page 9: A moment based metric for 2D and 3D packingA moment based metric for 2D and 3D packing John K. Dickinson and George K. Knopf ... The arbitrary 3D shape packing problem is used as an

Page 9 of 17

free space is rearranged to more and more resemble a disk, sphere or hyper-sphere, and thus be in as compact form as

possible. For the general packing problem, it is hoped that this provides a better opportunity for packing subsequent

arbitrarily shaped objects.

Algorithm 2 details a way to calculate an updated metric value after an object has been added to a packing

arrangement. It assumes that the centroid, ND volume and point moment � � are known for the object being added as

well as for the region of remaining free space. It is also assumed that the point moment is known for the completely

empty packing space before the packing procedure had commenced. The following is a list of steps and the

computational difficulty required in performing the steps. Subscripts k and k+1 refer to before and after the object has

been added to the packing space and N is the dimensionality of the packing problem.

Algorithm 2:

1) Compute reduced free space volume: V V Vk k ob j+ = −1 cost: 1 addition

2) Determine new center of volume: xx x

k+

k k o b j o b j

k+

V V

V11

=( - ) cost: 1 addition,

3N multiplications.

3) Find new point moment: � � � � � �k k k k k o b j o b j k o b jV V+ + += + − − + −

1 1

2

1

2

x x x xcost: 4N addition,

2N+3 multiplications

4) Calculate new metric: � �� �

� �kk

in itia l+

+=11 cost: 1 multiplication

Total Cost: 4N + 2 additions and 5N + 4 multiplications

If the packing problem is three dimensional, i.e. N = 3, then the total cost to calculate a new metric value is only 14

additions and 19 multiplications. This is a very quick set of calculations on today’s processors and could even be further

reduced for processors with built in vector calculating capabilities. This means that optimization routines can go through

many iterations in their search for the best solution without demanding too much CPU time to evaluate the efficiency

of a packing, which might otherwise make finding a good packing too expensive.

6. 3D serial packing example

To illustrate an application of the point moment metric an example was taken from tests of a 3D packing program.

The program was designed to sequentially pack arbitrary 3D shapes into a specified box volume. A simulated annealing

optimization method was used by the program to minimize the point moment metric � � to locate the best position for

each object. Additional constraints were used to stop objects from intersecting the container walls or overlapping other

objects. The example presented here was selected to demonstrate how the point moment metric changes as an object

Page 10: A moment based metric for 2D and 3D packingA moment based metric for 2D and 3D packing John K. Dickinson and George K. Knopf ... The arbitrary 3D shape packing problem is used as an

Page 10 of 17

Figure 4: The knight chess piece near the center of thebox early in the packing program’s attempts to placethe part. At this stage the metric � � = 0.98656 .

Figure 5: The knight chess piece is in the sameposition as in the previous figure but with a differentorientation. The metric � � remains at 0.98656 .

being packed moves through the container. The example is of 6 chess pieces being packed into a box, 2 rooks, 2 knights

and 2 pawns. In this case the packing algorithm was unable to place the final pawn without it intersecting other parts.

The box container was designed to be just tall enough for the knight pieces so that the packing algorithm would place

them vertically to simplify visualization. This limits the possibility of tipping the chess pieces since any angle from

vertical would cause the base or top of the piece to touch or pass through the container walls.

Figures 4-7 show the first piece, the knight, being tested in different positions in the box and the corresponding point

moment metric values. The first figure in the series, Figure 4, shows the knight near the middle of the box where the

metric is almost at its maximum. Figure 5 shows the metric remains the same as the knight changes orientation without

changing position. This position was manually introduced into the packing sequence for illustration purposes of this

paper. It is highly unlikely that an optimization routine would repeat exactly the same position for a part while

attempting to generate a packing arrangement. The next figure in the series, Figure 6, shows the knight against the right

wall and approaching the back corner of the container as the metric’s value drops. The knight’s final resting position

is depicted in Figure 7. By placing the knight in this corner the simulated annealing algorithm has located the lowest

metric value that it could.

The last picture (Figure 8) shows the final packing arrangement generated for all the parts by the packing program.

Each successive figure shows how the metric decreases as the object is placed farther into a corner leaving the remaining

free space as usable as possible. It should be noted that the chess pieces being packed here are hollow and have interior

Page 11: A moment based metric for 2D and 3D packingA moment based metric for 2D and 3D packing John K. Dickinson and George K. Knopf ... The arbitrary 3D shape packing problem is used as an

Page 11 of 17

Figure 6: The knight is now near the right wall of thecontainer and getting close to the back corner. Thevalue of the metric � � = is now down to 0.976313.

Figure 7: The knight is in its final position in thecorner and � � = 0.96455. Though difficult to see, thepiece just fits vertically in the container and thuscannot be tilted much off the vertical in the corner.

detail. This means that their point moments are smaller than if they were solid and thus their impact on the metric is

correspondingly smaller as well. Nevertheless, the simulated annealing algorithm is able to arrange the chess pieces

in the container.

More extensive testing of the implementation has been done [2, 3]. Results have shown that the serial packing

method based on the point moment metric generated solutions faster than previously published approaches.

7. Conclusions

It has been shown that the point moment metric � � is highly suitable for use with standard optimization algorithms.

This is due to the fact that it has a limited range of 1 to 0, and that it continuously decreases as the remaining free space

in a 1D, 2D, ... ND packing arrangements gets smaller and more compact. More specifically, as an arrangement of free

space becomes more compact the metric will monotonically decrease. When viewed from an implementational

perspective, it has also been shown that the point moment metric can be cheaply recalculated from the previous metric

value, the container’s initial point moment and the point moment, volume and centroid of the object being added to the

packing arrangement (Algorithm 2, Section 5). Furthermore, estimates or exact values for the point moment of 3D

objects modeled in CAD packages or stored in voxel representations can also be easily found.

Page 12: A moment based metric for 2D and 3D packingA moment based metric for 2D and 3D packing John K. Dickinson and George K. Knopf ... The arbitrary 3D shape packing problem is used as an

Page 12 of 17

Figure 8: Final position of all the hollow chess pieces packed. Thepoint moment metric � � = 0.837802 . The tall pieces can’t be tiltedwithout their bases or tops intersecting the container.

This combination of features make the point moment metric an ideal tool for optimizing partial packing arrangements

found in serial approaches to packing problems.

8. Appendix A : theorems and proofs

This appendix includes the theorems referenced in Sections 4 and 5 and their proofs. These theorems provide the

foundation for the mathematical properties of the point moment and the point moment metric that make them useful for

evaluating partial packing arrangements. Theorem 1 shows that the metric is continuous and thus can be used with

standard continuous optimization routines. Theorem 2 shows that the point moment can be determined for a region

based on simple knowledge of its constituent sub-regions. Theorem 3 shows the metric monotonically decreases as a

region get more compact. Finally Theorem 4 demonstrates that the moment can be quickly determined for a region if

common moments used in dynamics are known for the same region.

Page 13: A moment based metric for 2D and 3D packingA moment based metric for 2D and 3D packing John K. Dickinson and George K. Knopf ... The arbitrary 3D shape packing problem is used as an

Page 13 of 17

Figure 9: Region R with its centroid coincident with the origin O and vector xrepresenting the distance of the infinitesimally small portion of region R, dR,from the centroid and vector x + p representing the distance of dR from pointP.

Theorem 1: The point moment metric � � is a continuous function.

Proof: As the point moment metric in Equation 8 is by definition only � � divided by a constant, it will vary only as � �

varies. However, � � is continuous as it is an integral of a continuous function (i.e. the distance to the centroid) defined

for any region belonging to the ND space. Any slight change in the region of space considered will only slightly change

the integral’s result. Thus, as � � is continuous, so too must the point moment metric � � be. �

Theorem 2: The equivalent of the parallel axis theorem for area moments of inertia applies to the ND point moment

P. In other words, if the point moment were to be taken around any point P positioned in space at p instead of the

region’s centroid, then the resulting point moment Pp can be found using the formula where Pp is� � � �

p c V d= + 2

the point moment about the region’s centroid, d is the distance from the centroid of the region to the point P, and

V is the volume of the region R.

Proof: To simplify the algebra without loss of generality assume that the centroid of the region over which the point

moment should be calculated is at the origin (see Figure 9). The vector p points from the region’s centroid to the point

the moment should be taken around and thus d 2 = p � p. Note the vectors x and p can be expanded into component form

to be [x1, x2, x3, ... xN] and [p1, p2, p3, ... pN] respectfully.

Page 14: A moment based metric for 2D and 3D packingA moment based metric for 2D and 3D packing John K. Dickinson and George K. Knopf ... The arbitrary 3D shape packing problem is used as an

Page 14 of 17

(9)( )

� �

� � � �

pRR

R RR

i iRi

N

RR

c c

d R d R

d R d R d R

d R d R d R

V V d

= + • + = • + • + •

= • + • + •

= • +

+ •

= + + = +

∫∫

∫ ∫∫

∫∑ ∫∫=

( ) ( ) ( )

( ) ( ) ( )

( ) ( )

x p x p x x x p p p

x x x p p p

x x p p

p

2

2

2

0

1

2 2

p x

The first integral is just the definition of the point moment P of a region when the centroid of the region is centered

at the origin. Since the region’s centroid has been placed at the origin, the definition of the centroid requires that the

integral for each component xi , of the vector x. As the second integral breaks down into a sum of these( )x iR

d R∫ = 0

integrals times the constant components of the vector p the second term equals zero. The third integral is just the volume

magnitude of the region times d2. �

Theorem 3: The � � value monotonically decreases as a region of space, R, becomes more compact.

Proof: Assume that the region R occupying the ND volume VR is made up of two subregions occupying volumes V1 and

V2 with point moments � � 1 and � � 2. Thus VR = V1 + V2. Given that these regions have their centroids at locations x1 and

x2 respectively, the centroid of region R, xR, can be found using the equation:

(10)x x xRR R

V

V

V

V= +1

12

2

Let the distance between x1 and x2 be represented by d1 (see Figure 10). The outer circle drawn in the figure is

centered at x1 and is of radius d1. Since the combined region is made up of only two regions, it follows that the centroid

xc lies on the line between the component region’s centroids x1 and x2. In fact, the centroid xR is always a distance of

(V2 /VR )d1 from x1 and (V1 /VR )d1 from x2 along the line. Let d2 = (V1 /VR )d1 be the distance the combined region’s

centroid is from x2.

Now if region 2 is moved slightly closer to the centroid xc, the overall region R becomes more compact. Label

region 2' s new centroid x2*. Reviewing the definition of the metric for both positions of region 2, it can be seen that

the denominators match. Therefore to show that the point moment metric after region 2' s shift � �

* is smaller than the

original metric � �

only requires showing that � � * is smaller than � � .

Page 15: A moment based metric for 2D and 3D packingA moment based metric for 2D and 3D packing John K. Dickinson and George K. Knopf ... The arbitrary 3D shape packing problem is used as an

Page 15 of 17

Figure 10: View of a plane passing through the centroid points x1 and x2

of the two component regions as well as through the centroid x*2 forRegion 2 after it is moved towards the centroid of the combined regionsxR as described in the proof for Theorem 2. The plane represents thewhole space for the 2D case and a slice of the space for the ND caseswhere N > 2.

(11)� � � �� �

� � � �� �= =

free space

orig space R

free space

orig space**_

_

_

_an d

Expanding both point moments gives:

(12a)� � � � � �

R R RV V= + − + + −1 1 1

2

2 2 2

2x x x x

(12b)33 33 33R R R* V V= + − + + −1 1 1

2

2 2 2

2x x x x* * *

and subtracting � � * from � � gives:

(13)( ) ( )� � � �R R R R R RV V− = − − − + − − −* * * *1 1

2

1

2

2 2

2

2

2x x x x x x x x

Page 16: A moment based metric for 2D and 3D packingA moment based metric for 2D and 3D packing John K. Dickinson and George K. Knopf ... The arbitrary 3D shape packing problem is used as an

Page 16 of 17

Equation 13 will show that P* is smaller than P if it can be shown that the distance || x1 - xR || > || x1 - x*R || and

|| x2 - xR || > || x*2 - x*R ||. The smaller circle of radius d2 in Figure 10 encloses the entire region where region 2 can be

moved so that its centroid x*2 is closer to the initial centroid xR than x2 (remember that the plane view in Figure 10 was

picked to pass through points x1, x2 and x*2). Since, the smaller circle is completely contained in the big circle of radius

d1 it shows that no matter where region 2 is placed, it gets closer to x1. Thus the distance d3 between x1 and x*2 must

be less than d1. But x*R lies along the line between the two centroids x1 and x*2 and maintains a fixed proportional

distance from each. Therefore, if d3 < d1 then x*R must be closer to both x1 and x*2 than xR is to x1 and x2 so

|| x1 - xR || > || x1 - x*R || and || x2 - xR || > || x*2 - x*R ||.

In fact, this shows that the point moment metric will monotonically decrease as the space becomes more compact

as any shift of an arbitrary region 2 from x2 to x*2 will result in the point moment getting smaller so long as the region

2 moves closer to xR. �

Theorem 4: For the 3D spatial case the point moment � �

is equal to one half the sum of the standard dynamics moments

Ixx, Iyy and Izz for a 3D object of uniform unit density.

Proof: From the definition of the moments Ixx, Iyy and Izz for an object with unit density as found in standard dynamics

texts (see [12]) we have:

(14)I y z d R I x z d R I x y d Rxx yy zz= + = + = +∫ ∫ ∫( ) , ( ) , ( )2 2 2 2 2 2

Summing these moments together gives:

(15)I I I x y z d Rxx yy zz+ + + + =∫� � � �2 22 2 2( )

which can be turned around to be:

� (16)( )� �= + +

1

2I I Ixx yy zz

9. References

[1] Beer, F.P., and Johnston, E.R. , Mechanics of materials SI Metric Edition, McGraw-Hill Ryerson, 574-584, 1981.

[2] Dickinson, J.K., and Knopf, G.K., “Serial packing of arbitrary 3D objects for optimizing layered manufacturing”,

accepted for SPIE: Intelligent Robots and Computer Vision XVII: Algorithms, techniques, and Active Vision

conference, Boston, Nov. 1998.

[3] Dickinson, J.K., and Knopf, G.K.,“Generating 3D packing arrangements for layered manufacturing”, accepted for

Page 17: A moment based metric for 2D and 3D packingA moment based metric for 2D and 3D packing John K. Dickinson and George K. Knopf ... The arbitrary 3D shape packing problem is used as an

Page 17 of 17

Rensselaer’s International Conference on Agile, Intelli gent, and Computer Intgrated Manufacturing, Troy, New

York, Oct. 1998.

[4] Dowsland, W.B., “Two and three dimensional packing problems and solution methods”, New Zealand Operational

Research, Vol. 13 (1985), No. 1, 1-18.

[5] Dowsland, K.A., and Dowsland, W.B., “Packing problems”, European Journal of Operational Research, Vol.

56 (1992), 2-14.

[6] Dudzinski, K., and Walukiewicz, S., “Exact methods for the knapsack problem and Its generalizations”, European

Journal of Operational Research, Vol. 28 (1987), 3-21.

[7] Dyckhoff, H., “A typology of cutting and packing problems”, European Journal of Operational Research, Vol.

44 (1990), 145-159.

[8] Ferreira, C.E., Martin, A., and Weismantel, R., “Solving multiple knapsack problems by cutting planes”, SIAM

Journal of Optimization, Vol. 6 (1996), No.3, 858-877.

[9] Frieze, A.M., “Shortest path algorithms for knapsack type problems”, Mathematical Programming, Vol. 11

(1976), 150-157.

[10] Li, Z., and Milenkovic, V., “Compaction and separation algorithms for non-convex polygons and their

applications”, European Journal of Operational Research V. 85 (1995), 539-561.

[11] Webster’s Ninth New Collegiate Dictionary, Merriam-Webster Inc., Springfield, Mass., 1983.

[12] Meriam, J.L. and Kraige, L.G., Engineering Mechanics, Volume 2, Dynamics, 2nd Edition, SI / English Version,

Wiley and Sons, New York, 592-593, 1986.