增加拟合测试按钮

This commit is contained in:
Zhuangkh 2024-09-04 18:25:34 +08:00
parent f0b589073f
commit 5aba199b66
2 changed files with 43 additions and 40 deletions

View File

@ -108,51 +108,51 @@ namespace uBIMEarthTools.Commands.Monitor
var boreholeKriging = new IDW<Point3D>(boreholeList.SelectMany(b => b.ValueList.Select(p => new Point3D() { X = p.Point.X, Y = p.Point.Y, Z = p.Point.Z, Value = typeValue[p.Type] })).ToList(), 2); var boreholeKriging = new IDW<Point3D>(boreholeList.SelectMany(b => b.ValueList.Select(p => new Point3D() { X = p.Point.X, Y = p.Point.Y, Z = p.Point.Z, Value = typeValue[p.Type] })).ToList(), 2);
List<Borehole> boreholes1 = new List<Borehole>(); List<Borehole> boreholes1 = new List<Borehole>();
//tris.AsParallel().ForAll(item => tris.AsParallel().ForAll(item =>
//{ {
// Func<XYZ, Borehole> func = (p => Func<XYZ, Borehole> func = (p =>
// { {
// var topZ = topKriging.Interpolate(new Point2D() { X = p.X, Y = p.Y }); var topZ = topKriging.Interpolate(new Point2D() { X = p.X, Y = p.Y });
// var bottomZ = bottomKriging.Interpolate(new Point2D() { X = p.X, Y = p.Y }); var bottomZ = bottomKriging.Interpolate(new Point2D() { X = p.X, Y = p.Y });
// var plus = (topZ - bottomZ) / 10; var plus = (topZ - bottomZ) / 10;
// var geologyLayers = new List<GeologyLayer>(); var geologyLayers = new List<GeologyLayer>();
// for (int i = 0; i < 10; i++) for (int i = 0; i < 10; i++)
// { {
// var p3d = new Point3D() { X = p.X, Y = p.Y, Z = topZ - i * plus }; var p3d = new Point3D() { X = p.X, Y = p.Y, Z = topZ - i * plus };
// var value = boreholeKriging.Interpolate2(p3d); var value = boreholeKriging.Interpolate2(p3d);
// geologyLayers.Add(new GeologyLayer(valueType[(int)Math.Round(value)], new Autodesk.Revit.DB.XYZ(p3d.X, p3d.Y, p3d.Z))); geologyLayers.Add(new GeologyLayer(valueType[(int)Math.Round(value)], new Autodesk.Revit.DB.XYZ(p3d.X, p3d.Y, p3d.Z)));
// } }
// return new Borehole("", geologyLayers); return new Borehole("", geologyLayers);
// }); });
// var v1 = boreholeList.ElementAt(item[1]).ValueList[0].Point - boreholeList.ElementAt(item[0]).ValueList[0].Point; var v1 = boreholeList.ElementAt(item[1]).ValueList[0].Point - boreholeList.ElementAt(item[0]).ValueList[0].Point;
// var v2 = boreholeList.ElementAt(item[2]).ValueList[0].Point - boreholeList.ElementAt(item[0]).ValueList[0].Point; var v2 = boreholeList.ElementAt(item[2]).ValueList[0].Point - boreholeList.ElementAt(item[0]).ValueList[0].Point;
// var originP = boreholeList.ElementAt(item[0]).ValueList[0].Point; var originP = boreholeList.ElementAt(item[0]).ValueList[0].Point;
// var triangle = new List<XYZ>() { boreholeList.ElementAt(item[0]).ValueList[0].Point, var triangle = new List<XYZ>() { boreholeList.ElementAt(item[0]).ValueList[0].Point,
// boreholeList.ElementAt(item[1]).ValueList[0].Point, boreholeList.ElementAt(item[1]).ValueList[0].Point,
// boreholeList.ElementAt(item[2]).ValueList[0].Point }; boreholeList.ElementAt(item[2]).ValueList[0].Point };
// var seg = 10; var seg = 20;
// v1 = v1 / seg; v1 = v1 / seg;
// v2 = v2 / seg; v2 = v2 / seg;
// for (int i = 0; i < seg; i++) for (int i = 0; i < seg; i++)
// { {
// for (int j = 0; j < seg; j++) for (int j = 0; j < seg; j++)
// { {
// if (i == j && i == 0) { continue; } if (i == j && i == 0) { continue; }
// var xyz = originP + v1 * i + v2 * j; var xyz = originP + v1 * i + v2 * j;
// if (IsInPolygon(xyz, triangle)) if (IsInPolygon(xyz, triangle))
// { {
// boreholes1.Add(func(xyz)); boreholes1.Add(func(xyz));
// } }
// } }
// } }
//}); });
//foreach (int[] item in tris) //foreach (int[] item in tris)
//{ //{
//} //}
#endregion #endregion
boreholeList.AddRange(boreholes1); boreholeList.AddRange(boreholes1);
#region #region
List<int[]> triIndexList = Common.Delaunay(boreholeList, 10000000 / 304.8); List<int[]> triIndexList = Common.Delaunay(boreholeList, 10000000 / 304.8);

View File

@ -53,6 +53,9 @@ namespace uBIMEarthTools
ReLoadLink_ButtonData.LargeImage = Icon(uBIMEarthTools.Properties.Resources.pyramid); ReLoadLink_ButtonData.LargeImage = Icon(uBIMEarthTools.Properties.Resources.pyramid);
sPanel.AddItem(ReLoadLink_ButtonData); sPanel.AddItem(ReLoadLink_ButtonData);
ReLoadLink_ButtonData = new PushButtonData("Test", "Test", AddInPath, "uBIMEarthTools.Commands.Monitor.MonitorCommand");
sPanel.AddItem(ReLoadLink_ButtonData);
} }
private BitmapSource Icon(System.Drawing.Bitmap bitmap) private BitmapSource Icon(System.Drawing.Bitmap bitmap)