Cut Optimize
Read this in other languages: English, Português-BR.
Bin pack Lib to cut optimize.
This lib has basead in code and post in blog by Jake Gordon.
Installation
Use the package manager npm to install.
npm i cut-optimizer --save
Javascript Usage
var cut_optimizer = ;var cut_opt = ;var shapes = 10 22 // OR { height: 10, width: 22 } 12 220// OR { height: 12, width: 22 } 13 230// OR { height: 13, width: 22 } 13 20// OR { height: 13 width: 20 } 120 241// OR { height: 120, width: 241};console; //Output/*{ width: 241, height: 158, items: [ { width: 241, height: 120, item: [Object], x: 0, y: 0 }, { width: 230, height: 13, item: [Object], x: 0, y: 120 }, { width: 220, height: 12, item: [Object], x: 0, y: 133 }, { width: 20, height: 13, item: [Object], x: 0, y: 145 }, { width: 22, height: 10, item: [Object], x: 20, y: 145 } ] }/*
Typescript Usage
; ; console.logcut_opt.optimizeshapes; //Output/*{ width: 241, height: 158, items: [ { width: 241, height: 120, item: [Object], x: 0, y: 0 }, { width: 230, height: 13, item: [Object], x: 0, y: 120 }, { width: 220, height: 12, item: [Object], x: 0, y: 133 }, { width: 20, height: 13, item: [Object], x: 0, y: 145 }, { width: 22, height: 10, item: [Object], x: 20, y: 145 } ] }/*
Typescript Demo
Angular 6 Demo
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.