1.0.4 • Published 7 years ago

bin-pack.js v1.0.4

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

bin-pack.js

2d rectangular bin packing in javascript.

Install

npm install bin-pack.js

Usage

  const binpack = require('bin-pack');

  binpack.sort(nodes, 'height', 'descending', true);
  binpack.pack(nodes, algorithmEL.value, 512, 512, 2, true, (i, total, id) => {
    console.log(i, total, id);
  });

Documentation

sort (nodes, sortBy, order, allowRotate)

pack (nodes, algorithm, width, height, padding, allowRotate, progress)

packAutoResize (nodes, algorithm, width, height, padding, allowRotate, progress)

Reference

License

MIT © 2017 Johnny Wu

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago