From b7cdb72ff7ec64fccb09bf3be7659d30a33ed9d9 Mon Sep 17 00:00:00 2001 From: tian <11429339@qq.com> Date: Fri, 6 Feb 2026 00:36:30 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=AF=BC=E5=87=BA=E7=B2=BE?= =?UTF-8?q?=E5=BA=A6=EF=BC=8C=E5=B0=86=E8=B7=AF=E5=BE=84=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E7=9A=84=E6=95=B0=E5=80=BC=E7=B2=BE=E5=BA=A6?= =?UTF-8?q?=E4=BB=8E6=E4=BD=8D=E5=B0=8F=E6=95=B0=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E4=B8=BA3=E4=BD=8D=E5=B0=8F=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Core/PathDataManager.cs | 48 ++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/src/Core/PathDataManager.cs b/src/Core/PathDataManager.cs index 64528dd..4353eab 100644 --- a/src/Core/PathDataManager.cs +++ b/src/Core/PathDataManager.cs @@ -269,16 +269,16 @@ namespace NavisworksTransport name = route.Name, description = route.Description ?? "", pathType = route.PathType.ToString(), - totalLength = Math.Round(route.TotalLength, exportSettings?.Precision ?? 6), + totalLength = Math.Round(route.TotalLength, exportSettings?.Precision ?? 3), vehicleLimits = new { - maxLength = Math.Round(route.MaxVehicleLength, exportSettings?.Precision ?? 6), - maxWidth = Math.Round(route.MaxVehicleWidth, exportSettings?.Precision ?? 6), - maxHeight = Math.Round(route.MaxVehicleHeight, exportSettings?.Precision ?? 6), - safetyMargin = Math.Round(route.SafetyMargin, exportSettings?.Precision ?? 6) + maxLength = Math.Round(route.MaxVehicleLength, exportSettings?.Precision ?? 3), + maxWidth = Math.Round(route.MaxVehicleWidth, exportSettings?.Precision ?? 3), + maxHeight = Math.Round(route.MaxVehicleHeight, exportSettings?.Precision ?? 3), + safetyMargin = Math.Round(route.SafetyMargin, exportSettings?.Precision ?? 3) }, - gridSize = Math.Round(route.GridSize, exportSettings?.Precision ?? 6), - liftHeightMeters = Math.Round(route.LiftHeightMeters, exportSettings?.Precision ?? 6), + gridSize = Math.Round(route.GridSize, exportSettings?.Precision ?? 3), + liftHeightMeters = Math.Round(route.LiftHeightMeters, exportSettings?.Precision ?? 3), created = route.CreatedTime.ToString("yyyy-MM-ddTHH:mm:ss"), points = route.GetSortedPoints().Select(point => new { @@ -286,15 +286,15 @@ namespace NavisworksTransport name = point.Name, type = point.Type.ToString(), index = point.Index, - x = Math.Round(point.Position.X, exportSettings?.Precision ?? 6), - y = Math.Round(point.Position.Y, exportSettings?.Precision ?? 6), - z = Math.Round(point.Position.Z, exportSettings?.Precision ?? 6), + x = Math.Round(point.Position.X, exportSettings?.Precision ?? 3), + y = Math.Round(point.Position.Y, exportSettings?.Precision ?? 3), + z = Math.Round(point.Position.Z, exportSettings?.Precision ?? 3), created = point.CreatedTime.ToString("yyyy-MM-ddTHH:mm:ss") }).ToArray(), edges = route.Edges != null && route.Edges.Count > 0 ? route.Edges.Select(edge => new { type = edge.SegmentType.ToString().ToLower(), - physicalLength = Math.Round(edge.PhysicalLength, exportSettings?.Precision ?? 6), + physicalLength = Math.Round(edge.PhysicalLength, exportSettings?.Precision ?? 3), trajectory = edge.SegmentType == PathSegmentType.Arc && edge.Trajectory != null ? new { ts = new @@ -317,7 +317,7 @@ namespace NavisworksTransport }, requestedRadius = Math.Round(edge.Trajectory.RequestedRadius, 3), actualRadius = Math.Round(edge.Trajectory.ActualRadius, 3), - deflectionAngle = Math.Round(edge.Trajectory.DeflectionAngle, 6), + deflectionAngle = Math.Round(edge.Trajectory.DeflectionAngle, 3), arcLength = Math.Round(edge.Trajectory.ArcLength, 3) } : null }).ToArray() : null @@ -392,9 +392,9 @@ namespace NavisworksTransport edgeIndex.ToString(), edge.SegmentType.ToString(), pointIndex.ToString(), - point.X.ToString("F6", CultureInfo.InvariantCulture), - point.Y.ToString("F6", CultureInfo.InvariantCulture), - point.Z.ToString("F6", CultureInfo.InvariantCulture) + point.X.ToString("F3", CultureInfo.InvariantCulture), + point.Y.ToString("F3", CultureInfo.InvariantCulture), + point.Z.ToString("F3", CultureInfo.InvariantCulture) ); writer.WriteLine(row); } @@ -1009,9 +1009,9 @@ namespace NavisworksTransport pointElement.SetAttribute("name", point.Name); pointElement.SetAttribute("type", point.Type.ToString()); pointElement.SetAttribute("index", point.Index.ToString()); - pointElement.SetAttribute("x", point.Position.X.ToString("F6")); - pointElement.SetAttribute("y", point.Position.Y.ToString("F6")); - pointElement.SetAttribute("z", point.Position.Z.ToString("F6")); + pointElement.SetAttribute("x", point.Position.X.ToString("F3")); + pointElement.SetAttribute("y", point.Position.Y.ToString("F3")); + pointElement.SetAttribute("z", point.Position.Z.ToString("F3")); pointElement.SetAttribute("created", point.CreatedTime.ToString("yyyy-MM-ddTHH:mm:ss")); pointsElement.AppendChild(pointElement); @@ -1027,7 +1027,7 @@ namespace NavisworksTransport { var edgeElement = xmlDoc.CreateElement("Edge", _delmiaNamespace); edgeElement.SetAttribute("type", edge.SegmentType.ToString().ToLower()); - edgeElement.SetAttribute("physicalLength", edge.PhysicalLength.ToString("F6")); + edgeElement.SetAttribute("physicalLength", edge.PhysicalLength.ToString("F3")); // 圆弧轨迹数据 if (edge.SegmentType == PathSegmentType.Arc && edge.Trajectory != null) @@ -1067,7 +1067,7 @@ namespace NavisworksTransport // 偏转角 var angleElement = xmlDoc.CreateElement("DeflectionAngle", _delmiaNamespace); - angleElement.InnerText = edge.Trajectory.DeflectionAngle.ToString("F6"); + angleElement.InnerText = edge.Trajectory.DeflectionAngle.ToString("F3"); trajElement.AppendChild(angleElement); // 圆弧长度 @@ -1251,9 +1251,9 @@ namespace NavisworksTransport /// private void AddDelmiaPointData(XmlDocument xmlDoc, XmlElement element, PathPoint point) { - element.SetAttribute("x", point.Position.X.ToString("F6")); - element.SetAttribute("y", point.Position.Y.ToString("F6")); - element.SetAttribute("z", point.Position.Z.ToString("F6")); + element.SetAttribute("x", point.Position.X.ToString("F3")); + element.SetAttribute("y", point.Position.Y.ToString("F3")); + element.SetAttribute("z", point.Position.Z.ToString("F3")); element.SetAttribute("name", point.Name); element.SetAttribute("type", point.Type.ToString()); } @@ -1311,7 +1311,7 @@ namespace NavisworksTransport /// /// 精度(小数位数) /// - public int Precision { get; set; } = 6; + public int Precision { get; set; } = 3; }