示例#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);
        }
示例#2
0
文件: SDF.cs 项目: xfischer/PTSharp
        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);
        }