Beispiel #1
0
        public void CircleWithTransverseRectangle_ReturnsTrue()
        {
            List <Brep> TestEnv = BrepFactory.CircleWithTransverseRectangle();

            bool result = Logic.Relationships.Confirm.RegionsIntersect(TestEnv[0], TestEnv[1]);

            Assert.IsTrue(result);
        }
Beispiel #2
0
        public void CircleWithTransverseRectangle_SelectsTwo()
        {
            List <Brep> TestEnv       = BrepFactory.CircleWithTransverseRectangle();
            Brep        testCircle    = TestEnv[0];
            Brep        testRectangle = TestEnv[1];

            List <Brep> allRegions     = Breps.SplitTwoBreps(testCircle, testRectangle);
            List <Brep> resultGeometry = Logic.Relationships.Select.FloorFromCore(allRegions, testRectangle);

            Assert.AreEqual(resultGeometry.Count, 2);
        }
Beispiel #3
0
        public void CircleWithTransverseRectangle_NotCore()
        {
            List <Brep> TestEnv       = BrepFactory.CircleWithTransverseRectangle();
            Brep        testCircle    = TestEnv[0];
            Brep        testRectangle = TestEnv[1];

            List <Brep> allRegions     = Breps.SplitTwoBreps(testCircle, testRectangle);
            List <Brep> resultGeometry = Logic.Relationships.Select.FloorFromCore(allRegions, testRectangle);

            Point3d coreCenter = Logic.Utils.GetRegionCenter(testRectangle);

            foreach (Brep region in resultGeometry)
            {
                Point3d regionCenter = Logic.Utils.GetRegionCenter(region);

                if (regionCenter.DistanceTo(coreCenter) < .05)
                {
                    Assert.Fail();
                }
            }
        }