BuildingCoder.CmdListAllRooms.GetBoundingBox C# (CSharp) 메소드

GetBoundingBox() 정적인 개인적인 메소드

Return bounding box calculated from the room boundary segments. The lower left corner turns out to be identical with the one returned by the standard room bounding box.
static private GetBoundingBox ( IList boundary ) : BoundingBoxXYZ
boundary IList
리턴 BoundingBoxXYZ
        static BoundingBoxXYZ GetBoundingBox(
            IList<IList<BoundarySegment>> boundary)
        {
            BoundingBoxXYZ bb = new BoundingBoxXYZ();
              double infinity = double.MaxValue;

              bb.Min = new XYZ( infinity, infinity, infinity );
              bb.Max = -bb.Min;

              foreach( IList<BoundarySegment> loop in boundary )
              {
            foreach( BoundarySegment seg in loop )
            {
              Curve c = seg.GetCurve();
              IList<XYZ> pts = c.Tessellate();
              foreach( XYZ p in pts )
              {
            bb.ExpandToContain( p );
              }
            }
              }
              return bb;
        }