Exemplo n.º 1
0
        public void SquareInCircle_ReturnsTrue()
        {
            List <Brep> TestEnv = BrepFactory.SquareInCircle();

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

            Assert.IsTrue(result);
        }
Exemplo n.º 2
0
        public void SquareInCircle_SelectsOne()
        {
            List <Brep> TestEnv    = BrepFactory.SquareInCircle();
            Brep        testSquare = TestEnv[0];
            Brep        testCircle = TestEnv[1];

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

            Assert.AreEqual(resultGeometry.Count, 1);
        }
Exemplo n.º 3
0
        public void SquareInCircle_SelectsOne()
        {
            List <Brep> TestEnv = BrepFactory.SquareInCircle();

            List <Brep> testSquare = new List <Brep>();

            testSquare.Add(TestEnv[0]);

            List <Brep> testCircle = new List <Brep>();

            testCircle.Add(TestEnv[1]);

            List <Brep> resultGeometry = Logic.Relationships.Select.NotExemptRegions(testCircle, testSquare);

            Assert.AreEqual(resultGeometry.Count, 1);
        }
Exemplo n.º 4
0
        public void SquareInCircle_SelectsCircle()
        {
            List <Brep> TestEnv = BrepFactory.SquareInCircle();

            List <Brep> testSquare = new List <Brep>();

            testSquare.Add(TestEnv[0]);

            List <Brep> testCircle = new List <Brep>();

            testCircle.Add(TestEnv[1]);

            List <Brep> resultGeometry = Logic.Relationships.Select.NotExemptRegions(testCircle, testSquare);

            bool result = (resultGeometry[0].GetArea() > TestEnv[0].GetArea()) ? true : false;

            Assert.IsTrue(result);
        }
Exemplo n.º 5
0
        public void SquareInCircle_NotCore()
        {
            List <Brep> TestEnv    = BrepFactory.SquareInCircle();
            Brep        testSquare = TestEnv[0];
            Brep        testCircle = TestEnv[1];

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

            double resultArea  = resultGeometry[0].GetArea();
            double profileArea = testCircle.GetArea();
            double coreArea    = testSquare.GetArea();

            double difference = (profileArea - coreArea) - resultArea;
            bool   tolerated  = (difference < 0.01) ? true : false;

            Assert.IsTrue(tolerated);
        }
Exemplo n.º 6
0
        public void SquareInCircle_RemovesAreaFromCircle()
        {
            List <Brep> TestEnv = BrepFactory.SquareInCircle();

            List <Brep> testSquare = new List <Brep>();

            testSquare.Add(TestEnv[0]);

            List <Brep> testCircle = new List <Brep>();

            testCircle.Add(TestEnv[1]);

            List <Brep> resultGeometry = Logic.Relationships.Select.NotExemptRegions(testCircle, testSquare);

            double calculated = TestEnv[1].GetArea() - TestEnv[0].GetArea();
            double actual     = resultGeometry[0].GetArea();

            bool result = (actual - calculated < 0.1) ? true : false;

            Assert.IsTrue(result);
        }