public class DelaunayTriangulator
extends java.lang.Object
Copyright (c) 2015, Poly2Tri Contributors. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
| Modifier and Type | Class and Description |
|---|---|
static class |
DelaunayTriangulator.Triangle
Returns information about a specific Delaunay triangle.
|
| Constructor and Description |
|---|
DelaunayTriangulator() |
| Modifier and Type | Method and Description |
|---|---|
static PolygonalMesh |
createMesh(java.util.List<? extends Vector2d> points)
Creates a PolygonalMesh, in the x-y plane, from the Delaunay
triangulation of a set of 2D points.
|
static PolygonalMesh |
createMesh(java.util.List<? extends Vector2d> points,
int[] constraints)
Creates a PolygonalMesh, in the x-y plane, from the constrained Delaunay
triangulation of a set of 2D points.
|
static void |
main(java.lang.String[] args) |
static java.util.List<DelaunayTriangulator.Triangle> |
triangulate(java.util.List<? extends Vector2d> points)
Computes the Delaunay triangulation of a set of 2D points.
|
static java.util.List<DelaunayTriangulator.Triangle> |
triangulate(java.util.List<? extends Vector2d> points,
int[] constraints)
Computes the constrained Delaunay triangulation of a set of 2D
points.
|
public static java.util.List<DelaunayTriangulator.Triangle> triangulate(java.util.List<? extends Vector2d> points)
DelaunayTriangulator.Triangle structures.
As indicated in the documentation for Poly2Tri, points should be unique within machine precision.
points - points to compute the triangulation forpublic static java.util.List<DelaunayTriangulator.Triangle> triangulate(java.util.List<? extends Vector2d> points, int[] constraints)
numc constraints,
then this array should have a length of 2*numc, with two point
indices per constraint. The triangles are returned as a list of DelaunayTriangulator.Triangle structures.
As indicated in the documentation for Poly2Tri, points should be unique within machine precision, and no check is made to ensure that the constraints constitute a valid constraint set (e.g., no check is made to ensure that constraint edges do not cross eah other).
points - points to compute the triangulation forconstraints - if non-null, specifices indices of the points defining
the constrained edgespublic static PolygonalMesh createMesh(java.util.List<? extends Vector2d> points)
As indicated in the documentation for Poly2Tri, points should be unique within machine precision.
points - points to compute the triangulation forpublic static PolygonalMesh createMesh(java.util.List<? extends Vector2d> points, int[] constraints)
numc constraints, then this array should have a length of 2*numc, with two point indices per constraint.
As indicated in the documentation for Poly2Tri, points should be unique within machine precision, and no check is made to ensure that the constraints constitute a valid constraint set (e.g., no check is made to ensure that constraint edges do not cross eah other).
points - points to compute the triangulation forconstraints - if non-null, specifices indices of the points defining
the constrained edgespublic static void main(java.lang.String[] args)