コード例 #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);
        }