use of com.revolsys.geometry.model.Geometry in project com.revolsys.open by revolsys.
the class PreparedPolygonIntersectsStressTest method run.
public void run(final int nPts) {
// Geometry poly = newCircle(new BaseLasPoint((double)0, 0), 100, nPts);
final Geometry poly = newSineStar(new PointDoubleXY(0, 0), 100, nPts);
// System.out.println(poly);
//
// System.out.println();
// System.out.println("Running with " + nPts + " points");
test(poly);
}
use of com.revolsys.geometry.model.Geometry in project com.revolsys.open by revolsys.
the class PreparedPolygonIntersectsStressTest method newSineStar.
Geometry newSineStar(final Point origin, final double size, final int nPts) {
final SineStarFactory gsf = new SineStarFactory();
gsf.setCentre(origin);
gsf.setSize(size);
gsf.setNumPoints(nPts);
gsf.setArmLengthRatio(0.1);
gsf.setNumArms(20);
final Geometry poly = gsf.newSineStar();
return poly;
}
use of com.revolsys.geometry.model.Geometry in project com.revolsys.open by revolsys.
the class PreparedPolygonIntersectsStressTest method newCircle.
Geometry newCircle(final Point origin, final double size, final int nPts) {
final GeometricShapeFactory gsf = new GeometricShapeFactory();
gsf.setCentre(origin);
gsf.setSize(size);
gsf.setNumPoints(nPts);
final Geometry circle = gsf.newCircle();
// Geometry g = gRect.getExteriorRing();
return circle;
}
use of com.revolsys.geometry.model.Geometry in project com.revolsys.open by revolsys.
the class StressTestHarness method newTestCircle.
Geometry newTestCircle(final Point base, final double size, final int nPts) {
final GeometricShapeFactory gsf = new GeometricShapeFactory();
gsf.setCentre(base);
gsf.setSize(size);
gsf.setNumPoints(nPts);
final Geometry circle = gsf.newCircle();
// System.out.println(circle);
return circle;
}
use of com.revolsys.geometry.model.Geometry in project com.revolsys.open by revolsys.
the class TriangleFunctions method circumcentre.
public static Geometry circumcentre(final Geometry geometry) {
return geometry.applyGeometry((final Geometry part) -> {
final Point[] pts = trianglePts(part);
final Point cc = Triangles.circumcentre(pts[0], pts[1], pts[2]);
final GeometryFactory geomFact = FunctionsUtil.getFactoryOrDefault(part);
return geomFact.point(cc);
});
}
Aggregations