/// <summary> /// Get maximum internal rectangle smaller than the rectangle specified by 'l' and 's' /// Each axis value in 's' must be positive. /// </summary> public static Rect3D MaxSmallerRect(LocationF l, Size3DF s) { Location loc = Location.Ceiling(l); int x2 = (int)Math.Floor(l.X + s.sx); int y2 = (int)Math.Floor(l.Y + s.sy); int z2 = (int)Math.Floor(l.Z + s.sz); Size3D size = new Size3D(x2 - loc.X, y2 - loc.Y, z2 - loc.Z); return(new Rect3D(loc, size)); }
/// Convert each coordinate to integer which is smallest but not lesser than original. /// public static Size3D Ceiling(Size3DF s) { return(new Size3D((int)Math.Ceiling(s.sx), (int)Math.Ceiling(s.sy), (int)Math.Ceiling(s.sz))); }
/// Convert each coordinate to integer which is largest but not greater than original. /// public static Size3D Floor(Size3DF s) { return(new Size3D((int)Math.Floor(s.sx), (int)Math.Floor(s.sy), (int)Math.Floor(s.sz))); }
public DistanceF(Size3DF sz) { X = sz.sx; Y = sz.sy; Z = sz.sz; }