Navigation
API > API/Runtime > API/Runtime/GeometryCore > API/Runtime/GeometryCore/CompGeom
References
| Module | GeometryCore |
| Header | /Engine/Source/Runtime/GeometryCore/Public/CompGeom/Delaunay2.h |
| Include | #include "CompGeom/Delaunay2.h" |
Syntax
class FDelaunay2
Variables
| Type | Name | Description | |
|---|---|---|---|
| bool | bAutomaticallyFixEdgesToDuplicateVertices | Option to automatically track duplicate vertices and treat edges that reference them as if they referenced the instance that was actually used in the triangulation Note: Cannot change this to 'true' after triangulation and then call ConstrainEdges; duplicate vertices will only be detected on their initial insertion | |
| bool | bIsConstrained | ||
| bool | bKeepFastEdgeAdjacencyData | Option to keep extra vertex->edge adjacency data; useful if you will call ConstrainEdges many times on the same triangulation. | |
| bool | bValidateEdges | Option to validate that edges remain in the triangulation after multiple constraint edges passed in Only validates for the edges in the current call; if separate calls constrain additional edges, set this to 'false' and call HasEdges() on the full edge set TODO: Consider having the internal mesh remember what edges have been constrained, so we can set an error flag when constrained edges cross previous constrained edges | |
| TPimplPtr< FDelaunay2Connectivity > | Connectivity | ||
| FRandomStream | RandomStream | Source for random permutations, used internally in the triangulation algorithm. |
Functions
| Type | Name | Description | |
|---|---|---|---|
| TArray< TArray< TVector2< RealType > > > | ComputeVoronoiCells
(
TArrayView< const TVector2< RealType >> Sites, |
Compute Voronoi diagram cells | |
| bool | ConstrainEdges
(
TArrayView< const TVector2< float >> Vertices, |
Update an already-computed triangulation so the given edges are in the triangulation. | |
| bool | ConstrainEdges
(
TArrayView< const TVector2< double >> Vertices, |
Update an already-computed triangulation so the given edges are in the triangulation. | |
| void | FixDuplicatesOnEdge
(
FIndex2i& Edge |
Remap any references to duplicate vertices to only reference the vertices used in the triangulation. | |
| bool | GetFilledTriangles
(
TArray< FIndex3i >& TrianglesOut, |
Get (by reference) the triangles that are inside the given edges, removing the outside-boundary triangles and the inside-hole triangles | |
| bool | GetFilledTriangles
(
TArray< FIndex3i >& TrianglesOut, |
Get (by reference) the triangles that are inside the given edges, removing the outer boundary triangles If a Winding-Number-based fill mode is used, assumes edges are oriented and tracks the winding number across edges | |
| TArray< FIndex3i > | GetFilledTriangles
(
TArrayView< const FIndex2i > Edges, |
Return the triangles that are inside the given edges, removing the outer boundary triangles If a Winding-Number-based fill mode is used, assumes edges are oriented and tracks the winding number across edges | |
| bool | GetFilledTrianglesGeneralizedWinding
(
TArray< FIndex3i >& TrianglesOut, |
Get (by reference) the triangles that are inside the given edges, using a generalized winding number method to determine which triangles are inside Not valid for EFillMode::Solid, will fall back to the above GetFilledTriangles method in that case. | |
| bool | GetFilledTrianglesGeneralizedWinding
(
TArray< FIndex3i >& TrianglesOut, |
Get (by reference) the triangles that are inside the given edges, using a generalized winding number method to determine which triangles are inside Not valid for EFillMode::Solid, will fall back to the above GetFilledTriangles method in that case. | |
| TArray< FIndex3i > | GetTriangles () |
TODO: Support incremental vertex insertion Update the triangulation incrementally, assuming Vertices are unchanged before FirstNewIndex, and nothing after FirstNewIndex has been inserted yet Note that updating with new vertices after constraining edges may remove previously-constrained edges, unless we also add a way to tag constrained edges bool Update(TArrayView |
|
| void | GetTrianglesAndAdjacency
(
TArray< FIndex3i >& Triangles, |
Get the triangulation as an array with a corresponding adjacency array, indicating the adjacent triangle on each triangle edge (-1 if no adjacent triangle) | |
| TArray< TArray< FVector2f > > | GetVoronoiCells
(
TArrayView< const FVector2f > Vertices, |
Get Voronoi diagram cells as dual of the Delaunay triangulation. | |
| TArray< TArray< FVector2d > > | GetVoronoiCells
(
TArrayView< const FVector2d > Vertices, |
Get Voronoi diagram cells as dual of the Delaunay triangulation. | |
| bool | |||
| bool | |||
| bool | HasEdges
(
TArrayView< const FIndex2i > Edges |
||
| bool | |||
| bool | IsDelaunay
(
TArrayView< const FVector2f > Vertices, |
||
| bool | IsDelaunay
(
TArrayView< const FVector2d > Vertices, |
||
| int32 | RemapIfDuplicate
(
int32 Index |
||
| bool | Triangulate
(
TArrayView< const TVector2< double >> Vertices, |
TODO: it would often be useful to pass in sparse vertex data / Optional function to allow Triangulate to skip vertices. | |
| bool | Triangulate
(
TArrayView< const TVector2< float >> Vertices, |
TODO: it would often be useful to pass in sparse vertex data / Optional function to allow Triangulate to skip vertices. | |
| bool | Triangulate
(
const TPolygon2< RealType >& Polygon, |
Triangulate a polygon, and optionally pass back the resulting triangles Uses the 'solid' fill mode, and fills the polygon regardless of the edge orientation Note: TrianglesOut may be empty or incomplete if the input is self-intersecting. | |
| bool | Triangulate
(
const TGeneralPolygon2< RealType >& GeneralPolygon, |
Triangulate a polygon, and optionally pass back the resulting triangles Uses a winding-number-based fill mode, and relies on the general polygon having correct orientations (Uses TGeneralPolygon2's OuterIsClockwise() to automatically choose between positive or negative winding) Note: TrianglesOut may be empty or incomplete if the input is self-intersecting. | |
| bool | ValidateResult
(
TArrayView< const FIndex2i > Edges |
Helper to perform standard validation on results after Triangulate or ConstrainEdges calls |
Enums
| Type | Name | Description | |
|---|---|---|---|
| EFillMode | Options for selecting what triangles to include in the output, for constrained Delaunay triangulation of polygons. |