public class DelaunayTriangulator
extends java.lang.Object
implements java.io.Serializable
com.badlogic.gdx.math.DelaunayTriangulator
class if you use libGDX, which allocates fewer objects,
or IndexedDelaunayTriangulator
for a version of that libGDX class ported to use doubles.Modifier and Type | Class and Description |
---|---|
static class |
DelaunayTriangulator.Edge |
static class |
DelaunayTriangulator.Triangle |
Constructor and Description |
---|
DelaunayTriangulator()
Constructs a triangulator instance but does not insert any points; you should add points to
getPoints() , which is an array that can hold 256 points, before running triangulate() . |
DelaunayTriangulator(java.util.Collection<CoordDouble> points)
Constructs a new triangulator instance using the specified point set.
|
Modifier and Type | Method and Description |
---|---|
DelaunayTriangulator.Triangle |
findContainingTriangle(CoordDouble point)
Returns the triangle from this triangle soup that contains the specified
point or null if no triangle from the triangle soup contains the point.
|
DelaunayTriangulator.Edge |
findNearestEdge(CoordDouble point)
Returns the edge from the triangle soup nearest to the specified point.
|
DelaunayTriangulator.Triangle |
findNeighbor(DelaunayTriangulator.Triangle triangle,
CoordDouble ea,
CoordDouble eb) |
DelaunayTriangulator.Triangle |
findNeighbor(DelaunayTriangulator.Triangle triangle,
DelaunayTriangulator.Edge edge)
Returns the neighbor triangle of the specified triangle sharing the same
edge as specified.
|
DelaunayTriangulator.Triangle |
findOneTriangleSharing(DelaunayTriangulator.Edge edge)
Returns one of the possible triangles sharing the specified edge.
|
CoordDouble[] |
getPoints()
Returns the point set in form of a vector of 2D vectors.
|
java.util.ArrayList<DelaunayTriangulator.Triangle> |
getTriangles()
Returns the triangles of the triangulation in form of a list of 2D
triangles.
|
void |
removeTrianglesUsing(CoordDouble vertex)
Removes all triangles from this triangle soup that contain the specified
vertex.
|
void |
shuffle(IRNG rng)
Creates a random permutation of the specified point set.
|
java.util.ArrayList<DelaunayTriangulator.Triangle> |
triangulate()
This method generates a Delaunay triangulation from the specified point
set.
|
public DelaunayTriangulator()
getPoints()
, which is an array that can hold 256 points, before running triangulate()
.public DelaunayTriangulator(java.util.Collection<CoordDouble> points)
points
- The point set to be triangulatedpublic DelaunayTriangulator.Triangle findContainingTriangle(CoordDouble point)
point
- The pointpublic DelaunayTriangulator.Triangle findNeighbor(DelaunayTriangulator.Triangle triangle, DelaunayTriangulator.Edge edge)
triangle
- The triangleedge
- The edgepublic DelaunayTriangulator.Triangle findNeighbor(DelaunayTriangulator.Triangle triangle, CoordDouble ea, CoordDouble eb)
public DelaunayTriangulator.Triangle findOneTriangleSharing(DelaunayTriangulator.Edge edge)
findNeighbor(Triangle, Edge)
method.edge
- The edgepublic DelaunayTriangulator.Edge findNearestEdge(CoordDouble point)
point
- The pointpublic void removeTrianglesUsing(CoordDouble vertex)
vertex
- The vertexpublic java.util.ArrayList<DelaunayTriangulator.Triangle> triangulate()
public void shuffle(IRNG rng)
public CoordDouble[] getPoints()
public java.util.ArrayList<DelaunayTriangulator.Triangle> getTriangles()
Copyright © Eben Howard 2012–2022. All rights reserved.