Exemplo n.º 1
0
        public void TestGrid()
        {
            // Use fixed PM to try and get at least some points hitting the boundary
            var geomFactory = GeometryFactory.Fixed;
            // GeometryFactory geomFactory = new GeometryFactory();

            var gridBuilder = new PerturbedGridPolygonBuilder(geomFactory)
            {
                NumLines  = 20,
                LineWidth = 10.0,
                Seed      = 1185072199
                , Verbose = false
            };
            // gridBuilder.SetSeed(1185072199562);
            var area = gridBuilder.Geometry;

            // PointInAreaLocator pia = new IndexedPointInAreaLocator(area);
            IPointOnGeometryLocator pia = new IndexedPointInAreaLocator(area);

            var gridTester = new PointInAreaStressTester(geomFactory, area)
            {
                NumPoints = 100000,
                TestPointInAreaLocator = pia
            };

            bool isCorrect = gridTester.Run();

            Assert.IsTrue(isCorrect);
        }
Exemplo n.º 2
0
        public void TestGrid()
        {
            // Use fixed PM to try and get at least some points hitting the boundary
            var geomFactory = new GeometryFactory(pmFixed_1);
            // GeometryFactory geomFactory = new GeometryFactory();

            var gridBuilder = new PerturbedGridPolygonBuilder(geomFactory);

            gridBuilder.NumLines  = 20;
            gridBuilder.LineWidth = 10.0;
            var area = gridBuilder.Geometry;

            var pia = new SimpleRayCrossingPointInAreaLocator(area);

            var gridTester = new PointInAreaStressTester(geomFactory, area);

            gridTester.NumPoints = 100000;
            gridTester.TestPointInAreaLocator = pia;

            bool isCorrect = gridTester.Run();

            Assert.IsTrue(isCorrect);
        }