├── .DS_Store ├── .vscode ├── launch.json └── settings.json ├── C++ Nesting Problem ├── .DS_Store ├── Nesting Problem.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ ├── xcshareddata │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ └── WorkspaceSettings.xcsettings │ │ └── xcuserdata │ │ │ └── sean.xcuserdatad │ │ │ ├── UserInterfaceState.xcuserstate │ │ │ └── WorkspaceSettings.xcsettings │ ├── xcshareddata │ │ └── xcschemes │ │ │ └── Nesting Problem.xcscheme │ └── xcuserdata │ │ └── sean.xcuserdatad │ │ ├── xcdebugger │ │ └── Breakpoints_v2.xcbkptlist │ │ └── xcschemes │ │ └── xcschememanagement.plist ├── Nesting Problem │ ├── Plot.cpp │ ├── data_assistant.cpp │ ├── data_assistant.hpp │ ├── geometry.cpp │ ├── main.cpp │ └── old_main.cpp └── readme.md ├── LICENSE ├── README.md ├── TOPOS.py ├── __pycache__ ├── data.cpython-37.pyc ├── geo_func.cpython-37.pyc ├── gravity_lowest.cpython-37.pyc ├── heuristic.cpython-37.pyc ├── nfp.cpython-37.pyc └── show.cpython-37.pyc ├── best_result ├── albano.png ├── dagli.png └── jakobs2_clus 89.10.png ├── bottom_left_fill.py ├── compaction_separation.py ├── cuckoo_search.py ├── data ├── .DS_Store ├── albano.csv ├── albano.pdf ├── albano_nfp.csv ├── albano_orientation.csv ├── ali2.csv ├── ali3.csv ├── blaz.csv ├── blaz.pdf ├── blaz1.csv ├── blaz2.csv ├── blaz_clus.csv ├── blaz_clus_nfp.csv ├── blaz_clus_orientation.csv ├── blaz_nfp.csv ├── blaz_orientation.csv ├── blaz_vec.csv ├── convex.csv ├── dagli.csv ├── dagli_clus.csv ├── dagli_clus_nfp.csv ├── dagli_clus_orientation.csv ├── dagli_nfp.csv ├── dagli_orientation.csv ├── dighe.pdf ├── dighe1.csv ├── dighe1_nfp.csv ├── dighe1_orientation.csv ├── dighe2.csv ├── dighe2_nfp.csv ├── dighe2_orientation.csv ├── fu.csv ├── fu.pdf ├── fu_nfp.csv ├── fu_orientation.csv ├── ga.csv ├── han.csv ├── han.pdf ├── jakobs.pdf ├── jakobs1.csv ├── jakobs1_clus.csv ├── jakobs1_clus_orientation.csv ├── jakobs1_orientation.csv ├── jakobs2.csv ├── jakobs2_clus.csv ├── jakobs2_clus_orientation.csv ├── jakobs2_nfp.csv ├── jakobs2_orientation.csv ├── mao.csv ├── mao.pdf ├── mao_orientation.csv ├── marques.csv ├── marques.pdf ├── marques_orientation.csv ├── shapes.csv ├── shapes.pdf ├── shapes0.csv ├── shapes0_nfp.csv ├── shapes0_orientation.csv ├── shapes1.csv ├── shapes1_nfp.csv ├── shapes1_orientation.csv ├── shirts.csv ├── shirts.pdf ├── shirts_nfp.csv ├── shirts_orientation.csv ├── simple.csv ├── swim.csv ├── swim.pdf ├── swim_clus.csv ├── swim_clus_orientation.csv ├── swim_orientation.csv ├── trousers.csv ├── trousers.pdf ├── trousers_nfp.csv └── trousers_orientation.csv ├── fast_neighbor_search.py ├── figs └── 1.jpg ├── genetic_algorithm.py ├── lp_search.py ├── nfp_test.py ├── readme_en.md ├── record ├── best_result │ ├── albano.csv │ ├── best_result.csv │ ├── blaz_clus.csv │ ├── fu.csv │ ├── jakobs2.csv │ ├── marques.csv │ ├── shapes0.csv │ └── shapes1.csv ├── blf.csv ├── c_blf.csv ├── lp_initial.csv ├── lp_result │ ├── dighe1_result_fail.csv │ ├── dighe1_result_success.csv │ ├── dighe2_result_fail.csv │ └── dighe2_result_success.csv ├── new_c_blf.csv ├── nfp.csv └── test.csv ├── simulating_annealing.py └── tools ├── __pycache__ ├── assistant.cpython-37.pyc ├── data.cpython-37.pyc ├── geo_func.cpython-37.pyc ├── geofunc.cpython-37.pyc ├── lp.cpython-37.pyc ├── lp_assistant.cpython-37.pyc ├── nfp.cpython-37.pyc ├── packing.cpython-37.pyc └── show.cpython-37.pyc ├── assistant.py ├── data.py ├── geofunc.py ├── lp.py ├── lp_assistant.py ├── nfp.py ├── packing.py └── show.py /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seanys/2D-Irregular-Packing-Algorithm/a2b9494be9b811e56dce5058fe29ff2a134e8403/.DS_Store -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": "Python: 当前文件", 9 | "type": "python", 10 | "request": "launch", 11 | "program": "${file}", 12 | "console": "integratedTerminal" 13 | } 14 | ] 15 | } -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "python.pythonPath": "/Library/Frameworks/Python.framework/Versions/3.7/bin/python3", 3 | "python.linting.pylintEnabled": true, 4 | "python.linting.enabled": true, 5 | "python.linting.banditEnabled": false 6 | } -------------------------------------------------------------------------------- /C++ Nesting Problem/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seanys/2D-Irregular-Packing-Algorithm/a2b9494be9b811e56dce5058fe29ff2a134e8403/C++ Nesting Problem/.DS_Store -------------------------------------------------------------------------------- /C++ Nesting Problem/Nesting Problem.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /C++ Nesting Problem/Nesting Problem.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /C++ Nesting Problem/Nesting Problem.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /C++ Nesting Problem/Nesting Problem.xcodeproj/project.xcworkspace/xcuserdata/sean.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seanys/2D-Irregular-Packing-Algorithm/a2b9494be9b811e56dce5058fe29ff2a134e8403/C++ Nesting Problem/Nesting Problem.xcodeproj/project.xcworkspace/xcuserdata/sean.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /C++ Nesting Problem/Nesting Problem.xcodeproj/project.xcworkspace/xcuserdata/sean.xcuserdatad/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildLocationStyle 6 | UseAppPreferences 7 | CustomBuildLocationType 8 | RelativeToDerivedData 9 | DerivedDataLocationStyle 10 | Default 11 | IssueFilterStyle 12 | ShowActiveSchemeOnly 13 | LiveSourceIssuesEnabled 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /C++ Nesting Problem/Nesting Problem.xcodeproj/xcshareddata/xcschemes/Nesting Problem.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 45 | 51 | 52 | 53 | 54 | 60 | 62 | 68 | 69 | 70 | 71 | 73 | 74 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /C++ Nesting Problem/Nesting Problem.xcodeproj/xcuserdata/sean.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | -------------------------------------------------------------------------------- /C++ Nesting Problem/Nesting Problem.xcodeproj/xcuserdata/sean.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Nesting Problem.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 14BE2F842444ABB00049BA76 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /C++ Nesting Problem/Nesting Problem/Plot.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Plot.cpp 3 | // Nesting Problem 4 | // 5 | // Created by Yang Shan on 2020/4/14. 6 | // Copyright © 2020 Tongji SEM. All rights reserved. 7 | // 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | using namespace std; 14 | 15 | class FileAssistant{ 16 | public: 17 | /* 18 | 用于记录形状,输入polygons,记录到目标文件 19 | */ 20 | static void recordPolys(string _path,vector>> all_polys){ 21 | // 读取并设置文件头 22 | csv::Writer foo(_path); 23 | foo.configure_dialect() 24 | .delimiter(", ") 25 | .column_names("polygon"); 26 | 27 | // 将形状全部写入 28 | for (long i = 0; i < all_polys.size(); i++) { 29 | string res=vectorToString(all_polys[i]); 30 | foo.write_row(res); 31 | } 32 | foo.close(); 33 | }; 34 | /* 35 | 36 | */ 37 | static string vectorToString(vector> poly){ 38 | string str_poly="\"["; 39 | for(int i=0;i>> polys; // 全部的形状 57 | vector colors; // 形状的颜色 58 | public: 59 | // 后续修改为初始化,可以增加形状 60 | PltFunc(){ 61 | polys={}; 62 | colors={}; 63 | }; 64 | // 增加一个形状 65 | void addPolygon(vector> poly,string color){ 66 | polys.push_back(poly); 67 | colors.push_back(color); 68 | }; 69 | void showAll(){ 70 | 71 | }; 72 | // 多个形状的加载 73 | static void polysShow(vector>> all_polys){ 74 | string _path="/Users/sean/Documents/Projects/Packing-Algorithm/record/lp_result.csv"; 75 | FileAssistant::recordPolys(_path,all_polys); 76 | system("/Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7 /Users/sean/Documents/Projects/Packing-Algorithm/new_data.py"); 77 | }; 78 | // 单个形状的加载 79 | static void polyShow(vector> poly){ 80 | vector>> all_polys={poly}; 81 | polysShow(all_polys); 82 | } 83 | }; 84 | -------------------------------------------------------------------------------- /C++ Nesting Problem/Nesting Problem/data_assistant.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Data Assistant.cpp 3 | // Nesting Problem 4 | // 5 | // Created by Sean Yang on 2020/4/14. 6 | // Copyright © 2020 Tongji SEM. All rights reserved. 7 | // 8 | // CSV Kits 9 | // https://github.com/p-ranav/csv 10 | // 11 | // 包含内容:基础定义、输出辅助、形状加载、NFP加载和获取、CSV写 12 | 13 | #include "data_assistant.hpp" 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | 20 | using namespace x2struct; 21 | 22 | class DataAssistant{ 23 | public: 24 | void test(){ 25 | PolysArrange blf_result; 26 | readBLF(1,blf_result); 27 | }; 28 | /* 29 | 直接读取指定的Index 30 | */ 31 | static void readCSV(){ 32 | csv::Reader foo; 33 | foo.read("/Users/sean/Documents/Projects/Packing-Algorithm/record/c_blf.csv"); 34 | auto rows = foo.rows(); 35 | cout<> new_poly; 57 | load2DVector(row["clock_polygon"],new_poly); 58 | normData(&new_poly, 20); 59 | // 修改对应性质 60 | polys_arrange.polys.push_back(new_poly); 61 | polys_arrange.polys_type.push_back(row_index); 62 | polys_arrange.polys_orientation.push_back(0); 63 | polys_arrange.polys_position.push_back(vector {0,0}); 64 | } 65 | // 统计数目 66 | polys_arrange.total_num+=poly_num; 67 | polys_arrange.type_num++; 68 | row_index++; 69 | } 70 | } 71 | }; 72 | /* 73 | 加载某个形状的全部方向 74 | */ 75 | static void readAllPolygon(vector> &all_polygons){ 76 | // 初步读取 77 | csv::Reader foo; 78 | foo.read("/Users/sean/Documents/Projects/Data/fu_orientation.csv"); 79 | // 加载全部形状 80 | int row_index=0; 81 | while(foo.busy()) { 82 | if (foo.ready()) { 83 | // 下一行(默认跳过第一行) 84 | auto row = foo.next_row(); 85 | // 设置本轮读取 86 | vector all_lines={"clock_o_0","clock_o_1","clock_o_2","clock_o_3"}; 87 | all_polygons.push_back({}); 88 | // 加载每个角度对应的形状 89 | for(auto line:all_lines){ 90 | vector> new_poly; 91 | load2DVector(row[line],new_poly); 92 | all_polygons[row_index].push_back(new_poly); 93 | } 94 | row_index++; 95 | } 96 | } 97 | }; 98 | /* 99 | 读取BLF某一行的结果,包括宽度、方向、总面积、位置和形状 100 | */ 101 | static void readBLF(int index,PolysArrange &blf_result){ 102 | csv::Reader foo; 103 | foo.read("/Users/sean/Documents/Projects/Packing-Algorithm/record/c_blf.csv"); 104 | auto rows = foo.rows(); 105 | // 加载宽度和总面积 106 | blf_result.width=stod(rows[index]["width"]);; 107 | blf_result.total_area=stod(rows[index]["total_area"]); 108 | // 所有方向/位置/形状 109 | load1DVector(rows[index]["polys_orientation"],blf_result.polys_orientation); 110 | load3DVector(rows[index]["polys"],blf_result.polys); 111 | // 设置形状总数和类型总数——后续存储好 112 | blf_result.total_num=(int)blf_result.polys_orientation.size(); 113 | blf_result.type_num=(int)blf_result.polys_orientation.size(); 114 | // 暂时采用全部不一致的情况,后续增加该列即可 115 | for(int i=0;i {pt[0],pt[1]}); 126 | } 127 | PrintAssistant::print2DVector(poly,false); 128 | }; 129 | 130 | /* 131 | 标准化数据(扩大或者缩小倍数) 132 | */ 133 | static void normData(VectorPoints *poly,double multiplier){ 134 | for(int i=0; i<(*poly).size();i++){ 135 | (*poly)[i][0]=(*poly)[i][0]*multiplier; 136 | (*poly)[i][1]=(*poly)[i][1]*multiplier; 137 | } 138 | }; 139 | 140 | /* 141 | 加载一维的数组向量并返回 142 | */ 143 | template 144 | static void load1DVector(string str,vector &vec){ 145 | str.erase(remove(str.begin(), str.end(), '\"'), str.end()); 146 | X::loadjson(str, vec, false); 147 | }; 148 | 149 | /* 150 | 加载二维数组 151 | */ 152 | template 153 | static void load2DVector(string str,vector> &vec){ 154 | str.erase(remove(str.begin(), str.end(), '\"'), str.end()); 155 | X::loadjson(str, vec, false); 156 | }; 157 | 158 | /* 159 | 加载三维数组 160 | */ 161 | template 162 | static void load3DVector(string str,vector>> &vec){ 163 | str.erase(remove(str.begin(), str.end(), '\"'), str.end()); 164 | X::loadjson(str, vec, false); 165 | }; 166 | 167 | /* 168 | List数组的增长 169 | */ 170 | template 171 | static void appendList(list &old_list,list &new_list){ 172 | for(auto item:new_list){ 173 | old_list.push_back(item); 174 | } 175 | } 176 | }; 177 | 178 | class WriterAssistant{ 179 | public: 180 | /* 181 | csv文件的重写 182 | */ 183 | static void writeCSV(){ 184 | csv::Writer foo("/Users/sean/Documents/Projects/Packing-Algorithm/record/test.csv"); 185 | // 设置头文件 186 | foo.configure_dialect() 187 | .delimiter(", ") 188 | .column_names("a", "b", "c"); 189 | 190 | // 需要现转化为String再写入 191 | for (long i = 0; i < 10; i++) { 192 | // 可以直接写入 193 | foo.write_row("1", "2", "3"); 194 | // 也可以按mapping写入 195 | foo.write_row(map{ 196 | {"a", "7"}, {"b", "8"}, {"c", "9"} }); 197 | } 198 | foo.close(); 199 | }; 200 | }; 201 | -------------------------------------------------------------------------------- /C++ Nesting Problem/Nesting Problem/data_assistant.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // data_assistant.hpp 3 | // Nesting Problem 4 | // 5 | // Created by Yang Shan on 2020/4/14. 6 | // Copyright © 2020 Tongji SEM. All rights reserved. 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | using namespace std; 15 | 16 | // 基础定义 17 | typedef vector> VectorPoints; 18 | typedef vector>> ServalPolygons; 19 | 20 | // 形状排样的结果 21 | struct PolysArrange{ 22 | string name=""; // 该数据集的来源 23 | int type_num=0; // 形状类别总数 24 | int total_num=0; // 总形状数目 25 | double width; // 宽度 26 | double length; // 形状的长度 27 | double total_area; // 总面积 28 | vector>> polys; // 所有形状的情况 29 | vector> polys_position; // 所有形状的顶点位置 30 | vector polys_type; // 形状对应的关系 31 | vector polys_orientation; // 所有形状的方向 32 | }; 33 | 34 | // 输出数组的函数集合 35 | class PrintAssistant{ 36 | public: 37 | /* 38 | 输出一维数组——泛型,暂时统一用double,比如Orientation 39 | */ 40 | template 41 | static void print1DVector (vector &vec, bool with_endle) 42 | { 43 | cout<<"["; 44 | for (int i=0;i 59 | static void print2DVector (vector> &vec,bool with_endle) 60 | { 61 | cout<<"\"["; 62 | for (int i=0;i 77 | static void print3DVector (vector>> &vec,bool with_endle) 78 | { 79 | cout<<"["; 80 | for (int i=0;i 66 | 67 | 68 | 69 | ### 序列排样 70 | 71 | - [x] Bottom Left Fill:已经实现,参考论文 72 | 73 | a. 选择一个形状加入,通过计算inner fit polygon,也就是形状绕着Bin/Region内部一周,参考点P会形成的一个长方形,P点在该长方形内部则解是feasible solution 74 | 75 | b. 选择能够摆到的最左侧位置,放进去即可 ([图片来源](https://github.com/Jack000/SVGnest)) 76 | 77 | No Fit Polygon example 78 | 79 | - [x] TOPOS:已经实现,参考论文: 80 | - [x] GA/SA:两个优化算法优化顺序已经实现 81 | 82 | ### 基于布局的优化 83 | 84 | - [x] Fast Neighborhood Search:基本实现,有一些Bug还需要修改 85 | - [x] Cuckoo Search:基本算法已经实现,需要进一步完善 86 | - [x] ~~ILSQN:不准备写了,没太大意义~~ 87 | - [x] ~~Guided Local Search:同上~~ 88 | 89 | ### 线性规划排样 90 | 91 | - [x] Compaction:压缩边界,已经实现 92 | - [x] Separation:去除重叠,已经实现 93 | - [ ] SHAH:基于模拟退火算法和上述两个算法的Hybrid Algorithm,暂时未做 94 | 95 | ## Reference Paper 96 | 97 | 98 | -------------------------------------------------------------------------------- /TOPOS.py: -------------------------------------------------------------------------------- 1 | """ 2 | 该文件实现了主要基于序列的排样算法 3 | ----------------------------------- 4 | Created on Wed Dec 11, 2019 5 | @author: seanys,prinway 6 | ----------------------------------- 7 | """ 8 | from tools.geofunc import GeoFunc 9 | from tools.show import PltFunc 10 | from tools.data import getData 11 | import tools.packing as packing 12 | from tools.nfp import NFP 13 | from shapely.geometry import Polygon,mapping 14 | from shapely import affinity 15 | import numpy as np, random, operator, pandas as pd, matplotlib.pyplot as plt 16 | import json 17 | import csv 18 | import time 19 | import multiprocessing 20 | import datetime 21 | import random 22 | import copy 23 | 24 | class TOPOS(object): 25 | ''' 26 | TOPOS启发式算法:将形状一个个放入,动态移动整体的位置,该算法参考Bennell的TOPOS Revised 27 | 问题:中线情况、好像有一些bug 28 | ''' 29 | def __init__(self,original_polys,width): 30 | self.polys=original_polys 31 | self.cur_polys=[] 32 | self.width=width 33 | self.NFPAssistant=packing.NFPAssistant(self.polys,store_nfp=False,get_all_nfp=True,load_history=True) 34 | 35 | self.run() 36 | 37 | def run(self): 38 | self.cur_polys.append(GeoFunc.getSlide(self.polys[0],1000,1000)) # 加入第一个形状 39 | self.border_left,self.border_right,self.border_bottom,self.border_top=0,0,0,0 # 初始化包络长方形 40 | self.border_height,self.border_width=0,0 41 | for i in range(1,len(self.polys)): 42 | # 更新所有的边界情况 43 | self.updateBound() 44 | 45 | # 计算NFP的合并情况 46 | feasible_border=Polygon(self.cur_polys[0]) 47 | for fixed_poly in self.cur_polys: 48 | nfp=self.NFPAssistant.getDirectNFP(fixed_poly,self.polys[i]) 49 | feasible_border=feasible_border.union(Polygon(nfp)) 50 | 51 | # 获得所有可行的点 52 | feasible_point=self.chooseFeasiblePoint(feasible_border) 53 | 54 | # 获得形状的左右侧宽度 55 | poly_left_pt,poly_bottom_pt,poly_right_pt,poly_top_pt=GeoFunc.checkBoundPt(self.polys[i]) 56 | poly_left_width,poly_right_width=poly_top_pt[0]-poly_left_pt[0],poly_right_pt[0]-poly_top_pt[0] 57 | 58 | # 逐一遍历NFP上的点,选择可行且宽度变化最小的位置 59 | min_change=999999999999 60 | target_position=[] 61 | for pt in feasible_point: 62 | change=min_change 63 | if pt[0]-poly_left_width>=self.border_left and pt[0]+poly_right_width<=self.border_right: 64 | # 形状没有超出边界,此时min_change为负 65 | change=min(self.border_left-pt[0],self.border_left-pt[0]) 66 | elif min_change>0: 67 | # 形状超出了左侧或右侧边界,若变化大于0,则需要选择左右侧变化更大的值 68 | change=max(self.border_left-pt[0]+poly_left_width,pt[0]+poly_right_width-self.border_right) 69 | else: 70 | # 有超出且min_change<=0的时候不需要改变 71 | pass 72 | 73 | if changeself.border_right: 95 | self.border_right=border_right 96 | if border_top>self.border_top: 97 | self.border_top=border_top 98 | self.border_height=self.border_top-self.border_bottom 99 | self.border_width=self.border_right-self.border_left 100 | 101 | def chooseFeasiblePoint(self,border): 102 | '''选择可行的点''' 103 | res=mapping(border) 104 | _arr=[] 105 | if res["type"]=="MultiPolygon": 106 | for poly in res["coordinates"]: 107 | _arr=_arr+self.feasiblePoints(poly) 108 | else: 109 | _arr=_arr+self.feasiblePoints(res["coordinates"][0]) 110 | 111 | return _arr 112 | 113 | def feasiblePoints(self,poly): 114 | ''' 115 | 1. 将Polygon对象转化为点 116 | 2. 超出Width范围的点排除 117 | 3. 直线与边界的交点选入 118 | ''' 119 | result=[] 120 | for pt in poly: 121 | # (1) 超出了上侧&总宽度没有超过 122 | feasible1=pt[1]-self.border_top>0 and pt[1]-self.border_top+self.border_height<=self.width 123 | # (2) 超过了下侧&总宽度没有超过 124 | feasible2=self.border_bottom-pt[1]>0 and self.border_bottom-pt[1]+self.border_heigt<=self.width 125 | # (3) Top和bottom的内部 126 | feasible3=pt[1]<=self.border_top and pt[1]>=self.border_bottom 127 | if feasible1==True or feasible2==True or feasible3==True: 128 | result.append([pt[0],pt[1]]) 129 | return result 130 | 131 | def slideToBottomLeft(self): 132 | '''移到最左下角位置''' 133 | for poly in self.cur_polys: 134 | GeoFunc.slidePoly(poly,-self.border_left,-self.border_bottom) 135 | 136 | def showResult(self): 137 | '''显示排样结果''' 138 | for poly in self.cur_polys: 139 | PltFunc.addPolygon(poly) 140 | PltFunc.showPlt(width=2000,height=2000) 141 | 142 | 143 | if __name__=='__main__': 144 | # index from 0-15 145 | index=6 146 | polys=getData(index) 147 | # nfp_ass=packing.NFPAssistant(polys,store_nfp=True,get_all_nfp=True,load_history=False) 148 | # nfp_ass=packing.NFPAssistant(polys,store_nfp=False,get_all_nfp=True,load_history=True) 149 | # nfp_ass=packing.NFPAssistant(polys,store_nfp=False,get_all_nfp=False,load_history=False) 150 | 151 | starttime = datetime.datetime.now() 152 | # bfl=BottomLeftFill(2000,polys,vertical=False) 153 | topos = TOPOS(polys,760) 154 | 155 | endtime = datetime.datetime.now() 156 | print ("total time: ",endtime - starttime) 157 | -------------------------------------------------------------------------------- /__pycache__/data.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seanys/2D-Irregular-Packing-Algorithm/a2b9494be9b811e56dce5058fe29ff2a134e8403/__pycache__/data.cpython-37.pyc -------------------------------------------------------------------------------- /__pycache__/geo_func.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seanys/2D-Irregular-Packing-Algorithm/a2b9494be9b811e56dce5058fe29ff2a134e8403/__pycache__/geo_func.cpython-37.pyc -------------------------------------------------------------------------------- /__pycache__/gravity_lowest.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seanys/2D-Irregular-Packing-Algorithm/a2b9494be9b811e56dce5058fe29ff2a134e8403/__pycache__/gravity_lowest.cpython-37.pyc -------------------------------------------------------------------------------- /__pycache__/heuristic.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seanys/2D-Irregular-Packing-Algorithm/a2b9494be9b811e56dce5058fe29ff2a134e8403/__pycache__/heuristic.cpython-37.pyc -------------------------------------------------------------------------------- /__pycache__/nfp.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seanys/2D-Irregular-Packing-Algorithm/a2b9494be9b811e56dce5058fe29ff2a134e8403/__pycache__/nfp.cpython-37.pyc -------------------------------------------------------------------------------- /__pycache__/show.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seanys/2D-Irregular-Packing-Algorithm/a2b9494be9b811e56dce5058fe29ff2a134e8403/__pycache__/show.cpython-37.pyc -------------------------------------------------------------------------------- /best_result/albano.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seanys/2D-Irregular-Packing-Algorithm/a2b9494be9b811e56dce5058fe29ff2a134e8403/best_result/albano.png -------------------------------------------------------------------------------- /best_result/dagli.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seanys/2D-Irregular-Packing-Algorithm/a2b9494be9b811e56dce5058fe29ff2a134e8403/best_result/dagli.png -------------------------------------------------------------------------------- /best_result/jakobs2_clus 89.10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seanys/2D-Irregular-Packing-Algorithm/a2b9494be9b811e56dce5058fe29ff2a134e8403/best_result/jakobs2_clus 89.10.png -------------------------------------------------------------------------------- /bottom_left_fill.py: -------------------------------------------------------------------------------- 1 | """ 2 | 该文件实现了主要基于序列的排样算法 3 | ----------------------------------- 4 | Created on Wed Dec 11, 2019 5 | @author: seanys,prinway 6 | ----------------------------------- 7 | """ 8 | from tools.geofunc import GeoFunc 9 | from tools.show import PltFunc 10 | from tools.data import getData 11 | import tools.packing as packing 12 | from tools.nfp import NFP 13 | from shapely.geometry import Polygon,mapping 14 | from shapely import affinity 15 | import numpy as np, random, operator, pandas as pd, matplotlib.pyplot as plt 16 | import json 17 | import csv 18 | import time 19 | import multiprocessing 20 | import datetime 21 | import random 22 | import copy 23 | 24 | class BottomLeftFill(object): 25 | def __init__(self,width,original_polygons,**kw): 26 | self.choose_nfp=False 27 | self.width=width 28 | self.length=150000 # 代表长度 29 | self.contain_length=2000 30 | self.polygons=original_polygons 31 | self.NFPAssistant=None 32 | if 'NFPAssistant' in kw: 33 | self.NFPAssistant=kw["NFPAssistant"] 34 | self.vertical=False 35 | if 'vertical' in kw: 36 | self.vertical=kw['vertical'] 37 | 38 | print("Total Num:", len(original_polygons)) 39 | self.placeFirstPoly() 40 | for i in range(1,len(self.polygons)): 41 | print("############################## Place the ",i+1,"th shape #################################") 42 | # self.showAll() 43 | self.placePoly(i) 44 | 45 | self.getLength() 46 | # self.showAll() 47 | 48 | def placeFirstPoly(self): 49 | poly=self.polygons[0] 50 | left_index,bottom_index,right_index,top_index=GeoFunc.checkBound(poly) # 获得边界 51 | GeoFunc.slidePoly(poly,-poly[left_index][0],-poly[bottom_index][1]) # 平移到左下角 52 | 53 | def placePoly(self,index): 54 | adjoin=self.polygons[index] 55 | # 是否垂直 56 | if self.vertical==True: 57 | ifr=packing.PackingUtil.getInnerFitRectangle(self.polygons[index],self.width,self.length) 58 | else: 59 | ifr=packing.PackingUtil.getInnerFitRectangle(self.polygons[index],self.length,self.width) 60 | differ_region=Polygon(ifr) 61 | 62 | for main_index in range(0,index): 63 | main=self.polygons[main_index] 64 | if self.NFPAssistant==None: 65 | nfp=NFP(main,adjoin).nfp 66 | else: 67 | nfp=self.NFPAssistant.getDirectNFP(main,adjoin) 68 | nfp_poly=Polygon(nfp) 69 | try: 70 | differ_region=differ_region.difference(nfp_poly) 71 | except: 72 | print('NFP failure, areas of polygons are:') 73 | self.showAll() 74 | for poly in main,adjoin: 75 | print(Polygon(poly).area) 76 | self.showPolys([main]+[adjoin]+[nfp]) 77 | print('NFP loaded from: ',self.NFPAssistant.history_path) 78 | 79 | differ=GeoFunc.polyToArr(differ_region) 80 | differ_index=self.getBottomLeft(differ) 81 | refer_pt_index=GeoFunc.checkTop(adjoin) 82 | GeoFunc.slideToPoint(self.polygons[index],adjoin[refer_pt_index],differ[differ_index]) 83 | 84 | def getBottomLeft(self,poly): 85 | ''' 86 | 获得左底部点,优先左侧,有多个左侧选择下方 87 | ''' 88 | bl=[] # bottom left的全部点 89 | _min=999999 90 | # 选择最左侧的点 91 | for i,pt in enumerate(poly): 92 | pt_object={ 93 | "index":i, 94 | "x":pt[0], 95 | "y":pt[1] 96 | } 97 | if self.vertical==True: 98 | target=pt[1] 99 | else: 100 | target=pt[0] 101 | if target<_min: 102 | _min=target 103 | bl=[pt_object] 104 | elif target==_min: 105 | bl.append(pt_object) 106 | if len(bl)==1: 107 | return bl[0]["index"] 108 | else: 109 | if self.vertical==True: 110 | target="x" 111 | else: 112 | target="y" 113 | _min=bl[0][target] 114 | one_pt=bl[0] 115 | for pt_index in range(1,len(bl)): 116 | if bl[pt_index][target]<_min: 117 | one_pt=bl[pt_index] 118 | _min=one_pt["y"] 119 | return one_pt["index"] 120 | 121 | def showAll(self): 122 | # for i in range(0,2): 123 | for i in range(0,len(self.polygons)): 124 | PltFunc.addPolygon(self.polygons[i]) 125 | length=max(self.width,self.contain_length) 126 | # PltFunc.addLine([[self.width,0],[self.width,self.contain_height]],color="blue") 127 | PltFunc.showPlt(width=max(length,self.width),height=max(length,self.width),minus=100) 128 | 129 | def showPolys(self,polys): 130 | for i in range(0,len(polys)-1): 131 | PltFunc.addPolygon(polys[i]) 132 | PltFunc.addPolygonColor(polys[len(polys)-1]) 133 | length=max(self.width,self.contain_length) 134 | PltFunc.showPlt(width=max(length,self.width),height=max(length,self.width),minus=200) 135 | 136 | def getLength(self): 137 | _max=0 138 | for i in range(0,len(self.polygons)): 139 | if self.vertical==True: 140 | extreme_index=GeoFunc.checkTop(self.polygons[i]) 141 | extreme=self.polygons[i][extreme_index][1] 142 | else: 143 | extreme_index=GeoFunc.checkRight(self.polygons[i]) 144 | extreme=self.polygons[i][extreme_index][0] 145 | if extreme>_max: 146 | _max=extreme 147 | self.contain_length=_max 148 | # PltFunc.addLine([[0,self.contain_length],[self.width,self.contain_length]],color="blue") 149 | return _max 150 | 151 | class TOPOS(object): 152 | ''' 153 | TOPOS启发式算法:将形状一个个放入,动态移动整体的位置,该算法参考Bennell的TOPOS Revised 154 | 问题:中线情况、好像有一些bug 155 | ''' 156 | def __init__(self,original_polys,width): 157 | self.polys=original_polys 158 | self.cur_polys=[] 159 | self.width=width 160 | self.NFPAssistant=packing.NFPAssistant(self.polys,store_nfp=False,get_all_nfp=True,load_history=True) 161 | 162 | self.run() 163 | 164 | def run(self): 165 | self.cur_polys.append(GeoFunc.getSlide(self.polys[0],1000,1000)) # 加入第一个形状 166 | self.border_left,self.border_right,self.border_bottom,self.border_top=0,0,0,0 # 初始化包络长方形 167 | self.border_height,self.border_width=0,0 168 | for i in range(1,len(self.polys)): 169 | # 更新所有的边界情况 170 | self.updateBound() 171 | 172 | # 计算NFP的合并情况 173 | feasible_border=Polygon(self.cur_polys[0]) 174 | for fixed_poly in self.cur_polys: 175 | nfp=self.NFPAssistant.getDirectNFP(fixed_poly,self.polys[i]) 176 | feasible_border=feasible_border.union(Polygon(nfp)) 177 | 178 | # 获得所有可行的点 179 | feasible_point=self.chooseFeasiblePoint(feasible_border) 180 | 181 | # 获得形状的左右侧宽度 182 | poly_left_pt,poly_bottom_pt,poly_right_pt,poly_top_pt=GeoFunc.checkBoundPt(self.polys[i]) 183 | poly_left_width,poly_right_width=poly_top_pt[0]-poly_left_pt[0],poly_right_pt[0]-poly_top_pt[0] 184 | 185 | # 逐一遍历NFP上的点,选择可行且宽度变化最小的位置 186 | min_change=999999999999 187 | target_position=[] 188 | for pt in feasible_point: 189 | change=min_change 190 | if pt[0]-poly_left_width>=self.border_left and pt[0]+poly_right_width<=self.border_right: 191 | # 形状没有超出边界,此时min_change为负 192 | change=min(self.border_left-pt[0],self.border_left-pt[0]) 193 | elif min_change>0: 194 | # 形状超出了左侧或右侧边界,若变化大于0,则需要选择左右侧变化更大的值 195 | change=max(self.border_left-pt[0]+poly_left_width,pt[0]+poly_right_width-self.border_right) 196 | else: 197 | # 有超出且min_change<=0的时候不需要改变 198 | pass 199 | 200 | if changeself.border_right: 222 | self.border_right=border_right 223 | if border_top>self.border_top: 224 | self.border_top=border_top 225 | self.border_height=self.border_top-self.border_bottom 226 | self.border_width=self.border_right-self.border_left 227 | 228 | def chooseFeasiblePoint(self,border): 229 | '''选择可行的点''' 230 | res=mapping(border) 231 | _arr=[] 232 | if res["type"]=="MultiPolygon": 233 | for poly in res["coordinates"]: 234 | _arr=_arr+self.feasiblePoints(poly) 235 | else: 236 | _arr=_arr+self.feasiblePoints(res["coordinates"][0]) 237 | 238 | return _arr 239 | 240 | def feasiblePoints(self,poly): 241 | ''' 242 | 1. 将Polygon对象转化为点 243 | 2. 超出Width范围的点排除 244 | 3. 直线与边界的交点选入 245 | ''' 246 | result=[] 247 | for pt in poly: 248 | # (1) 超出了上侧&总宽度没有超过 249 | feasible1=pt[1]-self.border_top>0 and pt[1]-self.border_top+self.border_height<=self.width 250 | # (2) 超过了下侧&总宽度没有超过 251 | feasible2=self.border_bottom-pt[1]>0 and self.border_bottom-pt[1]+self.border_heigt<=self.width 252 | # (3) Top和bottom的内部 253 | feasible3=pt[1]<=self.border_top and pt[1]>=self.border_bottom 254 | if feasible1==True or feasible2==True or feasible3==True: 255 | result.append([pt[0],pt[1]]) 256 | return result 257 | 258 | def slideToBottomLeft(self): 259 | '''移到最左下角位置''' 260 | for poly in self.cur_polys: 261 | GeoFunc.slidePoly(poly,-self.border_left,-self.border_bottom) 262 | 263 | def showResult(self): 264 | '''显示排样结果''' 265 | for poly in self.cur_polys: 266 | PltFunc.addPolygon(poly) 267 | PltFunc.showPlt(width=2000,height=2000) 268 | 269 | 270 | if __name__=='__main__': 271 | # index from 0-15 272 | index=6 273 | polys=getData(index) 274 | nfp_ass=packing.NFPAssistant(polys,store_nfp=True,get_all_nfp=True,load_history=False) 275 | # nfp_ass=packing.NFPAssistant(polys,store_nfp=False,get_all_nfp=True,load_history=True) 276 | # nfp_ass=packing.NFPAssistant(polys,store_nfp=False,get_all_nfp=False,load_history=False) 277 | 278 | starttime = datetime.datetime.now() 279 | # bfl=BottomLeftFill(2000,polys,vertical=False) 280 | bfl=BottomLeftFill(760,polys,vertical=False,NFPAssistant=nfp_ass) 281 | 282 | endtime = datetime.datetime.now() 283 | print ("total time: ",endtime - starttime) 284 | bfl.showAll() -------------------------------------------------------------------------------- /compaction_separation.py: -------------------------------------------------------------------------------- 1 | """ 2 | 该文件实现了拆分算法 Separation去除重叠 3 | 和Compaction压缩当前解 4 | ----------------------------------- 5 | Created on Wed Dec 11, 2020 6 | @author: seanys,prinway 7 | ----------------------------------- 8 | We will update this file soon, now 9 | it has some wrong. 10 | """ 11 | from tools.geofunc import GeoFunc 12 | from tools.show import PltFunc 13 | from tools.lp import sovleLP,problem 14 | from tools.lp_assistant import LPAssistant 15 | import pandas as pd 16 | import json 17 | from shapely.geometry import Polygon,Point,mapping,LineString 18 | from interval import Interval 19 | import copy 20 | import random 21 | import math 22 | 23 | class LPFunction(object): 24 | ''' 25 | 参考文献:Solving Irregular Strip Packing problems by hybridising simulated annealing and linear programming 26 | 功能:Compaction与Separation函数处理 27 | ''' 28 | def __init__(self,polys,poly_status,width,length,_type): 29 | self._type=_type 30 | self.all_nfp=pd.read_csv("/Users/sean/Documents/Projects/Data/fu_simplify.csv") 31 | self.poly_status=copy.deepcopy(poly_status) 32 | self.polys=copy.deepcopy(polys) 33 | self.WIDTH=width 34 | # print("初始高度:",LPAssistant.getLength(polys)) 35 | # self.LENGTH=LPAssistant.getLength(polys) 36 | # print(LPAssistant.getLength(polys)) 37 | self.LENGTH=length 38 | self.DISTANCE=400 39 | self.main() 40 | 41 | def main(self): 42 | # 初始化全部参数,目标参数为z,x1,y1,x2,y..., 43 | N=len(self.polys) 44 | if self._type=="separation": 45 | a,b,c=[[0]*(2*N+N*N) for _ in range(8*N+N*N)],[0 for _ in range(8*N+N*N)],[0 for _ in range(N*2+N*N)] 46 | else: 47 | # Compaction有x1-xn/y1-yn/z共2N+1个参数,限制距离和边界2N个限制,N*N个两两间的约束 48 | a,b,c=[[0]*(2*N+1) for _ in range(9*N+N*N)],[0 for _ in range(9*N+N*N)],[0 for _ in range(N*2+1)] 49 | 50 | # 获得常数限制和多边形的限制 51 | self.getConstants() 52 | self.getTargetEdges() 53 | 54 | # 限制全部移动距离 OK 55 | for i in range(N): 56 | row=i*4 57 | a[row+0][i*2+0],b[row+0]=-1,-self.DISTANCE-self.Xi[i] # -xi>=-DISTANCE-Xi 58 | a[row+1][i*2+1],b[row+1]=-1,-self.DISTANCE-self.Yi[i] # -yi>=-DISTANCE-Yi 59 | a[row+2][i*2+0],b[row+2]= 1,-self.DISTANCE+self.Xi[i] # xi>=-DISTANCE+Xi 60 | a[row+3][i*2+1],b[row+3]= 1,-self.DISTANCE+self.Yi[i] # yi>=-DISTANCE+Yi 61 | 62 | # 限制无法移出边界 OK 63 | for i in range(N): 64 | row=4*N+i*4 65 | a[row+0][i*2+0],b[row+0]= 1,self.W_[i] # xi>=Wi* 66 | a[row+1][i*2+1],b[row+1]= 1,self.H[i] # yi>=Hi 67 | a[row+2][i*2+0],b[row+2]=-1,self.W[i]-self.LENGTH # -xi>=Wi-Length 68 | a[row+3][i*2+1],b[row+3]=-1,-self.WIDTH # -yi>=-Width 69 | 70 | # 限制不出现重叠情况 有一点问题 71 | for i in range(N): 72 | for j in range(N): 73 | row=8*N+i*N+j 74 | if self._type=="separation": 75 | if i!=j: 76 | a[row][i*2+0],a[row][i*2+1],a[row][j*2+0],a[row][j*2+1],b[row]=self.getOverlapConstrain(i,j) 77 | a[row][2*N+i*N+j],c[2*N+i*N+j]=1,1 # 目标函数变化 78 | else: 79 | a[row][2*N+i*N+j],c[2*N+i*N+j],b[row]=1,1,0 80 | else: 81 | if i!=j: 82 | a[row][i*2+0],a[row][i*2+1],a[row][j*2+0],a[row][j*2+1],b[row]=self.getOverlapConstrain(i,j) 83 | 84 | if self._type=="compaction": 85 | # 大于所有形状的位置+高度,z-xi>=w OK 86 | for i in range(N): 87 | row=8*N+N*N+i 88 | a[row][2*N],a[row][i*2],b[row]=1,-1,self.W[i] 89 | c[2*N]=1 90 | 91 | # 求解计算结果 92 | result,self.final_value=sovleLP(a,b,c,_type=self._type) 93 | 94 | # 将其转化为坐标,Variable的输出顺序是[a00,..,ann,x1,..,xn,y1,..,yn] 95 | placement_points=[] 96 | if self._type=="separation": 97 | for i in range(N*N,N*N+N): 98 | placement_points.append([result[i],result[i+N]]) 99 | else: 100 | for i in range(len(result)//2): 101 | placement_points.append([result[i],result[i+N]]) 102 | 103 | # 获得最终结果 104 | self.getResult(placement_points) 105 | 106 | # 更新最终的结果,更新所有的位置 107 | def getResult(self,placement_points): 108 | self.final_polys,self.final_poly_status=[],copy.deepcopy(self.poly_status) 109 | for i,poly in enumerate(self.polys): 110 | self.final_polys.append(GeoFunc.getSlide(poly,placement_points[i][0]-self.Xi[i],placement_points[i][1]-self.Yi[i])) 111 | self.final_poly_status[i][1]=[placement_points[i][0],placement_points[i][1]] 112 | 113 | # for i in range(len(self.polys)): 114 | # PltFunc.addPolygon(self.final_polys[i]) 115 | # PltFunc.addPolygonColor(self.polys[i]) # 初始化的结果 116 | # PltFunc.showPlt(width=1500,height=1500) 117 | 118 | def getOverlapConstrain(self,i,j): 119 | # 初始化参数 120 | a_xi,a_yi,a_xj,a_yj,b=0,0,0,0,0 121 | 122 | # 获取Stationary Poly的参考点的坐标 123 | Xi,Yi=self.Xi[i],self.Yi[i] 124 | 125 | # 获取参考的边 126 | edge=self.target_edges[i][j] 127 | X1,Y1,X2,Y2=edge[0][0],edge[0][1],edge[1][0],edge[1][1] 128 | 129 | ''' 130 | 非重叠情况 131 | 式1: (y2-y1)*xj+(x1-x2)*yj+x2*y1-x1*y2>0 右侧距离大于0 132 | 式2: (Y2-Y1)*xj+(X1-X2)*yj+X2*Y1-X1*Y2+(xi-Xi)*(Y1-Y2)+(yi-Yi)*(X2-X1)+>0 133 | 式3: (Y2-Y1)*xj+(X1-X2)*yj+X2*Y1-X1*Y2+(Y1-Y2)*xi+(X2-X1)*yi-Xi*(Y1-Y2)-Yi*(X2-X1)>0 134 | 式4: (Y1-Y2)*xi+(X2-X1)*yi+(Y2-Y1)*xj+(X1-X2)*yj>-X2*Y1+X1*Y2+Xi*(Y1-Y2)+Yi*(X2-X1) 135 | 重叠情况 136 | 式1: -((y2-y1)*xj+(x1-x2)*yj+x2*y1-x1*y2)-a_ij<0 左侧距离小于0 137 | 式2: (y2-y1)*xj+(x1-x2)*yj+x2*y1-x1*y2+a_ij>0 138 | 式1: (Y1-Y2)*xi+(X2-X1)*yi+(Y2-Y1)*xj+(X1-X2)*yj+a_ij>-X2*Y1+X1*Y2+Xi*(Y1-Y2)+Yi*(X2-X1) 左侧距离小于0 139 | 总结: 重叠的时候由于求出来是负值,最终只增加了一个a_ij,参数肯定是1 140 | ''' 141 | a_xi,a_yi,a_xj,a_yj,b=Y1-Y2,X2-X1,Y2-Y1,X1-X2,-X2*Y1+X1*Y2+Xi*(Y1-Y2)+Yi*(X2-X1) 142 | 143 | return a_xi,a_yi,a_xj,a_yj,b 144 | 145 | # 获取所有的常数限制 146 | def getConstants(self): 147 | self.W=[] # 最高位置到右侧的距离 148 | self.W_=[] # 最高位置到左侧的距离 149 | self.H=[] # 最高点 150 | self.Xi=[] # Xi的初始位置 151 | self.Yi=[] # Yi的初始位置 152 | self.PLACEMENTPOINT=[] 153 | for i,poly in enumerate(self.polys): 154 | left,bottom,right,top=LPAssistant.getBoundPoint(poly) 155 | self.PLACEMENTPOINT.append([top[0],top[1]]) 156 | self.Xi.append(top[0]) 157 | self.Yi.append(top[1]) 158 | self.W.append(right[0]-top[0]) 159 | self.W_.append(top[0]-left[0]) 160 | self.H.append(top[1]-bottom[1]) 161 | # print("W:",self.W) 162 | # print("W_:",self.W_) 163 | # print("H:",self.H) 164 | # print("Xi:",self.Xi) 165 | # print("Yi:",self.Yi) 166 | # print("PLACEMENTPOINT:",self.PLACEMENTPOINT) 167 | # print("Length:",self.LENGTH) 168 | 169 | # 获取所有两条边之间的关系 170 | def getTargetEdges(self): 171 | self.target_edges=[[0]*len(self.polys) for _ in range(len(self.polys))] 172 | for i in range(len(self.polys)): 173 | for j in range(len(self.polys)): 174 | if i==j: 175 | continue 176 | nfp=self.getNFP(i,j) 177 | nfp_edges=GeoFunc.getPolyEdges(nfp) 178 | point=self.PLACEMENTPOINT[j] 179 | if Polygon(nfp).contains(Point(point)) and self._type=="separation": 180 | # 如果包含且是拆分,则寻找距离最近的那个 181 | min_distance=99999999999999 182 | for edge in nfp_edges: 183 | left_distance=-self.getRightDistance(edge,point) 184 | if left_distance<=min_distance: 185 | min_distance=left_distance 186 | self.target_edges[i][j]=copy.deepcopy(edge) 187 | else: 188 | # 如果不包含或者是压缩,则选择最远的 189 | max_distance=-0.00001 190 | for edge in nfp_edges: 191 | right_distance=self.getRightDistance(edge,point) 192 | if right_distance>=max_distance: 193 | max_distance=right_distance 194 | self.target_edges[i][j]=copy.deepcopy(edge) 195 | 196 | @staticmethod 197 | def getRightDistance(edge,point): 198 | A=edge[1][1]-edge[0][1] 199 | B=edge[0][0]-edge[1][0] 200 | C=edge[1][0]*edge[0][1]-edge[0][0]*edge[1][1] 201 | D=A*point[0]+B*point[1]+C 202 | dis=(math.fabs(A*point[0]+B*point[1]+C))/(math.pow(A*A+B*B,0.5)) 203 | if D>0: 204 | return dis # 右侧返回正 205 | elif D==0: 206 | return 0 # 直线上返回0 207 | else: 208 | return -dis # 左侧返回负值 209 | 210 | def getNFP(self,j,i): 211 | # j是固定位置,i是移动位置 212 | row=j*192+i*16+self.poly_status[j][2]*4+self.poly_status[i][2] 213 | bottom_pt=LPAssistant.getBottomPoint(self.polys[j]) 214 | delta_x,delta_y=bottom_pt[0],bottom_pt[1] 215 | nfp=GeoFunc.getSlide(json.loads(self.all_nfp["nfp"][row]),delta_x,delta_y) 216 | return nfp 217 | 218 | 219 | def searchForBest(polys,poly_status,width,length): 220 | # 记录最优结果 221 | best_poly_status,best_polys=[],[] 222 | cur_length=length 223 | 224 | # 循环检索最优位置(Polys不需要变化) 225 | while True: 226 | print("允许高度:",cur_length) 227 | result_polys,result_poly_status,result_value=searchOneLength(polys,poly_status,width,cur_length,"separation") 228 | if result_value==0: 229 | best_polys=result_polys 230 | break 231 | cur_length=cur_length+4 232 | 233 | print("开始准确检索") 234 | # 精准检索最优结果 235 | for i in range(3): 236 | cur_length=cur_length-1 237 | print("允许高度:",cur_length) 238 | result_polys,result_poly_status,result_value=searchOneLength(polys,poly_status,width,cur_length,"separation") 239 | if result_value!=0: 240 | break 241 | best_polys=result_polys 242 | 243 | best_length=cur_length+1 244 | print("Separation最终高度:",best_length) 245 | 246 | # 执行Compaction代码更新状态,只有在最后这次才需要改poly_status 247 | best_polys,best_poly_status,best_length=searchOneLength(best_polys,poly_status,width,best_length,"compaction") 248 | 249 | print("最终高度:",best_length) 250 | return best_polys,poly_status,best_length 251 | 252 | 253 | def searchOneLength(polys,poly_status,width,length,_type): 254 | ''' 255 | 检索一个确定高度到不会变化 256 | Separation: 检索某个高度是否能够达到0,如果不能达到,就返回最终结果、状态、最终重叠 257 | Compaction: 检索某个高度,返回最终形状、状态、计算高度 258 | ''' 259 | input_polys=copy.deepcopy(polys) # 每次输入的形状 260 | last_value=99999999999 261 | final_polys,final_poly_status=[],[] 262 | while True: 263 | res=LPFunction(input_polys,poly_status,width,length,_type) 264 | # 如果没有重叠,或者等于上一个状态 265 | if res.final_value==0 or abs(res.final_value-last_value)<0.001: 266 | last_value=res.final_value 267 | final_polys=copy.deepcopy(res.final_polys) 268 | final_poly_status=copy.deepcopy(res.final_poly_status) 269 | break 270 | # 如果有变化,则更换状态再试一次 271 | input_polys=copy.deepcopy(res.final_polys) 272 | last_value=res.final_value 273 | return final_polys,final_poly_status,last_value 274 | 275 | if __name__ == "__main__": 276 | blf = pd.read_csv("record/blf.csv") 277 | index = 7 278 | polys,poly_status,width=json.loads(blf["polys"][index]),json.loads(blf["poly_status"][index]),int(blf["width"][index]) 279 | 280 | searchForBest(polys,poly_status,width,628.1533587455999) 281 | 282 | # LPFunction(polys,poly_status,width,628.1533587455999,"compaction") 283 | # Compaction(polys,poly_status,width) 284 | 285 | 286 | -------------------------------------------------------------------------------- /data/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seanys/2D-Irregular-Packing-Algorithm/a2b9494be9b811e56dce5058fe29ff2a134e8403/data/.DS_Store -------------------------------------------------------------------------------- /data/albano.csv: -------------------------------------------------------------------------------- 1 | num,polygon 2 | 2,"[[0.0, 86.0], [966.0, 142.0], [1983.0, 0.0], [2185.0, 238.0], [2734.0, 217.0], [3000.0, 767.0], [2819.0, 900.0], [2819.0, 1360.0], [3000.0, 1493.0], [2734.0, 2043.0], [2185.0, 2022.0], [1983.0, 2260.0], [966.0, 2118.0], [0.0, 2174.0]]" 3 | 2,"[[0.0, 0.0], [3034.0, 0.0], [3034.0, 261.0], [0.0, 261.0]]" 4 | 4,"[[0.0, 173.0], [1761.0, 0.0], [2183.0, 650.0], [2183.0, 1010.0], [1761.0, 1660.0], [0.0, 1487.0]]" 5 | 4,"[[74.0, 0.0], [870.0, 119.0], [1666.0, 0.0], [1740.0, 125.0], [870.0, 305.0], [0.0, 125.0]]" 6 | 4,"[[0.0, 0.0], [411.0, 65.0], [800.0, 0.0], [1189.0, 65.0], [1600.0, 0.0], [1500.0, 368.0], [800.0, 286.0], [100.0, 368.0]]" 7 | 4,"[[0.0, 0.0], [936.0, 0.0], [936.0, 659.0], [0.0, 659.0]]" 8 | 2,"[[56.0, 73.0], [1066.0, 143.0], [1891.0, 0.0], [2186.0, 288.0], [2573.0, 241.0], [2676.0, 926.0], [2594.0, 1366.0], [0.0, 1366.0]]" 9 | 2,"[[0.0, 0.0], [2499.0, 0.0], [2705.0, 387.0], [2622.0, 934.0], [2148.0, 967.0], [1920.0, 1152.0], [1061.0, 1059.0], [0.0, 1125.0]]" -------------------------------------------------------------------------------- /data/albano.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seanys/2D-Irregular-Packing-Algorithm/a2b9494be9b811e56dce5058fe29ff2a134e8403/data/albano.pdf -------------------------------------------------------------------------------- /data/albano_orientation.csv: -------------------------------------------------------------------------------- 1 | o_0,o_1,ver_sym 2 | "[[0.0, 17.2], [193.20000000000002, 28.400000000000002], [396.6, 0.0], [437.0, 47.6], [546.8000000000001, 43.400000000000006], [600.0, 153.4], [563.8000000000001, 180.0], [563.8000000000001, 272.0], [600.0, 298.6], [546.8000000000001, 408.6], [437.0, 404.40000000000003], [396.6, 452.0], [193.20000000000002, 423.6], [0.0, 434.8], [0.0, 17.2]]","[[600.0, 434.8], [406.79999999999995, 423.6], [203.39999999999998, 452.0], [163.0, 404.4], [53.19999999999993, 408.6], [0.0, 298.6], [36.19999999999993, 272.0], [36.19999999999993, 180.0], [0.0, 153.39999999999998], [53.19999999999993, 43.39999999999998], [163.0, 47.599999999999966], [203.39999999999998, 0.0], [406.79999999999995, 28.399999999999977], [600.0, 17.19999999999999], [600.0, 434.8]]",0 3 | "[[0.0, 0.0], [606.8000000000001, 0.0], [606.8000000000001, 52.2], [0.0, 52.2], [0.0, 0.0]]","[[606.8000000000001, 52.2], [0.0, 52.2], [0.0, 0.0], [606.8000000000001, 0.0], [606.8000000000001, 52.2]]",1 4 | "[[0.0, 34.6], [352.20000000000005, 0.0], [436.6, 130.0], [436.6, 202.0], [352.20000000000005, 332.0], [0.0, 297.40000000000003], [0.0, 34.6]]","[[436.6, 297.4], [84.39999999999998, 332.0], [0.0, 202.0], [0.0, 130.0], [84.39999999999998, 0.0], [436.6, 34.599999999999966], [436.6, 297.4]]",0 5 | "[[14.8, 0.0], [174.0, 23.8], [333.20000000000005, 0.0], [348.0, 25.0], [174.0, 61.0], [0.0, 25.0], [14.8, 0.0]]","[[333.2, 61.0], [174.0, 37.2], [14.799999999999955, 61.0], [0.0, 36.0], [174.0, 0.0], [348.0, 36.0], [333.2, 61.0]]",0 6 | "[[0.0, 0.0], [82.2, 13.0], [160.0, 0.0], [237.8, 13.0], [320.0, 0.0], [300.0, 73.60000000000001], [160.0, 57.2], [20.0, 73.60000000000001], [0.0, 0.0]]","[[320.0, 73.60000000000001], [237.8, 60.60000000000001], [160.0, 73.60000000000001], [82.19999999999999, 60.60000000000001], [0.0, 73.60000000000001], [20.0, 0.0], [160.0, 16.400000000000006], [300.0, 0.0], [320.0, 73.60000000000001]]",0 7 | "[[0.0, 0.0], [187.20000000000002, 0.0], [187.20000000000002, 131.8], [0.0, 131.8], [0.0, 0.0]]","[[187.20000000000002, 131.8], [0.0, 131.8], [0.0, 0.0], [187.20000000000002, 0.0], [187.20000000000002, 131.8]]",1 8 | "[[11.200000000000001, 14.600000000000001], [213.20000000000002, 28.6], [378.20000000000005, 0.0], [437.20000000000005, 57.6], [514.6, 48.2], [535.2, 185.20000000000002], [518.8000000000001, 273.2], [0.0, 273.2], [11.200000000000001, 14.600000000000001]]","[[524.0, 258.59999999999997], [322.0, 244.6], [157.0, 273.2], [98.0, 215.6], [20.600000000000023, 225.0], [0.0, 87.99999999999997], [16.399999999999977, 0.0], [535.2, 0.0], [524.0, 258.59999999999997]]",0 9 | "[[0.0, 0.0], [499.8, 0.0], [541.0, 77.4], [524.4, 186.8], [429.6, 193.4], [384.0, 230.4], [212.20000000000002, 211.8], [0.0, 225.0], [0.0, 0.0]]","[[541.0, 230.4], [41.19999999999999, 230.4], [0.0, 153.0], [16.600000000000023, 43.599999999999994], [111.39999999999998, 37.0], [157.0, 0.0], [328.79999999999995, 18.599999999999994], [541.0, 5.400000000000006], [541.0, 230.4]]",0 10 | -------------------------------------------------------------------------------- /data/blaz.csv: -------------------------------------------------------------------------------- 1 | num,polygon,clock_polygon 2 | 4,"[[0.0, 0.0], [2.0, -1.0], [4.0, 0.0], [4.0, 3.0], [2.0, 4.0], [0.0, 3.0]]","[[0.0, 3.0], [2.0, 4.0], [4.0, 3.0], [4.0, 0.0], [2.0, -1.0], [0.0, 0.0]]" 3 | 4,"[[0.0, 0.0], [3.0, 0.0], [2.0, 2.0], [3.0, 4.0], [3.0, 5.0], [1.0, 5.0], [-1.0, 3.0], [-1.0, 1.0]]","[[-1.0, 1.0], [-1.0, 3.0], [1.0, 5.0], [3.0, 5.0], [3.0, 4.0], [2.0, 2.0], [3.0, 0.0], [0.0, 0.0]]" 4 | 4,"[[0.0, 0.0], [2.0, 0.0], [3.0, 1.0], [3.0, 3.0], [2.0, 4.0], [0.0, 4.0], [-1.0, 3.0], [-1.0, 1.0]]","[[-1.0, 1.0], [-1.0, 3.0], [0.0, 4.0], [2.0, 4.0], [3.0, 3.0], [3.0, 1.0], [2.0, 0.0], [0.0, 0.0]]" 5 | 4,"[[0.0, 0.0], [2.0, 1.0], [4.0, 0.0], [3.0, 2.0], [4.0, 5.0], [2.0, 4.0], [0.0, 5.0], [1.0, 3.0]]","[[1.0, 3.0], [0.0, 5.0], [2.0, 4.0], [4.0, 5.0], [3.0, 2.0], [4.0, 0.0], [2.0, 1.0], [0.0, 0.0]]" 6 | 4,"[[0.0, 0.0], [5.0, 0.0], [5.0, 5.0], [4.0, 5.0], [3.0, 3.0], [2.0, 2.0], [0.0, 1.0]]","[[0.0, 1.0], [2.0, 2.0], [3.0, 3.0], [4.0, 5.0], [5.0, 5.0], [5.0, 0.0], [0.0, 0.0]]" 7 | 4,"[[0.0, 0.0], [2.0, 3.0], [-2.0, 3.0]]","[[-2.0, 3.0], [2.0, 3.0], [0.0, 0.0]]" 8 | 4,"[[0.0, 0.0], [2.0, 0.0], [2.0, 2.0], [0.0, 2.0]]","[[0.0, 2.0], [2.0, 2.0], [2.0, 0.0], [0.0, 0.0]]" -------------------------------------------------------------------------------- /data/blaz.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seanys/2D-Irregular-Packing-Algorithm/a2b9494be9b811e56dce5058fe29ff2a134e8403/data/blaz.pdf -------------------------------------------------------------------------------- /data/blaz1.csv: -------------------------------------------------------------------------------- 1 | num,polygon 2 | 7,"[[0.0, 0.0], [2.0, -1.0], [4.0, 0.0], [4.0, 3.0], [2.0, 4.0], [0.0, 3.0]]" 3 | 7,"[[0.0, 0.0], [3.0, 0.0], [2.0, 2.0], [3.0, 4.0], [3.0, 5.0], [1.0, 5.0], [-1.0, 3.0], [-1.0, 1.0]]" 4 | 7,"[[0.0, 0.0], [2.0, 0.0], [3.0, 1.0], [3.0, 3.0], [2.0, 4.0], [0.0, 4.0], [-1.0, 3.0], [-1.0, 1.0]]" 5 | 7,"[[0.0, 0.0], [2.0, 1.0], [4.0, 0.0], [3.0, 2.0], [4.0, 5.0], [2.0, 4.0], [0.0, 5.0], [1.0, 3.0]]" 6 | 7,"[[0.0, 0.0], [5.0, 0.0], [5.0, 5.0], [4.0, 5.0], [3.0, 3.0], [2.0, 2.0], [0.0, 1.0]]" 7 | 7,"[[0.0, 0.0], [2.0, 3.0], [-2.0, 3.0]]" 8 | 7,"[[0.0, 0.0], [2.0, 0.0], [2.0, 2.0], [0.0, 2.0]]" -------------------------------------------------------------------------------- /data/blaz2.csv: -------------------------------------------------------------------------------- 1 | num,polygon 2 | 4,"[[0.0, 0.0], [2.0, -1.0], [4.0, 0.0], [4.0, 3.0], [2.0, 4.0], [0.0, 3.0]]" 3 | 4,"[[0.0, 0.0], [3.0, 0.0], [2.0, 2.0], [3.0, 4.0], [3.0, 5.0], [1.0, 5.0], [-1.0, 3.0], [-1.0, 1.0]]" 4 | 4,"[[0.0, 0.0], [2.0, 0.0], [3.0, 1.0], [3.0, 3.0], [2.0, 4.0], [0.0, 4.0], [-1.0, 3.0], [-1.0, 1.0]]" 5 | 4,"[[0.0, 0.0], [2.0, 1.0], [4.0, 0.0], [3.0, 2.0], [4.0, 5.0], [2.0, 4.0], [0.0, 5.0], [1.0, 3.0]]" 6 | 4,"[[0.0, 0.0], [5.0, 0.0], [5.0, 5.0], [4.0, 5.0], [3.0, 3.0], [2.0, 2.0], [0.0, 1.0]]" 7 | -------------------------------------------------------------------------------- /data/blaz_clus.csv: -------------------------------------------------------------------------------- 1 | num,polygon 2 | 1,"[[0.0, 0.0], [2.0, -1.0], [4.0, 0.0], [4.0, 3.0], [3.0, 5.0], [4.0, 8.0], [4.0, 11.0], [2.0, 12.0], [0.0, 11.0], [0.0, 8.0], [1.0, 6.0], [0.0, 3.0]]" 3 | 1,"[[0.0, 0.0], [2.0, 1.0], [4.0, 0.0], [3.0, 2.0], [4.0, 5.0], [4.0, 8.0], [3.0, 10.0], [4.0, 13.0], [2.0, 12.0], [0.0, 13.0], [1.0, 11.0], [0.0, 8.0], [0.0, 5.0], [1.0, 3.0]]" 4 | 1,"[[0.0, 0.0], [2.0, 1.0], [4.0, 0.0], [3.0, 2.0], [4.0, 5.0], [4.0, 8.0], [2.0, 9.0], [0.0, 8.0], [0.0, 5.0], [1.0, 3.0]]" 5 | 4,"[[0.0, 0.0], [3.0, 0.0], [2.0, 2.0], [3.0, 4.0], [3.0, 5.0], [1.0, 5.0], [-1.0, 3.0], [-1.0, 1.0]]" 6 | 4,"[[0.0, 0.0], [2.0, 0.0], [3.0, 1.0], [3.0, 3.0], [2.0, 4.0], [0.0, 4.0], [-1.0, 3.0], [-1.0, 1.0]]" 7 | 4,"[[0.0, 0.0], [5.0, 0.0], [5.0, 5.0], [4.0, 5.0], [3.0, 3.0], [2.0, 2.0], [0.0, 1.0]]" 8 | 4,"[[0.0, 0.0], [2.0, 3.0], [-2.0, 3.0]]" 9 | 4,"[[0.0, 0.0], [2.0, 0.0], [2.0, 2.0], [0.0, 2.0]]" 10 | -------------------------------------------------------------------------------- /data/blaz_clus_orientation.csv: -------------------------------------------------------------------------------- 1 | o_0,o_1,ver_sym 2 | "[[0.0, 0.0], [100.0, -50.0], [200.0, 0.0], [200.0, 150.0], [150.0, 250.0], [200.0, 400.0], [200.0, 550.0], [100.0, 600.0], [0.0, 550.0], [0.0, 400.0], [50.0, 300.0], [0.0, 150.0], [0.0, 0.0]]","[[200.0, 550.0], [100.0, 600.0], [0.0, 550.0], [0.0, 400.0], [50.0, 300.0], [0.0, 150.0], [0.0, 0.0], [100.0, -50.0], [200.0, 0.0], [200.0, 150.0], [150.0, 250.0], [200.0, 400.0], [200.0, 550.0]]",1 3 | "[[0.0, 0.0], [100.0, 50.0], [200.0, 0.0], [150.0, 100.0], [200.0, 250.0], [200.0, 400.0], [150.0, 500.0], [200.0, 650.0], [100.0, 600.0], [0.0, 650.0], [50.0, 550.0], [0.0, 400.0], [0.0, 250.0], [50.0, 150.0], [0.0, 0.0]]","[[200.0, 650.0], [100.0, 600.0], [0.0, 650.0], [50.0, 550.0], [0.0, 400.0], [0.0, 250.0], [50.0, 150.0], [0.0, 0.0], [100.0, 50.0], [200.0, 0.0], [150.0, 100.0], [200.0, 250.0], [200.0, 400.0], [150.0, 500.0], [200.0, 650.0]]",1 4 | "[[0.0, 0.0], [100.0, 50.0], [200.0, 0.0], [150.0, 100.0], [200.0, 250.0], [200.0, 400.0], [100.0, 450.0], [0.0, 400.0], [0.0, 250.0], [50.0, 150.0], [0.0, 0.0]]","[[200.0, 450.0], [100.0, 400.0], [0.0, 450.0], [50.0, 350.0], [0.0, 200.0], [0.0, 50.0], [100.0, 0.0], [200.0, 50.0], [200.0, 200.0], [150.0, 300.0], [200.0, 450.0]]",0 5 | "[[0.0, 0.0], [150.0, 0.0], [100.0, 100.0], [150.0, 200.0], [150.0, 250.0], [50.0, 250.0], [-50.0, 150.0], [-50.0, 50.0], [0.0, 0.0]]","[[100.0, 250.0], [-50.0, 250.0], [0.0, 150.0], [-50.0, 50.0], [-50.0, 0.0], [50.0, 0.0], [150.0, 100.0], [150.0, 200.0], [100.0, 250.0]]",0 6 | "[[0.0, 0.0], [100.0, 0.0], [150.0, 50.0], [150.0, 150.0], [100.0, 200.0], [0.0, 200.0], [-50.0, 150.0], [-50.0, 50.0], [0.0, 0.0]]","[[100.0, 200.0], [0.0, 200.0], [-50.0, 150.0], [-50.0, 50.0], [0.0, 0.0], [100.0, 0.0], [150.0, 50.0], [150.0, 150.0], [100.0, 200.0]]",1 7 | "[[0.0, 0.0], [250.0, 0.0], [250.0, 250.0], [200.0, 250.0], [150.0, 150.0], [100.0, 100.0], [0.0, 50.0], [0.0, 0.0]]","[[250.0, 250.0], [0.0, 250.0], [0.0, 0.0], [50.0, 0.0], [100.0, 100.0], [150.0, 150.0], [250.0, 200.0], [250.0, 250.0]]",0 8 | "[[0.0, 0.0], [100.0, 150.0], [-100.0, 150.0], [0.0, 0.0]]","[[0.0, 150.0], [-100.0, 0.0], [100.0, 0.0], [0.0, 150.0]]",0 9 | "[[0.0, 0.0], [100.0, 0.0], [100.0, 100.0], [0.0, 100.0], [0.0, 0.0]]","[[100.0, 100.0], [0.0, 100.0], [0.0, 0.0], [100.0, 0.0], [100.0, 100.0]]",1 10 | -------------------------------------------------------------------------------- /data/blaz_orientation.csv: -------------------------------------------------------------------------------- 1 | o_0,o_1,ver_sym 2 | "[[0.0, 0.0], [100.0, -50.0], [200.0, 0.0], [200.0, 150.0], [100.0, 200.0], [0.0, 150.0], [0.0, 0.0]]","[[200.0, 150.0], [100.0, 200.0], [0.0, 150.0], [0.0, 0.0], [100.0, -50.0], [200.0, 0.0], [200.0, 150.0]]",1 3 | "[[0.0, 0.0], [150.0, 0.0], [100.0, 100.0], [150.0, 200.0], [150.0, 250.0], [50.0, 250.0], [-50.0, 150.0], [-50.0, 50.0], [0.0, 0.0]]","[[100.0, 250.0], [-50.0, 250.0], [0.0, 150.0], [-50.0, 50.0], [-50.0, 0.0], [50.0, 0.0], [150.0, 100.0], [150.0, 200.0], [100.0, 250.0]]",0 4 | "[[0.0, 0.0], [100.0, 0.0], [150.0, 50.0], [150.0, 150.0], [100.0, 200.0], [0.0, 200.0], [-50.0, 150.0], [-50.0, 50.0], [0.0, 0.0]]","[[100.0, 200.0], [0.0, 200.0], [-50.0, 150.0], [-50.0, 50.0], [0.0, 0.0], [100.0, 0.0], [150.0, 50.0], [150.0, 150.0], [100.0, 200.0]]",1 5 | "[[0.0, 0.0], [100.0, 50.0], [200.0, 0.0], [150.0, 100.0], [200.0, 250.0], [100.0, 200.0], [0.0, 250.0], [50.0, 150.0], [0.0, 0.0]]","[[200.0, 250.0], [100.0, 200.0], [0.0, 250.0], [50.0, 150.0], [0.0, 0.0], [100.0, 50.0], [200.0, 0.0], [150.0, 100.0], [200.0, 250.0]]",1 6 | "[[0.0, 0.0], [250.0, 0.0], [250.0, 250.0], [200.0, 250.0], [150.0, 150.0], [100.0, 100.0], [0.0, 50.0], [0.0, 0.0]]","[[250.0, 250.0], [0.0, 250.0], [0.0, 0.0], [50.0, 0.0], [100.0, 100.0], [150.0, 150.0], [250.0, 200.0], [250.0, 250.0]]",0 7 | "[[0.0, 0.0], [100.0, 150.0], [-100.0, 150.0], [0.0, 0.0]]","[[0.0, 150.0], [-100.0, 0.0], [100.0, 0.0], [0.0, 150.0]]",0 8 | "[[0.0, 0.0], [100.0, 0.0], [100.0, 100.0], [0.0, 100.0], [0.0, 0.0]]","[[100.0, 100.0], [0.0, 100.0], [0.0, 0.0], [100.0, 0.0], [100.0, 100.0]]",1 9 | -------------------------------------------------------------------------------- /data/convex.csv: -------------------------------------------------------------------------------- 1 | num,polygon 2 | 1,"[[1046.3065021785415, 796.9303395120693], [926.335575687742, 992.7050983124842], [873.606797749979, 1130.4226065180615], [659.2019000520907, 928.2013048376735], [369.5773934819386, 873.606797749979], [464.6830451114539, 657.2949016875158], [467.1572875253809, 467.15728752538104], [626.393202250021, 369.5773934819386], [985.1141009169892, 426.393202250021], [992.7050983124842, 573.664424312258]]" 3 | 1,"[[950.0, 750.0], [626.3932022500211, 1130.4226065180615], [507.2949016875158, 926.335575687742], [514.8858990830107, 426.3932022500211], [1073.6067977499788, 514.8858990830107]]" 4 | 1,"[[1050.0, 750.0], [950.0, 1096.4101615137754], [608.5786437626905, 891.4213562373095], [350.0, 750.0], [749.9999999999999, 350.0], [899.9999999999998, 490.1923788646683]]" 5 | 1,"[[930.1937735804838, 836.7767478235116], [836.7767478235116, 930.1937735804838], [576.4465043529767, 1110.3875471609676], [360.02883512727055, 839.0083735825258], [569.8062264195162, 663.2232521764884], [750.0, 550.0], [999.3959207434933, 437.26740701278806]]" 6 | 1,"[[923.2050807568878, 850.0], [801.7638090205041, 943.1851652578137], [600.0, 1009.8076211353316], [550.0, 750.0], [672.3542864692436, 460.2222521132796], [849.9999999999999, 576.7949192431122]]" 7 | -------------------------------------------------------------------------------- /data/dagli.csv: -------------------------------------------------------------------------------- 1 | no,num,polygon 2 | 1,3,"[[0.0, 8.0], [1.0, 7.0], [7.0, 5.0], [12.0, 0.0], [15.0, 3.0], [10.0, 8.0], [11.0, 9.0], [1.0, 9.0]]" 3 | 2,3,"[[2.0, 12.0], [0.0, 0.0], [4.0, 0.0], [4.0, 1.0], [5.0, 1.0], [5.0, 0.0], [9.0, 0.0], [9.0, 2.0], [5.0, 12.0], [2.0, 12.0]]" 4 | 3,3,"[[2.0, 24.0], [0.0, 18.0], [0.0, 6.0], [2.0, 0.0], [9.0, 0.0], [11.0, 6.0], [11.0, 18.0], [9.0, 24.0]]" 5 | 4,3,"[[0.0, 15.0], [0.0, 0.0], [14.0, 0.0], [14.0, 15.0]]" 6 | 5,3,"[[0.0, 0.0], [9.0, 0.0], [7.0, 5.0], [2.0, 5.0]]" 7 | 6,3,"[[0.0, 32.0], [1.0, 3.0], [3.0, 0.0], [6.0, 1.0], [11.0, 11.0], [5.0, 31.0], [2.0, 33.0]]" 8 | 7,3,"[[0.0, 3.0], [5.0, 0.0], [23.0, 0.0], [13.0, 5.0], [1.0, 5.0]]" 9 | 8,3,"[[1.0, 0.0], [4.0, 0.0], [5.0, 6.0], [4.0, 6.0], [4.0, 5.0], [3.0, 4.0], [2.0, 4.0], [1.0, 5.0], [1.0, 6.0], [0.0, 6.0]]" 10 | 9,3,"[[0.0, 2.0], [1.0, 0.0], [8.0, 0.0], [6.0, 3.0]]" 11 | 10,3,"[[0.0, 0.0], [14.0, 0.0], [5.0, 6.4]]" 12 | -------------------------------------------------------------------------------- /data/dagli_clus.csv: -------------------------------------------------------------------------------- 1 | desc,num,polygon 2 | "No 1",3,"[[0.0, 8.0], [1.0, 7.0], [7.0, 5.0], [12.0, 0.0], [15.0, 3.0], [10.0, 8.0], [11.0, 9.0], [1.0, 9.0]]" 3 | "No 2",3,"[[2.0, 12.0], [0.0, 0.0], [5.0, 0.0], [9.0, 0.0], [9.0, 2.0], [5.0, 12.0], [2.0, 12.0]]" 4 | "No 3",3,"[[2.0, 24.0], [0.0, 18.0], [0.0, 6.0], [2.0, 0.0], [9.0, 0.0], [11.0, 6.0], [11.0, 18.0], [9.0, 24.0]]" 5 | "No 4",3,"[[0.0, 15.0], [0.0, 0.0], [14.0, 0.0], [14.0, 15.0]]" 6 | "No 5",1,"[[0.0, 0.0], [9.0, 0.0], [7.0, 5.0], [2.0, 5.0]]" 7 | "No 5合并",1,"[[0.0, 0.0], [14.0, 0.0], [16.0, 5.0], [2.0, 5.0]]" 8 | "No 6",3,"[[0.0, 32.0], [1.0, 3.0], [3.0, 0.0], [6.0, 1.0], [11.0, 11.0], [5.0, 31.0], [2.0, 33.0]]" 9 | "No 7",1,"[[0.0, 3.0], [5.0, 0.0], [23.0, 0.0], [13.0, 5.0], [1.0, 5.0]]" 10 | "No 7 的合并结果",1,"[[0.0, 3.0], [5.0, 0.0], [35.0, 0.0], [36.0, 2.0], [31.0, 5.0], [1.0, 5.0]]" 11 | "No 8",3,"[[1.0, 0.0], [4.0, 0.0], [5.0, 6.0], [1.0, 6.0], [0.0, 6.0]]" 12 | "No 9",1,"[[0.0, 2.0], [1.0, 0.0], [8.0, 0.0], [6.0, 3.0]]" 13 | "No 9合并",1,"[[0.0, 5.0], [3.0, 0.0], [10.0, 0.0], [7.0, 5.0]]" 14 | "No 10",3,"[[0.0, 0.0], [14.0, 0.0], [5.0, 6.4]]" 15 | -------------------------------------------------------------------------------- /data/dagli_clus_orientation.csv: -------------------------------------------------------------------------------- 1 | o_0,o_1,ver_sym 2 | "[[0.0, 160.0], [20.0, 140.0], [140.0, 100.0], [240.0, 0.0], [300.0, 60.0], [200.0, 160.0], [220.0, 180.0], [20.0, 180.0], [0.0, 160.0]]","[[300.0, 20.0], [280.0, 40.0], [160.0, 80.0], [60.0, 180.0], [0.0, 120.0], [100.0, 20.0], [80.0, 0.0], [280.0, 0.0], [300.0, 20.0]]",0 3 | "[[40.0, 240.0], [0.0, 0.0], [100.0, 0.0], [180.0, 0.0], [180.0, 40.0], [100.0, 240.0], [40.0, 240.0]]","[[140.0, 0.0], [180.0, 240.0], [80.0, 240.0], [0.0, 240.0], [0.0, 200.0], [80.0, 0.0], [140.0, 0.0]]",0 4 | "[[40.0, 480.0], [0.0, 360.0], [0.0, 120.0], [40.0, 0.0], [180.0, 0.0], [220.0, 120.0], [220.0, 360.0], [180.0, 480.0], [40.0, 480.0]]","[[180.0, 0.0], [220.0, 120.0], [220.0, 360.0], [180.0, 480.0], [40.0, 480.0], [0.0, 360.0], [0.0, 120.0], [40.0, 0.0], [180.0, 0.0]]",1 5 | "[[0.0, 300.0], [0.0, 0.0], [280.0, 0.0], [280.0, 300.0], [0.0, 300.0]]","[[280.0, 0.0], [280.0, 300.0], [0.0, 300.0], [0.0, 0.0], [280.0, 0.0]]",1 6 | "[[0.0, 0.0], [180.0, 0.0], [140.0, 100.0], [40.0, 100.0], [0.0, 0.0]]","[[180.0, 100.0], [0.0, 100.0], [40.0, 0.0], [140.0, 0.0], [180.0, 100.0]]",0 7 | "[[0.0, 0.0], [280.0, 0.0], [320.0, 100.0], [40.0, 100.0], [0.0, 0.0]]","[[320.0, 100.0], [40.0, 100.0], [0.0, 0.0], [280.0, 0.0], [320.0, 100.0]]",1 8 | "[[0.0, 640.0], [20.0, 60.0], [60.0, 0.0], [120.0, 20.0], [220.0, 220.0], [100.0, 620.0], [40.0, 660.0], [0.0, 640.0]]","[[220.0, 20.0], [200.0, 600.0], [160.0, 660.0], [100.0, 640.0], [0.0, 440.0], [120.0, 40.0], [180.0, 0.0], [220.0, 20.0]]",0 9 | "[[0.0, 60.0], [100.0, 0.0], [460.0, 0.0], [260.0, 100.0], [20.0, 100.0], [0.0, 60.0]]","[[460.0, 40.0], [360.0, 100.0], [0.0, 100.0], [200.0, 0.0], [440.0, 0.0], [460.0, 40.0]]",0 10 | "[[0.0, 60.0], [100.0, 0.0], [700.0, 0.0], [720.0, 40.0], [620.0, 100.0], [20.0, 100.0], [0.0, 60.0]]","[[720.0, 40.0], [620.0, 100.0], [20.0, 100.0], [0.0, 60.0], [100.0, 0.0], [700.0, 0.0], [720.0, 40.0]]",1 11 | "[[20.0, 0.0], [80.0, 0.0], [100.0, 120.0], [20.0, 120.0], [0.0, 120.0], [20.0, 0.0]]","[[80.0, 120.0], [20.0, 120.0], [0.0, 0.0], [80.0, 0.0], [100.0, 0.0], [80.0, 120.0]]",0 12 | "[[0.0, 40.0], [20.0, 0.0], [160.0, 0.0], [120.0, 60.0], [0.0, 40.0]]","[[160.0, 20.0], [140.0, 60.0], [0.0, 60.0], [40.0, 0.0], [160.0, 20.0]]",0 13 | "[[0.0, 100.0], [60.0, 0.0], [200.0, 0.0], [140.0, 100.0], [0.0, 100.0]]","[[200.0, 0.0], [140.0, 100.0], [0.0, 100.0], [60.0, 0.0], [200.0, 0.0]]",1 14 | "[[0.0, 0.0], [280.0, 0.0], [100.0, 128.0], [0.0, 0.0]]","[[280.0, 128.0], [0.0, 128.0], [180.0, 0.0], [280.0, 128.0]]",0 15 | -------------------------------------------------------------------------------- /data/dagli_orientation.csv: -------------------------------------------------------------------------------- 1 | o_0,o_1,ver_sym 2 | "[[0.0, 160.0], [20.0, 140.0], [140.0, 100.0], [240.0, 0.0], [300.0, 60.0], [200.0, 160.0], [220.0, 180.0], [20.0, 180.0], [0.0, 160.0]]","[[300.0, 20.0], [280.0, 40.0], [160.0, 80.0], [60.0, 180.0], [0.0, 120.0], [100.0, 20.0], [80.0, 0.0], [280.0, 0.0], [300.0, 20.0]]",0 3 | "[[40.0, 240.0], [0.0, 0.0], [80.0, 0.0], [80.0, 20.0], [100.0, 20.0], [100.0, 0.0], [180.0, 0.0], [180.0, 40.0], [100.0, 240.0], [40.0, 240.0]]","[[140.0, 0.0], [180.0, 240.0], [100.0, 240.0], [100.0, 220.0], [80.0, 220.0], [80.0, 240.0], [0.0, 240.0], [0.0, 200.0], [80.0, 0.0], [140.0, 0.0]]",0 4 | "[[40.0, 480.0], [0.0, 360.0], [0.0, 120.0], [40.0, 0.0], [180.0, 0.0], [220.0, 120.0], [220.0, 360.0], [180.0, 480.0], [40.0, 480.0]]","[[180.0, 0.0], [220.0, 120.0], [220.0, 360.0], [180.0, 480.0], [40.0, 480.0], [0.0, 360.0], [0.0, 120.0], [40.0, 0.0], [180.0, 0.0]]",1 5 | "[[0.0, 300.0], [0.0, 0.0], [280.0, 0.0], [280.0, 300.0], [0.0, 300.0]]","[[280.0, 0.0], [280.0, 300.0], [0.0, 300.0], [0.0, 0.0], [280.0, 0.0]]",1 6 | "[[0.0, 0.0], [180.0, 0.0], [140.0, 100.0], [40.0, 100.0], [0.0, 0.0]]","[[180.0, 100.0], [0.0, 100.0], [40.0, 0.0], [140.0, 0.0], [180.0, 100.0]]",0 7 | "[[0.0, 640.0], [20.0, 60.0], [60.0, 0.0], [120.0, 20.0], [220.0, 220.0], [100.0, 620.0], [40.0, 660.0], [0.0, 640.0]]","[[220.0, 20.0], [200.0, 600.0], [160.0, 660.0], [100.0, 640.0], [0.0, 440.0], [120.0, 40.0], [180.0, 0.0], [220.0, 20.0]]",0 8 | "[[0.0, 60.0], [100.0, 0.0], [460.0, 0.0], [260.0, 100.0], [20.0, 100.0], [0.0, 60.0]]","[[460.0, 40.0], [360.0, 100.0], [0.0, 100.0], [200.0, 0.0], [440.0, 0.0], [460.0, 40.0]]",0 9 | "[[20.0, 0.0], [80.0, 0.0], [100.0, 120.0], [80.0, 120.0], [80.0, 100.0], [60.0, 80.0], [40.0, 80.0], [20.0, 100.0], [20.0, 120.0], [0.0, 120.0], [20.0, 0.0]]","[[80.0, 120.0], [20.0, 120.0], [0.0, 0.0], [20.0, 0.0], [20.0, 20.0], [40.0, 40.0], [60.0, 40.0], [80.0, 20.0], [80.0, 0.0], [100.0, 0.0], [80.0, 120.0]]",0 10 | "[[0.0, 40.0], [20.0, 0.0], [160.0, 0.0], [120.0, 60.0], [0.0, 40.0]]","[[160.0, 20.0], [140.0, 60.0], [0.0, 60.0], [40.0, 0.0], [160.0, 20.0]]",0 11 | "[[0.0, 0.0], [280.0, 0.0], [100.0, 128.0], [0.0, 0.0]]","[[280.0, 128.0], [0.0, 128.0], [180.0, 0.0], [280.0, 128.0]]",0 12 | -------------------------------------------------------------------------------- /data/dighe.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seanys/2D-Irregular-Packing-Algorithm/a2b9494be9b811e56dce5058fe29ff2a134e8403/data/dighe.pdf -------------------------------------------------------------------------------- /data/dighe1.csv: -------------------------------------------------------------------------------- 1 | num,polygon 2 | 1,"[[0.0, 0.0], [35.0, 0.0], [0.0, 34.0]]" 3 | 1,"[[0.0, 0.0], [33.0, 0.0], [18.0, 15.0]]" 4 | 1,"[[0.0, 0.0], [32.0, 0.0], [32.0, 41.0], [14.0, 33.0]]" 5 | 1,"[[35.0, 0.0], [53.0, 15.0], [51.0, 38.0], [48.0, 62.0], [39.0, 57.0], [0.0, 34.0]]" 6 | 1,"[[2.0, 15.0], [17.0, 0.0], [31.0, 33.0], [25.0, 34.0], [0.0, 38.0]]" 7 | 1,"[[0.0, 0.0], [39.0, 23.0], [20.0, 26.0], [0.0, 66.0]]" 8 | 1,"[[3.0, 4.0], [28.0, 0.0], [30.0, 18.0], [32.0, 39.0], [25.0, 37.0], [0.0, 28.0]]" 9 | 1,"[[0.0, 1.0], [6.0, 0.0], [24.0, 8.0], [2.0, 19.0]]" 10 | 1,"[[0.0, 11.0], [22.0, 0.0], [2.0, 32.0]]" 11 | 1,"[[0.0, 32.0], [20.0, 0.0], [20.0, 37.0]]" 12 | 1,"[[1.0, 0.0], [26.0, 9.0], [0.0, 15.0]]" 13 | 1,"[[0.0, 3.0], [19.0, 0.0], [28.0, 5.0], [27.0, 20.0], [24.0, 43.0]]" 14 | 1,"[[20.0, 0.0], [44.0, 40.0], [0.0, 40.0]]" 15 | 1,"[[3.0, 6.0], [29.0, 0.0], [36.0, 2.0], [0.0, 29.0]]" 16 | 1,"[[0.0, 27.0], [36.0, 0.0], [56.0, 27.0]]" 17 | 1,"[[0.0, 0.0], [20.0, 5.0], [20.0, 27.0]]" 18 | -------------------------------------------------------------------------------- /data/dighe1_orientation.csv: -------------------------------------------------------------------------------- 1 | o_0 2 | "[[0.0, 0.0], [350.0, 0.0], [0.0, 340.0], [0.0, 0.0]]" 3 | "[[0.0, 0.0], [330.0, 0.0], [180.0, 150.0], [0.0, 0.0]]" 4 | "[[0.0, 0.0], [320.0, 0.0], [320.0, 410.0], [140.0, 330.0], [0.0, 0.0]]" 5 | "[[350.0, 0.0], [530.0, 150.0], [510.0, 380.0], [480.0, 620.0], [390.0, 570.0], [0.0, 340.0], [350.0, 0.0]]" 6 | "[[20.0, 150.0], [170.0, 0.0], [310.0, 330.0], [250.0, 340.0], [0.0, 380.0], [20.0, 150.0]]" 7 | "[[0.0, 0.0], [390.0, 230.0], [200.0, 260.0], [0.0, 660.0], [0.0, 0.0]]" 8 | "[[30.0, 40.0], [280.0, 0.0], [300.0, 180.0], [320.0, 390.0], [250.0, 370.0], [0.0, 280.0], [30.0, 40.0]]" 9 | "[[0.0, 10.0], [60.0, 0.0], [240.0, 80.0], [20.0, 190.0], [0.0, 10.0]]" 10 | "[[0.0, 110.0], [220.0, 0.0], [20.0, 320.0], [0.0, 110.0]]" 11 | "[[0.0, 320.0], [200.0, 0.0], [200.0, 370.0], [0.0, 320.0]]" 12 | "[[10.0, 0.0], [260.0, 90.0], [0.0, 150.0], [10.0, 0.0]]" 13 | "[[0.0, 30.0], [190.0, 0.0], [280.0, 50.0], [270.0, 200.0], [240.0, 430.0], [0.0, 30.0]]" 14 | "[[200.0, 0.0], [440.0, 400.0], [0.0, 400.0], [200.0, 0.0]]" 15 | "[[30.0, 60.0], [290.0, 0.0], [360.0, 20.0], [0.0, 290.0], [30.0, 60.0]]" 16 | "[[0.0, 270.0], [360.0, 0.0], [560.0, 270.0], [0.0, 270.0]]" 17 | "[[0.0, 0.0], [200.0, 50.0], [200.0, 270.0], [0.0, 0.0]]" -------------------------------------------------------------------------------- /data/dighe2.csv: -------------------------------------------------------------------------------- 1 | num,polygon 2 | 1,"[[0.0, 0.0], [33.0, 0.0], [33.0, 19.0], [3.0, 11.0]]" 3 | 1,"[[0.0, 0.0], [42.0, 0.0], [37.0, 30.0], [0.0, 19.0]]" 4 | 1,"[[5.0, 0.0], [30.0, 0.0], [30.0, 51.0], [0.0, 30.0]]" 5 | 1,"[[0.0, 0.0], [3.0, 11.0], [7.0, 33.0], [8.0, 38.0], [0.0, 36.0]]" 6 | 1,"[[0.0, 0.0], [30.0, 8.0], [67.0, 19.0], [56.0, 29.0], [4.0, 22.0]]" 7 | 1,"[[23.0, 0.0], [53.0, 21.0], [53.0, 70.0], [19.0, 70.0], [7.0, 42.0], [0.0, 23.0], [12.0, 10.0]]" 8 | 1,"[[0.0, 0.0], [52.0, 7.0], [40.0, 20.0], [47.0, 39.0], [3.0, 30.0], [1.0, 5.0]]" 9 | 1,"[[0.0, 0.0], [8.0, 2.0], [10.0, 27.0], [12.0, 64.0], [0.0, 64.0]]" 10 | 1,"[[0.0, 0.0], [44.0, 9.0], [16.0, 37.0], [2.0, 37.0]]" 11 | 1,"[[0.0, 28.0], [28.0, 0.0], [40.0, 28.0]]" 12 | -------------------------------------------------------------------------------- /data/dighe2_orientation.csv: -------------------------------------------------------------------------------- 1 | o_0 2 | "[[0.0, 0.0], [330.0, 0.0], [330.0, 190.0], [30.0, 110.0], [0.0, 0.0]]" 3 | "[[0.0, 0.0], [420.0, 0.0], [370.0, 300.0], [0.0, 190.0], [0.0, 0.0]]" 4 | "[[50.0, 0.0], [300.0, 0.0], [300.0, 510.0], [0.0, 300.0], [50.0, 0.0]]" 5 | "[[0.0, 0.0], [30.0, 110.0], [70.0, 330.0], [80.0, 380.0], [0.0, 360.0], [0.0, 0.0]]" 6 | "[[0.0, 0.0], [300.0, 80.0], [670.0, 190.0], [560.0, 290.0], [40.0, 220.0], [0.0, 0.0]]" 7 | "[[230.0, 0.0], [530.0, 210.0], [530.0, 700.0], [190.0, 700.0], [70.0, 420.0], [0.0, 230.0], [120.0, 100.0], [230.0, 0.0]]" 8 | "[[0.0, 0.0], [520.0, 70.0], [400.0, 200.0], [470.0, 390.0], [30.0, 300.0], [10.0, 50.0], [0.0, 0.0]]" 9 | "[[0.0, 0.0], [80.0, 20.0], [100.0, 270.0], [120.0, 640.0], [0.0, 640.0], [0.0, 0.0]]" 10 | "[[0.0, 0.0], [440.0, 90.0], [160.0, 370.0], [20.0, 370.0], [0.0, 0.0]]" 11 | "[[0.0, 280.0], [280.0, 0.0], [400.0, 280.0], [0.0, 280.0]]" 12 | -------------------------------------------------------------------------------- /data/fu.csv: -------------------------------------------------------------------------------- 1 | num,polygon 2 | 1,"[[0.0, 0.0], [10.0, 0.0], [10.0, 10.0], [0.0, 10.0]]" 3 | 1,"[[0.0, 0.0], [10.0, 0.0], [10.0, 10.0], [0.0, 10.0]]" 4 | 1,"[[0.0, 0.0], [14.0, 0.0], [14.0, 9.0], [0.0, 9.0]]" 5 | 1,"[[0.0, 0.0], [14.0, 0.0], [7.0, 7.0]]" 6 | 1,"[[0.0, 9.0], [0.0, 0.0], [14.0, 9.0]]" 7 | 1,"[[0.0, 0.0], [14.0, 0.0], [14.0, 14.0], [0.0, 14.0]]" 8 | 1,"[[0.0, 0.0], [10.0, 4.0], [10.0, 9.0], [0.0, 9.0]]" 9 | 1,"[[0.0, 0.0], [5.0, 0.0], [5.0, 9.0], [0.0, 9.0]]" 10 | 1,"[[0.0, 0.0], [14.0, 0.0], [14.0, 14.0]]" 11 | 1,"[[0.0, 0.0], [10.0, 0.0], [10.0, 10.0], [0.0, 14.0]]" 12 | 1,"[[0.0, 8.0], [4.0, 0.0], [8.0, 8.0]]" 13 | 1,"[[0.0, 0.0], [14.0, 0.0], [7.0, 12.0]]" 14 | -------------------------------------------------------------------------------- /data/fu.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seanys/2D-Irregular-Packing-Algorithm/a2b9494be9b811e56dce5058fe29ff2a134e8403/data/fu.pdf -------------------------------------------------------------------------------- /data/fu_orientation.csv: -------------------------------------------------------------------------------- 1 | o_0,o_1,o_2,o_3,ver_sym,hori_sym 2 | "[[0.0, 0.0], [200.0, 0.0], [200.0, 200.0], [0.0, 200.0], [0.0, 0.0]]","[[200.0, 0.0], [200.0, 200.0], [0.0, 200.0], [0.0, 0.0], [200.0, 0.0]]","[[200.0, 200.0], [0.0, 200.0], [0.0, 0.0], [200.0, 0.0], [200.0, 200.0]]","[[0.0, 200.0], [0.0, 0.0], [200.0, 0.0], [200.0, 200.0], [0.0, 200.0]]",1,1 3 | "[[0.0, 0.0], [200.0, 0.0], [200.0, 200.0], [0.0, 200.0], [0.0, 0.0]]","[[200.0, 0.0], [200.0, 200.0], [0.0, 200.0], [0.0, 0.0], [200.0, 0.0]]","[[200.0, 200.0], [0.0, 200.0], [0.0, 0.0], [200.0, 0.0], [200.0, 200.0]]","[[0.0, 200.0], [0.0, 0.0], [200.0, 0.0], [200.0, 200.0], [0.0, 200.0]]",1,1 4 | "[[0.0, 0.0], [280.0, 0.0], [280.0, 180.0], [0.0, 180.0], [0.0, 0.0]]","[[230.0, -50.0], [230.0, 230.0], [50.0, 230.0], [50.0, -50.0], [230.0, -50.0]]","[[280.0, 180.0], [0.0, 180.0], [0.0, 0.0], [280.0, 0.0], [280.0, 180.0]]","[[50.0, 230.0], [50.0, -50.0], [230.0, -50.0], [230.0, 230.0], [50.0, 230.0]]",1,1 5 | "[[0.0, 0.0], [280.0, 0.0], [140.0, 140.0], [0.0, 0.0]]","[[210.0, -70.0], [210.0, 210.0], [70.0, 70.0], [210.0, -70.0]]","[[280.0, 140.0], [0.0, 140.0], [140.0, 0.0], [280.0, 140.0]]","[[70.0, 210.0], [70.0, -70.0], [210.0, 70.0], [70.0, 210.0]]",0,0 6 | "[[0.0, 180.0], [0.0, 0.0], [280.0, 180.0], [0.0, 180.0]]","[[50.0, -50.0], [230.0, -50.0], [50.0, 230.0], [50.0, -50.0]]","[[280.0, 0.0], [280.0, 180.0], [0.0, 0.0], [280.0, 0.0]]","[[230.0, 230.0], [50.0, 230.0], [230.0, -50.0], [230.0, 230.0]]",0,0 7 | "[[0.0, 0.0], [280.0, 0.0], [280.0, 280.0], [0.0, 280.0], [0.0, 0.0]]","[[280.0, 0.0], [280.0, 280.0], [0.0, 280.0], [0.0, 0.0], [280.0, 0.0]]","[[280.0, 280.0], [0.0, 280.0], [0.0, 0.0], [280.0, 0.0], [280.0, 280.0]]","[[0.0, 280.0], [0.0, 0.0], [280.0, 0.0], [280.0, 280.0], [0.0, 280.0]]",1,1 8 | "[[0.0, 0.0], [200.0, 80.0], [200.0, 180.0], [0.0, 180.0], [0.0, 0.0]]","[[190.0, -10.0], [110.0, 190.0], [10.0, 190.0], [10.0, -10.0], [190.0, -10.0]]","[[200.0, 180.0], [0.0, 100.0], [0.0, 0.0], [200.0, 0.0], [200.0, 180.0]]","[[10.0, 190.0], [90.0, -10.0], [190.0, -10.0], [190.0, 190.0], [10.0, 190.0]]",0,0 9 | "[[0.0, 0.0], [100.0, 0.0], [100.0, 180.0], [0.0, 180.0], [0.0, 0.0]]","[[140.0, 40.0], [140.0, 140.0], [-40.0, 140.0], [-40.0, 40.0], [140.0, 40.0]]","[[100.0, 180.0], [0.0, 180.0], [0.0, 0.0], [100.0, 0.0], [100.0, 180.0]]","[[-40.0, 140.0], [-40.0, 40.0], [140.0, 40.0], [140.0, 140.0], [-40.0, 140.0]]",1,1 10 | "[[0.0, 0.0], [280.0, 0.0], [280.0, 280.0], [0.0, 0.0]]","[[280.0, 0.0], [280.0, 280.0], [0.0, 280.0], [280.0, 0.0]]","[[280.0, 280.0], [0.0, 280.0], [0.0, 0.0], [280.0, 280.0]]","[[0.0, 280.0], [0.0, 0.0], [280.0, 0.0], [0.0, 280.0]]",0,0 11 | "[[0.0, 0.0], [200.0, 0.0], [200.0, 200.0], [0.0, 280.0], [0.0, 0.0]]","[[240.0, 40.0], [240.0, 240.0], [40.0, 240.0], [-40.0, 40.0], [240.0, 40.0]]","[[200.0, 280.0], [0.0, 280.0], [0.0, 80.0], [200.0, 0.0], [200.0, 280.0]]","[[-40.0, 240.0], [-40.0, 40.0], [160.0, 40.0], [240.0, 240.0], [-40.0, 240.0]]",0,0 12 | "[[0.0, 160.0], [80.0, 0.0], [160.0, 160.0], [0.0, 160.0]]","[[0.0, 0.0], [160.0, 80.0], [0.0, 160.0], [0.0, 0.0]]","[[160.0, 0.0], [80.0, 160.0], [0.0, 0.0], [160.0, 0.0]]","[[160.0, 160.0], [0.0, 80.0], [160.0, 0.0], [160.0, 160.0]]",0,0 13 | "[[0.0, 0.0], [280.0, 0.0], [140.0, 240.0], [0.0, 0.0]]","[[260.0, -20.0], [260.0, 260.0], [20.0, 120.0], [260.0, -20.0]]","[[280.0, 240.0], [0.0, 240.0], [140.0, 0.0], [280.0, 240.0]]","[[20.0, 260.0], [20.0, -20.0], [260.0, 120.0], [20.0, 260.0]]",0,0 14 | -------------------------------------------------------------------------------- /data/ga.csv: -------------------------------------------------------------------------------- 1 | num,rotation,polygon 2 | 2,"[0,180]","[[0.0, 0.0], [2.0, -1.0], [4.0, 0.0], [4.0, 3.0], [2.0, 4.0], [0.0, 3.0]]" 3 | 2,"[0,180]","[[0.0, 0.0], [3.0, 0.0], [2.0, 2.0], [3.0, 4.0], [3.0, 5.0], [1.0, 5.0], [-1.0, 3.0], [-1.0, 1.0]]" 4 | 2,"[0,180]","[[0.0, 0.0], [2.0, 0.0], [3.0, 1.0], [3.0, 3.0], [2.0, 4.0], [0.0, 4.0], [-1.0, 3.0], [-1.0, 1.0]]" 5 | 2,"[0,180]","[[0.0, 0.0], [2.0, 1.0], [4.0, 0.0], [3.0, 2.0], [4.0, 5.0], [2.0, 4.0], [0.0, 5.0], [1.0, 3.0]]" 6 | 2,"[0,180]","[[0.0, 0.0], [5.0, 0.0], [5.0, 5.0], [4.0, 5.0], [3.0, 3.0], [2.0, 2.0], [0.0, 1.0]]" 7 | -------------------------------------------------------------------------------- /data/han.csv: -------------------------------------------------------------------------------- 1 | num,polygon 2 | 1,"[[0.0, 0.0], [5.0, 0.0], [5.0, 13.0], [0.0, 13.0]]" 3 | 1,"[[9.0, 0.0], [13.0, 1.0], [17.0, 5.0], [18.0, 9.0], [17.0, 13.0], [13.0, 17.0], [9.0, 18.0], [5.0, 17.0], [1.0, 13.0], [0.0, 9.0], [1.0, 5.0], [5.0, 1.0]]" 4 | 1,"[[2.0, 0.0], [6.0, 0.0], [8.0, 2.0], [8.0, 9.0], [6.0, 11.0], [2.0, 11.0], [0.0, 9.0], [0.0, 2.0]]" 5 | 1,"[[0.0, 0.0], [5.0, 0.0], [5.0, 6.0], [0.0, 6.0]]" 6 | 1,"[[5.0, 0.0], [7.0, 0.0], [4.0, 3.0], [2.0, 6.0], [2.0, 9.0], [4.0, 12.0], [7.0, 15.0], [5.0, 15.0], [2.0, 12.0], [0.0, 9.0], [0.0, 6.0], [2.0, 3.0]]" 7 | 1,"[[0.0, 0.0], [8.0, 0.0], [8.0, 17.0], [0.0, 17.0]]" 8 | 3,"[[0.0, 0.0], [5.0, 0.0], [6.0, 2.0], [6.0, 3.0], [3.0, 3.0], [3.0, 6.0], [8.0, 6.0], [8.0, 11.0], [0.0, 11.0]]" 9 | 1,"[[0.0, 0.0], [1.0, 0.0], [3.0, 5.0], [3.0, 8.0], [1.0, 13.0], [0.0, 13.0], [0.0, 9.0], [2.0, 9.0], [2.0, 4.0], [0.0, 4.0]]" 10 | 1,"[[0.0, 0.0], [11.0, 0.0], [0.0, 10.0]]" 11 | 1,"[[6.0, 0.0], [6.0, 2.0], [11.0, 2.0], [11.0, 0.0], [23.0, 0.0], [20.0, 3.0], [20.0, 5.0], [8.0, 10.0], [8.0, 15.0], [5.0, 15.0], [0.0, 7.0]]" 12 | 1,"[[0.0, 0.0], [6.0, 0.0], [6.0, 16.0], [2.0, 16.0], [2.0, 7.0], [0.0, 5.0]]" 13 | 1,"[[6.0, 2.0], [11.0, 0.0], [15.0, 5.0], [12.0, 10.0], [12.0, 13.0], [0.0, 13.0], [0.0, 11.0], [2.0, 10.0], [3.0, 10.0]]" 14 | 1,"[[0.0, 8.0], [0.0, 2.0], [3.0, 0.0], [5.0, 3.0], [8.0, 6.0], [11.0, 6.0], [11.0, 8.0]]" 15 | 1,"[[0.0, 5.0], [4.0, 0.0], [6.0, 0.0], [2.0, 5.0], [6.0, 10.0], [4.0, 10.0]]" 16 | 1,"[[11.0, 0.0], [17.0, 0.0], [17.0, 5.0], [15.0, 5.0], [15.0, 8.0], [17.0, 8.0], [17.0, 10.0], [14.0, 10.0], [3.0, 15.0], [0.0, 12.0], [2.0, 11.0], [3.0, 8.0], [6.0, 8.0]]" 17 | 2,"[[0.0, 8.0], [0.0, 0.0], [5.0, 0.0], [12.0, 7.0], [12.0, 8.0]]" 18 | 1,"[[0.0, 13.0], [0.0, 0.0], [10.0, 0.0], [10.0, 13.0]]" 19 | 1,"[[0.0, 5.0], [0.0, 0.0], [7.0, 0.0], [7.0, 5.0]]" 20 | -------------------------------------------------------------------------------- /data/han.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seanys/2D-Irregular-Packing-Algorithm/a2b9494be9b811e56dce5058fe29ff2a134e8403/data/han.pdf -------------------------------------------------------------------------------- /data/jakobs.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seanys/2D-Irregular-Packing-Algorithm/a2b9494be9b811e56dce5058fe29ff2a134e8403/data/jakobs.pdf -------------------------------------------------------------------------------- /data/jakobs1.csv: -------------------------------------------------------------------------------- 1 | num,polygon 2 | 1,"[[5.0, 0.0], [5.0, 3.0], [3.0, 3.0], [3.0, 5.0], [0.0, 5.0]]" 3 | 1,"[[4.0, 0.0], [4.0, 1.0], [2.0, 1.0], [2.0, 4.0], [0.0, 4.0]]" 4 | 1,"[[6.0, 0.0], [6.0, 3.0], [4.0, 3.0], [4.0, 6.0], [0.0, 6.0]]" 5 | 1,"[[5.0, 0.0], [5.0, 2.0], [3.0, 2.0], [3.0, 1.0], [0.0, 1.0]]" 6 | 1,"[[4.0, 0.0], [4.0, 2.0], [3.0, 2.0], [3.0, 1.0], [0.0, 1.0]]" 7 | 1,"[[6.0, 0.0], [6.0, 3.0], [4.0, 3.0], [4.0, 6.0], [0.0, 6.0]]" 8 | 1,"[[6.0, 0.0], [6.0, 6.0], [0.0, 6.0]]" 9 | 1,"[[5.0, 0.0], [5.0, 5.0], [0.0, 5.0]]" 10 | 1,"[[4.0, 0.0], [4.0, 4.0], [0.0, 4.0]]" 11 | 1,"[[4.0, 0.0], [4.0, 2.0], [6.0, 2.0], [6.0, 4.0], [4.0, 4.0], [4.0, 6.0], [2.0, 6.0], [2.0, 4.0], [0.0, 4.0], [0.0, 2.0], [2.0, 2.0]]" 12 | 1,"[[2.0, 0.0], [2.0, 1.0], [3.0, 1.0], [3.0, 2.0], [2.0, 2.0], [2.0, 3.0], [1.0, 3.0], [1.0, 2.0], [0.0, 2.0], [0.0, 1.0], [1.0, 1.0]]" 13 | 1,"[[4.0, 0.0], [4.0, 2.0], [6.0, 2.0], [6.0, 4.0], [4.0, 4.0], [4.0, 6.0], [2.0, 6.0], [2.0, 4.0], [0.0, 4.0], [0.0, 2.0], [2.0, 2.0]]" 14 | 1,"[[2.0, 0.0], [2.0, 1.0], [3.0, 1.0], [3.0, 2.0], [2.0, 2.0], [2.0, 3.0], [1.0, 3.0], [1.0, 2.0], [0.0, 2.0], [0.0, 1.0], [1.0, 1.0]]" 15 | 1,"[[6.0, 0.0], [6.0, 3.0], [0.0, 3.0]]" 16 | 1,"[[1.0, 0.0], [1.0, 4.0], [0.0, 4.0]]" 17 | 1,"[[5.0, 0.0], [5.0, 2.0], [0.0, 2.0]]" 18 | 1,"[[4.0, 0.0], [6.0, 2.0], [6.0, 4.0], [4.0, 6.0], [2.0, 6.0], [0.0, 4.0], [0.0, 2.0]]" 19 | 1,"[[6.0, 0.0], [8.0, 2.0], [8.0, 4.0], [6.0, 6.0], [3.0, 6.0], [0.0, 4.0], [0.0, 2.0]]" 20 | 1,"[[2.0, 0.0], [4.0, 0.0], [6.0, 1.0], [6.0, 2.0], [4.0, 3.0], [2.0, 3.0], [0.0, 2.0]]" 21 | -------------------------------------------------------------------------------- /data/jakobs1_clus.csv: -------------------------------------------------------------------------------- 1 | index,num,polygon 2 | 1,1,"[[0.0, 0.0], [2.0, 0.0], [0.0, 2.0]]" 3 | 2,1,"[[0.0, 0.0], [3.0, 0.0], [0.0, 3.0]]" 4 | 3,1,"[[0.0, 0.0], [4.0, 0.0], [0.0, 4.0]]" 5 | 4,1,"[[5.0, 0.0], [5.0, 5.0], [0.0, 5.0]]" 6 | 5,1,"[[0.0, 3.0], [6.0, 0.0], [6.0, 3.0]]" 7 | 6,1,"[[0.0, 4.0], [7.0, 0.0], [7.0, 4.0]]" 8 | 7,1,"[[0.0, 0.0], [5.0, 0.0], [5.0, 3.0], [3.0, 3.0], [3.0, 5.0], [0.0, 5.0]]" 9 | 8,1,"[[0.0, 0.0], [4.0, 0.0], [4.0, 1.0], [2.0, 1.0], [2.0, 4.0], [0.0, 4.0]]" 10 | 9,1,"[[0.0, 0.0], [10.0, 0.0], [10.0, 10.0], [0.0, 10.0]]" 11 | 10,1,"[[0.0, 0.0], [5.0, 0.0], [5.0, 2.0], [3.0, 2.0], [3.0, 1.0], [0.0, 1.0]]" 12 | 11,1,"[[0.0, 0.0], [4.0, 0.0], [4.0, 2.0], [3.0, 2.0], [3.0, 1.0], [0.0, 1.0]]" 13 | 13,1,"[[0.0, 0.0], [6.0, 0.0], [6.0, 4.0], [8.0, 4.0], [8.0, 6.0], [10.0, 6.0], [10.0, 8.0], [8.0, 8.0], [8.0, 10.0], [6.0, 10.0], [6.0, 8.0], [4.0, 8.0], [4.0, 6.0], [0.0, 6.0]]" 14 | 14,1,"[[0.0, 0.0], [5.0, 0.0], [5.0, 5.0], [0.0, 5.0]]" 15 | 15,1,"[[0.0, 0.0], [4.0, 0.0], [4.0, 4.0], [0.0, 4.0]]" 16 | 17,1,"[[1.0, 0.0], [2.0, 0.0], [2.0, 1.0], [3.0, 1.0], [3.0, 2.0], [2.0, 2.0], [2.0, 3.0], [1.0, 3.0], [1.0, 2.0], [0.0, 2.0], [0.0, 1.0], [1.0, 1.0]]" 17 | 18,1,"[[2.0, 0.0], [4.0, 0.0], [4.0, 2.0], [6.0, 2.0], [6.0, 4.0], [4.0, 4.0], [4.0, 6.0], [2.0, 6.0], [2.0, 4.0], [0.0, 4.0], [0.0, 2.0], [2.0, 2.0]]" 18 | 19,1,"[[1.0, 0.0], [2.0, 0.0], [2.0, 1.0], [3.0, 1.0], [3.0, 2.0], [2.0, 2.0], [2.0, 3.0], [1.0, 3.0], [1.0, 2.0], [0.0, 2.0], [0.0, 1.0], [1.0, 1.0]]" 19 | 20,1,"[[0.0, 0.0], [6.0, 0.0], [6.0, 3.0], [0.0, 3.0]]" 20 | 21,1,"[[0.0, 0.0], [1.0, 0.0], [1.0, 4.0], [0.0, 4.0]]" 21 | 22,1,"[[0.0, 0.0], [5.0, 0.0], [5.0, 2.0], [0.0, 2.0]]" 22 | 23,1,"[[2.0, 0.0], [4.0, 0.0], [6.0, 2.0], [6.0, 4.0], [4.0, 6.0], [2.0, 6.0], [0.0, 4.0], [0.0, 2.0]]" 23 | 24,1,"[[3.0, 0.0], [6.0, 0.0], [8.0, 2.0], [8.0, 4.0], [6.0, 6.0], [3.0, 6.0], [0.0, 4.0], [0.0, 2.0]]" 24 | 25,1,"[[0.0, 1.0], [2.0, 0.0], [4.0, 0.0], [6.0, 1.0], [6.0, 2.0], [4.0, 3.0], [2.0, 3.0], [0.0, 2.0]]" 25 | -------------------------------------------------------------------------------- /data/jakobs1_clus_orientation.csv: -------------------------------------------------------------------------------- 1 | o_0,o_1,o_2,o_3,ver_sym,hori_sym 2 | "[[0.0, 0.0], [40.0, 0.0], [0.0, 40.0], [0.0, 0.0]]","[[40.0, 0.0], [40.0, 40.0], [0.0, 0.0], [40.0, 0.0]]","[[40.0, 40.0], [0.0, 40.0], [40.0, 0.0], [40.0, 40.0]]","[[0.0, 40.0], [0.0, 0.0], [40.0, 40.0], [0.0, 40.0]]",0,0 3 | "[[0.0, 0.0], [60.0, 0.0], [0.0, 60.0], [0.0, 0.0]]","[[60.0, 0.0], [60.0, 60.0], [0.0, 0.0], [60.0, 0.0]]","[[60.0, 60.0], [0.0, 60.0], [60.0, 0.0], [60.0, 60.0]]","[[0.0, 60.0], [0.0, 0.0], [60.0, 60.0], [0.0, 60.0]]",0,0 4 | "[[0.0, 0.0], [80.0, 0.0], [0.0, 80.0], [0.0, 0.0]]","[[80.0, 0.0], [80.0, 80.0], [0.0, 0.0], [80.0, 0.0]]","[[80.0, 80.0], [0.0, 80.0], [80.0, 0.0], [80.0, 80.0]]","[[0.0, 80.0], [0.0, 0.0], [80.0, 80.0], [0.0, 80.0]]",0,0 5 | "[[100.0, 0.0], [100.0, 100.0], [0.0, 100.0], [100.0, 0.0]]","[[100.0, 100.0], [0.0, 100.0], [0.0, 0.0], [100.0, 100.0]]","[[0.0, 100.0], [0.0, 0.0], [100.0, 0.0], [0.0, 100.0]]","[[0.0, 0.0], [100.0, 0.0], [100.0, 100.0], [0.0, 0.0]]",0,0 6 | "[[0.0, 60.0], [120.0, 0.0], [120.0, 60.0], [0.0, 60.0]]","[[30.0, -30.0], [90.0, 90.0], [30.0, 90.0], [30.0, -30.0]]","[[120.0, 0.0], [0.0, 60.0], [0.0, 0.0], [120.0, 0.0]]","[[90.0, 90.0], [30.0, -30.0], [90.0, -30.0], [90.0, 90.0]]",0,0 7 | "[[0.0, 80.0], [140.0, 0.0], [140.0, 80.0], [0.0, 80.0]]","[[30.0, -30.0], [110.0, 110.0], [30.0, 110.0], [30.0, -30.0]]","[[140.0, 0.0], [0.0, 80.0], [0.0, 0.0], [140.0, 0.0]]","[[110.0, 110.0], [30.0, -30.0], [110.0, -30.0], [110.0, 110.0]]",0,0 8 | "[[0.0, 0.0], [100.0, 0.0], [100.0, 60.0], [60.0, 60.0], [60.0, 100.0], [0.0, 100.0], [0.0, 0.0]]","[[100.0, 0.0], [100.0, 100.0], [40.0, 100.0], [40.0, 60.0], [0.0, 60.0], [0.0, 0.0], [100.0, 0.0]]","[[100.0, 100.0], [0.0, 100.0], [0.0, 40.0], [40.0, 40.0], [40.0, 0.0], [100.0, 0.0], [100.0, 100.0]]","[[0.0, 100.0], [0.0, 0.0], [60.0, 0.0], [60.0, 40.0], [100.0, 40.0], [100.0, 100.0], [0.0, 100.0]]",0,0 9 | "[[0.0, 0.0], [80.0, 0.0], [80.0, 20.0], [40.0, 20.0], [40.0, 80.0], [0.0, 80.0], [0.0, 0.0]]","[[80.0, 0.0], [80.0, 80.0], [60.0, 80.0], [60.0, 40.0], [0.0, 40.0], [0.0, 0.0], [80.0, 0.0]]","[[80.0, 80.0], [0.0, 80.0], [0.0, 60.0], [40.0, 60.0], [40.0, 0.0], [80.0, 0.0], [80.0, 80.0]]","[[0.0, 80.0], [0.0, 0.0], [20.0, 0.0], [20.0, 40.0], [80.0, 40.0], [80.0, 80.0], [0.0, 80.0]]",0,0 10 | "[[0.0, 0.0], [200.0, 0.0], [200.0, 200.0], [0.0, 200.0], [0.0, 0.0]]","[[200.0, 0.0], [200.0, 200.0], [0.0, 200.0], [0.0, 0.0], [200.0, 0.0]]","[[200.0, 200.0], [0.0, 200.0], [0.0, 0.0], [200.0, 0.0], [200.0, 200.0]]","[[0.0, 200.0], [0.0, 0.0], [200.0, 0.0], [200.0, 200.0], [0.0, 200.0]]",1,1 11 | "[[0.0, 0.0], [100.0, 0.0], [100.0, 40.0], [60.0, 40.0], [60.0, 20.0], [0.0, 20.0], [0.0, 0.0]]","[[70.0, -30.0], [70.0, 70.0], [30.0, 70.0], [30.0, 30.0], [50.0, 30.0], [50.0, -30.0], [70.0, -30.0]]","[[100.0, 40.0], [0.0, 40.0], [0.0, 0.0], [40.0, 0.0], [40.0, 20.0], [100.0, 20.0], [100.0, 40.0]]","[[30.0, 70.0], [30.0, -30.0], [70.0, -30.0], [70.0, 10.0], [50.0, 10.0], [50.0, 70.0], [30.0, 70.0]]",0,0 12 | "[[0.0, 0.0], [80.0, 0.0], [80.0, 40.0], [60.0, 40.0], [60.0, 20.0], [0.0, 20.0], [0.0, 0.0]]","[[60.0, -20.0], [60.0, 60.0], [20.0, 60.0], [20.0, 40.0], [40.0, 40.0], [40.0, -20.0], [60.0, -20.0]]","[[80.0, 40.0], [0.0, 40.0], [0.0, 0.0], [20.0, 0.0], [20.0, 20.0], [80.0, 20.0], [80.0, 40.0]]","[[20.0, 60.0], [20.0, -20.0], [60.0, -20.0], [60.0, 0.0], [40.0, 0.0], [40.0, 60.0], [20.0, 60.0]]",0,0 13 | "[[0.0, 0.0], [120.0, 0.0], [120.0, 80.0], [160.0, 80.0], [160.0, 120.0], [200.0, 120.0], [200.0, 160.0], [160.0, 160.0], [160.0, 200.0], [120.0, 200.0], [120.0, 160.0], [80.0, 160.0], [80.0, 120.0], [0.0, 120.0], [0.0, 0.0]]","[[200.0, 0.0], [200.0, 120.0], [120.0, 120.0], [120.0, 160.0], [80.0, 160.0], [80.0, 200.0], [40.0, 200.0], [40.0, 160.0], [0.0, 160.0], [0.0, 120.0], [40.0, 120.0], [40.0, 80.0], [80.0, 80.0], [80.0, 0.0], [200.0, 0.0]]","[[200.0, 200.0], [80.0, 200.0], [80.0, 120.0], [40.0, 120.0], [40.0, 80.0], [0.0, 80.0], [0.0, 40.0], [40.0, 40.0], [40.0, 0.0], [80.0, 0.0], [80.0, 40.0], [120.0, 40.0], [120.0, 80.0], [200.0, 80.0], [200.0, 200.0]]","[[0.0, 200.0], [0.0, 80.0], [80.0, 80.0], [80.0, 40.0], [120.0, 40.0], [120.0, 0.0], [160.0, 0.0], [160.0, 40.0], [200.0, 40.0], [200.0, 80.0], [160.0, 80.0], [160.0, 120.0], [120.0, 120.0], [120.0, 200.0], [0.0, 200.0]]",0,0 14 | "[[0.0, 0.0], [100.0, 0.0], [100.0, 100.0], [0.0, 100.0], [0.0, 0.0]]","[[100.0, 0.0], [100.0, 100.0], [0.0, 100.0], [0.0, 0.0], [100.0, 0.0]]","[[100.0, 100.0], [0.0, 100.0], [0.0, 0.0], [100.0, 0.0], [100.0, 100.0]]","[[0.0, 100.0], [0.0, 0.0], [100.0, 0.0], [100.0, 100.0], [0.0, 100.0]]",1,1 15 | "[[0.0, 0.0], [80.0, 0.0], [80.0, 80.0], [0.0, 80.0], [0.0, 0.0]]","[[80.0, 0.0], [80.0, 80.0], [0.0, 80.0], [0.0, 0.0], [80.0, 0.0]]","[[80.0, 80.0], [0.0, 80.0], [0.0, 0.0], [80.0, 0.0], [80.0, 80.0]]","[[0.0, 80.0], [0.0, 0.0], [80.0, 0.0], [80.0, 80.0], [0.0, 80.0]]",1,1 16 | "[[20.0, 0.0], [40.0, 0.0], [40.0, 20.0], [60.0, 20.0], [60.0, 40.0], [40.0, 40.0], [40.0, 60.0], [20.0, 60.0], [20.0, 40.0], [0.0, 40.0], [0.0, 20.0], [20.0, 20.0], [20.0, 0.0]]","[[60.0, 20.0], [60.0, 40.0], [40.0, 40.0], [40.0, 60.0], [20.0, 60.0], [20.0, 40.0], [0.0, 40.0], [0.0, 20.0], [20.0, 20.0], [20.0, 0.0], [40.0, 0.0], [40.0, 20.0], [60.0, 20.0]]","[[40.0, 60.0], [20.0, 60.0], [20.0, 40.0], [0.0, 40.0], [0.0, 20.0], [20.0, 20.0], [20.0, 0.0], [40.0, 0.0], [40.0, 20.0], [60.0, 20.0], [60.0, 40.0], [40.0, 40.0], [40.0, 60.0]]","[[0.0, 40.0], [0.0, 20.0], [20.0, 20.0], [20.0, 0.0], [40.0, 0.0], [40.0, 20.0], [60.0, 20.0], [60.0, 40.0], [40.0, 40.0], [40.0, 60.0], [20.0, 60.0], [20.0, 40.0], [0.0, 40.0]]",1,1 17 | "[[40.0, 0.0], [80.0, 0.0], [80.0, 40.0], [120.0, 40.0], [120.0, 80.0], [80.0, 80.0], [80.0, 120.0], [40.0, 120.0], [40.0, 80.0], [0.0, 80.0], [0.0, 40.0], [40.0, 40.0], [40.0, 0.0]]","[[120.0, 40.0], [120.0, 80.0], [80.0, 80.0], [80.0, 120.0], [40.0, 120.0], [40.0, 80.0], [0.0, 80.0], [0.0, 40.0], [40.0, 40.0], [40.0, 0.0], [80.0, 0.0], [80.0, 40.0], [120.0, 40.0]]","[[80.0, 120.0], [40.0, 120.0], [40.0, 80.0], [0.0, 80.0], [0.0, 40.0], [40.0, 40.0], [40.0, 0.0], [80.0, 0.0], [80.0, 40.0], [120.0, 40.0], [120.0, 80.0], [80.0, 80.0], [80.0, 120.0]]","[[0.0, 80.0], [0.0, 40.0], [40.0, 40.0], [40.0, 0.0], [80.0, 0.0], [80.0, 40.0], [120.0, 40.0], [120.0, 80.0], [80.0, 80.0], [80.0, 120.0], [40.0, 120.0], [40.0, 80.0], [0.0, 80.0]]",1,1 18 | "[[20.0, 0.0], [40.0, 0.0], [40.0, 20.0], [60.0, 20.0], [60.0, 40.0], [40.0, 40.0], [40.0, 60.0], [20.0, 60.0], [20.0, 40.0], [0.0, 40.0], [0.0, 20.0], [20.0, 20.0], [20.0, 0.0]]","[[60.0, 20.0], [60.0, 40.0], [40.0, 40.0], [40.0, 60.0], [20.0, 60.0], [20.0, 40.0], [0.0, 40.0], [0.0, 20.0], [20.0, 20.0], [20.0, 0.0], [40.0, 0.0], [40.0, 20.0], [60.0, 20.0]]","[[40.0, 60.0], [20.0, 60.0], [20.0, 40.0], [0.0, 40.0], [0.0, 20.0], [20.0, 20.0], [20.0, 0.0], [40.0, 0.0], [40.0, 20.0], [60.0, 20.0], [60.0, 40.0], [40.0, 40.0], [40.0, 60.0]]","[[0.0, 40.0], [0.0, 20.0], [20.0, 20.0], [20.0, 0.0], [40.0, 0.0], [40.0, 20.0], [60.0, 20.0], [60.0, 40.0], [40.0, 40.0], [40.0, 60.0], [20.0, 60.0], [20.0, 40.0], [0.0, 40.0]]",1,1 19 | "[[0.0, 0.0], [120.0, 0.0], [120.0, 60.0], [0.0, 60.0], [0.0, 0.0]]","[[90.0, -30.0], [90.0, 90.0], [30.0, 90.0], [30.0, -30.0], [90.0, -30.0]]","[[120.0, 60.0], [0.0, 60.0], [0.0, 0.0], [120.0, 0.0], [120.0, 60.0]]","[[30.0, 90.0], [30.0, -30.0], [90.0, -30.0], [90.0, 90.0], [30.0, 90.0]]",1,1 20 | "[[0.0, 0.0], [20.0, 0.0], [20.0, 80.0], [0.0, 80.0], [0.0, 0.0]]","[[50.0, 30.0], [50.0, 50.0], [-30.0, 50.0], [-30.0, 30.0], [50.0, 30.0]]","[[20.0, 80.0], [0.0, 80.0], [0.0, 0.0], [20.0, 0.0], [20.0, 80.0]]","[[-30.0, 50.0], [-30.0, 30.0], [50.0, 30.0], [50.0, 50.0], [-30.0, 50.0]]",1,1 21 | "[[0.0, 0.0], [100.0, 0.0], [100.0, 40.0], [0.0, 40.0], [0.0, 0.0]]","[[70.0, -30.0], [70.0, 70.0], [30.0, 70.0], [30.0, -30.0], [70.0, -30.0]]","[[100.0, 40.0], [0.0, 40.0], [0.0, 0.0], [100.0, 0.0], [100.0, 40.0]]","[[30.0, 70.0], [30.0, -30.0], [70.0, -30.0], [70.0, 70.0], [30.0, 70.0]]",1,1 22 | "[[40.0, 0.0], [80.0, 0.0], [120.0, 40.0], [120.0, 80.0], [80.0, 120.0], [40.0, 120.0], [0.0, 80.0], [0.0, 40.0], [40.0, 0.0]]","[[120.0, 40.0], [120.0, 80.0], [80.0, 120.0], [40.0, 120.0], [0.0, 80.0], [0.0, 40.0], [40.0, 0.0], [80.0, 0.0], [120.0, 40.0]]","[[80.0, 120.0], [40.0, 120.0], [0.0, 80.0], [0.0, 40.0], [40.0, 0.0], [80.0, 0.0], [120.0, 40.0], [120.0, 80.0], [80.0, 120.0]]","[[0.0, 80.0], [0.0, 40.0], [40.0, 0.0], [80.0, 0.0], [120.0, 40.0], [120.0, 80.0], [80.0, 120.0], [40.0, 120.0], [0.0, 80.0]]",1,1 23 | "[[60.0, 0.0], [120.0, 0.0], [160.0, 40.0], [160.0, 80.0], [120.0, 120.0], [60.0, 120.0], [0.0, 80.0], [0.0, 40.0], [60.0, 0.0]]","[[140.0, 40.0], [140.0, 100.0], [100.0, 140.0], [60.0, 140.0], [20.0, 100.0], [20.0, 40.0], [60.0, -20.0], [100.0, -20.0], [140.0, 40.0]]","[[100.0, 120.0], [40.0, 120.0], [0.0, 80.0], [0.0, 40.0], [40.0, 0.0], [100.0, 0.0], [160.0, 40.0], [160.0, 80.0], [100.0, 120.0]]","[[20.0, 80.0], [20.0, 20.0], [60.0, -20.0], [100.0, -20.0], [140.0, 20.0], [140.0, 80.0], [100.0, 140.0], [60.0, 140.0], [20.0, 80.0]]",0,0 24 | "[[0.0, 20.0], [40.0, 0.0], [80.0, 0.0], [120.0, 20.0], [120.0, 40.0], [80.0, 60.0], [40.0, 60.0], [0.0, 40.0], [0.0, 20.0]]","[[70.0, -30.0], [90.0, 10.0], [90.0, 50.0], [70.0, 90.0], [50.0, 90.0], [30.0, 50.0], [30.0, 10.0], [50.0, -30.0], [70.0, -30.0]]","[[120.0, 40.0], [80.0, 60.0], [40.0, 60.0], [0.0, 40.0], [0.0, 20.0], [40.0, 0.0], [80.0, 0.0], [120.0, 20.0], [120.0, 40.0]]","[[50.0, 90.0], [30.0, 50.0], [30.0, 10.0], [50.0, -30.0], [70.0, -30.0], [90.0, 10.0], [90.0, 50.0], [70.0, 90.0], [50.0, 90.0]]",1,1 25 | -------------------------------------------------------------------------------- /data/jakobs1_orientation.csv: -------------------------------------------------------------------------------- 1 | o_0,o_1,o_2,o_3,ver_sym,hori_sym 2 | "[[0.0, 0.0], [40.0, 0.0], [0.0, 40.0], [0.0, 0.0]]","[[40.0, 0.0], [40.0, 40.0], [0.0, 0.0], [40.0, 0.0]]","[[40.0, 40.0], [0.0, 40.0], [40.0, 0.0], [40.0, 40.0]]","[[0.0, 40.0], [0.0, 0.0], [40.0, 40.0], [0.0, 40.0]]",0,0 3 | "[[0.0, 0.0], [60.0, 0.0], [0.0, 60.0], [0.0, 0.0]]","[[60.0, 0.0], [60.0, 60.0], [0.0, 0.0], [60.0, 0.0]]","[[60.0, 60.0], [0.0, 60.0], [60.0, 0.0], [60.0, 60.0]]","[[0.0, 60.0], [0.0, 0.0], [60.0, 60.0], [0.0, 60.0]]",0,0 4 | "[[0.0, 0.0], [80.0, 0.0], [0.0, 80.0], [0.0, 0.0]]","[[80.0, 0.0], [80.0, 80.0], [0.0, 0.0], [80.0, 0.0]]","[[80.0, 80.0], [0.0, 80.0], [80.0, 0.0], [80.0, 80.0]]","[[0.0, 80.0], [0.0, 0.0], [80.0, 80.0], [0.0, 80.0]]",0,0 5 | "[[100.0, 0.0], [100.0, 100.0], [0.0, 100.0], [100.0, 0.0]]","[[100.0, 100.0], [0.0, 100.0], [0.0, 0.0], [100.0, 100.0]]","[[0.0, 100.0], [0.0, 0.0], [100.0, 0.0], [0.0, 100.0]]","[[0.0, 0.0], [100.0, 0.0], [100.0, 100.0], [0.0, 0.0]]",0,0 6 | "[[0.0, 60.0], [120.0, 0.0], [120.0, 60.0], [0.0, 60.0]]","[[30.0, -30.0], [90.0, 90.0], [30.0, 90.0], [30.0, -30.0]]","[[120.0, 0.0], [0.0, 60.0], [0.0, 0.0], [120.0, 0.0]]","[[90.0, 90.0], [30.0, -30.0], [90.0, -30.0], [90.0, 90.0]]",0,0 7 | "[[0.0, 80.0], [140.0, 0.0], [140.0, 80.0], [0.0, 80.0]]","[[30.0, -30.0], [110.0, 110.0], [30.0, 110.0], [30.0, -30.0]]","[[140.0, 0.0], [0.0, 80.0], [0.0, 0.0], [140.0, 0.0]]","[[110.0, 110.0], [30.0, -30.0], [110.0, -30.0], [110.0, 110.0]]",0,0 8 | "[[0.0, 0.0], [100.0, 0.0], [100.0, 60.0], [60.0, 60.0], [60.0, 100.0], [0.0, 100.0], [0.0, 0.0]]","[[100.0, 0.0], [100.0, 100.0], [40.0, 100.0], [40.0, 60.0], [0.0, 60.0], [0.0, 0.0], [100.0, 0.0]]","[[100.0, 100.0], [0.0, 100.0], [0.0, 40.0], [40.0, 40.0], [40.0, 0.0], [100.0, 0.0], [100.0, 100.0]]","[[0.0, 100.0], [0.0, 0.0], [60.0, 0.0], [60.0, 40.0], [100.0, 40.0], [100.0, 100.0], [0.0, 100.0]]",0,0 9 | "[[0.0, 0.0], [80.0, 0.0], [80.0, 20.0], [40.0, 20.0], [40.0, 80.0], [0.0, 80.0], [0.0, 0.0]]","[[80.0, 0.0], [80.0, 80.0], [60.0, 80.0], [60.0, 40.0], [0.0, 40.0], [0.0, 0.0], [80.0, 0.0]]","[[80.0, 80.0], [0.0, 80.0], [0.0, 60.0], [40.0, 60.0], [40.0, 0.0], [80.0, 0.0], [80.0, 80.0]]","[[0.0, 80.0], [0.0, 0.0], [20.0, 0.0], [20.0, 40.0], [80.0, 40.0], [80.0, 80.0], [0.0, 80.0]]",0,0 10 | "[[0.0, 0.0], [120.0, 0.0], [120.0, 60.0], [80.0, 60.0], [80.0, 120.0], [0.0, 120.0], [0.0, 0.0]]","[[120.0, 0.0], [120.0, 120.0], [60.0, 120.0], [60.0, 80.0], [0.0, 80.0], [0.0, 0.0], [120.0, 0.0]]","[[120.0, 120.0], [0.0, 120.0], [0.0, 60.0], [40.0, 60.0], [40.0, 0.0], [120.0, 0.0], [120.0, 120.0]]","[[0.0, 120.0], [0.0, 0.0], [60.0, 0.0], [60.0, 40.0], [120.0, 40.0], [120.0, 120.0], [0.0, 120.0]]",0,0 11 | "[[0.0, 0.0], [100.0, 0.0], [100.0, 40.0], [60.0, 40.0], [60.0, 20.0], [0.0, 20.0], [0.0, 0.0]]","[[70.0, -30.0], [70.0, 70.0], [30.0, 70.0], [30.0, 30.0], [50.0, 30.0], [50.0, -30.0], [70.0, -30.0]]","[[100.0, 40.0], [0.0, 40.0], [0.0, 0.0], [40.0, 0.0], [40.0, 20.0], [100.0, 20.0], [100.0, 40.0]]","[[30.0, 70.0], [30.0, -30.0], [70.0, -30.0], [70.0, 10.0], [50.0, 10.0], [50.0, 70.0], [30.0, 70.0]]",0,0 12 | "[[0.0, 0.0], [80.0, 0.0], [80.0, 40.0], [60.0, 40.0], [60.0, 20.0], [0.0, 20.0], [0.0, 0.0]]","[[60.0, -20.0], [60.0, 60.0], [20.0, 60.0], [20.0, 40.0], [40.0, 40.0], [40.0, -20.0], [60.0, -20.0]]","[[80.0, 40.0], [0.0, 40.0], [0.0, 0.0], [20.0, 0.0], [20.0, 20.0], [80.0, 20.0], [80.0, 40.0]]","[[20.0, 60.0], [20.0, -20.0], [60.0, -20.0], [60.0, 0.0], [40.0, 0.0], [40.0, 60.0], [20.0, 60.0]]",0,0 13 | "[[0.0, 0.0], [120.0, 0.0], [120.0, 60.0], [80.0, 60.0], [80.0, 120.0], [0.0, 120.0], [0.0, 0.0]]","[[120.0, 0.0], [120.0, 120.0], [60.0, 120.0], [60.0, 80.0], [0.0, 80.0], [0.0, 0.0], [120.0, 0.0]]","[[120.0, 120.0], [0.0, 120.0], [0.0, 60.0], [40.0, 60.0], [40.0, 0.0], [120.0, 0.0], [120.0, 120.0]]","[[0.0, 120.0], [0.0, 0.0], [60.0, 0.0], [60.0, 40.0], [120.0, 40.0], [120.0, 120.0], [0.0, 120.0]]",0,0 14 | "[[0.0, 0.0], [120.0, 0.0], [120.0, 120.0], [0.0, 120.0], [0.0, 0.0]]","[[120.0, 0.0], [120.0, 120.0], [0.0, 120.0], [0.0, 0.0], [120.0, 0.0]]","[[120.0, 120.0], [0.0, 120.0], [0.0, 0.0], [120.0, 0.0], [120.0, 120.0]]","[[0.0, 120.0], [0.0, 0.0], [120.0, 0.0], [120.0, 120.0], [0.0, 120.0]]",1,1 15 | "[[0.0, 0.0], [100.0, 0.0], [100.0, 100.0], [0.0, 100.0], [0.0, 0.0]]","[[100.0, 0.0], [100.0, 100.0], [0.0, 100.0], [0.0, 0.0], [100.0, 0.0]]","[[100.0, 100.0], [0.0, 100.0], [0.0, 0.0], [100.0, 0.0], [100.0, 100.0]]","[[0.0, 100.0], [0.0, 0.0], [100.0, 0.0], [100.0, 100.0], [0.0, 100.0]]",1,1 16 | "[[0.0, 0.0], [80.0, 0.0], [80.0, 80.0], [0.0, 80.0], [0.0, 0.0]]","[[80.0, 0.0], [80.0, 80.0], [0.0, 80.0], [0.0, 0.0], [80.0, 0.0]]","[[80.0, 80.0], [0.0, 80.0], [0.0, 0.0], [80.0, 0.0], [80.0, 80.0]]","[[0.0, 80.0], [0.0, 0.0], [80.0, 0.0], [80.0, 80.0], [0.0, 80.0]]",1,1 17 | "[[40.0, 0.0], [80.0, 0.0], [80.0, 40.0], [120.0, 40.0], [120.0, 80.0], [80.0, 80.0], [80.0, 120.0], [40.0, 120.0], [40.0, 80.0], [0.0, 80.0], [0.0, 40.0], [40.0, 40.0], [40.0, 0.0]]","[[120.0, 40.0], [120.0, 80.0], [80.0, 80.0], [80.0, 120.0], [40.0, 120.0], [40.0, 80.0], [0.0, 80.0], [0.0, 40.0], [40.0, 40.0], [40.0, 0.0], [80.0, 0.0], [80.0, 40.0], [120.0, 40.0]]","[[80.0, 120.0], [40.0, 120.0], [40.0, 80.0], [0.0, 80.0], [0.0, 40.0], [40.0, 40.0], [40.0, 0.0], [80.0, 0.0], [80.0, 40.0], [120.0, 40.0], [120.0, 80.0], [80.0, 80.0], [80.0, 120.0]]","[[0.0, 80.0], [0.0, 40.0], [40.0, 40.0], [40.0, 0.0], [80.0, 0.0], [80.0, 40.0], [120.0, 40.0], [120.0, 80.0], [80.0, 80.0], [80.0, 120.0], [40.0, 120.0], [40.0, 80.0], [0.0, 80.0]]",1,1 18 | "[[20.0, 0.0], [40.0, 0.0], [40.0, 20.0], [60.0, 20.0], [60.0, 40.0], [40.0, 40.0], [40.0, 60.0], [20.0, 60.0], [20.0, 40.0], [0.0, 40.0], [0.0, 20.0], [20.0, 20.0], [20.0, 0.0]]","[[60.0, 20.0], [60.0, 40.0], [40.0, 40.0], [40.0, 60.0], [20.0, 60.0], [20.0, 40.0], [0.0, 40.0], [0.0, 20.0], [20.0, 20.0], [20.0, 0.0], [40.0, 0.0], [40.0, 20.0], [60.0, 20.0]]","[[40.0, 60.0], [20.0, 60.0], [20.0, 40.0], [0.0, 40.0], [0.0, 20.0], [20.0, 20.0], [20.0, 0.0], [40.0, 0.0], [40.0, 20.0], [60.0, 20.0], [60.0, 40.0], [40.0, 40.0], [40.0, 60.0]]","[[0.0, 40.0], [0.0, 20.0], [20.0, 20.0], [20.0, 0.0], [40.0, 0.0], [40.0, 20.0], [60.0, 20.0], [60.0, 40.0], [40.0, 40.0], [40.0, 60.0], [20.0, 60.0], [20.0, 40.0], [0.0, 40.0]]",1,1 19 | "[[40.0, 0.0], [80.0, 0.0], [80.0, 40.0], [120.0, 40.0], [120.0, 80.0], [80.0, 80.0], [80.0, 120.0], [40.0, 120.0], [40.0, 80.0], [0.0, 80.0], [0.0, 40.0], [40.0, 40.0], [40.0, 0.0]]","[[120.0, 40.0], [120.0, 80.0], [80.0, 80.0], [80.0, 120.0], [40.0, 120.0], [40.0, 80.0], [0.0, 80.0], [0.0, 40.0], [40.0, 40.0], [40.0, 0.0], [80.0, 0.0], [80.0, 40.0], [120.0, 40.0]]","[[80.0, 120.0], [40.0, 120.0], [40.0, 80.0], [0.0, 80.0], [0.0, 40.0], [40.0, 40.0], [40.0, 0.0], [80.0, 0.0], [80.0, 40.0], [120.0, 40.0], [120.0, 80.0], [80.0, 80.0], [80.0, 120.0]]","[[0.0, 80.0], [0.0, 40.0], [40.0, 40.0], [40.0, 0.0], [80.0, 0.0], [80.0, 40.0], [120.0, 40.0], [120.0, 80.0], [80.0, 80.0], [80.0, 120.0], [40.0, 120.0], [40.0, 80.0], [0.0, 80.0]]",1,1 20 | "[[20.0, 0.0], [40.0, 0.0], [40.0, 20.0], [60.0, 20.0], [60.0, 40.0], [40.0, 40.0], [40.0, 60.0], [20.0, 60.0], [20.0, 40.0], [0.0, 40.0], [0.0, 20.0], [20.0, 20.0], [20.0, 0.0]]","[[60.0, 20.0], [60.0, 40.0], [40.0, 40.0], [40.0, 60.0], [20.0, 60.0], [20.0, 40.0], [0.0, 40.0], [0.0, 20.0], [20.0, 20.0], [20.0, 0.0], [40.0, 0.0], [40.0, 20.0], [60.0, 20.0]]","[[40.0, 60.0], [20.0, 60.0], [20.0, 40.0], [0.0, 40.0], [0.0, 20.0], [20.0, 20.0], [20.0, 0.0], [40.0, 0.0], [40.0, 20.0], [60.0, 20.0], [60.0, 40.0], [40.0, 40.0], [40.0, 60.0]]","[[0.0, 40.0], [0.0, 20.0], [20.0, 20.0], [20.0, 0.0], [40.0, 0.0], [40.0, 20.0], [60.0, 20.0], [60.0, 40.0], [40.0, 40.0], [40.0, 60.0], [20.0, 60.0], [20.0, 40.0], [0.0, 40.0]]",1,1 21 | "[[0.0, 0.0], [120.0, 0.0], [120.0, 60.0], [0.0, 60.0], [0.0, 0.0]]","[[90.0, -30.0], [90.0, 90.0], [30.0, 90.0], [30.0, -30.0], [90.0, -30.0]]","[[120.0, 60.0], [0.0, 60.0], [0.0, 0.0], [120.0, 0.0], [120.0, 60.0]]","[[30.0, 90.0], [30.0, -30.0], [90.0, -30.0], [90.0, 90.0], [30.0, 90.0]]",1,1 22 | "[[0.0, 0.0], [20.0, 0.0], [20.0, 80.0], [0.0, 80.0], [0.0, 0.0]]","[[50.0, 30.0], [50.0, 50.0], [-30.0, 50.0], [-30.0, 30.0], [50.0, 30.0]]","[[20.0, 80.0], [0.0, 80.0], [0.0, 0.0], [20.0, 0.0], [20.0, 80.0]]","[[-30.0, 50.0], [-30.0, 30.0], [50.0, 30.0], [50.0, 50.0], [-30.0, 50.0]]",1,1 23 | "[[0.0, 0.0], [100.0, 0.0], [100.0, 40.0], [0.0, 40.0], [0.0, 0.0]]","[[70.0, -30.0], [70.0, 70.0], [30.0, 70.0], [30.0, -30.0], [70.0, -30.0]]","[[100.0, 40.0], [0.0, 40.0], [0.0, 0.0], [100.0, 0.0], [100.0, 40.0]]","[[30.0, 70.0], [30.0, -30.0], [70.0, -30.0], [70.0, 70.0], [30.0, 70.0]]",1,1 24 | "[[40.0, 0.0], [80.0, 0.0], [120.0, 40.0], [120.0, 80.0], [80.0, 120.0], [40.0, 120.0], [0.0, 80.0], [0.0, 40.0], [40.0, 0.0]]","[[120.0, 40.0], [120.0, 80.0], [80.0, 120.0], [40.0, 120.0], [0.0, 80.0], [0.0, 40.0], [40.0, 0.0], [80.0, 0.0], [120.0, 40.0]]","[[80.0, 120.0], [40.0, 120.0], [0.0, 80.0], [0.0, 40.0], [40.0, 0.0], [80.0, 0.0], [120.0, 40.0], [120.0, 80.0], [80.0, 120.0]]","[[0.0, 80.0], [0.0, 40.0], [40.0, 0.0], [80.0, 0.0], [120.0, 40.0], [120.0, 80.0], [80.0, 120.0], [40.0, 120.0], [0.0, 80.0]]",1,1 25 | "[[60.0, 0.0], [120.0, 0.0], [160.0, 40.0], [160.0, 80.0], [120.0, 120.0], [60.0, 120.0], [0.0, 80.0], [0.0, 40.0], [60.0, 0.0]]","[[140.0, 40.0], [140.0, 100.0], [100.0, 140.0], [60.0, 140.0], [20.0, 100.0], [20.0, 40.0], [60.0, -20.0], [100.0, -20.0], [140.0, 40.0]]","[[100.0, 120.0], [40.0, 120.0], [0.0, 80.0], [0.0, 40.0], [40.0, 0.0], [100.0, 0.0], [160.0, 40.0], [160.0, 80.0], [100.0, 120.0]]","[[20.0, 80.0], [20.0, 20.0], [60.0, -20.0], [100.0, -20.0], [140.0, 20.0], [140.0, 80.0], [100.0, 140.0], [60.0, 140.0], [20.0, 80.0]]",0,0 26 | "[[0.0, 20.0], [40.0, 0.0], [80.0, 0.0], [120.0, 20.0], [120.0, 40.0], [80.0, 60.0], [40.0, 60.0], [0.0, 40.0], [0.0, 20.0]]","[[70.0, -30.0], [90.0, 10.0], [90.0, 50.0], [70.0, 90.0], [50.0, 90.0], [30.0, 50.0], [30.0, 10.0], [50.0, -30.0], [70.0, -30.0]]","[[120.0, 40.0], [80.0, 60.0], [40.0, 60.0], [0.0, 40.0], [0.0, 20.0], [40.0, 0.0], [80.0, 0.0], [120.0, 20.0], [120.0, 40.0]]","[[50.0, 90.0], [30.0, 50.0], [30.0, 10.0], [50.0, -30.0], [70.0, -30.0], [90.0, 10.0], [90.0, 50.0], [70.0, 90.0], [50.0, 90.0]]",1,1 27 | -------------------------------------------------------------------------------- /data/jakobs2.csv: -------------------------------------------------------------------------------- 1 | num,polygon 2 | 1,"[[6.0, 0.0], [12.0, 4.0], [6.0, 8.0]]" 3 | 1,"[[10.0, 0.0], [10.0, 10.0], [0.0, 10.0], [0.0, 5.0], [5.0, 5.0]]" 4 | 1,"[[6.0, 0.0], [4.0, 2.0], [4.0, 4.0], [6.0, 6.0], [0.0, 6.0], [2.0, 4.0], [2.0, 2.0]]" 5 | 1,"[[8.0, 0.0], [6.0, 2.0], [6.0, 6.0], [8.0, 8.0], [0.0, 8.0], [2.0, 6.0], [2.0, 2.0]]" 6 | 1,"[[10.0, 0.0], [8.0, 2.0], [8.0, 8.0], [10.0, 10.0], [0.0, 10.0], [2.0, 8.0], [2.0, 2.0]]" 7 | 1,"[[6.0, 0.0], [6.0, 6.0], [4.0, 6.0], [4.0, 2.0], [2.0, 2.0], [2.0, 6.0], [0.0, 6.0]]" 8 | 1,"[[8.0, 0.0], [8.0, 8.0], [6.0, 8.0], [6.0, 2.0], [2.0, 2.0], [2.0, 8.0], [0.0, 8.0]]" 9 | 1,"[[10.0, 0.0], [10.0, 10.0], [8.0, 10.0], [8.0, 2.0], [2.0, 2.0], [2.0, 10.0], [0.0, 10.0]]" 10 | 1,"[[12.0, 0.0], [6.0, 12.0]]" 11 | 1,"[[8.0, 0.0], [4.0, 8.0]]" 12 | 1,"[[10.0, 0.0], [10.0, 10.0]]" 13 | 1,"[[12.0, 8.0], [6.0, 16.0], [0.0, 8.0]]" 14 | 1,"[[12.0, 12.0], [0.0, 12.0]]" 15 | 1,"[[8.0, 0.0], [4.0, 8.0]]" 16 | 1,"[[10.0, 10.0], [0.0, 10.0]]" 17 | 1,"[[8.0, 5.0], [4.0, 10.0], [0.0, 5.0]]" 18 | 1,"[[4.0, 0.0], [6.0, 2.0], [6.0, 4.0], [3.0, 6.0], [0.0, 4.0], [0.0, 2.0]]" 19 | 1,"[[6.0, 0.0], [8.0, 2.0], [8.0, 6.0], [4.0, 8.0], [0.0, 6.0], [0.0, 2.0]]" 20 | 1,"[[6.0, 0.0], [6.0, 3.0], [3.0, 3.0], [3.0, 6.0], [0.0, 6.0]]" 21 | 1,"[[8.0, 0.0], [8.0, 8.0], [0.0, 8.0], [0.0, 4.0], [4.0, 4.0]]" 22 | 1,"[[6.0, 0.0], [6.0, 3.0], [3.0, 3.0], [3.0, 6.0], [0.0, 6.0]]" 23 | 1,"[[8.0, 0.0], [8.0, 8.0], [0.0, 8.0], [0.0, 4.0], [4.0, 4.0]]" 24 | 1,"[[12.0, 0.0], [12.0, 12.0], [0.0, 12.0]]" 25 | 1,"[[8.0, 0.0], [8.0, 8.0], [0.0, 8.0]]" 26 | 1,"[[10.0, 0.0], [10.0, 10.0], [0.0, 10.0]]" 27 | -------------------------------------------------------------------------------- /data/jakobs2_clus.csv: -------------------------------------------------------------------------------- 1 | desc,num,polygon 2 | "1",1,"[[0.0, 4.0], [6.0, 0.0], [12.0, 4.0], [6.0, 8.0]]" 3 | "2",1,"[[5.0, 0.0], [10.0, 0.0], [10.0, 10.0], [0.0, 10.0], [0.0, 5.0], [5.0, 5.0]]" 4 | "3+17",1,"[[0.0, 0.0], [8.0, 0.0], [10.0, 3.0], [8.0, 6.0], [0.0, 6.0]]" 5 | "4",1,"[[0.0, 0.0], [8.0, 0.0], [6.0, 2.0], [6.0, 6.0], [8.0, 8.0], [0.0, 8.0], [2.0, 6.0], [2.0, 2.0]]" 6 | "5",1,"[[0.0, 0.0], [10.0, 0.0], [8.0, 2.0], [8.0, 8.0], [10.0, 10.0], [0.0, 10.0], [2.0, 8.0], [2.0, 2.0]]" 7 | "6+7+8",1,"[[0.0, 0.0], [10.0, 0.0], [10.0, 10.0], [6.0, 10.0], [6.0, 12.0], [-2.0, 12.0], [-2.0, 2.0], [0.0, 2.0]]" 8 | "9",1,"[[0.0, 0.0], [12.0, 0.0], [6.0, 12.0]]" 9 | "10",1,"[[0.0, 0.0], [8.0, 0.0], [4.0, 8.0]]" 10 | "11",1,"[[0.0, 10.0], [10.0, 0.0], [10.0, 10.0]]" 11 | "12",1,"[[6.0, 0.0], [12.0, 8.0], [6.0, 16.0], [0.0, 8.0]]" 12 | "13",1,"[[6.0, 0.0], [12.0, 12.0], [0.0, 12.0]]" 13 | "14",1,"[[0.0, 0.0], [8.0, 0.0], [4.0, 8.0]]" 14 | "15",1,"[[5.0, 0.0], [10.0, 10.0], [0.0, 10.0]]" 15 | "16",1,"[[4.0, 0.0], [8.0, 5.0], [4.0, 10.0], [0.0, 5.0]]" 16 | "18",1,"[[2.0, 0.0], [6.0, 0.0], [8.0, 2.0], [8.0, 6.0], [4.0, 8.0], [0.0, 6.0], [0.0, 2.0]]" 17 | "19+21",1,"[[0.0, 0.0], [6.0, 0.0], [6.0, 9.0], [0.0, 9.0]]" 18 | "20",1,"[[4.0, 0.0], [8.0, 0.0], [8.0, 8.0], [0.0, 8.0], [0.0, 4.0], [4.0, 4.0]]" 19 | "22",1,"[[4.0, 0.0], [8.0, 0.0], [8.0, 8.0], [0.0, 8.0], [0.0, 4.0], [4.0, 4.0]]" 20 | "23",1,"[[0.0, 0.0], [12.0, 0.0], [12.0, 12.0], [0.0, 12.0]]" 21 | "24",1,"[[0.0, 0.0], [8.0, 0.0], [8.0, 8.0], [0.0, 8.0]]" 22 | "25",1,"[[0.0, 0.0], [10.0, 0.0], [10.0, 10.0], [0.0, 10.0]]" 23 | -------------------------------------------------------------------------------- /data/jakobs2_clus_orientation.csv: -------------------------------------------------------------------------------- 1 | o_0,o_1,o_2,o_3,ver_sym,hori_sym 2 | "[[0.0, 40.0], [60.0, 0.0], [120.0, 40.0], [60.0, 80.0], [0.0, 40.0]]","[[60.0, -20.0], [100.0, 40.0], [60.0, 100.0], [20.0, 40.0], [60.0, -20.0]]","[[120.0, 40.0], [60.0, 80.0], [0.0, 40.0], [60.0, 0.0], [120.0, 40.0]]","[[60.0, 100.0], [20.0, 40.0], [60.0, -20.0], [100.0, 40.0], [60.0, 100.0]]",1,1 3 | "[[50.0, 0.0], [100.0, 0.0], [100.0, 100.0], [0.0, 100.0], [0.0, 50.0], [50.0, 50.0], [50.0, 0.0]]","[[100.0, 50.0], [100.0, 100.0], [0.0, 100.0], [0.0, 0.0], [50.0, 0.0], [50.0, 50.0], [100.0, 50.0]]","[[50.0, 100.0], [0.0, 100.0], [0.0, 0.0], [100.0, 0.0], [100.0, 50.0], [50.0, 50.0], [50.0, 100.0]]","[[0.0, 50.0], [0.0, 0.0], [100.0, 0.0], [100.0, 100.0], [50.0, 100.0], [50.0, 50.0], [0.0, 50.0]]",0,0 4 | "[[0.0, 0.0], [80.0, 0.0], [100.0, 30.0], [80.0, 60.0], [0.0, 60.0], [0.0, 0.0]]","[[80.0, -20.0], [80.0, 60.0], [50.0, 80.0], [20.0, 60.0], [20.0, -20.0], [80.0, -20.0]]","[[100.0, 60.0], [20.0, 60.0], [0.0, 30.0], [20.0, 0.0], [100.0, 0.0], [100.0, 60.0]]","[[20.0, 80.0], [20.0, 0.0], [50.0, -20.0], [80.0, 0.0], [80.0, 80.0], [20.0, 80.0]]",0,0 5 | "[[0.0, 0.0], [80.0, 0.0], [60.0, 20.0], [60.0, 60.0], [80.0, 80.0], [0.0, 80.0], [20.0, 60.0], [20.0, 20.0], [0.0, 0.0]]","[[80.0, 0.0], [80.0, 80.0], [60.0, 60.0], [20.0, 60.0], [0.0, 80.0], [0.0, 0.0], [20.0, 20.0], [60.0, 20.0], [80.0, 0.0]]","[[80.0, 80.0], [0.0, 80.0], [20.0, 60.0], [20.0, 20.0], [0.0, 0.0], [80.0, 0.0], [60.0, 20.0], [60.0, 60.0], [80.0, 80.0]]","[[0.0, 80.0], [0.0, 0.0], [20.0, 20.0], [60.0, 20.0], [80.0, 0.0], [80.0, 80.0], [60.0, 60.0], [20.0, 60.0], [0.0, 80.0]]",1,1 6 | "[[0.0, 0.0], [100.0, 0.0], [80.0, 20.0], [80.0, 80.0], [100.0, 100.0], [0.0, 100.0], [20.0, 80.0], [20.0, 20.0], [0.0, 0.0]]","[[100.0, 0.0], [100.0, 100.0], [80.0, 80.0], [20.0, 80.0], [0.0, 100.0], [0.0, 0.0], [20.0, 20.0], [80.0, 20.0], [100.0, 0.0]]","[[100.0, 100.0], [0.0, 100.0], [20.0, 80.0], [20.0, 20.0], [0.0, 0.0], [100.0, 0.0], [80.0, 20.0], [80.0, 80.0], [100.0, 100.0]]","[[0.0, 100.0], [0.0, 0.0], [20.0, 20.0], [80.0, 20.0], [100.0, 0.0], [100.0, 100.0], [80.0, 80.0], [20.0, 80.0], [0.0, 100.0]]",1,1 7 | "[[0.0, 0.0], [100.0, 0.0], [100.0, 100.0], [60.0, 100.0], [60.0, 120.0], [-20.0, 120.0], [-20.0, 20.0], [0.0, 20.0], [0.0, 0.0]]","[[100.0, 20.0], [100.0, 120.0], [0.0, 120.0], [0.0, 80.0], [-20.0, 80.0], [-20.0, 0.0], [80.0, 0.0], [80.0, 20.0], [100.0, 20.0]]","[[80.0, 120.0], [-20.0, 120.0], [-20.0, 20.0], [20.0, 20.0], [20.0, 0.0], [100.0, 0.0], [100.0, 100.0], [80.0, 100.0], [80.0, 120.0]]","[[-20.0, 100.0], [-20.0, 0.0], [80.0, 0.0], [80.0, 40.0], [100.0, 40.0], [100.0, 120.0], [0.0, 120.0], [0.0, 100.0], [-20.0, 100.0]]",0,0 8 | "[[0.0, 0.0], [120.0, 0.0], [60.0, 120.0], [0.0, 0.0]]","[[120.0, 0.0], [120.0, 120.0], [0.0, 60.0], [120.0, 0.0]]","[[120.0, 120.0], [0.0, 120.0], [60.0, 0.0], [120.0, 120.0]]","[[0.0, 120.0], [0.0, 0.0], [120.0, 60.0], [0.0, 120.0]]",0,0 9 | "[[0.0, 0.0], [80.0, 0.0], [40.0, 80.0], [0.0, 0.0]]","[[80.0, 0.0], [80.0, 80.0], [0.0, 40.0], [80.0, 0.0]]","[[80.0, 80.0], [0.0, 80.0], [40.0, 0.0], [80.0, 80.0]]","[[0.0, 80.0], [0.0, 0.0], [80.0, 40.0], [0.0, 80.0]]",0,0 10 | "[[0.0, 100.0], [100.0, 0.0], [100.0, 100.0], [0.0, 100.0]]","[[0.0, 0.0], [100.0, 100.0], [0.0, 100.0], [0.0, 0.0]]","[[100.0, 0.0], [0.0, 100.0], [0.0, 0.0], [100.0, 0.0]]","[[100.0, 100.0], [0.0, 0.0], [100.0, 0.0], [100.0, 100.0]]",0,0 11 | "[[60.0, 0.0], [120.0, 80.0], [60.0, 160.0], [0.0, 80.0], [60.0, 0.0]]","[[140.0, 80.0], [60.0, 140.0], [-20.0, 80.0], [60.0, 20.0], [140.0, 80.0]]","[[60.0, 160.0], [0.0, 80.0], [60.0, 0.0], [120.0, 80.0], [60.0, 160.0]]","[[-20.0, 80.0], [60.0, 20.0], [140.0, 80.0], [60.0, 140.0], [-20.0, 80.0]]",1,1 12 | "[[60.0, 0.0], [120.0, 120.0], [0.0, 120.0], [60.0, 0.0]]","[[120.0, 60.0], [0.0, 120.0], [0.0, 0.0], [120.0, 60.0]]","[[60.0, 120.0], [0.0, 0.0], [120.0, 0.0], [60.0, 120.0]]","[[0.0, 60.0], [120.0, 0.0], [120.0, 120.0], [0.0, 60.0]]",0,0 13 | "[[0.0, 0.0], [80.0, 0.0], [40.0, 80.0], [0.0, 0.0]]","[[80.0, 0.0], [80.0, 80.0], [0.0, 40.0], [80.0, 0.0]]","[[80.0, 80.0], [0.0, 80.0], [40.0, 0.0], [80.0, 80.0]]","[[0.0, 80.0], [0.0, 0.0], [80.0, 40.0], [0.0, 80.0]]",0,0 14 | "[[50.0, 0.0], [100.0, 100.0], [0.0, 100.0], [50.0, 0.0]]","[[100.0, 50.0], [0.0, 100.0], [0.0, 0.0], [100.0, 50.0]]","[[50.0, 100.0], [0.0, 0.0], [100.0, 0.0], [50.0, 100.0]]","[[0.0, 50.0], [100.0, 0.0], [100.0, 100.0], [0.0, 50.0]]",0,0 15 | "[[40.0, 0.0], [80.0, 50.0], [40.0, 100.0], [0.0, 50.0], [40.0, 0.0]]","[[90.0, 50.0], [40.0, 90.0], [-10.0, 50.0], [40.0, 10.0], [90.0, 50.0]]","[[40.0, 100.0], [0.0, 50.0], [40.0, 0.0], [80.0, 50.0], [40.0, 100.0]]","[[-10.0, 50.0], [40.0, 10.0], [90.0, 50.0], [40.0, 90.0], [-10.0, 50.0]]",1,1 16 | "[[20.0, 0.0], [60.0, 0.0], [80.0, 20.0], [80.0, 60.0], [40.0, 80.0], [0.0, 60.0], [0.0, 20.0], [20.0, 0.0]]","[[80.0, 20.0], [80.0, 60.0], [60.0, 80.0], [20.0, 80.0], [0.0, 40.0], [20.0, 0.0], [60.0, 0.0], [80.0, 20.0]]","[[60.0, 80.0], [20.0, 80.0], [0.0, 60.0], [0.0, 20.0], [40.0, 0.0], [80.0, 20.0], [80.0, 60.0], [60.0, 80.0]]","[[0.0, 60.0], [0.0, 20.0], [20.0, 0.0], [60.0, 0.0], [80.0, 40.0], [60.0, 80.0], [20.0, 80.0], [0.0, 60.0]]",0,0 17 | "[[0.0, 0.0], [60.0, 0.0], [60.0, 90.0], [0.0, 90.0], [0.0, 0.0]]","[[75.0, 15.0], [75.0, 75.0], [-15.0, 75.0], [-15.0, 15.0], [75.0, 15.0]]","[[60.0, 90.0], [0.0, 90.0], [0.0, 0.0], [60.0, 0.0], [60.0, 90.0]]","[[-15.0, 75.0], [-15.0, 15.0], [75.0, 15.0], [75.0, 75.0], [-15.0, 75.0]]",1,1 18 | "[[40.0, 0.0], [80.0, 0.0], [80.0, 80.0], [0.0, 80.0], [0.0, 40.0], [40.0, 40.0], [40.0, 0.0]]","[[80.0, 40.0], [80.0, 80.0], [0.0, 80.0], [0.0, 0.0], [40.0, 0.0], [40.0, 40.0], [80.0, 40.0]]","[[40.0, 80.0], [0.0, 80.0], [0.0, 0.0], [80.0, 0.0], [80.0, 40.0], [40.0, 40.0], [40.0, 80.0]]","[[0.0, 40.0], [0.0, 0.0], [80.0, 0.0], [80.0, 80.0], [40.0, 80.0], [40.0, 40.0], [0.0, 40.0]]",0,0 19 | "[[40.0, 0.0], [80.0, 0.0], [80.0, 80.0], [0.0, 80.0], [0.0, 40.0], [40.0, 40.0], [40.0, 0.0]]","[[80.0, 40.0], [80.0, 80.0], [0.0, 80.0], [0.0, 0.0], [40.0, 0.0], [40.0, 40.0], [80.0, 40.0]]","[[40.0, 80.0], [0.0, 80.0], [0.0, 0.0], [80.0, 0.0], [80.0, 40.0], [40.0, 40.0], [40.0, 80.0]]","[[0.0, 40.0], [0.0, 0.0], [80.0, 0.0], [80.0, 80.0], [40.0, 80.0], [40.0, 40.0], [0.0, 40.0]]",0,0 20 | "[[0.0, 0.0], [120.0, 0.0], [120.0, 120.0], [0.0, 120.0], [0.0, 0.0]]","[[120.0, 0.0], [120.0, 120.0], [0.0, 120.0], [0.0, 0.0], [120.0, 0.0]]","[[120.0, 120.0], [0.0, 120.0], [0.0, 0.0], [120.0, 0.0], [120.0, 120.0]]","[[0.0, 120.0], [0.0, 0.0], [120.0, 0.0], [120.0, 120.0], [0.0, 120.0]]",1,1 21 | "[[0.0, 0.0], [80.0, 0.0], [80.0, 80.0], [0.0, 80.0], [0.0, 0.0]]","[[80.0, 0.0], [80.0, 80.0], [0.0, 80.0], [0.0, 0.0], [80.0, 0.0]]","[[80.0, 80.0], [0.0, 80.0], [0.0, 0.0], [80.0, 0.0], [80.0, 80.0]]","[[0.0, 80.0], [0.0, 0.0], [80.0, 0.0], [80.0, 80.0], [0.0, 80.0]]",1,1 22 | "[[0.0, 0.0], [100.0, 0.0], [100.0, 100.0], [0.0, 100.0], [0.0, 0.0]]","[[100.0, 0.0], [100.0, 100.0], [0.0, 100.0], [0.0, 0.0], [100.0, 0.0]]","[[100.0, 100.0], [0.0, 100.0], [0.0, 0.0], [100.0, 0.0], [100.0, 100.0]]","[[0.0, 100.0], [0.0, 0.0], [100.0, 0.0], [100.0, 100.0], [0.0, 100.0]]",1,1 23 | -------------------------------------------------------------------------------- /data/jakobs2_nfp.csv: -------------------------------------------------------------------------------- 1 | i,j,oi,oj,new_poly_i,new_poly_j,nfp,convex_status,vertical_direction,bounds,nfp_parts 2 | -------------------------------------------------------------------------------- /data/jakobs2_orientation.csv: -------------------------------------------------------------------------------- 1 | o_0,o_1,o_2,o_3,ver_sym,hori_sym 2 | "[[0.0, 40.0], [60.0, 0.0], [120.0, 40.0], [60.0, 80.0], [0.0, 40.0]]","[[60.0, -20.0], [100.0, 40.0], [60.0, 100.0], [20.0, 40.0], [60.0, -20.0]]","[[120.0, 40.0], [60.0, 80.0], [0.0, 40.0], [60.0, 0.0], [120.0, 40.0]]","[[60.0, 100.0], [20.0, 40.0], [60.0, -20.0], [100.0, 40.0], [60.0, 100.0]]",1,1 3 | "[[50.0, 0.0], [100.0, 0.0], [100.0, 100.0], [0.0, 100.0], [0.0, 50.0], [50.0, 50.0], [50.0, 0.0]]","[[100.0, 50.0], [100.0, 100.0], [0.0, 100.0], [0.0, 0.0], [50.0, 0.0], [50.0, 50.0], [100.0, 50.0]]","[[50.0, 100.0], [0.0, 100.0], [0.0, 0.0], [100.0, 0.0], [100.0, 50.0], [50.0, 50.0], [50.0, 100.0]]","[[0.0, 50.0], [0.0, 0.0], [100.0, 0.0], [100.0, 100.0], [50.0, 100.0], [50.0, 50.0], [0.0, 50.0]]",0,0 4 | "[[0.0, 0.0], [60.0, 0.0], [40.0, 20.0], [40.0, 40.0], [60.0, 60.0], [0.0, 60.0], [20.0, 40.0], [20.0, 20.0], [0.0, 0.0]]","[[60.0, 0.0], [60.0, 60.0], [40.0, 40.0], [20.0, 40.0], [0.0, 60.0], [0.0, 0.0], [20.0, 20.0], [40.0, 20.0], [60.0, 0.0]]","[[60.0, 60.0], [0.0, 60.0], [20.0, 40.0], [20.0, 20.0], [0.0, 0.0], [60.0, 0.0], [40.0, 20.0], [40.0, 40.0], [60.0, 60.0]]","[[0.0, 60.0], [0.0, 0.0], [20.0, 20.0], [40.0, 20.0], [60.0, 0.0], [60.0, 60.0], [40.0, 40.0], [20.0, 40.0], [0.0, 60.0]]",1,1 5 | "[[0.0, 0.0], [80.0, 0.0], [60.0, 20.0], [60.0, 60.0], [80.0, 80.0], [0.0, 80.0], [20.0, 60.0], [20.0, 20.0], [0.0, 0.0]]","[[80.0, 0.0], [80.0, 80.0], [60.0, 60.0], [20.0, 60.0], [0.0, 80.0], [0.0, 0.0], [20.0, 20.0], [60.0, 20.0], [80.0, 0.0]]","[[80.0, 80.0], [0.0, 80.0], [20.0, 60.0], [20.0, 20.0], [0.0, 0.0], [80.0, 0.0], [60.0, 20.0], [60.0, 60.0], [80.0, 80.0]]","[[0.0, 80.0], [0.0, 0.0], [20.0, 20.0], [60.0, 20.0], [80.0, 0.0], [80.0, 80.0], [60.0, 60.0], [20.0, 60.0], [0.0, 80.0]]",1,1 6 | "[[0.0, 0.0], [100.0, 0.0], [80.0, 20.0], [80.0, 80.0], [100.0, 100.0], [0.0, 100.0], [20.0, 80.0], [20.0, 20.0], [0.0, 0.0]]","[[100.0, 0.0], [100.0, 100.0], [80.0, 80.0], [20.0, 80.0], [0.0, 100.0], [0.0, 0.0], [20.0, 20.0], [80.0, 20.0], [100.0, 0.0]]","[[100.0, 100.0], [0.0, 100.0], [20.0, 80.0], [20.0, 20.0], [0.0, 0.0], [100.0, 0.0], [80.0, 20.0], [80.0, 80.0], [100.0, 100.0]]","[[0.0, 100.0], [0.0, 0.0], [20.0, 20.0], [80.0, 20.0], [100.0, 0.0], [100.0, 100.0], [80.0, 80.0], [20.0, 80.0], [0.0, 100.0]]",1,1 7 | "[[0.0, 0.0], [60.0, 0.0], [60.0, 60.0], [40.0, 60.0], [40.0, 20.0], [20.0, 20.0], [20.0, 60.0], [0.0, 60.0], [0.0, 0.0]]","[[60.0, 0.0], [60.0, 60.0], [0.0, 60.0], [0.0, 40.0], [40.0, 40.0], [40.0, 20.0], [0.0, 20.0], [0.0, 0.0], [60.0, 0.0]]","[[60.0, 60.0], [0.0, 60.0], [0.0, 0.0], [20.0, 0.0], [20.0, 40.0], [40.0, 40.0], [40.0, 0.0], [60.0, 0.0], [60.0, 60.0]]","[[0.0, 60.0], [0.0, 0.0], [60.0, 0.0], [60.0, 20.0], [20.0, 20.0], [20.0, 40.0], [60.0, 40.0], [60.0, 60.0], [0.0, 60.0]]",0,0 8 | "[[0.0, 0.0], [80.0, 0.0], [80.0, 80.0], [60.0, 80.0], [60.0, 20.0], [20.0, 20.0], [20.0, 80.0], [0.0, 80.0], [0.0, 0.0]]","[[80.0, 0.0], [80.0, 80.0], [0.0, 80.0], [0.0, 60.0], [60.0, 60.0], [60.0, 20.0], [0.0, 20.0], [0.0, 0.0], [80.0, 0.0]]","[[80.0, 80.0], [0.0, 80.0], [0.0, 0.0], [20.0, 0.0], [20.0, 60.0], [60.0, 60.0], [60.0, 0.0], [80.0, 0.0], [80.0, 80.0]]","[[0.0, 80.0], [0.0, 0.0], [80.0, 0.0], [80.0, 20.0], [20.0, 20.0], [20.0, 60.0], [80.0, 60.0], [80.0, 80.0], [0.0, 80.0]]",0,0 9 | "[[0.0, 0.0], [100.0, 0.0], [100.0, 100.0], [80.0, 100.0], [80.0, 20.0], [20.0, 20.0], [20.0, 100.0], [0.0, 100.0], [0.0, 0.0]]","[[100.0, 0.0], [100.0, 100.0], [0.0, 100.0], [0.0, 80.0], [80.0, 80.0], [80.0, 20.0], [0.0, 20.0], [0.0, 0.0], [100.0, 0.0]]","[[100.0, 100.0], [0.0, 100.0], [0.0, 0.0], [20.0, 0.0], [20.0, 80.0], [80.0, 80.0], [80.0, 0.0], [100.0, 0.0], [100.0, 100.0]]","[[0.0, 100.0], [0.0, 0.0], [100.0, 0.0], [100.0, 20.0], [20.0, 20.0], [20.0, 80.0], [100.0, 80.0], [100.0, 100.0], [0.0, 100.0]]",0,0 10 | "[[0.0, 0.0], [120.0, 0.0], [60.0, 120.0], [0.0, 0.0]]","[[120.0, 0.0], [120.0, 120.0], [0.0, 60.0], [120.0, 0.0]]","[[120.0, 120.0], [0.0, 120.0], [60.0, 0.0], [120.0, 120.0]]","[[0.0, 120.0], [0.0, 0.0], [120.0, 60.0], [0.0, 120.0]]",0,0 11 | "[[0.0, 0.0], [80.0, 0.0], [40.0, 80.0], [0.0, 0.0]]","[[80.0, 0.0], [80.0, 80.0], [0.0, 40.0], [80.0, 0.0]]","[[80.0, 80.0], [0.0, 80.0], [40.0, 0.0], [80.0, 80.0]]","[[0.0, 80.0], [0.0, 0.0], [80.0, 40.0], [0.0, 80.0]]",0,0 12 | "[[0.0, 100.0], [100.0, 0.0], [100.0, 100.0], [0.0, 100.0]]","[[0.0, 0.0], [100.0, 100.0], [0.0, 100.0], [0.0, 0.0]]","[[100.0, 0.0], [0.0, 100.0], [0.0, 0.0], [100.0, 0.0]]","[[100.0, 100.0], [0.0, 0.0], [100.0, 0.0], [100.0, 100.0]]",0,0 13 | "[[60.0, 0.0], [120.0, 80.0], [60.0, 160.0], [0.0, 80.0], [60.0, 0.0]]","[[140.0, 80.0], [60.0, 140.0], [-20.0, 80.0], [60.0, 20.0], [140.0, 80.0]]","[[60.0, 160.0], [0.0, 80.0], [60.0, 0.0], [120.0, 80.0], [60.0, 160.0]]","[[-20.0, 80.0], [60.0, 20.0], [140.0, 80.0], [60.0, 140.0], [-20.0, 80.0]]",1,1 14 | "[[60.0, 0.0], [120.0, 120.0], [0.0, 120.0], [60.0, 0.0]]","[[120.0, 60.0], [0.0, 120.0], [0.0, 0.0], [120.0, 60.0]]","[[60.0, 120.0], [0.0, 0.0], [120.0, 0.0], [60.0, 120.0]]","[[0.0, 60.0], [120.0, 0.0], [120.0, 120.0], [0.0, 60.0]]",0,0 15 | "[[0.0, 0.0], [80.0, 0.0], [40.0, 80.0], [0.0, 0.0]]","[[80.0, 0.0], [80.0, 80.0], [0.0, 40.0], [80.0, 0.0]]","[[80.0, 80.0], [0.0, 80.0], [40.0, 0.0], [80.0, 80.0]]","[[0.0, 80.0], [0.0, 0.0], [80.0, 40.0], [0.0, 80.0]]",0,0 16 | "[[50.0, 0.0], [100.0, 100.0], [0.0, 100.0], [50.0, 0.0]]","[[100.0, 50.0], [0.0, 100.0], [0.0, 0.0], [100.0, 50.0]]","[[50.0, 100.0], [0.0, 0.0], [100.0, 0.0], [50.0, 100.0]]","[[0.0, 50.0], [100.0, 0.0], [100.0, 100.0], [0.0, 50.0]]",0,0 17 | "[[40.0, 0.0], [80.0, 50.0], [40.0, 100.0], [0.0, 50.0], [40.0, 0.0]]","[[90.0, 50.0], [40.0, 90.0], [-10.0, 50.0], [40.0, 10.0], [90.0, 50.0]]","[[40.0, 100.0], [0.0, 50.0], [40.0, 0.0], [80.0, 50.0], [40.0, 100.0]]","[[-10.0, 50.0], [40.0, 10.0], [90.0, 50.0], [40.0, 90.0], [-10.0, 50.0]]",1,1 18 | "[[20.0, 0.0], [40.0, 0.0], [60.0, 20.0], [60.0, 40.0], [30.0, 60.0], [0.0, 40.0], [0.0, 20.0], [20.0, 0.0]]","[[60.0, 20.0], [60.0, 40.0], [40.0, 60.0], [20.0, 60.0], [0.0, 30.0], [20.0, 0.0], [40.0, 0.0], [60.0, 20.0]]","[[40.0, 60.0], [20.0, 60.0], [0.0, 40.0], [0.0, 20.0], [30.0, 0.0], [60.0, 20.0], [60.0, 40.0], [40.0, 60.0]]","[[0.0, 40.0], [0.0, 20.0], [20.0, 0.0], [40.0, 0.0], [60.0, 30.0], [40.0, 60.0], [20.0, 60.0], [0.0, 40.0]]",0,0 19 | "[[20.0, 0.0], [60.0, 0.0], [80.0, 20.0], [80.0, 60.0], [40.0, 80.0], [0.0, 60.0], [0.0, 20.0], [20.0, 0.0]]","[[80.0, 20.0], [80.0, 60.0], [60.0, 80.0], [20.0, 80.0], [0.0, 40.0], [20.0, 0.0], [60.0, 0.0], [80.0, 20.0]]","[[60.0, 80.0], [20.0, 80.0], [0.0, 60.0], [0.0, 20.0], [40.0, 0.0], [80.0, 20.0], [80.0, 60.0], [60.0, 80.0]]","[[0.0, 60.0], [0.0, 20.0], [20.0, 0.0], [60.0, 0.0], [80.0, 40.0], [60.0, 80.0], [20.0, 80.0], [0.0, 60.0]]",0,0 20 | "[[0.0, 0.0], [60.0, 0.0], [60.0, 30.0], [30.0, 30.0], [30.0, 60.0], [0.0, 60.0], [0.0, 0.0]]","[[60.0, 0.0], [60.0, 60.0], [30.0, 60.0], [30.0, 30.0], [0.0, 30.0], [0.0, 0.0], [60.0, 0.0]]","[[60.0, 60.0], [0.0, 60.0], [0.0, 30.0], [30.0, 30.0], [30.0, 0.0], [60.0, 0.0], [60.0, 60.0]]","[[0.0, 60.0], [0.0, 0.0], [30.0, 0.0], [30.0, 30.0], [60.0, 30.0], [60.0, 60.0], [0.0, 60.0]]",0,0 21 | "[[40.0, 0.0], [80.0, 0.0], [80.0, 80.0], [0.0, 80.0], [0.0, 40.0], [40.0, 40.0], [40.0, 0.0]]","[[80.0, 40.0], [80.0, 80.0], [0.0, 80.0], [0.0, 0.0], [40.0, 0.0], [40.0, 40.0], [80.0, 40.0]]","[[40.0, 80.0], [0.0, 80.0], [0.0, 0.0], [80.0, 0.0], [80.0, 40.0], [40.0, 40.0], [40.0, 80.0]]","[[0.0, 40.0], [0.0, 0.0], [80.0, 0.0], [80.0, 80.0], [40.0, 80.0], [40.0, 40.0], [0.0, 40.0]]",0,0 22 | "[[0.0, 0.0], [60.0, 0.0], [60.0, 30.0], [30.0, 30.0], [30.0, 60.0], [0.0, 60.0], [0.0, 0.0]]","[[60.0, 0.0], [60.0, 60.0], [30.0, 60.0], [30.0, 30.0], [0.0, 30.0], [0.0, 0.0], [60.0, 0.0]]","[[60.0, 60.0], [0.0, 60.0], [0.0, 30.0], [30.0, 30.0], [30.0, 0.0], [60.0, 0.0], [60.0, 60.0]]","[[0.0, 60.0], [0.0, 0.0], [30.0, 0.0], [30.0, 30.0], [60.0, 30.0], [60.0, 60.0], [0.0, 60.0]]",0,0 23 | "[[40.0, 0.0], [80.0, 0.0], [80.0, 80.0], [0.0, 80.0], [0.0, 40.0], [40.0, 40.0], [40.0, 0.0]]","[[80.0, 40.0], [80.0, 80.0], [0.0, 80.0], [0.0, 0.0], [40.0, 0.0], [40.0, 40.0], [80.0, 40.0]]","[[40.0, 80.0], [0.0, 80.0], [0.0, 0.0], [80.0, 0.0], [80.0, 40.0], [40.0, 40.0], [40.0, 80.0]]","[[0.0, 40.0], [0.0, 0.0], [80.0, 0.0], [80.0, 80.0], [40.0, 80.0], [40.0, 40.0], [0.0, 40.0]]",0,0 24 | "[[0.0, 0.0], [120.0, 0.0], [120.0, 120.0], [0.0, 120.0], [0.0, 0.0]]","[[120.0, 0.0], [120.0, 120.0], [0.0, 120.0], [0.0, 0.0], [120.0, 0.0]]","[[120.0, 120.0], [0.0, 120.0], [0.0, 0.0], [120.0, 0.0], [120.0, 120.0]]","[[0.0, 120.0], [0.0, 0.0], [120.0, 0.0], [120.0, 120.0], [0.0, 120.0]]",1,1 25 | "[[0.0, 0.0], [80.0, 0.0], [80.0, 80.0], [0.0, 80.0], [0.0, 0.0]]","[[80.0, 0.0], [80.0, 80.0], [0.0, 80.0], [0.0, 0.0], [80.0, 0.0]]","[[80.0, 80.0], [0.0, 80.0], [0.0, 0.0], [80.0, 0.0], [80.0, 80.0]]","[[0.0, 80.0], [0.0, 0.0], [80.0, 0.0], [80.0, 80.0], [0.0, 80.0]]",1,1 26 | "[[0.0, 0.0], [100.0, 0.0], [100.0, 100.0], [0.0, 100.0], [0.0, 0.0]]","[[100.0, 0.0], [100.0, 100.0], [0.0, 100.0], [0.0, 0.0], [100.0, 0.0]]","[[100.0, 100.0], [0.0, 100.0], [0.0, 0.0], [100.0, 0.0], [100.0, 100.0]]","[[0.0, 100.0], [0.0, 0.0], [100.0, 0.0], [100.0, 100.0], [0.0, 100.0]]",1,1 27 | -------------------------------------------------------------------------------- /data/mao.csv: -------------------------------------------------------------------------------- 1 | num,polygon 2 | 2,"[[10.0, 115.0], [478.0, 113.0], [727.0, 21.0], [856.0, 44.0], [930.0, 47.0], [1049.0, 0.0], [1097.0, 295.0], [1078.0, 396.0], [0.0, 407.0]]" 3 | 2,"[[0.0, 0.0], [316.0, 2.0], [316.0, 274.0], [0.0, 275.0]]" 4 | 4,"[[0.0, 1.0], [239.0, 0.0], [242.0, 80.0], [0.0, 78.0]]" 5 | 2,"[[0.0, 310.0], [0.0, 119.0], [384.0, 0.0], [384.0, 70.0], [759.0, 69.0], [758.0, 310.0]]" 6 | 2,"[[0.0, 252.0], [0.0, 75.0], [150.0, 0.0], [148.0, 175.0]]" 7 | 2,"[[852.0, 412.0], [503.0, 414.0], [387.0, 451.0], [355.0, 505.0], [300.0, 451.0], [45.0, 325.0], [0.0, 221.0], [0.0, 154.0], [55.0, 53.0], [145.0, 16.0], [329.0, 25.0], [407.0, 35.0], [539.0, 38.0], [597.0, 51.0], [668.0, 20.0], [736.0, 0.0], [784.0, 3.0], [849.0, 194.0]]" 8 | 2,"[[0.0, 232.0], [827.0, 0.0], [894.0, 20.0], [975.0, 258.0], [1097.0, 260.0], [1003.0, 500.0], [884.0, 463.0], [845.0, 453.0], [761.0, 490.0], [732.0, 547.0], [694.0, 544.0], [616.0, 477.0], [539.0, 414.0], [0.0, 426.0]]" 9 | 2,"[[151.0, 427.0], [97.0, 266.0], [0.0, 259.0], [75.0, 28.0], [126.0, 21.0], [191.0, 61.0], [271.0, 50.0], [316.0, 64.0], [359.0, 10.0], [436.0, 6.0], [442.0, 43.0], [694.0, 75.0], [726.0, 42.0], [1091.0, 0.0], [1094.0, 211.0], [1033.0, 208.0], [987.0, 346.0], [926.0, 393.0]]" 10 | 2,"[[0.0, 0.0], [745.0, 24.0], [619.0, 196.0], [590.0, 276.0], [522.0, 260.0], [6.0, 282.0]]" 11 | -------------------------------------------------------------------------------- /data/mao.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seanys/2D-Irregular-Packing-Algorithm/a2b9494be9b811e56dce5058fe29ff2a134e8403/data/mao.pdf -------------------------------------------------------------------------------- /data/mao_orientation.csv: -------------------------------------------------------------------------------- 1 | o_0,o_1,o_2,o_3,ver_sym,hori_sym 2 | "[[10.0, 115.0], [478.0, 113.0], [727.0, 21.0], [856.0, 44.0], [930.0, 47.0], [1049.0, 0.0], [1097.0, 295.0], [1078.0, 396.0], [0.0, 407.0], [10.0, 115.0]]","[[637.0, -335.0], [639.0, 133.0], [731.0, 382.0], [708.0, 511.0], [705.0, 585.0], [752.0, 704.0], [457.0, 752.0], [356.0, 733.0], [345.0, -345.0], [637.0, -335.0]]","[[1087.0, 292.0], [619.0, 294.0], [370.0, 386.0], [241.0, 363.0], [167.0, 360.0], [48.0, 407.0], [0.0, 112.0], [19.0, 11.0], [1097.0, 0.0], [1087.0, 292.0]]","[[460.0, 742.0], [458.0, 274.0], [366.0, 25.0], [389.0, -104.0], [392.0, -178.0], [345.0, -297.0], [640.0, -345.0], [741.0, -326.0], [752.0, 752.0], [460.0, 742.0]]",0,0 3 | "[[0.0, 0.0], [316.0, 2.0], [316.0, 274.0], [0.0, 275.0], [0.0, 0.0]]","[[295.5, -20.5], [293.5, 295.5], [21.5, 295.5], [20.5, -20.5], [295.5, -20.5]]","[[316.0, 275.0], [0.0, 273.0], [0.0, 1.0], [316.0, 0.0], [316.0, 275.0]]","[[20.5, 295.5], [22.5, -20.5], [294.5, -20.5], [295.5, 295.5], [20.5, 295.5]]",0,0 4 | "[[0.0, 1.0], [239.0, 0.0], [242.0, 80.0], [0.0, 78.0], [0.0, 1.0]]","[[160.0, -81.0], [161.0, 158.0], [81.0, 161.0], [83.0, -81.0], [160.0, -81.0]]","[[242.0, 79.0], [3.0, 80.0], [0.0, 0.0], [242.0, 2.0], [242.0, 79.0]]","[[82.0, 161.0], [81.0, -78.0], [161.0, -81.0], [159.0, 161.0], [82.0, 161.0]]",0,0 5 | "[[0.0, 310.0], [0.0, 119.0], [384.0, 0.0], [384.0, 70.0], [759.0, 69.0], [758.0, 310.0], [0.0, 310.0]]","[[224.5, -224.5], [415.5, -224.5], [534.5, 159.5], [464.5, 159.5], [465.5, 534.5], [224.5, 533.5], [224.5, -224.5]]","[[759.0, 0.0], [759.0, 191.0], [375.0, 310.0], [375.0, 240.0], [0.0, 241.0], [1.0, 0.0], [759.0, 0.0]]","[[534.5, 534.5], [343.5, 534.5], [224.5, 150.5], [294.5, 150.5], [293.5, -224.5], [534.5, -223.5], [534.5, 534.5]]",0,0 6 | "[[0.0, 252.0], [0.0, 75.0], [150.0, 0.0], [148.0, 175.0], [0.0, 252.0]]","[[-51.0, 51.0], [126.0, 51.0], [201.0, 201.0], [26.0, 199.0], [-51.0, 51.0]]","[[150.0, 0.0], [150.0, 177.0], [0.0, 252.0], [2.0, 77.0], [150.0, 0.0]]","[[201.0, 201.0], [24.0, 201.0], [-51.0, 51.0], [124.0, 53.0], [201.0, 201.0]]",0,0 7 | "[[852.0, 412.0], [503.0, 414.0], [387.0, 451.0], [355.0, 505.0], [300.0, 451.0], [45.0, 325.0], [0.0, 221.0], [0.0, 154.0], [55.0, 53.0], [145.0, 16.0], [329.0, 25.0], [407.0, 35.0], [539.0, 38.0], [597.0, 51.0], [668.0, 20.0], [736.0, 0.0], [784.0, 3.0], [849.0, 194.0], [852.0, 412.0]]","[[266.5, 678.5], [264.5, 329.5], [227.5, 213.5], [173.5, 181.5], [227.5, 126.5], [353.5, -128.5], [457.5, -173.5], [524.5, -173.5], [625.5, -118.5], [662.5, -28.5], [653.5, 155.5], [643.5, 233.5], [640.5, 365.5], [627.5, 423.5], [658.5, 494.5], [678.5, 562.5], [675.5, 610.5], [484.5, 675.5], [266.5, 678.5]]","[[0.0, 93.0], [349.0, 91.0], [465.0, 54.0], [497.0, 0.0], [552.0, 54.0], [807.0, 180.0], [852.0, 284.0], [852.0, 351.0], [797.0, 452.0], [707.0, 489.0], [523.0, 480.0], [445.0, 470.0], [313.0, 467.0], [255.0, 454.0], [184.0, 485.0], [116.0, 505.0], [68.0, 502.0], [3.0, 311.0], [0.0, 93.0]]","[[585.5, -173.5], [587.5, 175.5], [624.5, 291.5], [678.5, 323.5], [624.5, 378.5], [498.5, 633.5], [394.5, 678.5], [327.5, 678.5], [226.5, 623.5], [189.5, 533.5], [198.5, 349.5], [208.5, 271.5], [211.5, 139.5], [224.5, 81.5], [193.5, 10.5], [173.5, -57.5], [176.5, -105.5], [367.5, -170.5], [585.5, -173.5]]",0,0 8 | "[[0.0, 232.0], [827.0, 0.0], [894.0, 20.0], [975.0, 258.0], [1097.0, 260.0], [1003.0, 500.0], [884.0, 463.0], [845.0, 453.0], [761.0, 490.0], [732.0, 547.0], [694.0, 544.0], [616.0, 477.0], [539.0, 414.0], [0.0, 426.0], [0.0, 232.0]]","[[590.0, -275.0], [822.0, 552.0], [802.0, 619.0], [564.0, 700.0], [562.0, 822.0], [322.0, 728.0], [359.0, 609.0], [369.0, 570.0], [332.0, 486.0], [275.0, 457.0], [278.0, 419.0], [345.0, 341.0], [408.0, 264.0], [396.0, -275.0], [590.0, -275.0]]","[[1097.0, 315.0], [270.0, 547.0], [203.0, 527.0], [122.0, 289.0], [0.0, 287.0], [94.0, 47.0], [213.0, 84.0], [252.0, 94.0], [336.0, 57.0], [365.0, 0.0], [403.0, 3.0], [481.0, 70.0], [558.0, 133.0], [1097.0, 121.0], [1097.0, 315.0]]","[[507.0, 822.0], [275.0, -5.0], [295.0, -72.0], [533.0, -153.0], [535.0, -275.0], [775.0, -181.0], [738.0, -62.0], [728.0, -23.0], [765.0, 61.0], [822.0, 90.0], [819.0, 128.0], [752.0, 206.0], [689.0, 283.0], [701.0, 822.0], [507.0, 822.0]]",0,0 9 | "[[151.0, 427.0], [97.0, 266.0], [0.0, 259.0], [75.0, 28.0], [126.0, 21.0], [191.0, 61.0], [271.0, 50.0], [316.0, 64.0], [359.0, 10.0], [436.0, 6.0], [442.0, 43.0], [694.0, 75.0], [726.0, 42.0], [1091.0, 0.0], [1094.0, 211.0], [1033.0, 208.0], [987.0, 346.0], [926.0, 393.0], [151.0, 427.0]]","[[333.5, -182.5], [494.5, -236.5], [501.5, -333.5], [732.5, -258.5], [739.5, -207.5], [699.5, -142.5], [710.5, -62.5], [696.5, -17.5], [750.5, 25.5], [754.5, 102.5], [717.5, 108.5], [685.5, 360.5], [718.5, 392.5], [760.5, 757.5], [549.5, 760.5], [552.5, 699.5], [414.5, 653.5], [367.5, 592.5], [333.5, -182.5]]","[[943.0, 0.0], [997.0, 161.0], [1094.0, 168.0], [1019.0, 399.0], [968.0, 406.0], [903.0, 366.0], [823.0, 377.0], [778.0, 363.0], [735.0, 417.0], [658.0, 421.0], [652.0, 384.0], [400.0, 352.0], [368.0, 385.0], [3.0, 427.0], [0.0, 216.0], [61.0, 219.0], [107.0, 81.0], [168.0, 34.0], [943.0, 0.0]]","[[760.5, 609.5], [599.5, 663.5], [592.5, 760.5], [361.5, 685.5], [354.5, 634.5], [394.5, 569.5], [383.5, 489.5], [397.5, 444.5], [343.5, 401.5], [339.5, 324.5], [376.5, 318.5], [408.5, 66.5], [375.5, 34.5], [333.5, -330.5], [544.5, -333.5], [541.5, -272.5], [679.5, -226.5], [726.5, -165.5], [760.5, 609.5]]",0,0 10 | "[[0.0, 0.0], [745.0, 24.0], [619.0, 196.0], [590.0, 276.0], [522.0, 260.0], [6.0, 282.0], [0.0, 0.0]]","[[513.5, -231.5], [489.5, 513.5], [317.5, 387.5], [237.5, 358.5], [253.5, 290.5], [231.5, -225.5], [513.5, -231.5]]","[[745.0, 282.0], [0.0, 258.0], [126.0, 86.0], [155.0, 6.0], [223.0, 22.0], [739.0, 0.0], [745.0, 282.0]]","[[231.5, 513.5], [255.5, -231.5], [427.5, -105.5], [507.5, -76.5], [491.5, -8.5], [513.5, 507.5], [231.5, 513.5]]",0,0 11 | -------------------------------------------------------------------------------- /data/marques.csv: -------------------------------------------------------------------------------- 1 | num,polygon 2 | 4,"[[0.0, 0.0], [21.0, 0.0], [21.0, 22.0], [14.0, 28.0], [7.0, 28.0], [0.0, 22.0]]" 3 | 4,"[[0.0, 5.0], [2.0, 0.0], [11.0, 2.0], [19.0, 0.0], [21.0, 5.0], [17.0, 4.0], [11.0, 6.0], [4.0, 4.0]]" 4 | 2,"[[0.0, 0.0], [33.0, 0.0], [33.0, 14.0], [30.0, 14.0], [26.0, 17.0], [13.0, 15.0], [0.0, 17.0]]" 5 | 2,"[[0.0, 0.0], [4.0, 0.0], [4.0, 39.0], [0.0, 39.0]]" 6 | 4,"[[0.0, 0.0], [10.0, 0.0], [10.0, 11.0], [0.0, 11.0]]" 7 | 4,"[[2.0, 20.0], [0.0, 18.0], [2.0, 10.0], [0.0, 2.0], [2.0, 0.0], [4.0, 10.0], [2.0, 20.0]]" 8 | 2,"[[0.0, 0.0], [29.0, 0.0], [27.0, 12.0], [29.0, 22.0], [25.0, 26.0], [25.0, 33.0], [18.0, 37.0], [16.0, 35.0], [14.0, 35.0], [12.0, 37.0], [4.0, 34.0], [4.0, 26.0], [0.0, 22.0], [2.0, 12.0]]" 9 | 2,"[[0.0, 0.0], [33.0, 0.0], [37.0, 6.0], [35.0, 13.0], [28.0, 13.0], [25.0, 15.0], [14.0, 13.0], [0.0, 15.0]]" -------------------------------------------------------------------------------- /data/marques.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seanys/2D-Irregular-Packing-Algorithm/a2b9494be9b811e56dce5058fe29ff2a134e8403/data/marques.pdf -------------------------------------------------------------------------------- /data/marques_orientation.csv: -------------------------------------------------------------------------------- 1 | o_0,o_1,o_2,o_3,ver_sym,hori_sym 2 | "[[0.0, 0.0], [210.0, 0.0], [210.0, 220.0], [140.0, 280.0], [70.0, 280.0], [0.0, 220.0], [0.0, 0.0]]","[[245.0, 35.0], [245.0, 245.0], [25.0, 245.0], [-35.0, 175.0], [-35.0, 105.0], [25.0, 35.0], [245.0, 35.0]]","[[210.0, 280.0], [0.0, 280.0], [0.0, 60.0], [70.0, 0.0], [140.0, 0.0], [210.0, 60.0], [210.0, 280.0]]","[[-35.0, 245.0], [-35.0, 35.0], [185.0, 35.0], [245.0, 105.0], [245.0, 175.0], [185.0, 245.0], [-35.0, 245.0]]",0,0 3 | "[[0.0, 50.0], [20.0, 0.0], [110.0, 20.0], [190.0, 0.0], [210.0, 50.0], [170.0, 40.0], [110.0, 60.0], [40.0, 40.0], [0.0, 50.0]]","[[85.0, -75.0], [135.0, -55.0], [115.0, 35.0], [135.0, 115.0], [85.0, 135.0], [95.0, 95.0], [75.0, 35.0], [95.0, -35.0], [85.0, -75.0]]","[[210.0, 10.0], [190.0, 60.0], [100.0, 40.0], [20.0, 60.0], [0.0, 10.0], [40.0, 20.0], [100.0, 0.0], [170.0, 20.0], [210.0, 10.0]]","[[125.0, 135.0], [75.0, 115.0], [95.0, 25.0], [75.0, -55.0], [125.0, -75.0], [115.0, -35.0], [135.0, 25.0], [115.0, 95.0], [125.0, 135.0]]",0,0 4 | "[[0.0, 0.0], [330.0, 0.0], [330.0, 140.0], [300.0, 140.0], [260.0, 170.0], [130.0, 150.0], [0.0, 170.0], [0.0, 0.0]]","[[250.0, -80.0], [250.0, 250.0], [110.0, 250.0], [110.0, 220.0], [80.0, 180.0], [100.0, 50.0], [80.0, -80.0], [250.0, -80.0]]","[[330.0, 170.0], [0.0, 170.0], [0.0, 30.0], [30.0, 30.0], [70.0, 0.0], [200.0, 20.0], [330.0, 0.0], [330.0, 170.0]]","[[80.0, 250.0], [80.0, -80.0], [220.0, -80.0], [220.0, -50.0], [250.0, -10.0], [230.0, 120.0], [250.0, 250.0], [80.0, 250.0]]",0,0 5 | "[[0.0, 0.0], [40.0, 0.0], [40.0, 390.0], [0.0, 390.0], [0.0, 0.0]]","[[215.0, 175.0], [215.0, 215.0], [-175.0, 215.0], [-175.0, 175.0], [215.0, 175.0]]","[[40.0, 390.0], [0.0, 390.0], [0.0, 0.0], [40.0, 0.0], [40.0, 390.0]]","[[-175.0, 215.0], [-175.0, 175.0], [215.0, 175.0], [215.0, 215.0], [-175.0, 215.0]]",1,1 6 | "[[0.0, 0.0], [100.0, 0.0], [100.0, 110.0], [0.0, 110.0], [0.0, 0.0]]","[[105.0, 5.0], [105.0, 105.0], [-5.0, 105.0], [-5.0, 5.0], [105.0, 5.0]]","[[100.0, 110.0], [0.0, 110.0], [0.0, 0.0], [100.0, 0.0], [100.0, 110.0]]","[[-5.0, 105.0], [-5.0, 5.0], [105.0, 5.0], [105.0, 105.0], [-5.0, 105.0]]",1,1 7 | "[[20.0, 200.0], [0.0, 180.0], [20.0, 100.0], [0.0, 20.0], [20.0, 0.0], [40.0, 100.0], [20.0, 200.0]]","[[-80.0, 100.0], [-60.0, 80.0], [20.0, 100.0], [100.0, 80.0], [120.0, 100.0], [20.0, 120.0], [-80.0, 100.0]]","[[20.0, 0.0], [40.0, 20.0], [20.0, 100.0], [40.0, 180.0], [20.0, 200.0], [0.0, 100.0], [20.0, 0.0]]","[[120.0, 100.0], [100.0, 120.0], [20.0, 100.0], [-60.0, 120.0], [-80.0, 100.0], [20.0, 80.0], [120.0, 100.0]]",0,0 8 | "[[0.0, 0.0], [290.0, 0.0], [270.0, 120.0], [290.0, 220.0], [250.0, 260.0], [250.0, 330.0], [180.0, 370.0], [160.0, 350.0], [140.0, 350.0], [120.0, 370.0], [40.0, 340.0], [40.0, 260.0], [0.0, 220.0], [20.0, 120.0], [0.0, 0.0]]","[[330.0, 40.0], [330.0, 330.0], [210.0, 310.0], [110.0, 330.0], [70.0, 290.0], [0.0, 290.0], [-40.0, 220.0], [-20.0, 200.0], [-20.0, 180.0], [-40.0, 160.0], [-10.0, 80.0], [70.0, 80.0], [110.0, 40.0], [210.0, 60.0], [330.0, 40.0]]","[[290.0, 370.0], [0.0, 370.0], [20.0, 250.0], [0.0, 150.0], [40.0, 110.0], [40.0, 40.0], [110.0, 0.0], [130.0, 20.0], [150.0, 20.0], [170.0, 0.0], [250.0, 30.0], [250.0, 110.0], [290.0, 150.0], [270.0, 250.0], [290.0, 370.0]]","[[-40.0, 330.0], [-40.0, 40.0], [80.0, 60.0], [180.0, 40.0], [220.0, 80.0], [290.0, 80.0], [330.0, 150.0], [310.0, 170.0], [310.0, 190.0], [330.0, 210.0], [300.0, 290.0], [220.0, 290.0], [180.0, 330.0], [80.0, 310.0], [-40.0, 330.0]]",0,0 9 | "[[0.0, 0.0], [330.0, 0.0], [370.0, 60.0], [350.0, 130.0], [280.0, 130.0], [250.0, 150.0], [140.0, 130.0], [0.0, 150.0], [0.0, 0.0]]","[[260.0, -110.0], [260.0, 220.0], [200.0, 260.0], [130.0, 240.0], [130.0, 170.0], [110.0, 140.0], [130.0, 30.0], [110.0, -110.0], [260.0, -110.0]]","[[370.0, 150.0], [40.0, 150.0], [0.0, 90.0], [20.0, 20.0], [90.0, 20.0], [120.0, 0.0], [230.0, 20.0], [370.0, 0.0], [370.0, 150.0]]","[[110.0, 260.0], [110.0, -70.0], [170.0, -110.0], [240.0, -90.0], [240.0, -20.0], [260.0, 10.0], [240.0, 120.0], [260.0, 260.0], [110.0, 260.0]]",0,0 10 | -------------------------------------------------------------------------------- /data/shapes.csv: -------------------------------------------------------------------------------- 1 | num,polygon 2 | 15,"[[0.0, 0.0], [2.0, 0.0], [2.0, 3.0], [12.0, 3.0], [12.0, 0.0], [14.0, 0.0], [14.0, 5.0], [0.0, 5.0]]" 3 | 7,"[[0.0, 0.0], [6.0, -6.0], [12.0, 0.0], [6.0, 6.0]]" 4 | 9,"[[0.0, 0.0], [6.0, 0.0], [6.0, -2.0], [7.0, -2.0], [11.0, 2.0], [11.0, 4.0], [8.0, 4.0], [8.0, 1.0], [2.0, 1.0], [2.0, 4.0], [0.0, 4.0]]" 5 | 12,"[[0,0],[2,0],[2,-2],[4,-2],[4,0],[6,0],[6,2],[4,2],[4,4],[2,4],[2,2],[0,2]]" -------------------------------------------------------------------------------- /data/shapes.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seanys/2D-Irregular-Packing-Algorithm/a2b9494be9b811e56dce5058fe29ff2a134e8403/data/shapes.pdf -------------------------------------------------------------------------------- /data/shapes0.csv: -------------------------------------------------------------------------------- 1 | num,polygon,clock_polygon 2 | 15,"[[0.0, 0.0], [2.0, 0.0], [2.0, 3.0], [12.0, 3.0], [12.0, 0.0], [14.0, 0.0], [14.0, 5.0], [0.0, 5.0]]","[[0.0, 5.0], [14.0, 5.0], [14.0, 0.0], [12.0, 0.0], [12.0, 3.0], [2.0, 3.0], [2.0, 0.0], [0.0, 0.0]]" 3 | 7,"[[0.0, 0.0], [6.0, -6.0], [12.0, 0.0], [6.0, 6.0]]","[[6.0, 6.0], [12.0, 0.0], [6.0, -6.0], [0.0, 0.0]]" 4 | 9,"[[0.0, 0.0], [6.0, 0.0], [6.0, -2.0], [7.0, -2.0], [11.0, 2.0], [11.0, 4.0], [8.0, 4.0], [8.0, 1.0], [2.0, 1.0], [2.0, 4.0], [0.0, 4.0]]","[[0.0, 4.0], [2.0, 4.0], [2.0, 1.0], [8.0, 1.0], [8.0, 4.0], [11.0, 4.0], [11.0, 2.0], [7.0, -2.0], [6.0, -2.0], [6.0, 0.0], [0.0, 0.0]]" 5 | 12,"[[0, 0], [2, 0], [2, -2], [4, -2], [4, 0], [6, 0], [6, 2], [4, 2], [4, 4], [2, 4], [2, 2], [0, 2]]","[[0, 2], [2, 2], [2, 4], [4, 4], [4, 2], [6, 2], [6, 0], [4, 0], [4, -2], [2, -2], [2, 0], [0, 0]]" 6 | -------------------------------------------------------------------------------- /data/shapes0_orientation.csv: -------------------------------------------------------------------------------- 1 | o_0 2 | "[[0.0, 0.0], [40.0, 0.0], [40.0, 60.0], [240.0, 60.0], [240.0, 0.0], [280.0, 0.0], [280.0, 100.0], [0.0, 100.0], [0.0, 0.0]]" 3 | "[[0.0, 0.0], [120.0, -120.0], [240.0, 0.0], [120.0, 120.0], [0.0, 0.0]]" 4 | "[[0.0, 0.0], [120.0, 0.0], [120.0, -40.0], [140.0, -40.0], [220.0, 40.0], [220.0, 80.0], [160.0, 80.0], [160.0, 20.0], [40.0, 20.0], [40.0, 80.0], [0.0, 80.0], [0.0, 0.0]]" 5 | "[[0.0, 0.0], [40.0, 0.0], [40.0, -40.0], [80.0, -40.0], [80.0, 0.0], [120.0, 0.0], [120.0, 40.0], [80.0, 40.0], [80.0, 80.0], [40.0, 80.0], [40.0, 40.0], [0.0, 40.0], [0.0, 0.0]]" -------------------------------------------------------------------------------- /data/shapes1.csv: -------------------------------------------------------------------------------- 1 | num,polygon,clock_polygon 2 | 15,"[[0.0, 0.0], [2.0, 0.0], [2.0, 3.0], [12.0, 3.0], [12.0, 0.0], [14.0, 0.0], [14.0, 5.0], [0.0, 5.0]]","[[0.0, 5.0], [14.0, 5.0], [14.0, 0.0], [12.0, 0.0], [12.0, 3.0], [2.0, 3.0], [2.0, 0.0], [0.0, 0.0]]" 3 | 7,"[[0.0, 0.0], [6.0, -6.0], [12.0, 0.0], [6.0, 6.0]]","[[6.0, 6.0], [12.0, 0.0], [6.0, -6.0], [0.0, 0.0]]" 4 | 9,"[[0.0, 0.0], [6.0, 0.0], [6.0, -2.0], [7.0, -2.0], [11.0, 2.0], [11.0, 4.0], [8.0, 4.0], [8.0, 1.0], [2.0, 1.0], [2.0, 4.0], [0.0, 4.0]]","[[0.0, 4.0], [2.0, 4.0], [2.0, 1.0], [8.0, 1.0], [8.0, 4.0], [11.0, 4.0], [11.0, 2.0], [7.0, -2.0], [6.0, -2.0], [6.0, 0.0], [0.0, 0.0]]" 5 | 12,"[[0, 0], [2, 0], [2, -2], [4, -2], [4, 0], [6, 0], [6, 2], [4, 2], [4, 4], [2, 4], [2, 2], [0, 2]]","[[0, 2], [2, 2], [2, 4], [4, 4], [4, 2], [6, 2], [6, 0], [4, 0], [4, -2], [2, -2], [2, 0], [0, 0]]" 6 | -------------------------------------------------------------------------------- /data/shapes1_orientation.csv: -------------------------------------------------------------------------------- 1 | o_0,o_1,ver_sym 2 | "[[0.0, 0.0], [40.0, 0.0], [40.0, 60.0], [240.0, 60.0], [240.0, 0.0], [280.0, 0.0], [280.0, 100.0], [0.0, 100.0], [0.0, 0.0]]","[[280.0, 100.0], [240.0, 100.0], [240.0, 40.0], [40.0, 40.0], [40.0, 100.0], [0.0, 100.0], [0.0, 0.0], [280.0, 0.0], [280.0, 100.0]]",0 3 | "[[0.0, 0.0], [120.0, -120.0], [240.0, 0.0], [120.0, 120.0], [0.0, 0.0]]","[[240.0, 0.0], [120.0, 120.0], [0.0, 0.0], [120.0, -120.0], [240.0, 0.0]]",1 4 | "[[0.0, 0.0], [120.0, 0.0], [120.0, -40.0], [140.0, -40.0], [220.0, 40.0], [220.0, 80.0], [160.0, 80.0], [160.0, 20.0], [40.0, 20.0], [40.0, 80.0], [0.0, 80.0], [0.0, 0.0]]","[[220.0, 40.0], [100.0, 40.0], [100.0, 80.0], [80.0, 80.0], [0.0, 0.0], [0.0, -40.0], [60.0, -40.0], [60.0, 20.0], [180.0, 20.0], [180.0, -40.0], [220.0, -40.0], [220.0, 40.0]]",0 5 | "[[0.0, 0.0], [40.0, 0.0], [40.0, -40.0], [80.0, -40.0], [80.0, 0.0], [120.0, 0.0], [120.0, 40.0], [80.0, 40.0], [80.0, 80.0], [40.0, 80.0], [40.0, 40.0], [0.0, 40.0], [0.0, 0.0]]","[[120.0, 40.0], [80.0, 40.0], [80.0, 80.0], [40.0, 80.0], [40.0, 40.0], [0.0, 40.0], [0.0, 0.0], [40.0, 0.0], [40.0, -40.0], [80.0, -40.0], [80.0, 0.0], [120.0, 0.0], [120.0, 40.0]]",1 6 | -------------------------------------------------------------------------------- /data/shirts.csv: -------------------------------------------------------------------------------- 1 | polygon 2 | "[[0.0, 0.0], [7.0, 1.0], [7.0, 5.0], [0.0, 7.0], [-1.0, 5.0], [-1.0, 4.0], [-2.0, 3.0], [-1.0, 2.0]]" 3 | "[[0.0, 0.0], [11.0, 0.0], [12.0, 2.0], [11.0, 3.0], [11.0, 5.0], [10.0, 6.0], [6.0, 5.0], [3.0, 6.0], [0.0, 5.0], [-1.0, 3.0]]" 4 | "[[0.0, 0.0], [3.0, 0.0], [3.0, -1.0], [5.0, 0.0], [8.0, 0.0], [11.0, -1.0], [12.0, 4.0], [11.0, 8.0], [7.0, 7.0], [0.0, 7.0]]" 5 | "[[0.0, 0.0], [4.0, 0.0], [4.0, 2.0], [3.0, 3.0], [0.0, 3.0]]" 6 | "[[0.0, 0.0], [8.0, 0.0], [7.0, 1.0], [1.0, 1.0]]" 7 | "[[0.0, 0.0], [4.0, 0.0], [4.0, 1.0], [0.0, 1.0]]" 8 | "[[0.0, 0.0], [3.0, 0.0], [3.0, 1.0], [0.0, 1.0]]" 9 | -------------------------------------------------------------------------------- /data/shirts.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seanys/2D-Irregular-Packing-Algorithm/a2b9494be9b811e56dce5058fe29ff2a134e8403/data/shirts.pdf -------------------------------------------------------------------------------- /data/shirts_orientation.csv: -------------------------------------------------------------------------------- 1 | o_0,o_1,ver_sym 2 | "[[0.0, 0.0], [140.0, 20.0], [140.0, 100.0], [0.0, 140.0], [-20.0, 100.0], [-20.0, 80.0], [-40.0, 60.0], [-20.0, 40.0], [0.0, 0.0]]","[[100.0, 140.0], [-40.0, 120.0], [-40.0, 40.0], [100.0, 0.0], [120.0, 40.0], [120.0, 60.0], [140.0, 80.0], [120.0, 100.0], [100.0, 140.0]]",0 3 | "[[0.0, 0.0], [220.0, 0.0], [240.0, 40.0], [220.0, 60.0], [220.0, 100.0], [200.0, 120.0], [120.0, 100.0], [60.0, 120.0], [0.0, 100.0], [-20.0, 60.0], [0.0, 0.0]]","[[220.0, 120.0], [0.0, 120.0], [-20.0, 80.0], [0.0, 60.0], [0.0, 20.0], [20.0, 0.0], [100.0, 20.0], [160.0, 0.0], [220.0, 20.0], [240.0, 60.0], [220.0, 120.0]]",0 4 | "[[0.0, 0.0], [60.0, 0.0], [60.0, -20.0], [100.0, 0.0], [160.0, 0.0], [220.0, -20.0], [240.0, 80.0], [220.0, 160.0], [140.0, 140.0], [0.0, 140.0], [0.0, 0.0]]","[[240.0, 140.0], [180.0, 140.0], [180.0, 160.0], [140.0, 140.0], [80.0, 140.0], [20.0, 160.0], [0.0, 60.0], [20.0, -20.0], [100.0, 0.0], [240.0, 0.0], [240.0, 140.0]]",0 5 | "[[0.0, 0.0], [80.0, 0.0], [80.0, 40.0], [60.0, 60.0], [0.0, 60.0], [0.0, 0.0]]","[[80.0, 60.0], [0.0, 60.0], [0.0, 20.0], [20.0, 0.0], [80.0, 0.0], [80.0, 60.0]]",0 6 | "[[0.0, 0.0], [160.0, 0.0], [140.0, 20.0], [20.0, 20.0], [0.0, 0.0]]","[[160.0, 20.0], [0.0, 20.0], [20.0, 0.0], [140.0, 0.0], [160.0, 20.0]]",0 7 | "[[0.0, 0.0], [80.0, 0.0], [80.0, 20.0], [0.0, 20.0], [0.0, 0.0]]","[[80.0, 20.0], [0.0, 20.0], [0.0, 0.0], [80.0, 0.0], [80.0, 20.0]]",1 8 | "[[0.0, 0.0], [60.0, 0.0], [60.0, 20.0], [0.0, 20.0], [0.0, 0.0]]","[[60.0, 20.0], [0.0, 20.0], [0.0, 0.0], [60.0, 0.0], [60.0, 20.0]]",1 9 | "[[0.0, 0.0], [160.0, 0.0], [160.0, 40.0], [120.0, 40.0], [80.0, 20.0], [60.0, 20.0], [40.0, 40.0], [-20.0, 40.0], [0.0, 0.0]]","[[140.0, 40.0], [-20.0, 40.0], [-20.0, 0.0], [20.0, 0.0], [60.0, 20.0], [80.0, 20.0], [100.0, 0.0], [160.0, 0.0], [140.0, 40.0]]",0 10 | -------------------------------------------------------------------------------- /data/simple.csv: -------------------------------------------------------------------------------- 1 | num,polygon 2 | 1,"[[1050.0, 750.0], [600.0, 1009], [650, 490]]" 3 | 1,"[[800.0, 450.0], [1009, 700], [503, 949]]" 4 | 1,"[[900, 960.0], [608, 900], [750.0, 550.0]]" -------------------------------------------------------------------------------- /data/swim.csv: -------------------------------------------------------------------------------- 1 | polygon 2 | "[[0.0, 0.0], [-5.0, -321.0], [1.0, -642.0], [151.0, -660.0], [259.0, -691.0], [423.0, -738.0], [547.0, -770.0], [680.0, -801.0], [858.0, -837.0], [988.0, -682.0], [1075.0, -620.0], [1211.0, -553.0], [1319.0, -527.0], [1481.0, -526.0], [1597.0, -540.0], [1737.0, -564.0], [1719.0, -440.0], [1708.0, -317.0], [1718.0, -194.0], [1736.0, -70.0], [1596.0, -95.0], [1480.0, -109.0], [1318.0, -109.0], [1210.0, -83.0], [1074.0, -17.0], [986.0, 45.0], [856.0, 199.0], [678.0, 162.0], [545.0, 131.0], [421.0, 98.0], [257.0, 50.0], [149.0, 19.0]]" 3 | "[[0.0, 0.0], [8.0, -148.0], [26.962264, -299.698113], [68.443477, -462.432101], [179.0, -449.0], [288.0, -446.0], [401.0, -463.0], [548.0, -497.0], [764.01571, -545.561671], [805.0, -350.0], [887.0, -196.0], [755.0, -176.0], [655.0, -155.0], [523.0, -121.0], [272.0, -52.0], [117.453306, -11.877301]]" 4 | "[[-159.0, -185.0], [-328.0, -228.0], [-474.0, -262.0], [-694.846154, -307.571429], [-806.645161, -359.478111], [-532.0, -384.0], [-408.0, -400.0], [-215.0, -443.0], [-77.0, -501.0], [130.0, -620.0], [264.0, -589.0], [477.871841, -543.849278], [652.512195, -485.041812], [766.0, -431.0], [893.0, -362.0], [1115.0, -258.0], [1125.0, -131.0], [1133.0, -7.0], [940.0, 23.0], [792.0, 45.0], [680.0, 59.0], [524.0, 70.0], [357.526316, 70.0], [181.0, 44.0], [0.952833, 4.181876]]" 5 | "[[0.0, 0.0], [8.0, -172.0], [309.0, -166.0], [484.0, -165.0], [616.0, -167.0], [718.0, -172.0], [876.0, -194.0], [1031.0, -248.0], [1351.454902, -111.096798], [1209.0, -57.0], [1048.970624, -6.821297], [909.0, 16.0], [785.0, 26.0], [668.0, 29.0], [511.0, 26.0], [213.0, 14.0]]" 6 | "[[0.0, 0.0], [33.96, -142.915], [77.0, -268.0], [89.0, -388.0], [-826.0, -439.0], [-824.0, -598.0], [39.0, -607.0], [169.0, -650.0], [209.0, -800.0], [251.0, -940.0], [371.0, -924.0], [354.0, -726.0], [348.0, -610.0], [350.0, -412.0], [360.0, -264.0], [382.0, -94.0], [488.691229, 232.112814], [352.0, 54.0], [217.0, 0.0]]" 7 | "[[0.0, -7.222222], [129.8, -36.066667], [306.884615, 22.961538], [495.0, 110.0], [616.0, 172.0], [737.0, 238.0], [855.0, 290.0], [959.0, 313.0], [1071.0, 306.0], [1275.0, 255.0], [1260.0, 394.0], [1250.0, 499.0], [1260.0, 606.0], [1275.0, 745.0], [1071.0, 694.0], [959.0, 687.0], [855.0, 710.0], [737.0, 762.0], [616.0, 828.0], [495.0, 890.0], [306.884615, 977.038462], [129.8, 1036.066667], [0.0, 1007.222222]]" 8 | "[[0.0, 0.0], [-4.0, -123.0], [-8.0, -291.0], [-17.0, -454.0], [-40.0, -620.0], [119.0, -619.0], [246.0, -538.0], [352.0, -501.0], [492.0, -458.0], [647.0, -416.0], [766.0, -369.0], [913.0, -302.0], [1061.0, -224.0], [1046.0, -100.0], [1037.0, 2.0], [1061.0, 224.0], [913.0, 302.0], [766.0, 369.0], [647.0, 416.0], [492.0, 458.0], [352.0, 501.0], [246.0, 538.0], [119.0, 619.0], [-40.0, 620.0], [-17.0, 454.0], [-8.0, 291.0], [-4.0, 123.0]]" 9 | "[[-76.0, -85.0], [-178.0, -200.0], [-270.0, -306.0], [-412.0, -374.0], [-958.0, -383.0], [-954.0, -543.0], [-366.0, -560.0], [-269.0, -659.0], [-90.0, -708.0], [-4.0, -539.0], [40.0, -443.0], [94.0, -312.0], [140.238095, -190.31746], [189.0, -42.0], [4.52434, 5.060117]]" 10 | "[[-135.873563, -80.448276], [-238.052817, -203.06338], [-240.878156, -366.933041], [-197.360681, -485.880805], [-114.328444, -625.617985], [-32.885135, -555.033784], [58.285714, -445.0], [118.142857, -305.333333], [108.699029, -151.084142], [7.1138, 13.387181]]" 11 | -------------------------------------------------------------------------------- /data/swim.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seanys/2D-Irregular-Packing-Algorithm/a2b9494be9b811e56dce5058fe29ff2a134e8403/data/swim.pdf -------------------------------------------------------------------------------- /data/swim_clus.csv: -------------------------------------------------------------------------------- 1 | no,num,polygon 2 | 1,3,"[[0.0, 0.0], [-5.0, -321.0], [1.0, -642.0], [151.0, -660.0], [259.0, -691.0], [423.0, -738.0], [547.0, -770.0], [680.0, -801.0], [858.0, -837.0], [988.0, -682.0], [1075.0, -620.0], [1211.0, -553.0], [1319.0, -527.0], [1481.0, -526.0], [1597.0, -540.0], [1737.0, -564.0], [1719.0, -440.0], [1708.0, -317.0], [1718.0, -194.0], [1736.0, -70.0], [1596.0, -95.0], [1480.0, -109.0], [1318.0, -109.0], [1210.0, -83.0], [1074.0, -17.0], [986.0, 45.0], [856.0, 199.0], [678.0, 162.0], [545.0, 131.0], [421.0, 98.0], [257.0, 50.0], [149.0, 19.0]]" 3 | 2,6,"[[0.0, 0.0], [8.0, -148.0], [26.962264, -299.698113], [68.443477, -462.432101], [179.0, -449.0], [288.0, -446.0], [401.0, -463.0], [548.0, -497.0], [764.01571, -545.561671], [805.0, -350.0], [887.0, -196.0], [755.0, -176.0], [655.0, -155.0], [523.0, -121.0], [272.0, -52.0], [117.453306, -11.877301]]" 4 | 3,6,"[[-159.0, -185.0], [-328.0, -228.0], [-474.0, -262.0], [-694.846154, -307.571429], [-806.645161, -359.478111], [-532.0, -384.0], [-408.0, -400.0], [-215.0, -443.0], [-77.0, -501.0], [130.0, -620.0], [264.0, -589.0], [477.871841, -543.849278], [652.512195, -485.041812], [766.0, -431.0], [893.0, -362.0], [1115.0, -258.0], [1125.0, -131.0], [1133.0, -7.0], [940.0, 23.0], [792.0, 45.0], [680.0, 59.0], [524.0, 70.0], [357.526316, 70.0], [181.0, 44.0], [0.952833, 4.181876]]" 5 | 4,6,"[[0.0, 0.0], [8.0, -172.0], [309.0, -166.0], [484.0, -165.0], [616.0, -167.0], [718.0, -172.0], [876.0, -194.0], [1031.0, -248.0], [1351.454902, -111.096798], [1209.0, -57.0], [1048.970624, -6.821297], [909.0, 16.0], [785.0, 26.0], [668.0, 29.0], [511.0, 26.0], [213.0, 14.0]]" 6 | 5,6,"[[0.0, 0.0], [33.96, -142.915], [77.0, -268.0], [89.0, -388.0], [-826.0, -439.0], [-824.0, -598.0], [39.0, -607.0], [169.0, -650.0], [209.0, -800.0], [251.0, -940.0], [371.0, -924.0], [354.0, -726.0], [348.0, -610.0], [350.0, -412.0], [360.0, -264.0], [382.0, -94.0], [488.691229, 232.112814], [352.0, 54.0], [217.0, 0.0]]" 7 | 6,3,"[[0.0, -7.222222], [129.8, -36.066667], [306.884615, 22.961538], [495.0, 110.0], [616.0, 172.0], [737.0, 238.0], [855.0, 290.0], [959.0, 313.0], [1071.0, 306.0], [1275.0, 255.0], [1260.0, 394.0], [1250.0, 499.0], [1260.0, 606.0], [1275.0, 745.0], [1071.0, 694.0], [959.0, 687.0], [855.0, 710.0], [737.0, 762.0], [616.0, 828.0], [495.0, 890.0], [306.884615, 977.038462], [129.8, 1036.066667], [0.0, 1007.222222]]" 8 | 7+10,3,"[[1250.5645993720927, 706.7133251428572], [1121.9534883720928, 628.1928571428572], [1018.9534883720928, 586.1928571428573], [915.9534883720928, 571.1928571428573], [752.9534883720929, 587.1928571428572], [635.9534883720928, 610.1928571428572], [435.95348837209286, 655.1928571428572], [396.9534883720928, 487.1928571428572], [352.0, 501.0], [246.0, 538.0], [119.0, 619.0], [-40.0, 620.0], [-17.0, 454.00000000000006], [-8.0, 291.0], [-4.0, 123.0], [0.0, 0.0], [-4.0, -123.0], [-8.0, -291.0], [-17.0, -454.00000000000006], [-40.0, -620.0], [119.0, -619.0], [246.0, -538.0], [352.0, -501.0], [394.9534883720928, -487.8071428571428], [432.95348837209275, -655.8071428571428], [632.9534883720928, -611.8071428571427], [750.9534883720928, -588.8071428571429], [913.9534883720928, -573.8071428571429], [1016.9534883720928, -588.8071428571429], [1118.9534883720928, -631.8071428571427], [1245.5417233720927, -709.0925918571428], [1432.375175372093, -789.725975857143], [1744.953488372093, -719.8071428571428], [1695.9534883720928, -510.8071428571428], [1673.953488372093, -363.80714285714294], [1666.9534883720928, -142.80714285714282], [1667.953488372093, -2.8071428571428214], [1667.953488372093, 137.19285714285718], [1671.9534883720928, 285.1928571428572], [1682.953488372093, 421.1928571428572], [1747.953488372093, 714.1928571428572], [1441.800995372093, 787.2339131428572]]" 9 | 8,6,"[[-76.0, -85.0], [-178.0, -200.0], [-270.0, -306.0], [-412.0, -374.0], [-958.0, -383.0], [-954.0, -543.0], [-366.0, -560.0], [-269.0, -659.0], [-90.0, -708.0], [-4.0, -539.0], [40.0, -443.0], [94.0, -312.0], [140.238095, -190.31746], [189.0, -42.0], [4.52434, 5.060117]]" 10 | 9,6,"[[-135.873563, -80.448276], [-238.052817, -203.06338], [-240.878156, -366.933041], [-197.360681, -485.880805], [-114.328444, -625.617985], [-32.885135, -555.033784], [58.285714, -445.0], [118.142857, -305.333333], [108.699029, -151.084142], [7.1138, 13.387181]]" 11 | -------------------------------------------------------------------------------- /data/trousers.csv: -------------------------------------------------------------------------------- 1 | polygon 2 | "[[0.0, 0.0], [12.0, -1.0], [14.0, -3.0], [24.0, 0.0], [33.0, 1.0], [59.0, 2.0], [59.0, 13.0], [4.0, 13.0], [4.0, 8.0], [2.0, 5.0], [0.0, 5.0]]" 3 | "[[0.0, 0.0], [0.0, -14.0], [27.0, -17.0], [37.0, -20.0], [41.0, -22.0], [47.0, -19.0], [56.0, -16.0], [56.0, 0.0]]" 4 | "[[0.0, 0.0], [57.0, 0.0], [57.0, 5.0], [0.0, 5.0]]" 5 | "[[0.0, 0.0], [52.0, 0.0], [52.0, 5.0], [0.0, 5.0]]" 6 | "[[0.0, 0.0], [44.0, 0.0], [44.0, 5.0], [0.0, 5.0]]" 7 | "[[0.0, 0.0], [42.0, 0.0], [42.0, 5.0], [0.0, 5.0]]" 8 | "[[0.0, 0.0], [21.0, 0.0], [21.0, 2.0], [0.0, 2.0]]" 9 | "[[0.0, 0.0], [15.0, 4.0], [13.0, 7.0], [0.0, 6.0]]" 10 | "[[0.0, 0.0], [15.0, 1.0], [15.0, 4.0], [0.0, 4.0]]" 11 | "[[0.0, 0.0], [14.0, 0.0], [14.0, 5.0], [0.0, 5.0]]" 12 | "[[0.0, 0.0], [14.0, 1.0], [14.0, 4.0], [0.0, 4.0]]" 13 | "[[0.0, 0.0], [13.0, 0.0], [13.0, 5.0], [0.0, 5.0]]" 14 | "[[0.0, 0.0], [13.0, 1.0], [13.0, 4.0], [0.0, 4.0]]" 15 | "[[0.0, 0.0], [12.0, 0.0], [12.0, 5.0], [0.0, 5.0]]" 16 | "[[0.0, 0.0], [4.0, 2.0], [6.0, 10.0], [4.0, 11.0], [-4.0, 11.0], [-6.0, 10.0], [-4.0, 2.0]]" 17 | "[[0.0, 0.0], [3.0, -2.0], [8.0, 0.0], [8.0, 8.0], [2.0, 8.0]]" 18 | -------------------------------------------------------------------------------- /data/trousers.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seanys/2D-Irregular-Packing-Algorithm/a2b9494be9b811e56dce5058fe29ff2a134e8403/data/trousers.pdf -------------------------------------------------------------------------------- /data/trousers_orientation.csv: -------------------------------------------------------------------------------- 1 | o_0,o_1,ver_sym 2 | "[[0.0, 0.0], [120.0, -10.0], [140.0, -30.0], [240.0, 0.0], [330.0, 10.0], [590.0, 20.0], [590.0, 130.0], [40.0, 130.0], [40.0, 80.0], [20.0, 50.0], [0.0, 50.0], [0.0, 0.0]]","[[590.0, 100.0], [470.0, 110.0], [450.0, 130.0], [350.0, 100.0], [260.0, 90.0], [0.0, 80.0], [0.0, -30.0], [550.0, -30.0], [550.0, 20.0], [570.0, 50.0], [590.0, 50.0], [590.0, 100.0]]",0 3 | "[[0.0, 0.0], [0.0, -140.0], [270.0, -170.0], [370.0, -200.0], [410.0, -220.0], [470.0, -190.0], [560.0, -160.0], [560.0, 0.0], [0.0, 0.0]]","[[560.0, -220.0], [560.0, -80.0], [290.0, -50.0], [190.0, -20.0], [150.0, 0.0], [90.0, -30.0], [0.0, -60.0], [0.0, -220.0], [560.0, -220.0]]",0 4 | "[[0.0, 0.0], [570.0, 0.0], [570.0, 50.0], [0.0, 50.0], [0.0, 0.0]]","[[570.0, 50.0], [0.0, 50.0], [0.0, 0.0], [570.0, 0.0], [570.0, 50.0]]",1 5 | "[[0.0, 0.0], [520.0, 0.0], [520.0, 50.0], [0.0, 50.0], [0.0, 0.0]]","[[520.0, 50.0], [0.0, 50.0], [0.0, 0.0], [520.0, 0.0], [520.0, 50.0]]",1 6 | "[[0.0, 0.0], [440.0, 0.0], [440.0, 50.0], [0.0, 50.0], [0.0, 0.0]]","[[440.0, 50.0], [0.0, 50.0], [0.0, 0.0], [440.0, 0.0], [440.0, 50.0]]",1 7 | "[[0.0, 0.0], [420.0, 0.0], [420.0, 50.0], [0.0, 50.0], [0.0, 0.0]]","[[420.0, 50.0], [0.0, 50.0], [0.0, 0.0], [420.0, 0.0], [420.0, 50.0]]",1 8 | "[[0.0, 0.0], [210.0, 0.0], [210.0, 20.0], [0.0, 20.0], [0.0, 0.0]]","[[210.0, 20.0], [0.0, 20.0], [0.0, 0.0], [210.0, 0.0], [210.0, 20.0]]",1 9 | "[[0.0, 0.0], [150.0, 40.0], [130.0, 70.0], [0.0, 60.0], [0.0, 0.0]]","[[150.0, 70.0], [0.0, 30.0], [20.0, 0.0], [150.0, 10.0], [150.0, 70.0]]",0 10 | "[[0.0, 0.0], [150.0, 10.0], [150.0, 40.0], [0.0, 40.0], [0.0, 0.0]]","[[150.0, 40.0], [0.0, 30.0], [0.0, 0.0], [150.0, 0.0], [150.0, 40.0]]",0 11 | "[[0.0, 0.0], [140.0, 0.0], [140.0, 50.0], [0.0, 50.0], [0.0, 0.0]]","[[140.0, 50.0], [0.0, 50.0], [0.0, 0.0], [140.0, 0.0], [140.0, 50.0]]",1 12 | "[[0.0, 0.0], [140.0, 10.0], [140.0, 40.0], [0.0, 40.0], [0.0, 0.0]]","[[140.0, 40.0], [0.0, 30.0], [0.0, 0.0], [140.0, 0.0], [140.0, 40.0]]",0 13 | "[[0.0, 0.0], [130.0, 0.0], [130.0, 50.0], [0.0, 50.0], [0.0, 0.0]]","[[130.0, 50.0], [0.0, 50.0], [0.0, 0.0], [130.0, 0.0], [130.0, 50.0]]",1 14 | "[[0.0, 0.0], [130.0, 10.0], [130.0, 40.0], [0.0, 40.0], [0.0, 0.0]]","[[130.0, 40.0], [0.0, 30.0], [0.0, 0.0], [130.0, 0.0], [130.0, 40.0]]",0 15 | "[[0.0, 0.0], [120.0, 0.0], [120.0, 50.0], [0.0, 50.0], [0.0, 0.0]]","[[120.0, 50.0], [0.0, 50.0], [0.0, 0.0], [120.0, 0.0], [120.0, 50.0]]",1 16 | "[[0.0, 0.0], [40.0, 20.0], [60.0, 100.0], [40.0, 110.0], [-40.0, 110.0], [-60.0, 100.0], [-40.0, 20.0], [0.0, 0.0]]","[[0.0, 110.0], [-40.0, 90.0], [-60.0, 10.0], [-40.0, 0.0], [40.0, 0.0], [60.0, 10.0], [40.0, 90.0], [0.0, 110.0]]",0 17 | "[[0.0, 0.0], [30.0, -20.0], [80.0, 0.0], [80.0, 80.0], [20.0, 80.0], [0.0, 0.0]]","[[80.0, 60.0], [50.0, 80.0], [0.0, 60.0], [0.0, -20.0], [60.0, -20.0], [80.0, 60.0]]",0 18 | "[[0.0, 0.0], [20.0, 10.0], [30.0, 60.0], [20.0, 70.0], [-20.0, 70.0], [-30.0, 60.0], [-20.0, 10.0], [0.0, 0.0]]","[[0.0, 70.0], [-20.0, 60.0], [-30.0, 10.0], [-20.0, 0.0], [20.0, 0.0], [30.0, 10.0], [20.0, 60.0], [0.0, 70.0]]",0 19 | -------------------------------------------------------------------------------- /figs/1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seanys/2D-Irregular-Packing-Algorithm/a2b9494be9b811e56dce5058fe29ff2a134e8403/figs/1.jpg -------------------------------------------------------------------------------- /nfp_test.py: -------------------------------------------------------------------------------- 1 | import json 2 | from tools.geofunc import GeoFunc 3 | from tools.nfp import NFP 4 | import pandas as pd 5 | 6 | # 计算NFP然后寻找最合适位置 7 | def tryNFP(): 8 | df = pd.read_csv("data/blaz1.csv") 9 | 10 | poly1=json.loads(df['polygon'][1]) 11 | poly2=json.loads(df['polygon'][4]) 12 | GeoFunc.normData(poly1,50) 13 | GeoFunc.normData(poly2,50) 14 | GeoFunc.slidePoly(poly1,500,500) 15 | 16 | nfp=NFP(poly1,poly2,show=True) 17 | print(nfp.nfp) 18 | 19 | if __name__ == '__main__': 20 | # PlacePolygons(getData()) 21 | tryNFP() -------------------------------------------------------------------------------- /readme_en.md: -------------------------------------------------------------------------------- 1 | # 2D-Irregular-Packing-Algorithm 2 | Realize 2D irregular packing algorithm in python 3 | -------------------------------------------------------------------------------- /record/best_result/albano.csv: -------------------------------------------------------------------------------- 1 | ratio,width,total_area,polys 2 | 89.03,980,1706271.4,"[[[600.0, 483.60668633235014], [406.79999999999995, 472.40668633235015], [203.39999999999998, 500.8066863323501], [163.0, 453.2066863323501], [53.19999999999993, 457.40668633235015], [0.0, 347.40668633235015], [36.19999999999993, 320.8066863323501], [36.19999999999993, 228.80668633235013], [0.0, 202.2066863323501], [53.19999999999993, 92.2066863323501], [163.0, 96.40668633235009], [203.39999999999998, 48.806686332350125], [406.79999999999995, 77.2066863323501], [600.0, 66.00668633235011], [600.0, 483.60668633235014]], [[1951.162334679159, 650.7955828799734], [1757.9623346791589, 639.5955828799733], [1554.562334679159, 667.9955828799733], [1514.162334679159, 620.3955828799733], [1404.3623346791587, 624.5955828799733], [1351.162334679159, 514.5955828799733], [1387.3623346791587, 487.9955828799733], [1387.3623346791587, 395.9955828799733], [1351.162334679159, 369.3955828799733], [1404.3623346791587, 259.3955828799733], [1514.162334679159, 263.5955828799733], [1554.562334679159, 215.9955828799733], [1757.9623346791589, 244.3955828799733], [1951.162334679159, 233.1955828799733], [1951.162334679159, 650.7955828799734]], [[912.183180987203, 927.7999999999998], [1518.983180987203, 927.7999999999998], [1518.983180987203, 979.9999999999999], [912.183180987203, 979.9999999999999], [912.183180987203, 927.7999999999998]], [[684.8209703335966, 0.0], [1291.6209703335967, 0.0], [1291.6209703335967, 52.2], [684.8209703335966, 52.2], [684.8209703335966, 0.0]], [[599.9898980717281, 86.79999999999998], [952.1898980717282, 52.19999999999999], [1036.5898980717282, 182.2], [1036.5898980717282, 254.2], [952.1898980717282, 384.2], [599.9898980717281, 349.6], [599.9898980717281, 86.79999999999998]], [[1351.162334679159, 620.5039908552475], [998.962334679159, 655.1039908552475], [914.562334679159, 525.1039908552475], [914.562334679159, 453.1039908552475], [998.962334679159, 323.1039908552475], [1351.162334679159, 357.70399085524747], [1351.162334679159, 620.5039908552475]], [[1518.8771001882506, 680.7529605906453], [1871.0771001882506, 646.1529605906453], [1955.4771001882505, 776.1529605906453], [1955.4771001882505, 848.1529605906453], [1871.0771001882506, 978.1529605906453], [1518.8771001882506, 943.5529605906454], [1518.8771001882506, 680.7529605906453]], [[547.0644590604104, 550.8000000000001], [899.2644590604104, 516.2], [983.6644590604104, 646.2], [983.6644590604104, 718.2], [899.2644590604104, 848.2], [547.0644590604104, 813.6000000000001], [547.0644590604104, 550.8000000000001]], [[451.7153430729696, 483.52731235992474], [610.9153430729696, 507.32731235992475], [770.1153430729696, 483.52731235992474], [784.9153430729696, 508.52731235992474], [610.9153430729696, 544.5273123599247], [436.91534307296956, 508.52731235992474], [451.7153430729696, 483.52731235992474]], [[933.2, 427.11573900554765], [774.0, 403.31573900554764], [614.8, 427.11573900554765], [600.0, 402.11573900554765], [774.0, 366.11573900554765], [948.0, 402.11573900554765], [933.2, 427.11573900554765]], [[1527.074320619405, 678.0463385917484], [1367.874320619405, 654.2463385917484], [1208.6743206194049, 678.0463385917484], [1193.874320619405, 653.0463385917484], [1367.874320619405, 617.0463385917484], [1541.874320619405, 653.0463385917484], [1527.074320619405, 678.0463385917484]], [[359.8035790292489, 61.0], [200.60357902924892, 37.2], [41.403579029248874, 61.0], [26.60357902924892, 36.0], [200.60357902924892, 0.0], [374.6035790292489, 36.0], [359.8035790292489, 61.0]], [[1337.967489654619, 322.7304629749615], [1255.7674896546189, 309.7304629749615], [1177.967489654619, 322.7304629749615], [1100.167489654619, 309.7304629749615], [1017.9674896546189, 322.7304629749615], [1037.967489654619, 249.13046297496146], [1177.967489654619, 265.53046297496144], [1317.967489654619, 249.13046297496146], [1337.967489654619, 322.7304629749615]], [[600.0, 425.14237217137685], [682.2, 438.14237217137685], [760.0, 425.14237217137685], [837.8, 438.14237217137685], [920.0, 425.14237217137685], [900.0, 498.74237217137687], [760.0, 482.34237217137684], [620.0, 498.74237217137687], [600.0, 425.14237217137685]], [[1090.2684154781143, 184.0], [1172.4684154781144, 197.0], [1250.2684154781143, 184.0], [1328.0684154781143, 197.0], [1410.2684154781143, 184.0], [1390.2684154781143, 257.6], [1250.2684154781143, 241.2], [1110.2684154781143, 257.6], [1090.2684154781143, 184.0]], [[364.8209703335966, 0.0], [447.0209703335966, 13.0], [524.8209703335966, 0.0], [602.6209703335967, 13.0], [684.8209703335966, 0.0], [664.8209703335966, 73.60000000000001], [524.8209703335966, 57.2], [384.8209703335966, 73.60000000000001], [364.8209703335966, 0.0]], [[724.983180987203, 848.2], [912.1831809872031, 848.2], [912.1831809872031, 980.0], [724.983180987203, 980.0], [724.983180987203, 848.2]], [[1223.0684154781143, 52.19999999999999], [1410.2684154781143, 52.19999999999999], [1410.2684154781143, 184.0], [1223.0684154781143, 184.0], [1223.0684154781143, 52.19999999999999]], [[537.783180987203, 848.2], [724.983180987203, 848.2], [724.983180987203, 980.0], [537.783180987203, 980.0], [537.783180987203, 848.2]], [[1036.6, 52.19999999999999], [1223.8, 52.19999999999999], [1223.8, 184.0], [1036.6, 184.0], [1036.6, 52.19999999999999]], [[11.200000000000001, 491.00000000000006], [213.20000000000002, 505.00000000000006], [378.20000000000005, 476.40000000000003], [437.20000000000005, 534.0], [514.6, 524.6], [535.2, 661.6], [518.8000000000001, 749.6], [0.0, 749.6], [11.200000000000001, 491.00000000000006]], [[994.9831809872029, 669.1999999999999], [1196.9831809872028, 683.1999999999999], [1361.983180987203, 654.5999999999999], [1420.983180987203, 712.1999999999999], [1498.3831809872029, 702.8], [1518.983180987203, 839.8], [1502.583180987203, 927.8], [983.7831809872029, 927.8], [994.9831809872029, 669.1999999999999]], [[1410.268415478112, 1.9895196601282805e-13], [1910.068415478112, 1.9895196601282805e-13], [1951.268415478112, 77.4000000000002], [1934.668415478112, 186.8000000000002], [1839.8684154781122, 193.4000000000002], [1794.268415478112, 230.4000000000002], [1622.468415478112, 211.8000000000002], [1410.268415478112, 225.0000000000002], [1410.268415478112, 1.9895196601282805e-13]], [[0.0, 749.6], [499.8, 749.6], [541.0, 827.0], [524.4, 936.4000000000001], [429.6, 943.0], [384.0, 980.0], [212.20000000000002, 961.4000000000001], [0.0, 974.6], [0.0, 749.6]]]" 3 | 4 | -------------------------------------------------------------------------------- /record/best_result/best_result.csv: -------------------------------------------------------------------------------- 1 | set_name,ratio,polys_type,orientation,polys 2 | 107,"jakobs1_clus", 0.1, 1,"[0, 1, 2, 3]","jakobs1_clus实验结果检验", 800, 172800.0, 23,"[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22]","[0, 1, 2, 0, 0, 2, 2, 0, 0, 3, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0]","[[[0.0, 180.0], [40.0, 180.0], [0.0, 220.0], [0.0, 180.0]], [[240.0, 0.0], [240.0, 60.0], [180.0, 0.0], [240.0, 0.0]], [[240.0, 260.0], [160.0, 260.0], [240.0, 180.0], [240.0, 260.0]], [[242.42424242424244, 399.95734289499785], [242.42424242424244, 499.95734289499785], [142.42424242424244, 499.95734289499785], [242.42424242424244, 399.95734289499785]], [[109.55213892219976, 323.1130634730287], [229.55213892219976, 263.1130634730287], [229.55213892219976, 323.1130634730287], [109.55213892219976, 323.1130634730287]], [[220.0, 260.0], [80.0, 340.0], [80.0, 260.0], [220.0, 260.0]], [[199.71600103769902, 599.9573428949979], [99.71600103769902, 599.9573428949979], [99.71600103769902, 539.9573428949979], [139.71600103769902, 539.9573428949979], [139.71600103769902, 499.95734289499785], [199.71600103769902, 499.95734289499785], [199.71600103769902, 599.9573428949979]], [[0.0, 579.9573428949979], [80.0, 579.9573428949979], [80.0, 599.9573428949979], [40.0, 599.9573428949979], [40.0, 659.9573428949979], [0.0, 659.9573428949979], [0.0, 579.9573428949979]], [[42.424242424242436, 599.9573428949979], [242.42424242424244, 599.9573428949979], [242.42424242424244, 799.9573428949979], [42.424242424242436, 799.9573428949979], [42.424242424242436, 599.9573428949979]], [[0.0, 759.9573428949979], [0.0, 659.9573428949979], [40.0, 659.9573428949979], [40.0, 699.9573428949979], [20.0, 699.9573428949979], [20.0, 759.9573428949979], [0.0, 759.9573428949979]], [[40.0, 700.0], [40.0, 780.0], [0.0, 780.0], [0.0, 760.0], [20.0, 760.0], [20.0, 700.0], [40.0, 700.0]], [[0.0, 60.0], [120.0, 60.0], [120.0, 140.0], [160.0, 140.0], [160.0, 180.0], [200.0, 180.0], [200.0, 220.0], [160.0, 220.0], [160.0, 260.0], [120.0, 260.0], [120.0, 220.0], [80.0, 220.0], [80.0, 180.0], [0.0, 180.0], [0.0, 60.0]], [[0.0, 479.95734289499785], [100.0, 479.95734289499785], [100.0, 579.9573428949979], [0.0, 579.9573428949979], [0.0, 479.95734289499785]], [[0.0, 300.0], [80.0, 300.0], [80.0, 380.0], [0.0, 380.0], [0.0, 300.0]], [[200.0, 140.0], [220.0, 140.0], [220.0, 160.0], [240.0, 160.0], [240.0, 180.0], [220.0, 180.0], [220.0, 200.0], [200.0, 200.0], [200.0, 180.0], [180.0, 180.0], [180.0, 160.0], [200.0, 160.0], [200.0, 140.0]], [[40.0, 180.0], [80.0, 180.0], [80.0, 220.0], [120.0, 220.0], [120.0, 260.0], [80.0, 260.0], [80.0, 300.0], [40.0, 300.0], [40.0, 260.0], [0.0, 260.0], [0.0, 220.0], [40.0, 220.0], [40.0, 180.0]], [[119.71600103769902, 443.1130634730288], [139.71600103769902, 443.1130634730288], [139.71600103769902, 463.1130634730288], [159.71600103769902, 463.1130634730288], [159.71600103769902, 483.1130634730288], [139.71600103769902, 483.1130634730288], [139.71600103769902, 503.1130634730288], [119.71600103769902, 503.1130634730288], [119.71600103769902, 483.1130634730288], [99.71600103769902, 483.1130634730288], [99.71600103769902, 463.1130634730288], [119.71600103769902, 463.1130634730288], [119.71600103769902, 443.1130634730288]], [[0.0, 0.0], [120.0, 0.0], [120.0, 60.0], [0.0, 60.0], [0.0, 0.0]], [[80.0, 380.0], [80.0, 400.0], [0.0, 400.0], [0.0, 380.0], [80.0, 380.0]], [[239.99999999999994, 499.95734289499785], [239.99999999999994, 599.9573428949979], [199.99999999999994, 599.9573428949979], [199.99999999999994, 499.95734289499785], [239.99999999999994, 499.95734289499785]], [[160.0, 20.0], [200.0, 20.0], [240.0, 60.0], [240.0, 100.0], [200.0, 140.0], [160.0, 140.0], [120.0, 100.0], [120.0, 60.0], [160.0, 20.0]], [[139.71600103769902, 323.1130634730288], [199.71600103769902, 323.1130634730288], [239.71600103769902, 363.1130634730288], [239.71600103769902, 403.1130634730288], [199.71600103769902, 443.1130634730288], [139.71600103769902, 443.1130634730288], [79.71600103769902, 403.1130634730288], [79.71600103769902, 363.1130634730288], [139.71600103769902, 323.1130634730288]], [[0.0, 432.2333543345214], [40.0, 412.2333543345214], [80.0, 412.2333543345214], [120.0, 432.2333543345214], [120.0, 452.2333543345214], [80.0, 472.2333543345214], [40.0, 472.2333543345214], [0.0, 452.2333543345214], [0.0, 432.2333543345214]]]" 3 | -------------------------------------------------------------------------------- /record/best_result/fu.csv: -------------------------------------------------------------------------------- 1 | ratio,width,total_area,polys 2 | 89.59,760,433200,"[[[436.2039891376836, 560.0], [636.2039891376836, 560.0], [636.2039891376836, 760.0], [436.2039891376836, 760.0], [436.2039891376836, 560.0]], [[236.2039891376836, 560.0], [436.2039891376836, 560.0], [436.2039891376836, 760.0], [236.2039891376836, 760.0], [236.2039891376836, 560.0]], [[460.0, 0.0], [460.0, 280.0], [280.0, 280.0], [280.0, 0.0], [460.0, 0.0]], [[280.0, 280.0], [280.0, 560.0], [140.0, 420.0], [280.0, 280.0]], [[280.0, 280.0], [460.0, 280.0], [280.0, 560.0], [280.0, 280.0]], [[0.0, 0.0], [280.0, 0.0], [280.0, 280.0], [0.0, 280.0], [0.0, 0.0]], [[440.04842615012103, 329.8789346246974], [520.048426150121, 129.87893462469742], [620.048426150121, 129.87893462469742], [620.048426150121, 329.8789346246974], [440.04842615012103, 329.8789346246974]], [[636.2039891376836, 0.0], [636.2039891376836, 100.0], [456.2039891376836, 100.0], [456.2039891376836, 0.0], [636.2039891376836, 0.0]], [[0.0, 560.0], [0.0, 280.0], [280.0, 280.0], [0.0, 560.0]], [[200.0, 760.0], [0.0, 760.0], [0.0, 560.0], [200.0, 480.0], [200.0, 760.0]], [[613.3817594834545, 329.8789346246974], [533.3817594834545, 489.8789346246974], [453.3817594834545, 329.8789346246974], [613.3817594834545, 329.8789346246974]], [[574.2857142857143, 560.0], [294.28571428571433, 560.0], [434.28571428571433, 320.0], [574.2857142857143, 560.0]]]" 3 | 89.41,760,433200,"[[[0.0, 280.0], [200.0, 280.0], [200.0, 480.0], [0.0, 480.0], [0.0, 280.0]], [[437.50402565643435, 560.0], [637.5040256564344, 560.0], [637.5040256564344, 760.0], [437.50402565643435, 760.0], [437.50402565643435, 560.0]], [[180.0, 480.0], [180.0, 760.0], [0.0, 760.0], [0.0, 480.0], [180.0, 480.0]], [[209.64573261173882, 507.85829304469553], [489.6457326117388, 507.85829304469553], [349.6457326117388, 647.8582930446955], [209.64573261173882, 507.85829304469553]], [[637.5040256564345, 560.0], [457.50402565643446, 560.0], [637.5040256564345, 280.0], [637.5040256564345, 560.0]], [[0.0, 0.0], [280.0, 0.0], [280.0, 280.0], [0.0, 280.0], [0.0, 0.0]], [[180.0, 580.0], [380.0, 660.0], [380.0, 760.0], [180.0, 760.0], [180.0, 580.0]], [[587.7441656724012, 230.24014001596674], [587.7441656724012, 330.24014001596674], [407.7441656724012, 330.24014001596674], [407.7441656724012, 230.24014001596674], [587.7441656724012, 230.24014001596674]], [[357.50402565643446, 0.0], [637.5040256564345, 0.0], [637.5040256564345, 280.0], [357.50402565643446, 0.0]], [[200.0, 507.85829304469553], [200.0, 307.85829304469553], [400.0, 307.85829304469553], [480.0, 507.85829304469553], [200.0, 507.85829304469553]], [[568.9527387885084, 330.24014001596674], [488.9527387885085, 490.24014001596674], [408.9527387885085, 330.24014001596674], [568.9527387885084, 330.24014001596674]], [[278.5752625299376, 301.07123687350315], [278.5752625299376, 21.071236873503153], [518.5752625299376, 161.07123687350315], [278.5752625299376, 301.07123687350315]]]" 4 | 89.34,760,433200,"[[[0.0, 200.0], [200.0, 200.0], [200.0, 400.0], [0.0, 400.0], [0.0, 200.0]], [[437.99145041576867, 0.0], [637.9914504157687, 0.0], [637.9914504157687, 200.0], [437.99145041576867, 200.0], [437.99145041576867, 0.0]], [[100.0, 580.0], [380.0, 580.0], [380.0, 760.0], [100.0, 760.0], [100.0, 580.0]], [[200.0, 440.0], [200.0, 160.0], [340.0, 300.0], [200.0, 440.0]], [[633.1221463142977, 760.0], [453.12214631429765, 760.0], [633.1221463142977, 480.0], [633.1221463142977, 760.0]], [[353.12214631429765, 200.0], [633.1221463142977, 200.0], [633.1221463142977, 480.0], [353.12214631429765, 480.0], [353.12214631429765, 200.0]], [[0.0, 20.0], [200.0, 100.0], [200.0, 200.0], [0.0, 200.0], [0.0, 20.0]], [[0.0, 580.0], [100.0, 580.0], [100.0, 760.0], [0.0, 760.0], [0.0, 580.0]], [[340.0, 300.0], [340.0, 580.0], [60.0, 580.0], [340.0, 300.0]], [[440.0, 0.0], [440.0, 200.0], [240.0, 200.0], [160.0, 0.0], [440.0, 0.0]], [[160.0, 400.0], [80.0, 560.0], [0.0, 400.0], [160.0, 400.0]], [[338.8364320285833, 480.0000000000001], [618.8364320285833, 480.0000000000001], [478.8364320285833, 720.0000000000001], [338.8364320285833, 480.0000000000001]]]" 5 | 89.07,760,433200,"[[[0.0, 560.0], [200.0, 560.0], [200.0, 760.0], [0.0, 760.0], [0.0, 560.0]], [[200.0, 560.0], [400.0, 560.0], [400.0, 760.0], [200.0, 760.0], [200.0, 560.0]], [[359.9479826719672, 0.0], [639.9479826719672, 0.0], [639.9479826719672, 180.0], [359.9479826719672, 180.0], [359.9479826719672, 0.0]], [[339.9479826719672, 220.0], [59.947982671967225, 220.0], [199.94798267196722, 80.0], [339.9479826719672, 220.0]], [[359.9479826719672, 220.0], [359.9479826719672, 400.0], [79.94798267196722, 220.0], [359.9479826719672, 220.0]], [[359.9479826719672, 180.0], [639.9479826719672, 180.0], [639.9479826719672, 460.0], [359.9479826719672, 460.0], [359.9479826719672, 180.0]], [[180.0, 280.0], [100.0, 480.0], [0.0, 480.0], [0.0, 280.0], [180.0, 280.0]], [[580.0, 660.0], [580.0, 760.0], [400.0, 760.0], [400.0, 660.0], [580.0, 660.0]], [[0.0, 280.0], [0.0, 0.0], [280.0, 0.0], [0.0, 280.0]], [[639.9479826719672, 460.0], [639.9479826719672, 660.0], [439.9479826719672, 660.0], [359.9479826719672, 460.0], [639.9479826719672, 460.0]], [[359.9479826719672, 160.0], [199.94798267196722, 80.0], [359.9479826719672, 0.0], [359.9479826719672, 160.0]], [[333.3333333333334, 560.0], [53.33333333333343, 560.0], [193.33333333333343, 320.0], [333.3333333333334, 560.0]]]" 6 | 90.30,760,433200,"[[[431.18904347297973, 560.0], [631.1890434729797, 560.0], [631.1890434729797, 760.0], [431.18904347297973, 760.0], [431.18904347297973, 560.0]], [[431.18904347297973, 357.4051787357463], [631.1890434729797, 357.4051787357463], [631.1890434729797, 557.4051787357463], [431.18904347297973, 557.4051787357463], [431.18904347297973, 357.4051787357463]], [[404.48979591836735, 480.0], [404.48979591836735, 760.0], [224.48979591836735, 760.0], [224.48979591836735, 480.0], [404.48979591836735, 480.0]], [[435.0, 125.0], [435.0, 405.0], [295.0, 265.0], [435.0, 125.0]], [[280.0, 280.0], [280.0, 460.0], [0.0, 280.0], [280.0, 280.0]], [[0.0, 0.0], [280.0, 0.0], [280.0, 280.0], [0.0, 280.0], [0.0, 0.0]], [[451.18904347297973, 228.81095652702027], [531.1890434729797, 28.810956527020267], [631.1890434729797, 28.810956527020267], [631.1890434729797, 228.81095652702027], [451.18904347297973, 228.81095652702027]], [[615.0, 228.81095652702027], [615.0, 328.81095652702027], [435.0, 328.81095652702027], [435.0, 228.81095652702027], [615.0, 228.81095652702027]], [[280.0, 280.0], [280.0, 0.0], [560.0, 0.0], [280.0, 280.0]], [[224.48979591836735, 760.0], [24.48979591836735, 760.0], [24.48979591836735, 560.0], [224.48979591836735, 480.0], [224.48979591836735, 760.0]], [[270.0, 480.0], [350.0, 320.0], [430.0, 480.0], [270.0, 480.0]], [[0.0, 574.2857142857143], [0.0, 294.28571428571433], [240.0, 434.28571428571433], [0.0, 574.2857142857143]]]" 7 | 90.79,760,433200,"[[[147.80899731555246, 172.19100268444754], [347.80899731555246, 172.19100268444754], [347.80899731555246, 372.19100268444754], [147.80899731555246, 372.19100268444754], [147.80899731555246, 172.19100268444754]], [[0.0, 560.0], [200.0, 560.0], [200.0, 760.0], [0.0, 760.0], [0.0, 560.0]], [[380.0, 480.0], [380.0, 760.0], [200.0, 760.0], [200.0, 480.0], [380.0, 480.0]], [[147.80899731555246, 132.19100268444754], [147.80899731555246, 412.19100268444754], [7.80899731555246, 272.19100268444754], [147.80899731555246, 132.19100268444754]], [[627.8089973155525, 279.18744576260315], [627.8089973155525, 459.18744576260315], [347.80899731555246, 279.18744576260315], [627.8089973155525, 279.18744576260315]], [[347.80899731555246, 0.0], [627.8089973155525, 0.0], [627.8089973155525, 280.0], [347.80899731555246, 280.0], [347.80899731555246, 0.0]], [[0.0, 380.0], [200.0, 460.0], [200.0, 560.0], [0.0, 560.0], [0.0, 380.0]], [[380.0, 372.19100268444754], [380.0, 472.19100268444754], [200.0, 472.19100268444754], [200.0, 372.19100268444754], [380.0, 372.19100268444754]], [[0.0, 280.0], [0.0, 0.0], [280.0, 0.0], [0.0, 280.0]], [[627.8089973155525, 760.0], [427.80899731555246, 760.0], [427.80899731555246, 560.0], [627.8089973155525, 480.0], [627.8089973155525, 760.0]], [[347.80899731555246, 172.19100268444754], [187.80899731555246, 92.19100268444754], [347.80899731555246, 12.19100268444754], [347.80899731555246, 172.19100268444754]], [[380.0, 587.8885817674056], [380.0, 307.88858176740564], [620.0, 447.88858176740564], [380.0, 587.8885817674056]]]" 8 | 9 | -------------------------------------------------------------------------------- /record/best_result/jakobs2.csv: -------------------------------------------------------------------------------- 1 | ratio,orientation,polys 2 | 0.854520478384744,"[1, 3, 3, 0, 1, 2, 1, 3, 3, 1, 1, 3, 3, 1, 0, 0, 3, 1, 0, 0, 0]","[[[40.0, 580.0], [80.0, 640.0], [40.0, 700.0], [0.0, 640.0], [40.0, 580.0]], [[9.20122783641358, 50.0], [9.20122783641358, 0.0], [109.20122783641358, 0.0], [109.20122783641358, 100.0], [59.20122783641358, 100.0], [59.20122783641358, 50.0], [9.20122783641358, 50.0]], [[0.0, 580.0], [0.0, 500.0], [30.0, 480.0], [60.0, 500.0], [60.0, 580.0], [0.0, 580.0]], [[66.42206400817273, 619.6330960122591], [146.42206400817273, 619.6330960122591], [126.42206400817273, 639.6330960122591], [126.42206400817273, 679.6330960122591], [146.42206400817273, 699.6330960122591], [66.42206400817273, 699.6330960122591], [86.42206400817273, 679.6330960122591], [86.42206400817273, 639.6330960122591], [66.42206400817273, 619.6330960122591]], [[229.20122783641358, 305.5931574040798], [229.20122783641358, 405.5931574040798], [209.20122783641358, 385.5931574040798], [149.20122783641358, 385.5931574040798], [129.20122783641358, 405.5931574040798], [129.20122783641358, 305.5931574040798], [149.20122783641358, 325.5931574040798], [209.20122783641358, 325.5931574040798], [229.20122783641358, 305.5931574040798]], [[203.0990791226898, 519.6330960122591], [103.0990791226898, 519.6330960122591], [103.0990791226898, 419.6330960122591], [143.0990791226898, 419.6330960122591], [143.0990791226898, 399.6330960122591], [223.0990791226898, 399.6330960122591], [223.0990791226898, 499.6330960122591], [203.0990791226898, 499.6330960122591], [203.0990791226898, 519.6330960122591]], [[129.20122783641358, 293.23534277099884], [129.20122783641358, 413.23534277099884], [9.20122783641358, 353.23534277099884], [129.20122783641358, 293.23534277099884]], [[0.0, 348.09907912268983], [0.0, 268.09907912268983], [80.0, 308.09907912268983], [0.0, 348.09907912268983]], [[149.20122783641358, 225.7987721635864], [49.20122783641358, 125.79877216358639], [149.20122783641358, 125.79877216358639], [149.20122783641358, 225.7987721635864]], [[167.78950205321266, 253.94120566259932], [87.78950205321266, 313.9412056625993], [7.789502053212658, 253.94120566259932], [87.78950205321266, 193.94120566259932], [167.78950205321266, 253.94120566259932]], [[120.0, 408.09907912268983], [0.0, 468.09907912268983], [0.0, 348.09907912268983], [120.0, 408.09907912268983]], [[0.0, 150.39938608179318], [0.0, 70.39938608179318], [80.0, 110.39938608179318], [0.0, 150.39938608179318]], [[3.099079122689801, 466.5495395613449], [103.0990791226898, 416.5495395613449], [103.0990791226898, 516.5495395613449], [3.099079122689801, 466.5495395613449]], [[228.98276026721646, 285.0931574040798], [178.98276026721646, 325.0931574040798], [128.98276026721646, 285.0931574040798], [178.98276026721646, 245.09315740407982], [228.98276026721646, 285.0931574040798]], [[20.0, 140.3993860817932], [60.0, 140.3993860817932], [80.0, 160.3993860817932], [80.0, 200.3993860817932], [40.0, 220.3993860817932], [0.0, 200.3993860817932], [0.0, 160.3993860817932], [20.0, 140.3993860817932]], [[169.20122783641358, 519.6330960122591], [229.20122783641358, 519.6330960122591], [229.20122783641358, 609.6330960122591], [169.20122783641358, 609.6330960122591], [169.20122783641358, 519.6330960122591]], [[149.20122783641358, 160.0], [149.20122783641358, 120.0], [229.20122783641358, 120.0], [229.20122783641358, 200.0], [189.20122783641358, 200.0], [189.20122783641358, 160.0], [149.20122783641358, 160.0]], [[229.20122783641358, 200.0], [229.20122783641358, 240.0], [149.20122783641358, 240.0], [149.20122783641358, 160.0], [189.20122783641358, 160.0], [189.20122783641358, 200.0], [229.20122783641358, 200.0]], [[109.20122783641358, 0.0], [229.20122783641358, 0.0], [229.20122783641358, 120.0], [109.20122783641358, 120.0], [109.20122783641358, 0.0]], [[146.42206400817273, 619.6330960122591], [226.42206400817273, 619.6330960122591], [226.42206400817273, 699.6330960122591], [146.42206400817273, 699.6330960122591], [146.42206400817273, 619.6330960122591]], [[66.42206400817273, 519.6330960122591], [166.42206400817273, 519.6330960122591], [166.42206400817273, 619.6330960122591], [66.42206400817273, 619.6330960122591], [66.42206400817273, 519.6330960122591]]]" 3 | -------------------------------------------------------------------------------- /record/best_result/shapes0.csv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seanys/2D-Irregular-Packing-Algorithm/a2b9494be9b811e56dce5058fe29ff2a134e8403/record/best_result/shapes0.csv -------------------------------------------------------------------------------- /record/blf.csv: -------------------------------------------------------------------------------- 1 | index,descript,width,total_area,poly_status,polys 2 | 0,"",1500,433200.0,"[]","[[[523.606797749979, 380.42260651806146], [465.0281539872885, 521.843962755371], [323.60679774997897, 680.4226065180615], [147.2712220622371, 623.1277048305457], [161.80339887498957, 497.97965697655604], [133.39549449094824, 318.61920764307206], [0.0, 145.30850560107228], [199.99999999999994, 5.684341886080802e-14], [447.2135954999579, 0.0], [501.8081025876525, 289.6245065701521]], [[1077.868912395085, 619.5773934819385], [654.2621146451062, 1000.0], [377.8689123950851, 619.5773934819385], [535.1638140826009, 443.24181779419666], [1101.4757101450639, 384.46329256494926]], [[1290.7179030902917, 194.98558243636467], [1015.4158634620385, 351.35187892997055], [846.2137162990289, 389.97116487272933], [500.7467382175623, 283.99395601889046], [620.427242719566, 64.82046070109732], [935.2220898815546, 0.0], [1161.0085634610175, 64.8204607010972]]]" 3 | 1,"",1000,433200.0,"[]","[[[546.4101615137755, 300.0], [546.4101615137755, 646.4101615137754], [173.2050807568878, 400.0000000000001], [0.0, 100.00000000000011], [346.4101615137755, 0.0], [496.4101615137753, 40.192378864668285]], [[997.6368390787679, 339.0180644032257], [1084.322495472741, 582.842712474619], [724.9430965251039, 484.7759065022574], [660.0584267608124, 441.4213562373095], [524.3159232447358, 185.19497029047307], [589.3477486421576, 87.86796564403573], [801.4797829981219, 0.0], [1050.9206666888854, 133.3289300941194]], [[1488.3985125636684, 1000.0], [945.7481789537178, 867.1572875253811], [1032.3507193321616, 617.157287525381], [1405.5558000890494, 370.74712601160553]], [[1827.7748214896005, 300.0], [1794.4458913954813, 549.4408836907635], [1569.2477248847622, 594.2355841209692], [1486.3534652522912, 441.4213562373095], [1235.4607093283084, 221.9638711935487], [1516.6607748856802, 133.70607753949093], [1627.7748214896005, 0.0], [1904.9386812429866, 185.19497029047284]], [[2245.599136178337, 769.80485287563], [2201.0287634634115, 889.3026466303237], [2073.277207514623, 1000.0], [1865.5697010136798, 909.0368004645482], [1780.401997047821, 835.238564884764], [1748.6527036140571, 727.1104013936445], [1756.7541088911576, 670.7638900253586], [1824.0281997134912, 454.2208027872889], [2005.578638923371, 331.1818246412713], [2164.909030596296, 390.6089882611719], [2332.449893059856, 614.4173786570725]]]" 4 | 2,"",500,433200.0,"[]","[[[0.0, 0.0], [200.0, 0.0], [200.0, 200.0], [0.0, 200.0]], [[0.0, 200.0], [200.0, 200.0], [200.0, 400.0], [0.0, 400.0]], [[200.0, 0.0], [480.0, 0.0], [480.0, 180.0], [200.0, 180.0]], [[200.0, 180.0], [480.0, 180.0], [340.0, 320.0]], [[200.0, 410.0], [200.0, 230.0], [480.0, 410.0]], [[480.0, 0.0], [760.0, 0.0], [760.0, 280.0], [480.0, 280.0]], [[480.0, 280.0], [680.0, 360.0], [680.0, 460.0], [480.0, 460.0]], [[680.0, 280.0], [780.0, 280.0], [780.0, 460.0], [680.0, 460.0]], [[760.0, 0.0], [1040.0, 0.0], [1040.0, 280.0]], [[780.0, 219.9999999999999], [980.0, 219.9999999999999], [980.0, 419.9999999999999], [780.0, 499.9999999999999]], [[940.0, 500.0], [1020.0, 340.0], [1100.0, 500.0]], [[1040.0, 0.0], [1320.0, 0.0], [1180.0, 240.0]]]" 5 | 3,"",500,433200.0,"[]","[[[0.0, 0.0], [200.0, 0.0], [200.0, 200.0], [0.0, 200.0]], [[0.0, 200.0], [200.0, 200.0], [200.0, 400.0], [0.0, 400.0]], [[200.0, 0.0], [480.0, 0.0], [480.0, 180.0], [200.0, 180.0]], [[200.0, 180.0], [480.0, 180.0], [340.0, 320.0]], [[200.0, 410.0], [200.0, 230.0], [480.0, 410.0]]]" 6 | 4,"Fu的初步计算结果",760,433200.0,"[[0,[],0],[1,[],0],[2,[],0],[3,[],0],[4,[],0],[5,[],0],[6,[],0],[7,[],0],[8,[],0],[9,[],0],[10,[],0],[11,[],0]]","[[[0.0, 0.0], [200.0, 0.0], [200.0, 200.0], [0.0, 200.0]], [[0.0, 200.0], [200.0, 200.0], [200.0, 400.0], [0.0, 400.0]], [[0.0, 400.0], [280.0, 400.0], [280.0, 580.0], [0.0, 580.0]], [[0.0, 580.0], [280.0, 580.0], [140.0, 720.0]], [[200.0, 180.0], [200.0, 0.0], [480.0, 180.0]], [[280.0, 180.0], [560.0, 180.0], [560.0, 460.0], [280.0, 460.0]], [[280.0, 460.0], [480.0, 540.0], [480.0, 640.0], [280.0, 640.0]], [[480.0, 460.0], [580.0, 460.0], [580.0, 640.0], [480.0, 640.0]], [[380.0, 0.0], [660.0, 0.0], [660.0, 280.0]], [[580.0, 280.0], [780.0, 280.0], [780.0, 480.0], [580.0, 560.0]], [[520.0, 760.0], [600.0, 600.0], [680.0, 760.0]], [[660.0, 0.0], [940.0, 0.0], [800.0, 240.0]]]" 7 | 5,"Fu最佳序列0.8189655172413793",760,433200.0,"[]","[[[380.0, 264.0], [580.0, 264.0], [580.0, 464.0], [380.0, 464.0]], [[496.0, 64.0], [696.0, 64.0], [696.0, 264.0], [496.0, 264.0]], [[210.0, 580.0], [490.0, 580.0], [490.0, 760.0], [210.0, 760.0]], [[280.0, 0.0], [560.0, 0.0], [420.0, 140.0]], [[0.0, 460.0], [0.0, 280.0], [280.0, 460.0]], [[0.0, 0.0], [280.0, 0.0], [280.0, 280.0], [0.0, 280.0]], [[280.0, 84.0], [480.0, 164.0], [480.0, 264.0], [280.0, 264.0]], [[580.0, 264.0], [680.0, 264.0], [680.0, 444.0], [580.0, 444.0]], [[100.0, 280.0], [380.0, 280.0], [380.0, 560.0]], [[490.0, 464.0], [690.0, 464.0], [690.0, 664.0], [490.0, 744.0]], [[0.0, 757.1428571428571], [80.0, 597.1428571428571], [160.0, 757.1428571428571]], [[0.0, 460.0], [280.0, 460.0], [140.0, 700.0]]]" 8 | 6,"Fu的0.871利用率",760,433200,"[[0, [448.4696758857143, 760.0], 0], [1, [634.2857142857142, 485.67358464000006], 0], [2, [0.0, 560.0], 3], [3, [554.3264153599999, 285.67358464000006], 2], [4, [234.28571428571428, 760.0], 3], [5, [280.0, 280.0], 0], [6, [648.4696758857143, 760.0], 0], [7, [642.6536374857145, 585.6735846400001], 1], [8, [280.0, 280.0], 3], [9, [234.28571428571428, 565.6735846400001], 0], [10, [80.0, 720.0], 2], [11, [654.3264153599999, 285.67358464000006], 1]]","[[[248.4696758857143, 560.0], [448.4696758857143, 560.0], [448.4696758857143, 760.0], [248.4696758857143, 760.0], [248.4696758857143, 560.0]], [[434.2857142857142, 285.67358464000006], [634.2857142857142, 285.67358464000006], [634.2857142857142, 485.67358464000006], [434.2857142857142, 485.67358464000006], [434.2857142857142, 285.67358464000006]], [[0.0, 560.0], [0.0, 280.0], [180.0, 280.0], [180.0, 560.0], [0.0, 560.0]], [[554.3264153599999, 285.67358464000006], [274.32641535999994, 285.67358464000006], [414.32641535999994, 145.67358464000006], [554.3264153599999, 285.67358464000006]], [[234.28571428571428, 760.0], [54.28571428571428, 760.0], [234.28571428571428, 480.0], [234.28571428571428, 760.0]], [[0.0, 0.0], [280.0, 0.0], [280.0, 280.0], [0.0, 280.0], [0.0, 0.0]], [[448.4696758857143, 580.0], [648.4696758857143, 660.0], [648.4696758857143, 760.0], [448.4696758857143, 760.0], [448.4696758857143, 580.0]], [[642.6536374857145, 485.67358464000006], [642.6536374857145, 585.6735846400001], [462.6536374857145, 585.6735846400001], [462.6536374857145, 485.67358464000006], [642.6536374857145, 485.67358464000006]], [[280.0, 280.0], [280.0, 0.0], [560.0, 0.0], [280.0, 280.0]], [[234.28571428571428, 285.67358464000006], [434.2857142857143, 285.67358464000006], [434.2857142857143, 485.67358464000006], [234.28571428571428, 565.6735846400001], [234.28571428571428, 285.67358464000006]], [[160.0, 560.0], [80.0, 720.0], [0.0, 560.0], [160.0, 560.0]], [[654.3264153599999, 5.673584640000058], [654.3264153599999, 285.67358464000006], [414.32641535999994, 145.67358464000006], [654.3264153599999, 5.673584640000058]]]" 9 | 7,"Fu的0.9074利用率-带重叠",760,433200,"[[0, [260.26208894163955, 741.866712003217], 3], [1, [619.1716495871103, 493.9715475798728], 0], [2, [0.0, 559.9999999999999], 3], [3, [546.0284524201272, 293.9715475798728], 2], [4, [628.1533587455999, 760.0], 3], [5, [0.0, 280.0], 3], [6, [80.26208894163955, 759.9999999999999], 3], [7, [100.0, 739.9999999999999], 0], [8, [280.0, 280.0], 3], [9, [180.0, 573.9715475798728], 0], [10, [516.3145067299674, 653.9715475798728], 2], [11, [628.1533587455999, 299.21087792232504], 1]]","[[[260.26208894163955, 741.866712003217], [260.26208894163955, 541.866712003217], [460.26208894163955, 541.866712003217], [460.26208894163955, 741.866712003217], [260.26208894163955, 741.866712003217]], [[419.1716495871103, 293.9715475798728], [619.1716495871103, 293.9715475798728], [619.1716495871103, 493.9715475798728], [419.1716495871103, 493.9715475798728], [419.1716495871103, 293.9715475798728]], [[0.0, 559.9999999999999], [0.0, 279.9999999999999], [180.0, 279.9999999999999], [180.0, 559.9999999999999], [0.0, 559.9999999999999]], [[546.0284524201272, 293.9715475798728], [266.0284524201272, 293.9715475798728], [406.0284524201272, 153.97154757987278], [546.0284524201272, 293.9715475798728]], [[628.1533587455999, 760.0], [448.1533587455999, 760.0], [628.1533587455999, 480.0], [628.1533587455999, 760.0]], [[0.0, 280.0], [0.0, 0.0], [280.0, 0.0], [280.0, 280.0], [0.0, 280.0]], [[80.26208894163955, 759.9999999999999], [160.26208894163955, 559.9999999999999], [260.26208894163955, 559.9999999999999], [260.26208894163955, 759.9999999999999], [80.26208894163955, 759.9999999999999]], [[0.0, 559.9999999999999], [100.0, 559.9999999999999], [100.0, 739.9999999999999], [0.0, 739.9999999999999], [0.0, 559.9999999999999]], [[280.0, 280.0], [280.0, 0.0], [560.0, 0.0], [280.0, 280.0]], [[180.0, 293.9715475798728], [380.0, 293.9715475798728], [380.0, 493.9715475798728], [180.0, 573.9715475798728], [180.0, 293.9715475798728]], [[596.3145067299674, 493.9715475798728], [516.3145067299674, 653.9715475798728], [436.31450672996743, 493.9715475798728], [596.3145067299674, 493.9715475798728]], [[628.1533587455999, 19.21087792232504], [628.1533587455999, 299.21087792232504], [388.1533587455999, 159.21087792232504], [628.1533587455999, 19.21087792232504]]]" 10 | -------------------------------------------------------------------------------- /record/c_blf.csv: -------------------------------------------------------------------------------- 1 | index,descript,width,total_area,overlap,polys_orientation,polys 2 | 0,"Fu最佳序列0.8189655172413793",760,433200.0,false,"[0,0,0,0,0,0,0,0,0,0,0,0]","[[[380.0, 464.0], [580.0, 464.0], [580.0, 264.0], [380.0, 264.0]], [[496.0, 264.0], [696.0, 264.0], [696.0, 64.0], [496.0, 64.0]], [[210.0, 760.0], [490.0, 760.0], [490.0, 580.0], [210.0, 580.0]], [[420.0, 140.0], [560.0, 0.0], [280.0, 0.0]], [[280.0, 460.0], [0.0, 280.0], [0.0, 460.0]], [[0.0, 280.0], [280.0, 280.0], [280.0, 0.0], [0.0, 0.0]], [[280.0, 264.0], [480.0, 264.0], [480.0, 164.0], [280.0, 84.0]], [[580.0, 444.0], [680.0, 444.0], [680.0, 264.0], [580.0, 264.0]], [[380.0, 560.0], [380.0, 280.0], [100.0, 280.0]], [[490.0, 744.0], [690.0, 664.0], [690.0, 464.0], [490.0, 464.0]], [[160.0, 757.1428571428571], [80.0, 597.1428571428571], [0.0, 757.1428571428571]], [[140.0, 700.0], [280.0, 460.0], [0.0, 460.0]]]" 3 | 1,"Fu的0.871利用率",760,433200.0,false,"[0,0,3,2,3,0,0,1,3,0,2,1]","[[[248.4696758857143, 560.0], [248.4696758857143, 760.0], [448.4696758857143, 760.0], [448.4696758857143, 560.0], [248.4696758857143, 560.0]], [[434.2857142857142, 285.67358464000006], [434.2857142857142, 485.67358464000006], [634.2857142857142, 485.67358464000006], [634.2857142857142, 285.67358464000006], [434.2857142857142, 285.67358464000006]], [[0.0, 560.0], [180.0, 560.0], [180.0, 280.0], [0.0, 280.0], [0.0, 560.0]], [[554.3264153599999, 285.67358464000006], [414.32641535999994, 145.67358464000006], [274.32641535999994, 285.67358464000006], [554.3264153599999, 285.67358464000006]], [[234.28571428571428, 760.0], [234.28571428571428, 480.0], [54.28571428571428, 760.0], [234.28571428571428, 760.0]], [[0.0, 0.0], [0.0, 280.0], [280.0, 280.0], [280.0, 0.0], [0.0, 0.0]], [[448.4696758857143, 580.0], [448.4696758857143, 760.0], [648.4696758857143, 760.0], [648.4696758857143, 660.0], [448.4696758857143, 580.0]], [[642.6536374857145, 485.67358464000006], [462.6536374857145, 485.67358464000006], [462.6536374857145, 585.6735846400001], [642.6536374857145, 585.6735846400001], [642.6536374857145, 485.67358464000006]], [[280.0, 280.0], [560.0, 0.0], [280.0, 0.0], [280.0, 280.0]], [[234.28571428571428, 285.67358464000006], [234.28571428571428, 565.6735846400001], [434.2857142857143, 485.67358464000006], [434.2857142857143, 285.67358464000006], [234.28571428571428, 285.67358464000006]], [[160.0, 560.0], [0.0, 560.0], [80.0, 720.0], [160.0, 560.0]], [[654.3264153599999, 5.673584640000058], [414.32641535999994, 145.67358464000006], [654.3264153599999, 285.67358464000006], [654.3264153599999, 5.673584640000058]]]" 4 | 2,"Fu的0.9074利用率-带重叠",760,433200.0,true,"[3,0,3,2,3,3,3,0,3,0,2,1]","[[[260.26208894163955, 741.866712003217], [460.26208894163955, 741.866712003217], [460.26208894163955, 541.866712003217], [260.26208894163955, 541.866712003217], [260.26208894163955, 741.866712003217]], [[419.1716495871103, 293.9715475798728], [419.1716495871103, 493.9715475798728], [619.1716495871103, 493.9715475798728], [619.1716495871103, 293.9715475798728], [419.1716495871103, 293.9715475798728]], [[0.0, 559.9999999999999], [180.0, 559.9999999999999], [180.0, 279.9999999999999], [0.0, 279.9999999999999], [0.0, 559.9999999999999]], [[546.0284524201272, 293.9715475798728], [406.0284524201272, 153.97154757987278], [266.0284524201272, 293.9715475798728], [546.0284524201272, 293.9715475798728]], [[628.1533587455999, 760.0], [628.1533587455999, 480.0], [448.1533587455999, 760.0], [628.1533587455999, 760.0]], [[0.0, 280.0], [280.0, 280.0], [280.0, 0.0], [0.0, 0.0], [0.0, 280.0]], [[80.26208894163955, 759.9999999999999], [260.26208894163955, 759.9999999999999], [260.26208894163955, 559.9999999999999], [160.26208894163955, 559.9999999999999], [80.26208894163955, 759.9999999999999]], [[0.0, 559.9999999999999], [0.0, 739.9999999999999], [100.0, 739.9999999999999], [100.0, 559.9999999999999], [0.0, 559.9999999999999]], [[280.0, 280.0], [560.0, 0.0], [280.0, 0.0], [280.0, 280.0]], [[180.0, 293.9715475798728], [180.0, 573.9715475798728], [380.0, 493.9715475798728], [380.0, 293.9715475798728], [180.0, 293.9715475798728]], [[596.3145067299674, 493.9715475798728], [436.31450672996743, 493.9715475798728], [516.3145067299674, 653.9715475798728], [596.3145067299674, 493.9715475798728]], [[628.1533587455999, 19.21087792232504], [388.1533587455999, 159.21087792232504], [628.1533587455999, 299.21087792232504], [628.1533587455999, 19.21087792232504]]]" 5 | 3,"Fu的0.62利用率初始解",760,433200,false,"[0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0]","[[[0.0, 0.0], [200.0, 0.0], [200.0, 200.0], [0.0, 200.0]], [[0.0, 200.0], [200.0, 200.0], [200.0, 400.0], [0.0, 400.0]], [[0.0, 400.0], [280.0, 400.0], [280.0, 580.0], [0.0, 580.0]], [[0.0, 580.0], [280.0, 580.0], [140.0, 720.0]], [[200.0, 180.0], [200.0, 0.0], [480.0, 180.0]], [[280.0, 180.0], [560.0, 180.0], [560.0, 460.0], [280.0, 460.0]], [[280.0, 460.0], [480.0, 540.0], [480.0, 640.0], [280.0, 640.0]], [[480.0, 460.0], [580.0, 460.0], [580.0, 640.0], [480.0, 640.0]], [[900.0, 360.0], [900.0, 640.0], [620.0, 640.0], [900.0, 360.0]], [[580.0, 280.0], [780.0, 280.0], [780.0, 480.0], [580.0, 560.0]], [[520.0, 760.0], [600.0, 600.0], [680.0, 760.0]], [[622.4, 0.0], [902.4, 0.0], [762.4, 240.0]]]" 6 | -------------------------------------------------------------------------------- /simulating_annealing.py: -------------------------------------------------------------------------------- 1 | import numpy as np, random, operator, pandas as pd, matplotlib.pyplot as plt 2 | from tools.geofunc import GeoFunc 3 | from tools.show import PltFunc 4 | from tools.nfp import NFP 5 | from tools.data import getData 6 | from tools.packing import PackingUtil,NFPAssistant,PolyListProcessor,Poly 7 | from heuristic import TOPOS,BottomLeftFill 8 | import json 9 | from shapely.geometry import Polygon,mapping 10 | from shapely import affinity 11 | import csv 12 | import time 13 | import multiprocessing 14 | import datetime 15 | import random 16 | import copy 17 | 18 | def packingLength(poly_list,history_index_list,history_length_list,width,**kw): 19 | polys=PolyListProcessor.getPolysVertices(poly_list) 20 | index_list=PolyListProcessor.getPolyListIndex(poly_list) 21 | length=0 22 | check_index=PolyListProcessor.getIndex(index_list,history_index_list) 23 | if check_index>=0: 24 | length=history_length_list[check_index] 25 | else: 26 | try: 27 | if 'NFPAssistant' in kw: 28 | blf=BottomLeftFill(width,polys,NFPAssistant=kw['NFPAssistant']) 29 | # blf.showAll() 30 | length=blf.contain_length 31 | else: 32 | length=BottomLeftFill(width,polys).contain_length 33 | except: 34 | print('出现Self-intersection') 35 | length=99999 36 | history_index_list.append(index_list) 37 | history_length_list.append(length) 38 | return length 39 | 40 | class SA(object): 41 | ''' 42 | Simulating Annealing + Bottom Left Fill 43 | Reference:.... 44 | ''' 45 | def __init__(self,poly_list): 46 | self.min_angle=360 # 允许旋转的最小角度 47 | self.width=1500 # 排列的宽度 48 | 49 | self.temp_now=200 # 起始温度 2000 50 | self.temp_end=1e-5 # 结束温度 1e-20 51 | self.dec_rate=0.7 # 降温速率 0.995 52 | self.loop_times=5 # 内循环次数 53 | 54 | self.cur_poly_list=poly_list # 当前的序列 55 | self.new_poly_list=poly_list # 生成新的序列 56 | 57 | self.history_index_list=[] # 运行过的index序列 58 | self.history_length_list=[] # 运行结果 59 | 60 | self.NFPAssistant=NFPAssistant(PolyListProcessor.getPolysVertices(poly_list),get_all_nfp=True) 61 | 62 | self.run() 63 | 64 | def newPolyList(self): 65 | choose_id = int(random.random() * len(self.new_poly_list)) 66 | '''进行交换和旋转的操作,暂时不允许旋转''' 67 | if random.random()<=1: 68 | self.new_poly_list=PolyListProcessor.randomSwap(self.cur_poly_list,choose_id) 69 | else: 70 | self.new_poly_list=PolyListProcessor.randomRotate(self.cur_poly_list,self.min_angle,choose_id) 71 | 72 | def run(self): 73 | initial_length=packingLength(self.cur_poly_list,self.history_index_list,self.history_length_list,self.width) 74 | 75 | global_lowest_length_list = [] # 记录每个温度下最最低高度,理论上会下降 76 | temp_lowest_length_list= [] # 每个温度下的平衡高度 77 | 78 | global_best_list = copy.deepcopy(self.cur_poly_list) # 用于记录历史上最好蓄力 79 | global_lowest_length=initial_length # 全局最低高度 80 | 81 | temp_best_list=copy.deepcopy(self.cur_poly_list) # 局部温度下的最低 82 | temp_lowest_length=initial_length # 局部温度下的最低 83 | 84 | unchange_times=0 85 | 86 | # 开始循环寻找 87 | while self.temp_now>self.temp_end: 88 | print("当前温度:",self.temp_now) 89 | old_lowest_length=global_lowest_length # 统计未更改次数 90 | 91 | cur_length=packingLength(self.cur_poly_list,self.history_index_list,self.history_length_list,self.width,NFPAssistant=self.NFPAssistant) 92 | 93 | # 在某个温度下进行一定次数的寻找 94 | for i in range(self.loop_times): 95 | self.newPolyList() 96 | 97 | new_length=packingLength(self.new_poly_list,self.history_index_list,self.history_length_list,self.width,NFPAssistant=self.NFPAssistant) 98 | delta_length = new_length-cur_length 99 | 100 | if delta_length < 0: # 当前温度下如果高度更低则接受 101 | temp_best_list = self.cur_poly_list = copy.deepcopy(self.new_poly_list) 102 | temp_lowest_length=new_length # 修改为新的高度 103 | cur_length=new_length 104 | 105 | if new_length15: 121 | break 122 | else: 123 | unchange_times=0 124 | 125 | self.cur_poly_list=copy.deepcopy(temp_best_list) # 某温度下检索结束后取该温度下最优值 126 | self.temp_now*=self.dec_rate #退火 127 | global_lowest_length_list.append(global_lowest_length) # 全局的在每个温度下的最低高度,理论上一直在降低 128 | temp_lowest_length_list.append(temp_lowest_length) # 每个温度下的最低高度 129 | 130 | # print('结束温度的局部最优的序列:',temp_best_list) 131 | print('结束温度的局部最优高度:',temp_lowest_length) 132 | # print('最好序列:',global_best_list) 133 | print('最好序列高度:',global_lowest_length) 134 | 135 | PolyListProcessor.showPolyList(self.width,global_best_list) 136 | 137 | self.showBestResult(temp_lowest_length_list,global_lowest_length_list) 138 | 139 | def showBestResult(self,list1,list2): 140 | plt.figure(1) 141 | plt.subplot(311) 142 | plt.plot(list1)#每个温度下平衡路径长度 143 | plt.subplot(312) 144 | plt.plot(list2)#每个温度下最好路径长度 145 | plt.grid() 146 | plt.show() 147 | 148 | if __name__=='__main__': 149 | starttime = datetime.datetime.now() 150 | 151 | polys = getData(6) 152 | all_rotation = [0] # 禁止旋转 153 | poly_list = PolyListProcessor.getPolyObjectList(polys, all_rotation) 154 | 155 | SA(poly_list) 156 | 157 | endtime = datetime.datetime.now() 158 | print (endtime - starttime) 159 | -------------------------------------------------------------------------------- /tools/__pycache__/assistant.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seanys/2D-Irregular-Packing-Algorithm/a2b9494be9b811e56dce5058fe29ff2a134e8403/tools/__pycache__/assistant.cpython-37.pyc -------------------------------------------------------------------------------- /tools/__pycache__/data.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seanys/2D-Irregular-Packing-Algorithm/a2b9494be9b811e56dce5058fe29ff2a134e8403/tools/__pycache__/data.cpython-37.pyc -------------------------------------------------------------------------------- /tools/__pycache__/geo_func.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seanys/2D-Irregular-Packing-Algorithm/a2b9494be9b811e56dce5058fe29ff2a134e8403/tools/__pycache__/geo_func.cpython-37.pyc -------------------------------------------------------------------------------- /tools/__pycache__/geofunc.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seanys/2D-Irregular-Packing-Algorithm/a2b9494be9b811e56dce5058fe29ff2a134e8403/tools/__pycache__/geofunc.cpython-37.pyc -------------------------------------------------------------------------------- /tools/__pycache__/lp.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seanys/2D-Irregular-Packing-Algorithm/a2b9494be9b811e56dce5058fe29ff2a134e8403/tools/__pycache__/lp.cpython-37.pyc -------------------------------------------------------------------------------- /tools/__pycache__/lp_assistant.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seanys/2D-Irregular-Packing-Algorithm/a2b9494be9b811e56dce5058fe29ff2a134e8403/tools/__pycache__/lp_assistant.cpython-37.pyc -------------------------------------------------------------------------------- /tools/__pycache__/nfp.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seanys/2D-Irregular-Packing-Algorithm/a2b9494be9b811e56dce5058fe29ff2a134e8403/tools/__pycache__/nfp.cpython-37.pyc -------------------------------------------------------------------------------- /tools/__pycache__/packing.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seanys/2D-Irregular-Packing-Algorithm/a2b9494be9b811e56dce5058fe29ff2a134e8403/tools/__pycache__/packing.cpython-37.pyc -------------------------------------------------------------------------------- /tools/__pycache__/show.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seanys/2D-Irregular-Packing-Algorithm/a2b9494be9b811e56dce5058fe29ff2a134e8403/tools/__pycache__/show.cpython-37.pyc -------------------------------------------------------------------------------- /tools/assistant.py: -------------------------------------------------------------------------------- 1 | import time 2 | 3 | class OutputFunc(object): 4 | '''输出不同颜色字体''' 5 | @staticmethod 6 | def outputWarning(prefix,_str): 7 | '''输出红色字体''' 8 | _str = prefix + str(time.strftime("%H:%M:%S", time.localtime())) + " " + str(_str) 9 | print("\033[0;31m",_str,"\033[0m") 10 | 11 | @staticmethod 12 | def outputAttention(prefix,_str): 13 | '''输出绿色字体''' 14 | _str = prefix + str(time.strftime("%H:%M:%S", time.localtime())) + " " + str(_str) 15 | print("\033[0;32m",_str,"\033[0m") 16 | 17 | @staticmethod 18 | def outputInfo(prefix,_str): 19 | '''输出浅黄色字体''' 20 | _str = prefix + str(time.strftime("%H:%M:%S", time.localtime())) + " " + str(_str) 21 | print("\033[0;33m",_str,"\033[0m") 22 | -------------------------------------------------------------------------------- /tools/data.py: -------------------------------------------------------------------------------- 1 | from tools.geofunc import GeoFunc 2 | import pandas as pd 3 | import json 4 | 5 | def getData(index): 6 | '''报错数据集有(空心):han,jakobs1,jakobs2 ''' 7 | '''形状过多暂时未处理:shapes、shirt、swim、trousers''' 8 | name=["ga","albano","blaz1","blaz2","dighe1","dighe2","fu","han","jakobs1","jakobs2","mao","marques","shapes","shirts","swim","trousers"] 9 | print("开始处理",name[index],"数据集") 10 | '''暂时没有考虑宽度,全部缩放来表示''' 11 | scale=[100,0.5,100,100,20,20,20,10,20,20,0.5,20,50] 12 | print("缩放",scale[index],"倍") 13 | df = pd.read_csv("data/"+name[index]+".csv") 14 | polygons=[] 15 | for i in range(0,df.shape[0]): 16 | for j in range(0,df['num'][i]): 17 | poly=json.loads(df['polygon'][i]) 18 | GeoFunc.normData(poly,scale[index]) 19 | polygons.append(poly) 20 | return polygons 21 | -------------------------------------------------------------------------------- /tools/lp.py: -------------------------------------------------------------------------------- 1 | from pulp import * 2 | import random 3 | import math 4 | 5 | def sovleLP(a,b,c,**kw): 6 | # 变量所有的变量 7 | all_var=[] 8 | if '_type' in kw and kw['_type']=="compaction": 9 | '''Compaction约束效果''' 10 | for i in range(len(c)): 11 | if i==len(c)-1: 12 | all_var.append(LpVariable("z",0)) 13 | elif i%2==1: 14 | all_var.append(LpVariable("y"+formatNum(i//2),0)) 15 | elif i%2==0: 16 | all_var.append(LpVariable("x"+formatNum(i//2+1),0)) 17 | elif '_type' in kw and kw['_type']=="separation": 18 | '''Separation约束效果''' 19 | # print(len(c)) 20 | n=-1+math.sqrt(1+len(c)) 21 | for i in range(int(n)): 22 | all_var.append(LpVariable("x"+formatNum(i),0)) 23 | all_var.append(LpVariable("y"+formatNum(i),0)) 24 | for i in range(int(n)): 25 | for j in range(int(n)): 26 | all_var.append(LpVariable("a"+formatNum(i)+"_"+formatNum(j),0)) 27 | else: 28 | for i in range(len(c)): 29 | all_var.append(LpVariable("x"+formatNum(i),0)) 30 | # print(all_var) 31 | 32 | # 初始化限制 33 | prob = LpProblem("Minimize",LpMinimize) 34 | 35 | # 定义目标函数 36 | # print("目标函数:",lpSum([c[i]*all_var[i] for i in range(len(c))])) 37 | prob += lpSum([c[i]*all_var[i] for i in range(len(c))]) 38 | 39 | # 定义约束函数 40 | # 注意: print输出的约束会根据首字母顺序调整 41 | for j in range(len(a)): 42 | # print("约束",j,":",lpSum([a[j][i]*all_var[i] for i in range(len(c))]) >= b[j]) 43 | prob += lpSum([a[j][i]*all_var[i] for i in range(len(c))]) >= b[j] 44 | 45 | prob.solve() 46 | 47 | result=[] 48 | for i,v in enumerate(prob.variables()): 49 | result.append(v.varValue) 50 | # print(v.name, "=", v.varValue) 51 | # if i>=144: 52 | # print(v.name, "=", v.varValue) 53 | print("目标函数最小值 = ", value(prob.objective)) 54 | 55 | return result,value(prob.objective) 56 | 57 | def problem(a,b,c): 58 | print("目标问题") 59 | print("c:",c) 60 | for i in range(len(a)): 61 | print(a[i],b[i]) 62 | 63 | def formatNum(num): 64 | if num < 10: 65 | return "0" + str(num) 66 | return str(num) 67 | 68 | if __name__=='__main__': 69 | # a=[[10,0,20],[0,10,5],[5,5,10]] 70 | # b=[10,10,10] 71 | # c=[1,4,10] 72 | # 检测例题 解:0,12,5,8 目标函数:-19 73 | c = [1,-2,1,0] 74 | a = [[1,1,-2,1],[-1,-1,2,-1],[-2,1,-4,0],[1,-2,4,0]] 75 | b = [10,-10,-8,-4] 76 | sovleLP(a,b,c) 77 | -------------------------------------------------------------------------------- /tools/show.py: -------------------------------------------------------------------------------- 1 | import matplotlib.pyplot as plt 2 | 3 | class PltFunc(object): 4 | 5 | def addPolygon(poly): 6 | for i in range(0,len(poly)): 7 | if i == len(poly)-1: 8 | PltFunc.addLine([poly[i],poly[0]]) 9 | else: 10 | PltFunc.addLine([poly[i],poly[i+1]]) 11 | 12 | def addPolygonColor(poly): 13 | for i in range(0,len(poly)): 14 | if i == len(poly)-1: 15 | PltFunc.addLine([poly[i],poly[0]],color="blue") 16 | else: 17 | PltFunc.addLine([poly[i],poly[i+1]],color="blue") 18 | 19 | def addLine(line,**kw): 20 | if len(kw)==0: 21 | plt.plot([line[0][0],line[1][0]],[line[0][1],line[1][1]],color="black",linewidth=0.5) 22 | else: 23 | plt.plot([line[0][0],line[1][0]],[line[0][1],line[1][1]],color=kw["color"],linewidth=0.5) 24 | 25 | def showPlt(**kw): 26 | if len(kw)>0: 27 | if "minus" in kw: 28 | plt.axhline(y=0,c="blue") 29 | plt.axvline(x=0,c="blue") 30 | plt.axis([-kw["minus"],kw["width"],-kw["minus"],kw["height"]]) 31 | 32 | else: 33 | plt.axis([0,kw["width"],0,kw["height"]]) 34 | else: 35 | plt.axis([0,1000,0,1000]) 36 | # plt.axis([-1000,2000,-979400.4498015114,20000]) 37 | # plt.axis([-500,1000,0,1500]) 38 | plt.show() 39 | plt.clf() 40 | 41 | def showPolys(polys): 42 | for poly in polys: 43 | PltFunc.addPolygon(poly) 44 | PltFunc.showPlt(width=2000,height=2000) 45 | 46 | def saveFig(name): 47 | plt.savefig('figs\\'+name+'.png') 48 | plt.cla() 49 | 50 | --------------------------------------------------------------------------------