JAVASCRIPT
Binary Packing algorithm implementation
All samples are using Ink.requireModules
, please read how to use it at Ink.requireModules section
Binary Packing algorithm implementation
Based on the work of Jake Gordon
see https://github.com/jakesgordon/bin-packing/
Function name | Description |
---|---|
.binPack(o) |
o
Optionso.blocks
Array of items with width and height integer attributes.o.dimensions
Flag to fix container dimensionso.sorter
Sorting function. One of: random, height, width, area, maxside