diff --git a/data/Tinyroute_test/temp/START_A-F.xml b/data/Tinyroute_test/temp/START_A-F.xml new file mode 100644 index 0000000..77bf50a --- /dev/null +++ b/data/Tinyroute_test/temp/START_A-F.xml @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/data/Tinyroute_test/temp/START_END.xml b/data/Tinyroute_test/temp/START_END.xml new file mode 100644 index 0000000..fab5008 --- /dev/null +++ b/data/Tinyroute_test/temp/START_END.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/include/Astar.h b/include/Astar.h index 804999a..5c20b7e 100644 --- a/include/Astar.h +++ b/include/Astar.h @@ -505,7 +505,7 @@ struct Astar } int top = 0; int tag = T * 2; - while (pre[tag]) // pre[tag] 不存在导致无结果, + while (pre[tag]) // pre[tag] 值为0导致无结果, { st[++top] = tag; tag = pre[tag]; diff --git a/include/Const.h b/include/Const.h index 01a9e9d..096ffdc 100644 --- a/include/Const.h +++ b/include/Const.h @@ -15,21 +15,21 @@ using namespace std; // 该文件定义一些基本常量和通用函数 const int M = 10010; // 连接器数量 -const int N = 5010; // 卡箍数量 +const int N = 8010; // 卡箍数量 const int MaxSTL = 210000; // STL文件最大面片数 const double MAXDia = 50; // 卡箍能容纳的最大直径 const int maxCap = 50; // 卡箍能容纳的最大线缆数 const double pi = acos(-1.0); // Π const double minAngle = pi / 144; // 判断平行和垂直的偏差阈值 -const double minDis = 30; // +//const double minDis = 30; //* const double R = 2000; // 飞机横截面的近似半径 const double MARGIN = 1000; // 布线的空间范围,从STL模型向外延申的长度 //----------------------mark---------------------- const int MAXBranchPointNumOnSegment = 2; // 分支上的最大分支点数 const int MAXPointNum = N + MAXBranchPointNumOnSegment * N; // 最大分支点数加最大卡箍数 -double segmentLength = 0.8; //*卡箍到卡箍之间的最长距离,default:0.8 -const double MinClipToBranchPointDistance = 55; // 卡箍到分支点的最短距离,default:55 -const double MinBranchPointDistance = 55; // 分支点到分支点的最短距离,default:55 +double segmentLength = 3000; // *卡箍到卡箍之间的最长距离 +const double MinClipToBranchPointDistance = 11; // 卡箍到分支点的最短距离 +const double MinBranchPointDistance = 11; // 分支点到分支点的最短距离 P DX = P(1, 0, 0); P DY = P(0, 1, 0); @@ -42,7 +42,7 @@ double MAXX = -1e9, MINX = 1e9, MAXY = -1e9, MINY = 1e9, MAXZ = -1e9, MINZ = 1e9 vector vertices; // VS2008 vector indices; // VS2008 Mesh mesh; -const double intersection_distance = 1; +const double intersection_distance = 100; //* int intersection_model = 0; typedef P Point3; @@ -145,7 +145,8 @@ inline double distan(P A, P B, int inOut1, int inOut2) double len = distan1(A, B); // 求交判断并赋值惩罚参数 - if (intersection_model == 1) + // if (intersection_model == 1) + if (0) { LineSegment lineSegment(Vec3f(A.x, A.y, A.z), Vec3f(B.x, B.y, B.z)); static BVH_intersection bvh(mesh); @@ -202,7 +203,7 @@ inline double distan(P A, P B, int inOut1, int inOut2) // return pow(len,angel*3+1); double orign_distance = len * (angel * 4 + 1) + 300 * 600 * (angel2 + angel3) / len; - + // double orign_distance=len*(angel*0.4+1)+300*600*(angel2+angel3)/len; // cout<<"dir:"<