use of com.revolsys.elevation.tin.quadedge.QuadEdgeConformingDelaunayTinBuilder in project com.revolsys.open by revolsys.
the class TriangulationFunctions method conformingDelaunayEdgesWithTolerance.
public static Lineal conformingDelaunayEdgesWithTolerance(final Geometry sites, final Geometry constraints, final double tol) {
final QuadEdgeConformingDelaunayTinBuilder builder = new QuadEdgeConformingDelaunayTinBuilder();
builder.setSites(sites);
builder.setConstraints(constraints);
builder.setTolerance(tol);
final GeometryFactory geomFact = sites != null ? sites.getGeometryFactory() : constraints.getGeometryFactory();
final Lineal triangles = builder.getEdgesLineal(geomFact);
return triangles;
}
use of com.revolsys.elevation.tin.quadedge.QuadEdgeConformingDelaunayTinBuilder in project com.revolsys.open by revolsys.
the class ConformingDelaunayTest method runDelaunay.
void runDelaunay(final String sitesWKT, final String constraintsWKT, final boolean computeTriangles, final String expectedWKT) throws ParseException {
final Geometry sites = this.geometryFactory.geometry(sitesWKT);
final Geometry constraints = this.geometryFactory.geometry(constraintsWKT);
final QuadEdgeConformingDelaunayTinBuilder builder = new QuadEdgeConformingDelaunayTinBuilder();
builder.setSites(sites);
builder.setConstraints(constraints);
final GeometryFactory geomFact = GeometryFactory.DEFAULT_3D;
Geometry result = null;
if (computeTriangles) {
result = builder.getTrianglesPolygonal(geomFact);
} else {
result = builder.getEdgesLineal(geomFact);
}
// System.out.println(result);
Geometry expectedEdges = this.geometryFactory.geometry(expectedWKT);
result = result.normalize();
expectedEdges = expectedEdges.normalize();
Assert.equals("Triangulation", expectedEdges.equalsExact(result, COMPARISON_TOLERANCE), expectedEdges, result);
}
use of com.revolsys.elevation.tin.quadedge.QuadEdgeConformingDelaunayTinBuilder in project com.revolsys.open by revolsys.
the class TriangulationFunctions method conformingDelaunayTrianglesWithTolerance.
public static Polygonal conformingDelaunayTrianglesWithTolerance(final Geometry sites, final Geometry constraints, final double tol) {
final QuadEdgeConformingDelaunayTinBuilder builder = new QuadEdgeConformingDelaunayTinBuilder();
builder.setSites(sites);
builder.setConstraints(constraints);
builder.setTolerance(tol);
final GeometryFactory geomFact = sites != null ? sites.getGeometryFactory() : constraints.getGeometryFactory();
final Polygonal triangles = builder.getTrianglesPolygonal(geomFact);
return triangles;
}
Aggregations