Пример #1
0
        public void BoxReflectInPlaneTest()
        {
            Box3d          b = new Box3d();
            List <Point3d> original_points = b.ListOfPoints;

            Plane3d        s                = new Plane3d(new Point3d(-4.1, 7.876, -8), new Vector3d(1.25, -8, -22));
            Box3d          reflected_box    = b.ReflectIn(s);
            List <Point3d> reflected_points = reflected_box.ListOfPoints;

            foreach (Point3d op in original_points)
            {
                Point3d reflected_p = op.ReflectIn(s);
                foreach (Point3d rp in reflected_points)
                {
                    if (reflected_p == rp)
                    {
                        reflected_points.Remove(rp);
                        break;
                    }
                }
            }

            Assert.IsTrue(reflected_points.Count == 0);
        }
Пример #2
0
        public void BoxReflectInPointTest()
        {
            Box3d          b = new Box3d();
            List <Point3d> original_points = b.ListOfPoints;

            Point3d        p                = new Point3d(-4.1, 7.876, -8);
            Box3d          reflected_box    = b.ReflectIn(p);
            List <Point3d> reflected_points = reflected_box.ListOfPoints;

            foreach (Point3d op in original_points)
            {
                Point3d reflected_p = op.ReflectIn(p);
                foreach (Point3d rp in reflected_points)
                {
                    if (reflected_p == rp)
                    {
                        reflected_points.Remove(rp);
                        break;
                    }
                }
            }

            Assert.IsTrue(reflected_points.Count == 0);
        }