三维装箱
py3dbp的Python项目详细描述
三维装箱
基于this paper的三维装箱实现。代码基于go中的gedex实现。
安装
pip install py3dbp
用法
from main import Packer, Bin, Item
# Create the new packer
packer = Packer()
# Add the bins
packer.add_bin(Bin("Small Bin", 15, 15, 15, 10))
# Add the items
packer.add_item(Item("Item 1", 8, 15, 10, 20))
packer.add_item(Item("Item 2", 9, 10, 15, 20))
# Pack the items into de bins
packer.pack()
# Iterate the bins to show the items that contains
for b in packer.bins:
print(b.string())
for i in b.items:
print("====> ", i.string())
学分
- http://www.cs.ukzn.ac.za/publications/erick_dube_507-034.pdf
- https://github.com/bom-d-van/binpacking
- https://github.com/gedex/bp3d