添加项目

This commit is contained in:
GG Z
2026-01-01 10:02:59 +08:00
parent 1fd8d2ced7
commit 4df4ce1e6a
105 changed files with 4437 additions and 570 deletions

View File

@@ -168,7 +168,7 @@ public static class SpatialAssist
//container.Add(mergeList); // 添加最后的合并列表
return container;
}
public static Transform GetProfileTranform(Curve referCurve)
public static Transform GetProfileTransform(Curve referCurve)
{
//非刚性变换,会改变原几何,此变换在曲线计算导数时为非刚性变换各个basis的模不等于1
var point = referCurve.GetEndPoint(0);
@@ -292,145 +292,6 @@ public static class SpatialAssist
return allChains;
}
///// <summary>
///// 连成线串
///// </summary>
///// <param name="initCurve"></param>
///// <param name="sourceCurves"></param>
//private static void SortOpenedContinuousCurves(Curve initCurve, List<Curve> sourceCurves)
//{
// if (sourceCurves == null)
// {
// return;
// }
// //if (sourceCurves.Count <= 2)
// //{
// // return;
// //}
// var start = initCurve.GetEndPoint(0);
// var end = initCurve.GetEndPoint(1);
// //curvesSorted.Add(initCurve);
// sourceCurves.Remove(initCurve);
// for (var i = sourceCurves.Count - 1; i >= 0; i--)
// {
// if (sourceCurves.Count == 0)
// {
// break;
// }
// if (i >= sourceCurves.Count)
// {
// i = sourceCurves.Count - 1;
// }
// //var anotherCurve = sourceCurves[i];
// var comparisonR = initCurve.Intersect(sourceCurves[i], out var _);
// //圆
// if (comparisonR == SetComparisonResult.Disjoint && initCurve is Arc && sourceCurves[i] is Arc)
// {
// var curves = new List<Curve>() { initCurve, sourceCurves[i] };
// try
// {
// var loop = CurveLoop.Create(curves);//如果报错,说明两个半圆没形成圆,是不连续的;
// _curvesSorted = curves;
// //移除当前的线段
// sourceCurves.Remove(sourceCurves[i]);
// return;
// }
// catch (Exception)
// {
// }
// }
// if (SetComparisonResult.Overlap == comparisonR)
// {
// //XYZ point = null;
// //if (intersectionR != null && !intersectionR.IsEmpty)
// //{
// // point = intersectionR.get_Item(0).XYZPoint;
// //}
// var start1 = sourceCurves[i].GetEndPoint(0);
// var end1 = sourceCurves[i].GetEndPoint(1);
// if (end.IsAlmostEqualTo(start1))//顺序连接
// {
// _curvesSorted.Add(sourceCurves[i]);
// }
// if (end.IsAlmostEqualTo(end1))//终点一样,反向加到后面
// {
// sourceCurves[i] = sourceCurves[i].CreateReversed();//替换掉,才能保证移除的对象是同一个
// _curvesSorted.Add(sourceCurves[i]);
// }
// if (start.IsAlmostEqualTo(start1))//起点一样,反向插到前面
// {
// sourceCurves[i] = sourceCurves[i].CreateReversed();
// _curvesSorted.Insert(_curvesSorted.IndexOf(initCurve), sourceCurves[i]);
// }
// if (start.IsAlmostEqualTo(end1))//顺序连接,但是在前面
// {
// _curvesSorted.Insert(_curvesSorted.IndexOf(initCurve), sourceCurves[i]);
// }
// SortOpenedContinuousCurves(sourceCurves[i], sourceCurves);
// }
// }
//}
/// <summary>
/// 转线串
/// </summary>
/// <param name="curves"></param>
/// <returns></returns>
//public static List<List<Curve>> ToCurveLoops(List<Curve> curves)
//{
// List<List<Curve>> list = [];
// while (curves.Any())
// {
// _curvesSorted =
// [
// curves[0]
// ];
// if (!curves[0].IsBound)
// {
// curves.Remove(curves[0]);
// list.Add(_curvesSorted);
// continue;
// }
// SortOpenedContinuousCurves(curves[0], curves);
// list.Add(_curvesSorted);
// }
// //for (var i = 0; i < 100; i++)
// //{
// // try
// // {
// // if (!curves.Any())
// // {
// // break;
// // }
// // _curvesSorted = new()
// // {
// // curves[0]
// // };
// // if (!curves[0].IsBound)
// // {
// // curves.Remove(curves[0]);
// // list.Add(_curvesSorted);
// // continue;
// // }
// // SortOpenedContinuousCurves(curves[0], curves);
// // }
// // catch (Exception ex)
// // {
// // Debug.Write(ex.StackTrace);
// // }
// // list.Add(_curvesSorted);
// // if (!curves.Any())
// // {
// // break;
// // }
// //}
// return list;
//}
}
public interface ICurveContainer