public class TriangleTessellator
extends java.lang.Object
Constructor and Description |
---|
TriangleTessellator()
Create a new Triangular Tesselator.
|
Modifier and Type | Method and Description |
---|---|
void |
buildFromPoints(double[] coords)
Construct a 2D mesh from a set of point coordinates.
|
void |
buildFromPoints(double[] coords,
double minAngle)
Construct a quality 2D mesh with a minimum angle within any
given triangle.
|
void |
buildFromPoints(Point2d[] pnts)
Build a mesh from a collection of 2D points.
|
void |
buildFromPoints(Point2d[] pnts,
double minAngle)
Construct a quality 2D mesh with a minimum angle within any
given triangle.
|
void |
buildFromSegmentsAndPoints(double[] pntCoords,
int[] segments)
Builds a constrained mesh that includes the given 2D line segments.
|
void |
buildFromSegmentsAndPoints(double[] pntCoords,
int[] segments,
double minAngle)
Builds a constrained quality mesh that includes the given 2D line segments,
attempting to guarantee a minimum angle within the triangle.
|
void |
buildFromSegmentsAndPoints(Point2d[] pnts,
int[] segments)
Builds a constrained mesh that includes the given 2D line segments.
|
void |
buildFromSegmentsAndPoints(Point2d[] pnts,
int[] segments,
double minAngle)
Builds a constrained quality mesh that includes the given 2D line segments,
attempting to guarantee a minimum angle within the triangle.
|
void |
dispose()
Destroy the tessellator
|
void |
finalize() |
int |
getNumPoints()
Number of points in the resulting tessellation
|
int |
getNumTriangles()
The number of triangles in the resulting tessellation
|
double[] |
getPointCoords()
The 2D coordinates of points in the tesselation, interleaved.
|
Point2d[] |
getPoints()
The final 2D points in the tessellation
|
int[] |
getTriangles()
Returns the vertex indices of all the triangles in this tessellation.
|
static void |
main(java.lang.String[] args) |
public TriangleTessellator()
public void buildFromPoints(Point2d[] pnts)
pnts
- points to include in meshpublic void buildFromPoints(Point2d[] pnts, double minAngle)
pnts
- points to include in meshminAngle
- minimum anglepublic void buildFromPoints(double[] coords)
coords
- set of 2D point coordinatespublic void buildFromPoints(double[] coords, double minAngle)
coords
- coordinates of points to include in meshminAngle
- minimum anglepublic void buildFromSegmentsAndPoints(Point2d[] pnts, int[] segments)
segments={0,1,2,3}
would include the two
line segments, pnts[0] -> pnts[1]
, and
pnts[2] -> pnts[3]
.pnts
- points to include in the tesselationsegments
- line-segments to include as constraintspublic void buildFromSegmentsAndPoints(double[] pntCoords, int[] segments)
segments={0,1,2,3}
would include the two
line segments,
(pntCoords[0],pntCoords[1]) -> (pntCoords[2],pntsCoords[3])
, and(pntCoords[4],pntCoords[5]) -> (pntCoords[6],pntsCoords[7])
. pntCoords
- 2D coordinates of points, interleaved, to include in the tesselationsegments
- line-segments to include as constraintspublic void buildFromSegmentsAndPoints(Point2d[] pnts, int[] segments, double minAngle)
segments={0,1,2,3}
would include the two
line segments, pnts[0] -> pnts[1]
, and
pnts[2] -> pnts[3]
.pnts
- points to include in the tesselationsegments
- line-segments to include as constraintsminAngle
- minimum angle within any given trianglepublic void buildFromSegmentsAndPoints(double[] pntCoords, int[] segments, double minAngle)
segments={0,1,2,3}
would include the two
line segments,
(pntCoords[0],pntCoords[1]) -> (pntCoords[2],pntsCoords[3])
, and(pntCoords[4],pntCoords[5]) -> (pntCoords[6],pntsCoords[7])
. pntCoords
- 2D coordinates of points, interleaved, to include in the tesselationsegments
- line-segments to include as constraintsminAngle
- minimum angle within any given trianglepublic int[] getTriangles()
idxs
is the array returned by this method, then the
length of idxs
is three times the number of triangles, with
the vertex indices of the first triangle given by
idxs[0]
, idxs[1]
, idxs[2]
The vertices are ordered such that if v0 is the first vertex, v0, v1, and v2 are arranged counter-clockwise
public int getNumTriangles()
public int getNumPoints()
public double[] getPointCoords()
public Point2d[] getPoints()
public void dispose()
public void finalize()
finalize
in class java.lang.Object
public static void main(java.lang.String[] args)