From cf4ec1db7ad150b3da2367ce29746b9758d3ff4e Mon Sep 17 00:00:00 2001 From: tian <11429339@qq.com> Date: Sun, 1 Feb 2026 10:13:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=91=86=E6=AD=A3=E6=A8=A1=E5=9E=8B=E5=86=8D?= =?UTF-8?q?=E4=BF=AF=E8=A7=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Utils/ViewpointHelper.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Utils/ViewpointHelper.cs b/src/Utils/ViewpointHelper.cs index 18da80c..a86ff89 100644 --- a/src/Utils/ViewpointHelper.cs +++ b/src/Utils/ViewpointHelper.cs @@ -114,6 +114,9 @@ namespace NavisworksTransport.Utils // 3. 创建当前视角的副本(关键:使用 CreateCopy 而不是 new Viewpoint()) Viewpoint newViewpoint = doc.CurrentViewpoint.Value.CreateCopy(); + // 使用无旋转来摆正视图 + newViewpoint.Rotation = new Rotation3D(); + // 设置标准俯视图的相机配置 // 相机位置:在目标正上方 newViewpoint.Position = cameraPosition; @@ -124,9 +127,7 @@ namespace NavisworksTransport.Utils // 使用 AlignUp 设置向上向量(适配不同坐标系) newViewpoint.AlignUp(cs.UpVector); - // 注意:用户的 Y-Up 模型是旋转过的(+Y 180度,X 270度) - // 所以不能使用无旋转来摆正视图,需要后续研究如何处理 - // newViewpoint.Rotation = new Rotation3D(); + // 4. 扩展路径包围盒,避免边缘贴得太近 double boxWidth = viewBoundingBox.Max.X - viewBoundingBox.Min.X;