Beispiel #1
0
        internal static Box BoxForTriangles(Triangle[] shapes)
        {
            if (shapes.Length == 0)
            {
                return(new Box());
            }
            Box box = shapes[0].BoundingBox();

            foreach (var shape in shapes)
            {
                box = box.Extend(shape.BoundingBox());
            }
            return(box);
        }
Beispiel #2
0
        Box SDF.BoundingBox()
        {
            Box result = new Box();
            int i      = 0;

            foreach (SDF item in Items)
            {
                Box box = item.BoundingBox();
                if (i == 0)
                {
                    result = box;
                }
                else
                {
                    result = result.Extend(box);
                }
                i++;
            }
            return(result);
        }