Packer
=========
3D Bin Packing with multiple wrappers (boxes).
- Web: http://betterwaysystems.github.io/packer/demo
- Video: http://betterwaysystems.github.io/packer/demo/packer.mp4
Red Printing
Red-Printing is a brand name of printing service supported by Betterway-systems. 레드 프린팅은 베러웨이시스템즈에서 실시하는 인쇄 서비스의 브랜드 명입니다. 많은 이용 바랍니다. Packer를 이용하시는 여러분, 인쇄 주문은 꼭 레드프린팅에서 해 주세요. http://redprinting.co.kr/Author
- Jeongho Nam - developer in Betterway-systemsReferences
Demo
Programming
- API Documents
- C++ API Document: http://betterwaysystems.github.io/packer/api/cpp/
- TypeScript API Document: http://betterwaysystems.github.io/packer/api/ts
Algorithm from Airforce Bin Packing
- Thesis - The distributer's three-midemsional pallet-packing problem: A human intelligence-based heuristic approach - GitHub: https://github.com/exad/boxologicInstallation
Node.JS
``` bash npm install -g 3d-bin-packing tsd install 3d-bin-packing ```TypeScript (JavaScript) only
If you want the TypeScript (JavaScript) only mode, any installation procedure is not required. - http://betterwaysystems.github.io/packer/demo/ -release/ts/index.html
Build Cloud Server
However, if you want to install the C++ mode, you've to install Visual C++ Redistributable for Visual Studio 2015. After the installation, executerelease/cpp/Packer.exe
. Then a cloud server deducting packer solution will be opened. After running the cloud server, open release/browser/index.html
.
You also can separate cloud server(C++) and clients(Web), let users to connect remote Packer server, by editing ip address in release/browser/server.xml
- https://www.microsoft.com/en-US/download/details.aspx?id=48145
- release/cpp/Packer.exe
- release/browser/index.html
- release/browser/server.xml
Implementation
Design
Languages
- C++
- TypeScript
- The optimization result can be inferior than C++
Dependency
- C++
- Samchon Framework (SDN Framework) - https://github.com/samchon/framework
- TypeScript (JavaScript)
- TypeScript-STL (STL containers and algorithms for TypeScript) - https://github.com/samchon/typescript-stl
- Samchon Framework (SDN Framework) - https://github.com/samchon/framework
- Three.js (JavaScript library handling 3-D objects) - http://threejs.org
- React - https://facebook.github.io/react
- React-Data-Grid - https://github.com/adazzle/react-data-grid
Usage
TypeScript (Node.JS)
```typescript import packer = require("3d-bin-packing"); import samchon = require("samchon-framework"); function main(): void {///////////////////////////
// CONSTRUCT OBJECTS
///////////////////////////
let wrapperArray: packer.WrapperArray = new packer.WrapperArray();
let instanceArray: packer.InstanceArray = new packer.InstanceArray();
// Wrappers
wrapperArray.push
(
new packer.Wrapper("Large", 1000, 40, 40, 15, 0),
new packer.Wrapper("Medium", 700, 20, 20, 10, 0),
new packer.Wrapper("Small", 500, 15, 15, 8, 0)
);
///////
// Each Instance is repeated #15
///////
instanceArray.insert(instanceArray.end(), 15, new packer.Product("Eraser", 1, 2, 5));
instanceArray.insert(instanceArray.end(), 15, new packer.Product("Book", 15, 30, 3));
instanceArray.insert(instanceArray.end(), 15, new packer.Product("Drink", 3, 3, 10));
instanceArray.insert(instanceArray.end(), 15, new packer.Product("Umbrella", 5, 5, 20));
// Wrappers also can be packed into another Wrapper.
instanceArray.insert(instanceArray.end(), 15, new packer.Wrapper("Notebook-Box", 2000, 30, 40, 4, 2));
instanceArray.insert(instanceArray.end(), 15, new packer.Wrapper("Tablet-Box", 2500, 20, 28, 2, 0));
///////////////////////////
// BEGINS PACKING
///////////////////////////
// CONSTRUCT PACKER
let my_packer: packer.Packer = new packer.Packer(wrapperArray, instanceArray);
///////
// PACK (OPTIMIZE)
let result: packer.WrapperArray = my_packer.optimize();
///////
///////////////////////////
// TRACE PACKING RESULT
///////////////////////////
let xml: samchon.library.XML = result.toXML();
console.log(xml.toString());
}
main();
```
C++
```cppinclude
include
include
include
include
include
using namespace std;
using namespace samchon::library;
using namespace bws::packer;
int main()
{
///////////////////////////
// CONSTRUCT OBJECTS
///////////////////////////
shared_ptr<WrapperArray> wrapperArray(new WrapperArray());
shared_ptr<InstanceArray> instanceArray(new InstanceArray());
// Wrappers
wrapperArray->emplace_back(new bws.packer.Wrapper("Large", 1000, 40, 40, 15, 0));
wrapperArray->emplace_back(new Wrapper("Medium", 700, 20, 20, 10, 0));
wrapperArray->emplace_back(new Wrapper("Small", 500, 15, 15, 8, 0));
///////
// Each Instance is repeated #15
///////
instanceArray->insert(instanceArray->end(), 15, make_shared<Product>("Eraser", 1, 2, 5));
instanceArray->insert(instanceArray->end(), 15, make_shared<Product>("Book", 15, 30, 3));
instanceArray->insert(instanceArray->end(), 15, make_shared<Product>("Drink", 3, 3, 10));
instanceArray->insert(instanceArray->end(), 15, make_shared<Product>("Umbrella", 5, 5, 20));
// Wrappers also can be packed into another Wrapper.
instanceArray->insert(instanceArray->end(), 15, make_shared<Wrapper>("Notebook-Box", 2000, 30, 40, 4, 2));
instanceArray->insert(instanceArray->end(), 15, make_shared<Wrapper>("Tablet-Box", 2500, 20, 28, 2, 0));
///////////////////////////
// BEGINS PACKING
///////////////////////////
// CONSTRUCT PACKER
Packer packer(wrapperArray, instanceArray);
GAParameters gaParams = {500, 100, 50, 0.2};
///////
// PACK (OPTIMIZE)
///////
shared_ptr<WrapperArray> &result = packer.optimize(gaParams);
///////////////////////////
// TRACE PACKING RESULT
///////////////////////////
shared_ptr<XML> xml = result->toXML();
cout << xml->toString() << endl;
return 0;
}
```
License
BSD v3.
Copyright (c) 2016, betterwaysystems All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:- Redistributions of source code must retain the above copyright notice, this
- Redistributions in binary form must reproduce the above copyright notice,
- Neither the name of packer nor the names of its