lixiaojun
2025-03-20 5066a3d90ab19f8380dbb4159d57b0b8e3f17649
Yw.WinFrmUI.Hydro.L3d.Core/01-network/00-core/NetworkL3d_Method.cs
@@ -14,49 +14,6 @@
            return _parters.Exists(x => x.Id == id);
        }
        /// <summary>
        /// 获取包围盒
        /// </summary>
        public BoundingBoxL3d GetBoundingBox()
        {
            var minX = float.MaxValue;
            var minY = float.MaxValue;
            var minZ = float.MaxValue;
            var maxX = float.MinValue;
            var maxY = float.MinValue;
            var maxZ = float.MinValue;
            foreach (var node in this.Nodes)
            {
                minX = Math.Min(minX, node.Position.X);
                minY = Math.Min(minY, node.Position.Y);
                minZ = Math.Min(minZ, node.Position.Z);
                maxX = Math.Max(maxX, node.Position.X);
                maxY = Math.Max(maxY, node.Position.Y);
                maxZ = Math.Max(maxZ, node.Position.Z);
            }
            return new BoundingBoxL3d()
            {
                Min = new PointL3d(minX, minY, minZ),
                Max = new PointL3d(maxX, maxY, maxZ)
            };
        }
        /// <summary>
        /// 获取中心点
        /// </summary>
        public PointL3d GetCenter(BoundingBoxL3d boundingBox)
        {
            if (boundingBox == null)
            {
                boundingBox = GetBoundingBox();
            }
            return boundingBox.GetCenter();
        }