Search in sources :

Example 1 with PerturbedGridPolygonBuilder

use of com.revolsys.geometry.test.old.algorithm.PerturbedGridPolygonBuilder in project com.revolsys.open by revolsys.

the class SimpleRayCrossingStressTest method testGrid.

public void testGrid() {
    // Use fixed PM to try and get at least some points hitting the boundary
    final GeometryFactory geomFactory = GeometryFactory.fixed2d(0, 1.0, 1.0);
    // GeometryFactoryI geomFactory = new GeometryFactoryI();
    final PerturbedGridPolygonBuilder gridBuilder = new PerturbedGridPolygonBuilder(geomFactory);
    gridBuilder.setNumLines(20);
    gridBuilder.setLineWidth(10.0);
    final Geometry area = gridBuilder.getGeometry();
    final SimpleRayCrossingPointInAreaLocator pia = new SimpleRayCrossingPointInAreaLocator(area);
    final PointInAreaStressTester gridTester = new PointInAreaStressTester(geomFactory, area);
    gridTester.setNumPoints(100000);
    gridTester.setPIA(pia);
    final boolean isCorrect = gridTester.run();
    assertTrue(isCorrect);
}
Also used : Geometry(com.revolsys.geometry.model.Geometry) GeometryFactory(com.revolsys.geometry.model.GeometryFactory) PerturbedGridPolygonBuilder(com.revolsys.geometry.test.old.algorithm.PerturbedGridPolygonBuilder)

Aggregations

Geometry (com.revolsys.geometry.model.Geometry)1 GeometryFactory (com.revolsys.geometry.model.GeometryFactory)1 PerturbedGridPolygonBuilder (com.revolsys.geometry.test.old.algorithm.PerturbedGridPolygonBuilder)1