diff --git a/FlightRouteV2/FlightRouteV2.cs b/FlightRouteV2/FlightRouteV2.cs index 9fc30eb..5aa5de1 100644 --- a/FlightRouteV2/FlightRouteV2.cs +++ b/FlightRouteV2/FlightRouteV2.cs @@ -2062,6 +2062,12 @@ namespace FlightRouteV2 Vector3[] new_aVecs = aVecs.ToArray(); //a图副本 Vector3[] new_bVecs = bVecs.ToArray(); //矩阵副本 int planeCou = new_aVecs.Length; //获取飞机总数 + ///判断a图是不是平面 + if (!(planeCou == FindMaxPlaneIndices(aVecs).Count)) + { + StrPrint("-------,故不能做拉散图案操作-------"); + return null; + } ///a图b图 中心 Vector3 aCenterPos = GetPosCenter(new_aVecs, false); ///判断bVec 矩阵的数量长宽 diff --git a/FlightRouteV2/bin/Debug/FlightRouteV2.dll b/FlightRouteV2/bin/Debug/FlightRouteV2.dll index 543f85c..bf41f28 100644 Binary files a/FlightRouteV2/bin/Debug/FlightRouteV2.dll and b/FlightRouteV2/bin/Debug/FlightRouteV2.dll differ diff --git a/FlightRouteV2/bin/Debug/FlightRouteV2.pdb b/FlightRouteV2/bin/Debug/FlightRouteV2.pdb index fdda441..12afb21 100644 Binary files a/FlightRouteV2/bin/Debug/FlightRouteV2.pdb and b/FlightRouteV2/bin/Debug/FlightRouteV2.pdb differ diff --git a/FlightRouteV2/bin/Release/FlightRouteV2.dll b/FlightRouteV2/bin/Release/FlightRouteV2.dll index 263dd64..4a11972 100644 Binary files a/FlightRouteV2/bin/Release/FlightRouteV2.dll and b/FlightRouteV2/bin/Release/FlightRouteV2.dll differ diff --git a/FlightRouteV2/bin/Release/FlightRouteV2.pdb b/FlightRouteV2/bin/Release/FlightRouteV2.pdb index 6f83b56..9460819 100644 Binary files a/FlightRouteV2/bin/Release/FlightRouteV2.pdb and b/FlightRouteV2/bin/Release/FlightRouteV2.pdb differ diff --git a/FlightRouteV2/obj/Debug/FlightRouteV2.dll b/FlightRouteV2/obj/Debug/FlightRouteV2.dll index 543f85c..bf41f28 100644 Binary files a/FlightRouteV2/obj/Debug/FlightRouteV2.dll and b/FlightRouteV2/obj/Debug/FlightRouteV2.dll differ diff --git a/FlightRouteV2/obj/Debug/FlightRouteV2.pdb b/FlightRouteV2/obj/Debug/FlightRouteV2.pdb index fdda441..12afb21 100644 Binary files a/FlightRouteV2/obj/Debug/FlightRouteV2.pdb and b/FlightRouteV2/obj/Debug/FlightRouteV2.pdb differ diff --git a/FlightRouteV2/obj/Release/FlightRouteV2.dll b/FlightRouteV2/obj/Release/FlightRouteV2.dll index 263dd64..4a11972 100644 Binary files a/FlightRouteV2/obj/Release/FlightRouteV2.dll and b/FlightRouteV2/obj/Release/FlightRouteV2.dll differ diff --git a/FlightRouteV2/obj/Release/FlightRouteV2.pdb b/FlightRouteV2/obj/Release/FlightRouteV2.pdb index 6f83b56..9460819 100644 Binary files a/FlightRouteV2/obj/Release/FlightRouteV2.pdb and b/FlightRouteV2/obj/Release/FlightRouteV2.pdb differ diff --git a/FlyCube/MainWindow.xaml.cs b/FlyCube/MainWindow.xaml.cs index 4cf979e..f7121fa 100644 --- a/FlyCube/MainWindow.xaml.cs +++ b/FlyCube/MainWindow.xaml.cs @@ -40,39 +40,39 @@ namespace FlyCube //创建一个 主画布对象 TopCanvas = new MainCanvas(this.LayerPlane); - List abVecs = FileBase.TxtToPos("C:/Users/szdot/Desktop/1.txt", out string[] fightNames);//从txt文件里面读取航点 信息 - Vector3[] aVecs = abVecs[0].ToArray(); - Vector3[] bVecs = abVecs[1].ToArray(); - Vector3[] new_bVecs = FlyVecFun.ContactABOut(aVecs, bVecs, StrPrint); - List> listVecs = FlyVecFun.CollisionLayer(aVecs, new_bVecs, StrPrintAsync); + //List abVecs = FileBase.TxtToPos("C:/Users/szdot/Desktop/1.txt", out string[] fightNames);//从txt文件里面读取航点 信息 + //Vector3[] aVecs = abVecs[0].ToArray(); + //Vector3[] bVecs = abVecs[1].ToArray(); + //Vector3[] new_bVecs = FlyVecFun.ContactABOut(aVecs, bVecs, StrPrint); + //List> listVecs = FlyVecFun.CollisionLayer(aVecs, new_bVecs, StrPrintAsync); - string txta = ""; - string txtb = ""; - string txtd = ""; - for (int i = 0; i < bVecs.Length; i++) - { - txta += i + " 0" + " " + listVecs[0][i].X + " " + listVecs[0][i].Y + " " + listVecs[0][i].Z + "\r\n"; - txtb += i + " 0" + " " + listVecs[1][i].X + " " + listVecs[1][i].Y + " " + listVecs[1][i].Z + "\r\n"; - txtd += i + " 0" + " " + new_bVecs[i].X + " " + new_bVecs[i].Y + " " + new_bVecs[i].Z + "\r\n"; - } - string patha = "C:/Users/szdot/Desktop/a.txt"; - string pathb = "C:/Users/szdot/Desktop/b.txt"; - string pathd = "C:/Users/szdot/Desktop/d.txt"; - if (File.Exists(patha)) - { - File.Delete(patha); - } - SaveFile(patha, txta); - if (File.Exists(pathb)) - { - File.Delete(pathb); - } - SaveFile(pathb, txtb); - if (File.Exists(pathd)) - { - File.Delete(pathd); - } - SaveFile(pathd, txtd); + //string txta = ""; + //string txtb = ""; + //string txtd = ""; + //for (int i = 0; i < bVecs.Length; i++) + //{ + // txta += i + " 0" + " " + listVecs[0][i].X + " " + listVecs[0][i].Y + " " + listVecs[0][i].Z + "\r\n"; + // txtb += i + " 0" + " " + listVecs[1][i].X + " " + listVecs[1][i].Y + " " + listVecs[1][i].Z + "\r\n"; + // txtd += i + " 0" + " " + new_bVecs[i].X + " " + new_bVecs[i].Y + " " + new_bVecs[i].Z + "\r\n"; + //} + //string patha = "C:/Users/szdot/Desktop/a.txt"; + //string pathb = "C:/Users/szdot/Desktop/b.txt"; + //string pathd = "C:/Users/szdot/Desktop/d.txt"; + //if (File.Exists(patha)) + //{ + // File.Delete(patha); + //} + //SaveFile(patha, txta); + //if (File.Exists(pathb)) + //{ + // File.Delete(pathb); + //} + //SaveFile(pathb, txtb); + //if (File.Exists(pathd)) + //{ + // File.Delete(pathd); + //} + //SaveFile(pathd, txtd); } /// @@ -90,10 +90,12 @@ namespace FlyCube Vector3[] aVecs = abVecs[0].ToArray(); Vector3[] bVecs = abVecs[1].ToArray(); //Vector3[] new_bVecs = FlyVecFun.ContactABOut(aVecs, bVecs, StrPrint); - Vector3[] new_aVecs = FlyVecFun.NormalPull(aVecs, bVecs, StrPrintAsync); + //Vector3[] new_aVecs = FlyVecFun.NormalPull(aVecs, bVecs, StrPrintAsync); + + List mappingId = new List() { 1,2,3,4,10,7,5,8,9,6}; bool isPass; - Task>> reTask = Task.Run(() => FlyVecFun.ABypassB(new_aVecs, bVecs, StrPrintAsync, GetVal, cts.Token, out isPass)); + Task>> reTask = Task.Run(() => FlyVecFun.ABypassB(aVecs, bVecs, StrPrintAsync, GetVal, cts.Token, out isPass, mappingId)); List> re = await reTask; string txta = ""; @@ -115,7 +117,7 @@ namespace FlyCube { txtc += i + " 0" + " " + re[2][i].X + " " + re[2][i].Y + " " + re[2][i].Z + "\r\n"; } - txtd += i + " 0" + " " + new_aVecs[i].X + " " + new_aVecs[i].Y + " " + new_aVecs[i].Z + "\r\n"; + txtd += i + " 0" + " " + bVecs[i].X + " " + bVecs[i].Y + " " + bVecs[i].Z + "\r\n"; } if (re.Count > 0)