Navigation
API > API/Plugins > API/Plugins/GeometryAlgorithms
Arrangement2d constructs a planar arrangement of a set of 2D line segments. When a segment is inserted, existing edges are split, and the inserted segment becomes multiple graph edges. So, the resulting FDynamicGraph2d should not have any edges that intersect.
Calculations are performed in double-precision, so there is no guarantee of correctness.
[TODO] multi-level segment has to accelerate find_intersecting_edges() [TODO] maybe smarter handling
| Name | FArrangement2d |
| Type | struct |
| Header File | /Engine/Plugins/Runtime/GeometryProcessing/Source/GeometryAlgorithms/Public/Arrangement2d.h |
| Include Path | #include "Arrangement2d.h" |
Syntax
struct FArrangement2d
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FArrangement2d
(
double PointHashCellSize |
Arrangement2d.h | ||
FArrangement2d
(
const FAxisAlignedBox2d& BoundsHint |
Arrangement2d.h |
Structs
| Name | Remarks |
|---|---|
| FIntersection | |
| FSegmentPoint |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| Graph | FDynamicGraph2d | Graph of arrangement | Arrangement2d.h | |
| PointHash | TPointHashGrid2d< int > | PointHash for vertices of graph. | Arrangement2d.h | |
| VertexSnapTol | double | Points within this tolerance are merged | Arrangement2d.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
bool AttemptTriangulate
(
TArray< FIntVector >& Triangles, |
Variant of AttemptTriangulate using FIntVector instead of FIndex3i; Note this incurs an extra copy of the triangle array | Arrangement2d.h | |
bool AttemptTriangulate
(
TArray< FIndex3i >& Triangles, |
Attempts to triangulates the arrangement with a constrained Delaunay triangulation NOTE: Will return all triangles if no edges found with the BoundaryEdgeGroupID NOTE: May fail if arrangement has self-intersections | Arrangement2d.h | |
void ConnectOpenBoundaries
(
double DistThresh |
Graph improvement connect open boundary vertices within DistThresh, by inserting new segments | Arrangement2d.h | |
bool HasSelfIntersections() |
Check if current Graph has self-intersections; not optimized, only for debugging | Arrangement2d.h | |
bool HasVertexNear
(
FVector2d Point, |
Check if vertex exists in region | Arrangement2d.h | |
void Insert
(
const FSegment2d& Segment, |
Insert segment into the arrangement | Arrangement2d.h | |
int Insert
(
const FVector2d& Pt |
Insert isolated point P into the arrangement | Arrangement2d.h | |
void Insert
(
const FVector2d& A, |
Insert segment [A,B] into the arrangement | Arrangement2d.h | |
void Insert
(
const FPolygon2d& Poly, |
Int N = pline.VertexCount - 1; for (int i = 0; i < N; ++i) { FVector2d A = pline[i]; FVector2d B = pline[i + 1]; insert_segment(A, B, GID); } | Arrangement2d.h | |
int32 InsertNewIsolatedPointUnsafe
(
const FVector2d& Pt |
Insert isolated point P into the arrangement when you know by construction it's not too close to any vertex or edge Much faster, but will break things if you use it to insert a point that is on top of any existing element! | Arrangement2d.h | |
FIndex2i SplitEdgeAtPoint
(
int EdgeID, |
Subdivide edge at a given position | Arrangement2d.h | |
| Attempts to triangulate the arrangement with a constrained Delaunay triangulation NOTE: May fail if arrangement has self-intersections | Arrangement2d.h | ||
| Attempts to triangulate the arrangement with a constrained Delaunay triangulation NOTE: May fail if arrangement has self-intersections | Arrangement2d.h | ||
| Attempts to triangulate the arrangement with a constrained Delaunay triangulation NOTE: May fail if arrangement has self-intersections | Arrangement2d.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
int find_existing_vertex
(
FVector2d Pt |
Find existing vertex at point, if it exists | Arrangement2d.h | |
bool find_intersecting_edges
(
FVector2d A, |
Find set of edges in graph that intersect with edge [A,B] | Arrangement2d.h | |
bool find_intersecting_floating_vertices
(
const FSegment2d& SegAB, |
Arrangement2d.h | ||
int find_nearest_boundary_vertex
(
FVector2d Pt, |
Find nearest boundary vertex, within SearchRadius | Arrangement2d.h | |
int find_nearest_vertex
(
FVector2d Pt, |
Find closest vertex, within SearchRadius | Arrangement2d.h | |
int insert_point
(
const FVector2d& P, |
Insert pt P into the arrangement, splitting existing edges as necessary | Arrangement2d.h | |
bool insert_segment
(
FVector2d A, |
Insert edge [A,B] into the arrangement, splitting existing edges as necessary | Arrangement2d.h | |
FIndex2i split_segment_at_t
(
int EID, |
Insert new point into segment EID at parameter value T If T is within Tol of endpoint of segment, we use that instead. | Arrangement2d.h |