From ad4067cf1c35ecb475b30209053df8faf5646c48 Mon Sep 17 00:00:00 2001 From: tian <11429339@qq.com> Date: Wed, 8 Jul 2026 13:18:32 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=BF=87=E5=BC=AF=E6=A3=80=E6=B5=8B?= =?UTF-8?q?=E5=85=AC=E5=BC=8F=E5=88=A4=E6=96=AD=E6=96=B9=E5=90=91=E3=80=81?= =?UTF-8?q?=E5=AF=B9=E8=AF=9D=E6=A1=86=E6=96=87=E6=A1=88=E3=80=81=E4=B8=89?= =?UTF-8?q?=E5=88=86=E6=90=9C=E7=B4=A2=E6=96=B9=E5=90=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/UI/WPF/Views/CornerTurnCheckDialog.xaml.cs | 4 ++-- src/Utils/CornerTurnCheckHelper.cs | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/UI/WPF/Views/CornerTurnCheckDialog.xaml.cs b/src/UI/WPF/Views/CornerTurnCheckDialog.xaml.cs index 055437d..de7b436 100644 --- a/src/UI/WPF/Views/CornerTurnCheckDialog.xaml.cs +++ b/src/UI/WPF/Views/CornerTurnCheckDialog.xaml.cs @@ -28,7 +28,7 @@ namespace NavisworksTransport.UI.WPF.Views ResultBorder.BorderBrush = new SolidColorBrush(Color.FromRgb(76, 175, 80)); ResultTitle.Text = "✅ 可通过"; ResultTitle.Foreground = new SolidColorBrush(Color.FromRgb(46, 125, 50)); - ResultDetail.Text = $"余量: {margin:F2} 米\n最大可通过长度: {maxLength:F2} 米"; + ResultDetail.Text = $"余量: {margin:F2} 米\n临界长度: {maxLength:F2} 米"; } else { @@ -36,7 +36,7 @@ namespace NavisworksTransport.UI.WPF.Views ResultBorder.BorderBrush = new SolidColorBrush(Color.FromRgb(244, 67, 54)); ResultTitle.Text = "❌ 不可通过"; ResultTitle.Foreground = new SolidColorBrush(Color.FromRgb(183, 28, 28)); - ResultDetail.Text = $"超出: {-margin:F2} 米\n当前条件下最大可通过长度: {maxLength:F2} 米"; + ResultDetail.Text = $"不足: {-margin:F2} 米\n临界长度: {maxLength:F2} 米"; } } diff --git a/src/Utils/CornerTurnCheckHelper.cs b/src/Utils/CornerTurnCheckHelper.cs index ceab30f..906e2d9 100644 --- a/src/Utils/CornerTurnCheckHelper.cs +++ b/src/Utils/CornerTurnCheckHelper.cs @@ -21,11 +21,11 @@ namespace NavisworksTransport.Utils return false; maxLength = FindRequiredLength(width, entryWidth, exitWidth); - margin = length - maxLength; - return length >= maxLength; + margin = maxLength - length; + return length <= maxLength; } - /// 给定角度 θ,计算最大可通过长度 + /// 给定角度 θ,计算该角度下能通过的最大模块长度 private static double L(double theta, double width, double c1, double c2) { var sin = Math.Sin(theta); @@ -33,7 +33,7 @@ namespace NavisworksTransport.Utils return (c1 - width * cos) / sin + (c2 - width * sin) / cos; } - /// 三分法搜索 θ ∈ (0, π/2) 上 L(θ) 的最小值 + /// 三分法搜索 θ ∈ (0, π/2) 上 L(θ) 的最小值(即最大可通过长度) private static double FindRequiredLength(double width, double c1, double c2) { double lo = 1e-6;