Search in sources :

Example 1 with QuadEdgeDelaunayTinBuilder

use of com.revolsys.elevation.tin.quadedge.QuadEdgeDelaunayTinBuilder in project com.revolsys.open by revolsys.

the class TriangulationFunctions method delaunayEdges.

public static Lineal delaunayEdges(final Geometry geom) {
    GeometryFactory geometryFactory = geom.getGeometryFactory();
    geometryFactory = geometryFactory.convertScales(0, 0, 0);
    final QuadEdgeDelaunayTinBuilder builder = new QuadEdgeDelaunayTinBuilder(geometryFactory);
    builder.insertVertices(geom);
    final Lineal edges = builder.getEdges();
    return edges;
}
Also used : GeometryFactory(com.revolsys.geometry.model.GeometryFactory) Lineal(com.revolsys.geometry.model.Lineal) QuadEdgeDelaunayTinBuilder(com.revolsys.elevation.tin.quadedge.QuadEdgeDelaunayTinBuilder)

Example 2 with QuadEdgeDelaunayTinBuilder

use of com.revolsys.elevation.tin.quadedge.QuadEdgeDelaunayTinBuilder in project com.revolsys.open by revolsys.

the class TriangulationFunctions method delaunayEdgesWithTolerance.

public static Geometry delaunayEdgesWithTolerance(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);
    final Lineal edges = builder.getEdges();
    return edges;
}
Also used : GeometryFactory(com.revolsys.geometry.model.GeometryFactory) Lineal(com.revolsys.geometry.model.Lineal) QuadEdgeDelaunayTinBuilder(com.revolsys.elevation.tin.quadedge.QuadEdgeDelaunayTinBuilder)

Example 3 with QuadEdgeDelaunayTinBuilder

use of com.revolsys.elevation.tin.quadedge.QuadEdgeDelaunayTinBuilder in project com.revolsys.open by revolsys.

the class TriangulationFunctions method delaunayTrianglesWithTolerance.

public static Polygonal delaunayTrianglesWithTolerance(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);
    final Polygonal triangles = builder.getTrianglesPolygonal();
    return triangles;
}
Also used : GeometryFactory(com.revolsys.geometry.model.GeometryFactory) Polygonal(com.revolsys.geometry.model.Polygonal) QuadEdgeDelaunayTinBuilder(com.revolsys.elevation.tin.quadedge.QuadEdgeDelaunayTinBuilder)

Example 4 with QuadEdgeDelaunayTinBuilder

use of com.revolsys.elevation.tin.quadedge.QuadEdgeDelaunayTinBuilder in project com.revolsys.open by revolsys.

the class PointCloud method newTriangulatedIrregularNetwork.

default TriangulatedIrregularNetwork newTriangulatedIrregularNetwork(final Predicate<? super Point> filter) {
    final GeometryFactory geometryFactory = getGeometryFactory();
    final QuadEdgeDelaunayTinBuilder tinBuilder = new QuadEdgeDelaunayTinBuilder(geometryFactory);
    forEachPoint((point) -> {
        if (filter.test(point)) {
            tinBuilder.insertVertex(point);
        }
    });
    final TriangulatedIrregularNetwork tin = tinBuilder.newTriangulatedIrregularNetwork();
    return tin;
}
Also used : TriangulatedIrregularNetwork(com.revolsys.elevation.tin.TriangulatedIrregularNetwork) GeometryFactory(com.revolsys.geometry.model.GeometryFactory) QuadEdgeDelaunayTinBuilder(com.revolsys.elevation.tin.quadedge.QuadEdgeDelaunayTinBuilder)

Example 5 with QuadEdgeDelaunayTinBuilder

use of com.revolsys.elevation.tin.quadedge.QuadEdgeDelaunayTinBuilder in project com.revolsys.open by revolsys.

the class LasPointCloud method newTriangulatedIrregularNetwork.

@Override
public TriangulatedIrregularNetwork newTriangulatedIrregularNetwork() {
    final GeometryFactory geometryFactory = getGeometryFactory();
    final QuadEdgeDelaunayTinBuilder tinBuilder = new QuadEdgeDelaunayTinBuilder(geometryFactory);
    forEachPoint((lasPoint) -> {
        tinBuilder.insertVertex(lasPoint);
    });
    final TriangulatedIrregularNetwork tin = tinBuilder.newTriangulatedIrregularNetwork();
    return tin;
}
Also used : TriangulatedIrregularNetwork(com.revolsys.elevation.tin.TriangulatedIrregularNetwork) GeometryFactory(com.revolsys.geometry.model.GeometryFactory) QuadEdgeDelaunayTinBuilder(com.revolsys.elevation.tin.quadedge.QuadEdgeDelaunayTinBuilder)

Aggregations

QuadEdgeDelaunayTinBuilder (com.revolsys.elevation.tin.quadedge.QuadEdgeDelaunayTinBuilder)14 GeometryFactory (com.revolsys.geometry.model.GeometryFactory)8 TriangulatedIrregularNetwork (com.revolsys.elevation.tin.TriangulatedIrregularNetwork)4 Geometry (com.revolsys.geometry.model.Geometry)3 Polygonal (com.revolsys.geometry.model.Polygonal)3 Stopwatch (com.revolsys.geometry.util.Stopwatch)3 Lineal (com.revolsys.geometry.model.Lineal)2 Point (com.revolsys.geometry.model.Point)2 LocateFailureException (com.revolsys.elevation.tin.quadedge.LocateFailureException)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1