Elsevier

Computer Aided Geometric Design

Volumes 52–53, March–April 2017, Pages 13-27
Computer Aided Geometric Design

Dense packing of congruent circles in free-form non-convex containers

https://doi.org/10.1016/j.cagd.2017.03.006Get rights and content

Abstract

This paper proposes an algorithm for computing dense packings of congruent circles inside general 2D containers. Unlike the previous approaches which accept as containers, only simple, symmetric shapes such as circles, rectangles and triangles, our method works for any container with a general, freeform (spline) boundary. In contrast to most previous approaches which cast the problem into a non-convex optimization problem, our method attempts to maximize the number of packed circles via a perturbation approach and consists of two main phases. In the first phase, an initial packing is computed by placing circles in spiraling layers, starting along the boundary of the container. The next phase simulates the shaking of a container under gravity, thereby making room for additional circles by perturbing the existing circles. While the general circle packing problem is known to be NP-hard (Hifi et al., 2004), our method proposes heuristics which lead to dense packings. Comparison of results with previous approaches on simple, symmetric shapes shows the effectiveness of our algorithm while results of packing inside freeform containers demonstrates the generality of our algorithm.

Introduction

This paper addresses the problem of dense packing of congruent circles inside general 2D shapes. This involves placing as many circles of a given radius as possible, inside the given shape so that no two circles overlap. This is a well-studied problem in mathematics and in general, is known to be NP-hard (Hifi et al., 2004). While proven optimal solutions are known only for certain shapes and specific radii (Graham, 1968), a large body of literature is devoted to proposing heuristics for computing maximally dense packings.

The circle packing problem enjoys a wide range of applications. In architecture, circle packings are employed to obtain aesthetic patterns (Pottmann et al., 2007). Pottmann et al. (2015) explore substitution of conventional geometric objects such as meshes in graphics and architectural geometry, with other combinatorial objects such as circles. Covering of surfaces with circle and sphere packings, with applications towards architectural geometry is discussed in Schiftner et al. (2009). Stippling is an artistic technique which achieves monochrome rendering of objects by varying the distances between the dots (stipples) placed in different regions (Kim et al., 2009). Circle packing with different radii in different regions could potentially lead to stippling. Several industrial applications of circle packing are discussed in Castillo et al. (2008), such as the problem of cutting maximum number of circles from rectangular metal strips and cutting circular blanks for manufacturing stators and rotors of electric motors. Further, packing of cylindrical objects into rectangular cases may be reduced to packing circles in rectangular shapes. The problem of locating a set of maximally dispersed points in a convex region for the purpose of facility location may be approached via the equivalent problem of circle packing (Drezner and Erkut, 1995). Also, circle packings in a similar setting have been used for computing conformal maps (Stephenson, 2005).

While all the previous approaches are targeted towards densely packing circles inside simple convex shapes such as rectangles, squares, circles, triangles, etc., to the best of our knowledge, this is the first attempt at packing circles inside arbitrary non-convex shapes with free-form boundaries. In contrast to the traditional approach of posing the problem as a non-convex optimization problem, we propose a randomized algorithm which simulates the movement of balls inside a rotated container under shaking and gravity. As observed in practice, such a process is likely to create room for more items to insert. Our approach captures the interaction between the circles and the container boundary, given in freeform spline parametric form, by solving systems of algebraic constraints (Hanniel and Elber, 2007). Notably, each of the previous methods is geared towards a specific regular shape on which it improves the previously known best results. While our method accepts any general freeform shape as input, results of comparison on simple symmetric shapes show that we almost always achieve the best known packing when the shape is rectangular.

This paper is organized as follows. A brief survey of previous methods is given in Section 2. In Section 3, we state the basic notation and definitions and give an overview of our two-phase approach. The first phase is an initialization step, which produces a sub-optimal packing by placing circles in layers and is explained in Section 4. The second phase, which involves perturbation of existing circles, is described in Section 5 and aims to iteratively improve the packing by moving all the circles in randomly chosen directions, possibly creating room for inserting additional circles. Results from an implementation of our algorithm using the IRIT (Elber, 2015) modeling kernel are given in Section 6. We conclude the paper in Section 7 with remarks on future directions.

Section snippets

Previous work

Given the large volume of literature, it is beyond the scope of this paper to give a thorough survey of the existing methods for circle packing. Instead, here we present a brief overview of some of the representative previous approaches. A comprehensive survey of circle-packing algorithms is given by Hifi and M'Hallah (2009). One of the earliest attempts at packing circles inside a circular container was due to Kravitz (1967). A prominent approach to packing congruent circles inside circular or

Overview of our approach

In this section, we formulate the problem, set up the notation, and describe the basic mathematical tools which are used throughout the paper. Given a closed, bounded, 2D container D with boundary ∂D, and radius r of circles, the goal is to find a maximal packing of circles inside D, i.e., to place as many non-overlapping circles inside D as possible. Let d(p,D) be the Euclidean distance between point p and the point of ∂D which is closest to p. Then, such a packing must obey the following two

Initialization

The first phase of our approach consists of packing circles inside the container, one at a time, starting along ∂D. Given D and the radius r of circles, we pack the circles in D in layers, from the periphery till the center. The first layer of circles is packed along ∂D so that each circle makes either single or double tangential contact(s) with ∂D. This is explained in Section 4.1. The next layer of circles is packed so that each circle makes contact with two existing circles. This is repeated

The perturbation approach

Once an initial configuration C is computed as described in the previous section, the next phase of our approach attempts to make room for more circles by simulating shaking of the container under gravity. A direction, θ, in 2D, is chosen at random and the circles are moved in this direction, one at a time. Each time a circle is moved, an attempt is made to insert new circles if enough room has been created in any component of the free-space in C. For a chosen direction θ, the perturbation

Results

In this section, we compare our algorithm with some of the previous algorithms on simple symmetric containers as well as demonstrate packings in several non-convex, general containers. As is typical of any other packing algorithm, our algorithm is able, most of the time, to compute packings which are as dense as the best-known packings on one type of containers, rectangular in our case.

We randomly sample a few instances of best-known packings in rectangular containers maintained by Specht at

Conclusion

This paper presents an algorithm for packing circles in general freeform containers. Our perturbation based approach captures the interaction of circles with the freeform boundary via solution of algebraic constraints. Since we are aware of no similar circle packing work in freeform containers, the effectiveness of the algorithm is demonstrated by comparing its results on simple, symmetric containers such as rectangles and triangles, with those of the previous best known packings. Our algorithm

Acknowledgements

This research was supported in part by the Israel Science Foundation (grant No. 278/13). The freeform animal curves in Fig. 13(g) and 13(h) were created by In-Kwon Lee and Myung Soo Kim, Postech, Korea.

References (22)

  • Z. Drezner et al.

    Solving the continuous p-dispersion problem using non-linear programming

    J. Oper. Res. Soc.

    (1995)
  • Cited by (12)

    • Single-sized spheres on surfaces (S4)

      2021, Computer Aided Geometric Design
    • VOROPACK-D: Real-time disk packing algorithm using Voronoi diagram

      2020, Applied Mathematics and Computation
      Citation Excerpt :

      Since then, many reports followed on DPP-CSc or DPP-PSc problems [22,39,59–63]. Recent works include more generalized problems: Polysized disk packing into perimeter-minimizing convex hulls [64], congruent disk packing within a non-convex container defined by free-form curves [65], etc. Voronoi diagrams are powerful geometric constructs which are used to solve diverse problems related with spatial reasoning.

    View all citing articles on Scopus
    View full text