Algorithm to Pack as Many Circular Segments into a Rectangular Box

865 Views Asked by At

I have a circle of radius $r$, and I have a bounding box with 4 sides, $a$, $b$, $c$ and $d$ as illustrated in the below diagram:

Here are a few constraints

$$r \geq a$$ $$r \geq b$$ $$c >> a$$ $$d >> a$$ $$c >> b$$ $$d >> b$$

$a$ and $b$ must be perpendicular to $d$ segment.

Another condition is that the the circular sectors must touch one of the long line segment ( the top line segment in this case), base on another long segment ( the bottom line segment in this case) and must not go out from it.

What is the algorithm/equation that allows me to generate all the circular sectors that

  1. Touch one of the line segments
  2. Won't go out from it
  3. Fill the bounding box ( as defined by $a$, $b$, $c$ and $d$) as compactly as possible?
1

There are 1 best solutions below

2
On

There is quite a bit of information on circle packing on packomania, including packings in rectangles. So some of it may be of use to you.

Here's another page on the same theme.