/// <summary>
 /// Manually call this function to update AABB and Bounding Sphere
 /// </summary>
 public virtual void UpdateBounds()
 {
     if (position == null || position.Count == 0)
     {
         Bound          = new BoundingBox();
         BoundingSphere = new BoundingSphere();
     }
     else
     {
         Bound          = BoundingBoxExtensions.FromPoints(Positions);
         BoundingSphere = BoundingSphereExtensions.FromPoints(Positions);
     }
     if (Bound.Maximum.IsUndefined() || Bound.Minimum.IsUndefined() || BoundingSphere.Center.IsUndefined())
     {
         throw new Exception("Position vertex contains invalid value(Example: Float.NaN).");
     }
 }
 protected override BoundingBox GetMaxBound()
 {
     return(BoundingBoxExtensions.FromPoints(Positions));
 }
        /// <summary>
        /// Returns a line geometry of the axis-aligned bounding-box of the given mesh.
        /// </summary>
        /// <param name="mesh">Input mesh for the computation of the b-box</param>
        /// <returns></returns>
        public static LineGeometry3D GenerateBoundingBox(Geometry3D mesh)
        {
            var bb = BoundingBoxExtensions.FromPoints(mesh.Positions);

            return(GenerateBoundingBox(bb));
        }