Esempio n. 1
0
        public double DistanceSquared(Bounds3D b)
        {
            double dx = Math.Max(0.0, Math.Max(b.MinPoint.X - X, X - b.MaxPoint.X));
            double dy = Math.Max(0.0, Math.Max(b.MinPoint.Y - Y, Y - b.MaxPoint.Y));
            double dz = Math.Max(0.0, Math.Max(b.MinPoint.Z - Z, Z - b.MaxPoint.Z));

            return(dx * dx + dy * dy + dz * dz);
        }
Esempio n. 2
0
        public bool Overlaps(Bounds3D b2)
        {
            bool x = (MaxPoint.X >= b2.MinPoint.X) && (MinPoint.X <= b2.MaxPoint.X);
            bool y = (MaxPoint.Y >= b2.MinPoint.Y) && (MinPoint.Y <= b2.MaxPoint.Y);
            bool z = (MaxPoint.Z >= b2.MinPoint.Z) && (MinPoint.Z <= b2.MaxPoint.Z);

            return(x && y && z);
        }
Esempio n. 3
0
 public Bounds3D Intersect(Bounds3D b2)
 {
     return(new Bounds3D(Point3D.Max(MinPoint, b2.MinPoint), Point3D.Min(MaxPoint, b2.MaxPoint)));
 }
Esempio n. 4
0
 public Bounds3D Union(Bounds3D b2)
 {
     return(new Bounds3D(Point3D.Min(MinPoint, b2.MinPoint), Point3D.Max(MaxPoint, b2.MaxPoint)));
 }
Esempio n. 5
0
 public bool IsInsideExclusive(Bounds3D b)
 {
     return(X >= b.MinPoint.X && X < b.MaxPoint.X && Y >= b.MinPoint.Y && Y < b.MaxPoint.Y && Z >= b.MinPoint.Z &&
            Z < b.MaxPoint.Z);
 }
Esempio n. 6
0
 public bool IsInside(Bounds3D b)
 {
     return(X >= b.MinPoint.X && X <= b.MaxPoint.X && Y >= b.MinPoint.Y && Y <= b.MaxPoint.Y && Z >= b.MinPoint.Z &&
            Z <= b.MaxPoint.Z);
 }
Esempio n. 7
0
 public double Distance(Bounds3D b)
 {
     return(Math.Sqrt(DistanceSquared(b)));
 }