olragon/binpackingjs

The algorithm does not seem to behave correctly with boxes that are more rectangular than square.

chopsuey5000 opened this issue · 1 comments

Hi Long,

I would like to thank you for this amazing repository. I'm using using it to calculate the amount of needed material sheets for cnc machining. The code iterates over a set of predefined bin sizes to find out the optimal amount. So far so good it works perfectly but after trying and trying I 've found that with some box sizes behaves strangely. Especially with boxes that are rectangular. I have attached 2 images to illustrate the issue.

Any help will be more than welcome. or if you can point me where in the source code the issue may be.

img1
img2
.

The bug is solved by fixing pruneFreeList, suggested by @traaan 's pull request.