box-circle-packer
Circle Packing Alogrithm to pack Random Sized Circles in a Rectangle
Huge Credits to https://stackexchange.com/users/3544517/kuroi-neko for coding this Algorithm
Packer
const width = windowinnerWidth;const height = windowinnerHeightconst circles = 100const min_r = 20;const max_r = 80;const radiuses = for let i = 0; i !== circles; i++ radiuses;const list =
Installation
npm install box-circle-packer
Usage
Using NPM
1 . Require box-circle-packer after installation
2 . Call pack with required Arguments
const packedCircles =
Options
Arguments | Type | Description | Default Value |
---|---|---|---|
radiuses | Number[] | Array of circles Radius | [] |
width | Number | Width of Box | 0 |
height | Number | Height of Box | 0 |
spacingFactor | Number | Spacing Between Circles | 0 |
Contributing
We welcome your contribution! Fork the repo, make some changes, submit a pull-request!.
License
none