public class IndexedDelaunayTriangulator
extends java.lang.Object
Constructor and Description |
---|
IndexedDelaunayTriangulator() |
Modifier and Type | Method and Description |
---|---|
IntVLA |
computeTriangles(double[] polygon,
boolean sorted) |
IntVLA |
computeTriangles(double[] points,
int offset,
int count,
boolean sorted)
Triangulates the given point cloud to a list of triangle indices that make up the Delaunay triangulation.
|
static boolean |
isPointInPolygon(double[] polygon,
int offset,
int count,
double x,
double y)
Returns true if the specified point is in the polygon.
|
void |
trim(IntVLA triangles,
double[] points,
double[] hull,
int offset,
int count)
Removes all triangles with a centroid outside the specified hull, which may be concave.
|
public IntVLA computeTriangles(double[] polygon, boolean sorted)
public IntVLA computeTriangles(double[] points, int offset, int count, boolean sorted)
points
- x,y pairs describing points. Duplicate points will result in undefined behavior.sorted
- If false, the points will be sorted by the x coordinate, which is required by the triangulation
algorithm. In that case, the input array is not modified, the returned indices are for the input
array, and count*2 additional working memory is needed.public void trim(IntVLA triangles, double[] points, double[] hull, int offset, int count)
public static boolean isPointInPolygon(double[] polygon, int offset, int count, double x, double y)
offset
- Starting polygon index.count
- Number of array indices to use after offset.Copyright © Eben Howard 2012–2022. All rights reserved.