circle-packing

Simple heuristic for packing discs of varying radii in a circle

Version on this page:0.1.0.5
LTS Haskell 22.41:0.1.0.6@rev:4
Stackage Nightly 2024-11-12:0.1.0.6@rev:4
Latest on Hackage:0.1.0.6@rev:4

See all snapshots circle-packing appears in

BSD-3-Clause licensed and maintained by Joachim Breitner
This version can be pinned in stack with:circle-packing-0.1.0.5@sha256:38332850f0dc437c4fce486d6aa4e282f8939912fd0f5c15f8dcb3642c85554f,2338

Module documentation for 0.1.0.5

Depends on 1 package(full list with versions):
Used by 1 package in lts-6.19(full list with versions):

Given a number of circles with their radii, this packags tries to arrange them tightly, without overlap and forming a large circle.

Finding the optimal solution is NP hard, so only heuristics are feasible. This particular implementation is neither very good nor very fast, compared to the state of the art in research. Nevertheless it is simple to use and gives visually acceptable results.

You can explore the algorithm live at http://darcs.nomeata.de/circle-packing/ghcjs/ghcjs-demo.html.

Contributions of better algorithms are welcome.