示例#1
0
        public static BoundingBox ToBoundingBox(this DB.BoundingBoxXYZ value, out Transform transform)
        {
            var rhino = RawDecoder.AsBoundingBox(value, out transform);

            UnitConverter.Scale(ref rhino, UnitConverter.ToRhinoUnits);
            UnitConverter.Scale(ref transform, UnitConverter.ToRhinoUnits);
            return(rhino);
        }
示例#2
0
        public static Box ToBox(this DB.BoundingBoxXYZ value)
        {
            var rhino = RawDecoder.AsBoundingBox(value, out var transform);

            UnitConverter.Scale(ref rhino, UnitConverter.ToRhinoUnits);
            UnitConverter.Scale(ref transform, UnitConverter.ToRhinoUnits);

            return(new Box
                   (
                       new Plane
                       (
                           origin:    new Point3d(transform.M03, transform.M13, transform.M23),
                           xDirection: new Vector3d(transform.M00, transform.M10, transform.M20),
                           yDirection: new Vector3d(transform.M01, transform.M11, transform.M21)
                       ),
                       xSize: new Interval(rhino.Min.X, rhino.Max.X),
                       ySize: new Interval(rhino.Min.Y, rhino.Max.Y),
                       zSize: new Interval(rhino.Min.Z, rhino.Max.Z)
                   ));
        }