# packer **Repository Path**: kaohui/packer ## Basic Information - **Project Name**: packer - **Description**: 装箱问题 可以在线处理不同尺寸的货箱最优装箱问题 - **Primary Language**: Unknown - **License**: BSD-3-Clause - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2023-07-04 - **Last Updated**: 2023-07-04 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # README 代码来自:https://github.com/betterway-tinyman/packer - commit "b50ef98" 用于修复c++库的bug,直接从原始地址复制的pull request. - commit "6e27b20" 用于修复web上包装箱会重叠的bug,参考原始地址的pull request做的修改. #### 运行方法 用浏览器打开 ./demo/index.html #### 使用说明 1. 如何控制包装箱只能正放,不能侧放: 注释掉该文件835行开始的以下几行:./demo/include/3d-bin-packing.js ```typescript // this.analyze_box(i, hmx, hy, hmy, hz, hmz, box.width, box.length, box.height); this.analyze_box(i, hmx, hy, hmy, hz, hmz, box.height, box.width, box.length); // this.analyze_box(i, hmx, hy, hmy, hz, hmz, box.height, box.length, box.width); // this.analyze_box(i, hmx, hy, hmy, hz, hmz, box.length, box.width, box.height); // this.analyze_box(i, hmx, hy, hmy, hz, hmz, box.length, box.height, box.width); ``` 2. 如何修改网站打开时的默认包装箱和物品: 修改该文件的42行至43行的内容:./demo/include/packer.js ```typescript _this.wrappers.push(new packer_1.Wrapper("108L", 1, 570, 470, 400, 0)); _this.instances.push(new packer_1.InstanceForm(new packer_1.Product("R0011-B", 102, 52, 82), 226)); ``` 3. 参考代码: ./demo/include/3d-bin-packing.js,该文件的第166行提到,boxologic函数参考了这个代码:https://github.com/exad/boxologic 这个站点的Issue中有人问如何控制旋转(Rotating restriction) 有人回答:go to find_box method, this method analyzes each box in six different orientations by calling analyze_box method find_box method位于该文件的818行: ./demo/include/3d-bin-packing.js