diff --git a/FlightRouteV2/FlightRouteV2.cs b/FlightRouteV2/FlightRouteV2.cs
index 484fdb5..998d59a 100644
--- a/FlightRouteV2/FlightRouteV2.cs
+++ b/FlightRouteV2/FlightRouteV2.cs
@@ -411,7 +411,7 @@ namespace FlightRouteV2
///
/// 飞行过程中间距 平方值
///
- public static double SpaceBetweenSquare { get; set; } = 62500;
+ public static double SpaceBetweenSquare { get; set; } = 250000;
///
/// 算绕行时 中间取点 true在正中间取点即 一个圆盘 false在一个圆柱体内取点
///
@@ -1373,7 +1373,7 @@ namespace FlightRouteV2
/// 交换次数
/// 交叉线路数量上限 ps:超过这个数量则不进行交换
/// 新的目标点
- public static Vector3[] ContactABOut(Vector3[] aVecs, Vector3[] bVecs, SomeCalculateWay StrPrint,bool isStaticSkip = true, double staticThresholdSquare = 25 , bool isSwap = true, int swapCount = 5, int crossingLimit = 6)
+ public static Vector3[] ContactABOut(Vector3[] aVecs, Vector3[] bVecs, SomeCalculateWay StrPrint,bool isStaticSkip = false, double staticThresholdSquare = 25 , bool isSwap = true, int swapCount = 5, int crossingLimit = 6)
{
long t = DateTimeOffset.UtcNow.ToUnixTimeSeconds();
StrPrint("-------智能选择路径计算,开始-------");
@@ -1561,7 +1561,7 @@ namespace FlightRouteV2
/// 日志输出 回调函数
/// 错层层高
/// 返回一个二维向量坐标集合 middle[0]是第一个中间航点 middle[1]是第二个中间航点 返回空数组则代表两个图形不在一个平面上或者不够4个点
- public static List> CollisionLayer(Vector3[] aVecs, Vector3[] bVecs,SomeCalculateWay StrPrint, double layHight = 185)
+ public static List> CollisionLayer(Vector3[] aVecs, Vector3[] bVecs,SomeCalculateWay StrPrint, double layHight = 300)
{
long t = DateTimeOffset.UtcNow.ToUnixTimeSeconds();
StrPrint("-------错层,开始-------");
@@ -2056,6 +2056,7 @@ namespace FlightRouteV2
/// 平面图案坐标组
/// 回归矩阵坐标组
/// 日志输出 回调函数
+ /// 拉散层距
/// 拉散图案的坐标组
public static Vector3[] NormalPull(Vector3[] aVecs, Vector3[] bVecs, SomeCalculateWay StrPrint,double pullingDistance = 300)
{
diff --git a/FlightRouteV2/bin/Release/FlightRouteV2.dll b/FlightRouteV2/bin/Release/FlightRouteV2.dll
index 8b72826..baaa6b1 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 50fb96b..3e396ad 100644
Binary files a/FlightRouteV2/bin/Release/FlightRouteV2.pdb and b/FlightRouteV2/bin/Release/FlightRouteV2.pdb differ
diff --git a/FlightRouteV2/obj/Release/DesignTimeResolveAssemblyReferencesInput.cache b/FlightRouteV2/obj/Release/DesignTimeResolveAssemblyReferencesInput.cache
index 41b170c..cdf5f03 100644
Binary files a/FlightRouteV2/obj/Release/DesignTimeResolveAssemblyReferencesInput.cache and b/FlightRouteV2/obj/Release/DesignTimeResolveAssemblyReferencesInput.cache differ
diff --git a/FlightRouteV2/obj/Release/FlightRouteV2.dll b/FlightRouteV2/obj/Release/FlightRouteV2.dll
index 8b72826..baaa6b1 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 50fb96b..3e396ad 100644
Binary files a/FlightRouteV2/obj/Release/FlightRouteV2.pdb and b/FlightRouteV2/obj/Release/FlightRouteV2.pdb differ
diff --git a/FlyCube/MainWindow.xaml b/FlyCube/MainWindow.xaml
index fb91cf7..1a1ceaa 100644
--- a/FlyCube/MainWindow.xaml
+++ b/FlyCube/MainWindow.xaml
@@ -16,12 +16,13 @@
-
+
+
diff --git a/FlyCube/MainWindow.xaml.cs b/FlyCube/MainWindow.xaml.cs
index f7121fa..4149a68 100644
--- a/FlyCube/MainWindow.xaml.cs
+++ b/FlyCube/MainWindow.xaml.cs
@@ -75,6 +75,69 @@ namespace FlyCube
//SaveFile(pathd, txtd);
}
+ private async void CollisionLayer_Click(object sender, RoutedEventArgs e)
+ {
+ //资源管理器 获取航点文件路径
+ FileBase.FileClass = new string[] { "航点文件" };
+ FileBase.Pascal = new string[] { "*.txt" };
+ string FliePath = FileBase.OpenExplorer("航点文件导入", out bool isSelect);
+ if (isSelect)
+ {
+ List abVecs = FileBase.TxtToPos(FliePath, out string[] fightNames);//从txt文件里面读取航点 信息
+ Vector3[] aVecs = abVecs[0].ToArray();
+ Vector3[] bVecs = abVecs[1].ToArray();
+ Vector3[] new_bVecs = FlyVecFun.ContactABOut(aVecs, bVecs, StrPrint);
+ Task>> reTask = Task.Run(() => FlyVecFun.CollisionLayer(aVecs, new_bVecs, StrPrintAsync));
+ List> re = await reTask;
+
+ string txta = "";
+ string txtb = "";
+ string txtd = "";
+
+ for (int i = 0; i < abVecs[0].Length; i++)
+ {
+ if (re.Count > 0)
+ {
+ txta += i + " 0" + " " + re[0][i].X + " " + re[0][i].Y + " " + re[0][i].Z + "\r\n";
+ }
+ if (re.Count > 1)
+ {
+ txtb += i + " 0" + " " + re[1][i].X + " " + re[1][i].Y + " " + re[1][i].Z + "\r\n";
+ }
+ txtd += i + " 0" + " " + new_bVecs[i].X + " " + new_bVecs[i].Y + " " + new_bVecs[i].Z + "\r\n";
+
+ }
+ if (re.Count > 0)
+ {
+ string path = "C:/Users/szdot/Desktop/a.txt";
+ if (File.Exists(path))
+ {
+ File.Delete(path);
+ }
+ SaveFile(path, txta);
+ }
+ if (re.Count > 1)
+ {
+ string path = "C:/Users/szdot/Desktop/b.txt";
+ if (File.Exists(path))
+ {
+ File.Delete(path);
+ }
+ SaveFile(path, txtb);
+ }
+
+ string pathd = "C:/Users/szdot/Desktop/d.txt";
+ if (File.Exists(pathd))
+ {
+ File.Delete(pathd);
+ }
+ SaveFile(pathd, txtd);
+ }
+ else
+ {
+ return;
+ }
+ }
///
/// 3D绕行
///
@@ -89,13 +152,10 @@ namespace FlyCube
List abVecs = FileBase.TxtToPos(FliePath, out string[] fightNames);//从txt文件里面读取航点 信息
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);
-
- List mappingId = new List() { 1,2,3,4,10,7,5,8,9,6};
-
+ Vector3[] new_bVecs = FlyVecFun.ContactABOut(aVecs, bVecs, StrPrint);
+ //Vector3[] new_aVecs = FlyVecFun.NormalPull(aVecs, bVecs, StrPrintAsync);//拉散图案
bool isPass;
- Task>> reTask = Task.Run(() => FlyVecFun.ABypassB(aVecs, bVecs, StrPrintAsync, GetVal, cts.Token, out isPass, mappingId));
+ Task>> reTask = Task.Run(() => FlyVecFun.ABypassB(aVecs, bVecs, StrPrintAsync, GetVal, cts.Token, out isPass));
List> re = await reTask;
string txta = "";
@@ -117,12 +177,12 @@ namespace FlyCube
{
txtc += i + " 0" + " " + re[2][i].X + " " + re[2][i].Y + " " + re[2][i].Z + "\r\n";
}
- txtd += i + " 0" + " " + bVecs[i].X + " " + bVecs[i].Y + " " + bVecs[i].Z + "\r\n";
+ txtd += i + " 0" + " " + new_bVecs[i].X + " " + new_bVecs[i].Y + " " + new_bVecs[i].Z + "\r\n";
}
if (re.Count > 0)
{
- string path = "C:/Users/szdot/Desktop/a.txt";
+ string path = $"C:/Users/szdot/Desktop/a.txt";
if (File.Exists(path))
{
File.Delete(path);
@@ -350,7 +410,7 @@ namespace FlyCube
MessageBox.Show("成功");
}
-
+
}
///
/// 灯光 组
diff --git a/FlyCube/Properties/Settings.Designer.cs b/FlyCube/Properties/Settings.Designer.cs
index 64e5003..cc2cc5a 100644
--- a/FlyCube/Properties/Settings.Designer.cs
+++ b/FlyCube/Properties/Settings.Designer.cs
@@ -12,7 +12,7 @@ namespace FlyCube.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.7.0.0")]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.9.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));