use of com.revolsys.elevation.tin.quadedge.LocateFailureException in project com.revolsys.open by revolsys.
the class TriangulationFunctions method delaunayTrianglesWithToleranceNoError.
public static Polygonal delaunayTrianglesWithToleranceNoError(final Geometry geom, final double tolerance) {
GeometryFactory geometryFactory = geom.getGeometryFactory();
geometryFactory = geometryFactory.convertScales(tolerance, tolerance, tolerance);
final QuadEdgeDelaunayTinBuilder builder = new QuadEdgeDelaunayTinBuilder(geometryFactory);
builder.insertVertices(geom);
try {
final Polygonal triangles = builder.getTrianglesPolygonal();
return triangles;
} catch (final LocateFailureException ex) {
System.out.println(ex);
// ignore this exception and drop thru
}
/**
* Get the triangles created up until the error
*/
final Polygonal triangles = builder.getSubdivision().getTrianglesPolygonal(geom.getGeometryFactory());
return triangles;
}
Aggregations