public final class PGS_Triangulation extends Object
Modifier and Type | Method and Description |
---|---|
static processing.core.PShape |
delaunayTriangulation(Collection<processing.core.PVector> points)
Generates a Delaunay Triangulation from a collection of points.
|
static processing.core.PShape |
delaunayTriangulation(processing.core.PShape shape)
Generates a constrained Delaunay Triangulation from the given shape.
|
static processing.core.PShape |
delaunayTriangulation(processing.core.PShape shape,
Collection<processing.core.PVector> steinerPoints,
boolean constrain,
int refinements,
boolean pretty)
Generates a Delaunay Triangulation from the given shape.
|
static org.tinfour.common.IIncrementalTin |
delaunayTriangulationMesh(Collection<processing.core.PVector> points)
Generates a Delaunay Triangulation from a collection of points.
|
static org.tinfour.common.IIncrementalTin |
delaunayTriangulationMesh(processing.core.PShape shape)
Generates a constrained Delaunay Triangulation from the given shape.
|
static org.tinfour.common.IIncrementalTin |
delaunayTriangulationMesh(processing.core.PShape shape,
Collection<processing.core.PVector> steinerPoints,
boolean constrain,
int refinements,
boolean pretty)
Generates a Delaunay Triangulation of the given shape and returns it in raw
form as a Triangulated Irregular Network (mesh).
|
static List<processing.core.PVector> |
delaunayTriangulationPoints(Collection<processing.core.PVector> points)
Generates a Delaunay Triangulation from a collection of points.
|
static List<processing.core.PVector> |
delaunayTriangulationPoints(processing.core.PShape shape)
Generates a constrained Delaunay Triangulation from a collection of points.
|
static List<processing.core.PVector> |
delaunayTriangulationPoints(processing.core.PShape shape,
Collection<processing.core.PVector> steinerPoints,
boolean constrain,
int refinements,
boolean pretty)
Generates a Delaunay Triangulation from the given shape.
|
static processing.core.PShape |
earCutTriangulation(processing.core.PShape shape)
Computes a triangulation of the shape according to the ear clipping
("earcut") method.
|
static processing.core.PShape |
poissonTriangulation(processing.core.PShape shape,
double spacing)
Creates a Delaunay triangulation of the shape where additional steiner
points, populated by poisson sampling, are included.
|
static org.tinfour.common.IIncrementalTin |
poissonTriangulationMesh(processing.core.PShape shape,
double spacing)
Creates a Delaunay triangulation of the shape where additional steiner
points, populated by poisson sampling, are included.
|
static List<processing.core.PVector> |
poissonTriangulationPoints(processing.core.PShape shape,
double spacing)
Creates a Delaunay triangulation of the shape where additional steiner
points, populated by poisson sampling, are included.
|
static org.jgrapht.graph.SimpleGraph<org.tinfour.common.SimpleTriangle,org.jgrapht.graph.DefaultEdge> |
toDualGraph(org.tinfour.common.IIncrementalTin triangulation)
Finds the dual-graph of a triangulation.
|
static org.jgrapht.graph.SimpleGraph<processing.core.PVector,PEdge> |
toGraph(org.tinfour.common.IIncrementalTin triangulation)
Finds the graph equivalent to a triangulation.
|
static processing.core.PShape |
toPShape(org.tinfour.common.IIncrementalTin triangulation)
Converts a triangulated mesh object to a PShape representing the
triangulation.
|
static org.jgrapht.graph.SimpleGraph<org.tinfour.common.Vertex,org.tinfour.common.IQuadEdge> |
toTinfourGraph(org.tinfour.common.IIncrementalTin triangulation)
Finds the graph equivalent to a triangulation.
|
public static processing.core.PShape delaunayTriangulation(processing.core.PShape shape)
shape
- the shape whose vertices to generate a triangulation fromdelaunayTriangulation(PShape, Collection, boolean, int, boolean)
public static processing.core.PShape delaunayTriangulation(processing.core.PShape shape, @Nullable Collection<processing.core.PVector> steinerPoints, boolean constrain, int refinements, boolean pretty)
shape
- the shape whose vertices to generate a triangulation
fromsteinerPoints
- A list of additional points to insert into the
triangulation in addition to the vertices of the input
shape. Can be null.constrain
- Constrain the triangulation output using the shape
boundary (from point set). With shapes, you'll probably
want to this to be true.refinements
- The number of triangulation refinement passes to
perform. Each pass inserts the centroids of every
existing triangle into the triangulation. Should be 0 or
greater (probably no more than 5).pretty
- Whether to maintain the Delaunay nature when
constraining the triangulation, and whether to check
that centroid locations lie within the shape during
refinement. When pretty=true, triangles in the
triangulation may be slightly more regular in
shape/size. There is a small performance overhead which
becomes more considerable at higher refinement levels.
When constrain=false and refinements=0, this argument
has no effect.delaunayTriangulationPoints(PShape, Collection, boolean, int, boolean)
,
delaunayTriangulationMesh(PShape, Collection, boolean, int, boolean)
public static processing.core.PShape delaunayTriangulation(Collection<processing.core.PVector> points)
points
- the point collection to triangulatedelaunayTriangulation(PShape, Collection, boolean, int, boolean)
public static List<processing.core.PVector> delaunayTriangulationPoints(processing.core.PShape shape)
This method returns the triangulation as a list of points, rather than a PShape.
shape
- the shape whose vertices to generate a triangulation frompublic static List<processing.core.PVector> delaunayTriangulationPoints(processing.core.PShape shape, @Nullable Collection<processing.core.PVector> steinerPoints, boolean constrain, int refinements, boolean pretty)
This method returns the triangulation as a list of points, rather than a PShape.
shape
- the shape whose vertices to generate a triangulation ofsteinerPoints
- A list of additional points to insert into the
triangulation in addition to the vertices of the input
shape. Can be null.constrain
- Constrain the triangulation output using the shape
boundary (from point set). With shapes, you'll probably
want to this to be true.refinements
- The number of triangulation refinement passes to
perform. Each pass inserts the centroids of every
existing triangle into the triangulation. Should be 0 or
greater (probably no more than 5).pretty
- Whether to maintain the Delaunay nature when
constraining the triangulation, and whether to check
that centroid locations lie within the shape during
refinement. When pretty=true, triangles in the
triangulation may be slightly more regular in
shape/size. There is a small performance overhead which
becomes more considerable at higher refinement levels.
When constrain=false and refinements=0, this argument
has no effect.delaunayTriangulation(PShape, Collection, boolean, int, boolean)
,
delaunayTriangulationMesh(PShape, Collection, boolean, int, boolean)
public static List<processing.core.PVector> delaunayTriangulationPoints(Collection<processing.core.PVector> points)
This method returns the triangulation as a list of points, rather than a PShape.
points
- the point collection to triangulatedelaunayTriangulationPoints(PShape, Collection, boolean, int, boolean)
public static org.tinfour.common.IIncrementalTin delaunayTriangulationMesh(processing.core.PShape shape)
This method returns the triangulation in its raw form: a Triangulated Irregular Network (mesh).
shape
- the shape whose vertices to generate a triangulation fromdelaunayTriangulationMesh(PShape, Collection, boolean, int, boolean)
public static org.tinfour.common.IIncrementalTin delaunayTriangulationMesh(@Nullable processing.core.PShape shape, @Nullable Collection<processing.core.PVector> steinerPoints, boolean constrain, int refinements, boolean pretty)
The triangulation can be constrained to the shape's boundary and refined by adding additional points, resulting in more uniform triangle shapes and sizes.
shape
- the shape to generate a triangulation from. Can be
null.steinerPoints
- A list of additional points to insert into the
triangulation in addition to the vertices of the input
shape. Can be null.constrain
- whether to constrain the triangulation to the shape's
boundary. If using a shape, it is recommended to set
this to true.refinements
- The number of times to subdivide the triangulation by
inserting the centroid of each triangle. Should be 0 or
greater, typically no more than 5.pretty
- Whether to maintain Delaunay nature when constraining
the triangulation and check that centroid locations are
within the shape during refinement. This can result in
more regular triangle shapes and sizes, but with a
performance overhead that increases with higher
refinement levels. Has no effect if
constrain=false
and
refinements=0
.delaunayTriangulation(PShape, Collection, boolean, int, boolean)
,
delaunayTriangulationPoints(PShape, Collection, boolean, int, boolean)
public static org.tinfour.common.IIncrementalTin delaunayTriangulationMesh(Collection<processing.core.PVector> points)
This method returns the triangulation in its raw form: a Triangulated Irregular Network (mesh).
points
- the point collection to triangulatedelaunayTriangulationMesh(PShape, Collection, boolean, int, boolean)
public static processing.core.PShape poissonTriangulation(processing.core.PShape shape, double spacing)
shape
- spacing
- (Minimum) spacing between poisson pointspoissonTriangulationPoints(PShape, double)
public static List<processing.core.PVector> poissonTriangulationPoints(processing.core.PShape shape, double spacing)
shape
- spacing
- (Minimum) spacing between poisson pointspoissonTriangulation(PShape, double)
public static org.tinfour.common.IIncrementalTin poissonTriangulationMesh(processing.core.PShape shape, double spacing)
This method returns the triangulation in its raw form: a TriangulatedIrregular Network (mesh).
shape
- spacing
- (Minimum) spacing between poisson pointspoissonTriangulation(PShape, double)
public static processing.core.PShape earCutTriangulation(processing.core.PShape shape)
shape
- shape whose vertices to triangulatepublic static processing.core.PShape toPShape(org.tinfour.common.IIncrementalTin triangulation)
triangulation
- the IIncrementalTin object to convertpublic static org.jgrapht.graph.SimpleGraph<processing.core.PVector,PEdge> toGraph(org.tinfour.common.IIncrementalTin triangulation)
The output is an undirected weighted graph of Processing primitives; edge weights are their euclidean length of their triangulation equivalent.
triangulation
- triangulation meshtoTinfourGraph(IIncrementalTin)
,
toDualGraph(IIncrementalTin)
public static org.jgrapht.graph.SimpleGraph<org.tinfour.common.Vertex,org.tinfour.common.IQuadEdge> toTinfourGraph(org.tinfour.common.IIncrementalTin triangulation)
The output is an undirected weighted graph of Tinfour primtives; edge weights are their euclidean length of their triangulation equivalent.
triangulation
- triangulation meshtoGraph(IIncrementalTin)
,
toDualGraph(IIncrementalTin)
public static org.jgrapht.graph.SimpleGraph<org.tinfour.common.SimpleTriangle,org.jgrapht.graph.DefaultEdge> toDualGraph(org.tinfour.common.IIncrementalTin triangulation)
A dual graph of a triangulation has a vertex for each constrained triangle of the input, and an edge connecting each pair of triangles that are adjacent.
triangulation
- triangulation meshtoTinfourGraph(IIncrementalTin)
Copyright © 2023. All rights reserved.