|
|
|
@ -346,6 +346,7 @@ public class ViewportHelperPro |
|
|
|
|
List<Vector3> selFaceVector = new List<Vector3>(); |
|
|
|
|
if (waistList.Count > 0) |
|
|
|
|
{ |
|
|
|
|
//顶线和底线 |
|
|
|
|
foreach (var entity in waistList) |
|
|
|
|
{ |
|
|
|
|
selFaceVector.Add(entity.Point1); |
|
|
|
@ -367,8 +368,20 @@ public class ViewportHelperPro |
|
|
|
|
} |
|
|
|
|
result.Add(DisplayLineModel3D( VectorClockwiseSort(ViewportManager.GirdleBottomLines), color??ViewportManager.LineColor, thickness)); |
|
|
|
|
result.Add(DisplayLineModel3D( VectorClockwiseSort(ViewportManager.GirdleTopLines), color??ViewportManager.LineColor, thickness)); |
|
|
|
|
//找到所有平行于Y轴的线 |
|
|
|
|
for (int i = 0; i < uniqueVectors.ToList().Count - 1; i++) |
|
|
|
|
{ |
|
|
|
|
var nowItem = uniqueVectors.ToList()[i]; |
|
|
|
|
var nextItem = uniqueVectors.ToList()[i + 1]; |
|
|
|
|
var line = new Tuple<Vector3, Vector3>(nowItem, nextItem); |
|
|
|
|
if (IsLineSegmentParallelToYAxis(line)) |
|
|
|
|
{ |
|
|
|
|
result.Add(DisplayLineModel3D(new List<Vector3>(){nowItem,nextItem }, color??ViewportManager.LineColor, thickness)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -1009,6 +1022,17 @@ public class ViewportHelperPro |
|
|
|
|
var v = p2 - p0; |
|
|
|
|
return Vector3.Cross(u, v); |
|
|
|
|
} |
|
|
|
|
private static bool IsLineSegmentParallelToYAxis(Tuple<Vector3, Vector3> lineSegment,float epsilon = 1e-6f) |
|
|
|
|
{ |
|
|
|
|
Vector3 nowItem = lineSegment.Item1; |
|
|
|
|
Vector3 nextItem = lineSegment.Item2; |
|
|
|
|
|
|
|
|
|
if (Math.Abs(nowItem.X - nextItem.X) < epsilon && Math.Abs(nowItem.Z - nextItem.Z) < epsilon) |
|
|
|
|
{ |
|
|
|
|
return true; // 平行于 Y 轴 |
|
|
|
|
} |
|
|
|
|
return false; // 不平行于 Y 轴 |
|
|
|
|
} |
|
|
|
|
#endregion |
|
|
|
|
|
|
|
|
|
} |