Browse Source

调整参数

divide_struct_def_imp
郑敬润 1 year ago
parent
commit
a42779da70
  1. 30
      include/Const.h
  2. 5
      parameters.txt

30
include/Const.h

@ -21,9 +21,9 @@ const double MAXDia = 50; //
const int maxCap = 50; // 卡箍能容纳的最大线缆数 const int maxCap = 50; // 卡箍能容纳的最大线缆数
const double pi = acos(-1.0); // Π const double pi = acos(-1.0); // Π
const double minAngle = pi / 144; // 判断平行和垂直的偏差阈值 const double minAngle = pi / 144; // 判断平行和垂直的偏差阈值
//const double minDis = 30; //* // const double minDis = 30; //*
const double R = 2000; // 飞机横截面的近似半径 const double R = 2000; // 飞机横截面的近似半径
const double MARGIN = 1000; // 布线的空间范围,从STL模型向外延申的长度 const double MARGIN = 1000; // 布线的空间范围,从STL模型向外延申的长度
//----------------------mark---------------------- //----------------------mark----------------------
const int MAXBranchPointNumOnSegment = 2; // 分支上的最大分支点数 const int MAXBranchPointNumOnSegment = 2; // 分支上的最大分支点数
const int MAXPointNum = N + MAXBranchPointNumOnSegment * N; // 最大分支点数加最大卡箍数 const int MAXPointNum = N + MAXBranchPointNumOnSegment * N; // 最大分支点数加最大卡箍数
@ -145,8 +145,8 @@ inline double distan(P A, P B, int inOut1, int inOut2)
double len = distan1(A, B); double len = distan1(A, B);
// 求交判断并赋值惩罚参数 // 求交判断并赋值惩罚参数
// if (intersection_model == 1) if (intersection_model == 1)
if (0) // if (0)
{ {
LineSegment lineSegment(Vec3f(A.x, A.y, A.z), Vec3f(B.x, B.y, B.z)); LineSegment lineSegment(Vec3f(A.x, A.y, A.z), Vec3f(B.x, B.y, B.z));
static BVH_intersection bvh(mesh); static BVH_intersection bvh(mesh);
@ -154,13 +154,14 @@ inline double distan(P A, P B, int inOut1, int inOut2)
if (hit == 0) if (hit == 0)
penalty_par_intersection = 1; penalty_par_intersection = 1;
else else
penalty_par_intersection = 400; penalty_par_intersection = 100; //*原400
cout << "out: len:" << len << " intersection_distance" << intersection_distance << endl;
//----------------------mark-----------------------// //----------------------mark-----------------------//
// 注释效果好 // 注释下面效果可能
// if(len>intersection_distance) if (len > intersection_distance)
// penalty_par_distance=8; penalty_par_distance = 8;
// else else
// penalty_par_distance=1; penalty_par_distance = 1;
} }
double len1 = sqrt((A.y - Ycenter) * (A.y - Ycenter) + (A.z - Zcenter) * (A.z - Zcenter)); double len1 = sqrt((A.y - Ycenter) * (A.y - Ycenter) + (A.z - Zcenter) * (A.z - Zcenter));
@ -226,8 +227,8 @@ inline double distan(P A, P B)
angel = min(angel, pi / 2 - angel); angel = min(angel, pi / 2 - angel);
double len = distan1(A, B); double len = distan1(A, B);
// if (intersection_model == 1) if (intersection_model == 1)
if(0) // if(0)
{ {
LineSegment lineSegment(Vec3f(A.x, A.y, A.z), Vec3f(B.x, B.y, B.z)); LineSegment lineSegment(Vec3f(A.x, A.y, A.z), Vec3f(B.x, B.y, B.z));
static BVH_intersection bvh(mesh); static BVH_intersection bvh(mesh);
@ -235,7 +236,8 @@ inline double distan(P A, P B)
if (hit == 0) if (hit == 0)
penalty_par_intersection = 1; penalty_par_intersection = 1;
else else
penalty_par_intersection = 400; penalty_par_intersection = 100; //*原400
cout << "no_out: len:" << len << " intersection_distance" << intersection_distance << endl;
if (len > intersection_distance) if (len > intersection_distance)
penalty_par_distance = 8; penalty_par_distance = 8;
else else

5
parameters.txt

@ -18,4 +18,7 @@ VScode CMake:
"..\\..\\data\\OBJ", "..\\..\\data\\OBJ",
"output"] "output"]
} }
} }
cmd:
.\WireRouting.exe createTinyroute ..\\..\\data\\Tinyroute_test\\clip2 ..\\..\\data\\Tinyroute_test\\wirexml ..\\..\\data\\Tinyroute_test\\connector.csv ..\\..\\data\\Tinyroute_test\\OBJ D:\\outFile\\output_
Loading…
Cancel
Save