Ideas for an algorithm for random distribution of circles in a square

前端 未结 6 722
孤城傲影
孤城傲影 2021-02-08 15:18

I am searching for a concept to distribute circles in a square randomly, so that they dont overlap. All circles are of the same size. The area covered by the circles can be high

6条回答
  •  不思量自难忘°
    2021-02-08 15:30

    If you'll sometimes have a high number of circles such that you are close to, or at, maximal packing, the best solution is to start with your circles maximally packed in some corner (which I guess is hexagonal packing) and then do a physical simulation where you add some "temperature", i.e. you randomly kick some circles and let them collide for some finite time.

    I am afraid that with the other methods you might never be able to fit all your circles if you have so many circles that any valid solution would be close to maximal packing.

提交回复
热议问题