UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
UE::Geometry::FEdgeSpan Class Reference

#include <EdgeSpan.h>

Public Member Functions

 FEdgeSpan ()
 
 FEdgeSpan (const FDynamicMesh3 *mesh)
 
 FEdgeSpan (const FDynamicMesh3 *mesh, const TArray< int > &vertices, const TArray< int > &edges)
 
GEOMETRYCORE_API void Initialize (const FDynamicMesh3 *mesh, const TArray< int > &vertices, const TArray< int > &edges, const TArray< int > *BowtieVerticesIn=nullptr)
 
GEOMETRYCORE_API void InitializeFromEdges (const TArray< int > &EdgesIn)
 
void InitializeFromEdges (const FDynamicMesh3 *MeshIn, const TArray< int > &EdgesIn)
 
bool InitializeFromVertices (const FDynamicMesh3 *MeshIn, const TArray< int > &VerticesIn, bool bAutoOrient=true)
 
GEOMETRYCORE_API bool InitializeFromVertices (const TArray< int > &VerticesIn, bool bAutoOrient=true)
 
void SetBowtieVertices (const TArray< int > &Bowties)
 
GEOMETRYCORE_API void CalculateBowtieVertices ()
 
int GetVertexCount () const
 
int GetEdgeCount () const
 
FVector3d GetVertex (int SpanIndex) const
 
GEOMETRYCORE_API FAxisAlignedBox3d GetBounds () const
 
GEOMETRYCORE_API void GetPolyline (FPolyline3d &PolylineOut) const
 
GEOMETRYCORE_API bool SetCorrectOrientation ()
 
void Reverse ()
 
GEOMETRYCORE_API bool IsInternalspan () const
 
GEOMETRYCORE_API bool IsBoundaryspan (const FDynamicMesh3 *TestMesh=nullptr) const
 
GEOMETRYCORE_API int FindVertexIndex (int VertexID) const
 
GEOMETRYCORE_API int FindNearestVertexIndex (const FVector3d &QueryPoint) const
 
GEOMETRYCORE_API bool CheckValidity (EValidityCheckFailMode FailMode=EValidityCheckFailMode::Check) const
 
GEOMETRYCORE_API void GetSubspansByAngle (double AngleThresholdDeg, int32 MinSpanSize, TArray< FEdgeSpan > &OutSpans) const
 

Static Public Member Functions

static GEOMETRYCORE_API void VertexSpanToEdgeSpan (const FDynamicMesh3 *Mesh, const TArray< int > &VertexSpan, TArray< int > &OutEdgeSpan)
 

Public Attributes

const FDynamicMesh3Mesh
 
TArray< int > Vertices
 
TArray< int > Edges
 
TArray< int > BowtieVertices
 
bool bBowtiesCalculated = false
 

Detailed Description

Sequential lists of vertices/edges in a mesh that is not closed. If the list is closed it should be an FEdgeLoop

Constructor & Destructor Documentation

◆ FEdgeSpan() [1/3]

UE::Geometry::FEdgeSpan::FEdgeSpan ( )
inline

◆ FEdgeSpan() [2/3]

UE::Geometry::FEdgeSpan::FEdgeSpan ( const FDynamicMesh3 mesh)
inline

◆ FEdgeSpan() [3/3]

UE::Geometry::FEdgeSpan::FEdgeSpan ( const FDynamicMesh3 mesh,
const TArray< int > &  vertices,
const TArray< int > &  edges 
)
inline

Initialize EdgeSpan with the given vertices and edges

Member Function Documentation

◆ CalculateBowtieVertices()

void FEdgeSpan::CalculateBowtieVertices ( )

Populate the BowtieVertices member

◆ CheckValidity()

bool FEdgeSpan::CheckValidity ( EValidityCheckFailMode  FailMode = EValidityCheckFailMode::Check) const

Exhaustively check that verts and edges of this EdgeSpan are consistent. This is quite expensive.

Returns
true if span is consistent/valid

◆ FindNearestVertexIndex()

int FEdgeSpan::FindNearestVertexIndex ( const FVector3d QueryPoint) const
Returns
index of vertex in the Vertices list that is closest to QueryPoint

◆ FindVertexIndex()

int FEdgeSpan::FindVertexIndex ( int  VertexID) const
Returns
index of VertexID in the Vertices list, or -1 if not found

◆ GetBounds()

FAxisAlignedBox3d FEdgeSpan::GetBounds ( ) const
Returns
bounding box of the vertices of the EdgeSpan

◆ GetEdgeCount()

int UE::Geometry::FEdgeSpan::GetEdgeCount ( ) const
inline
Returns
number of edges in the span

◆ GetPolyline()

void FEdgeSpan::GetPolyline ( FPolyline3d PolylineOut) const

Extract Polyline from Mesh based on vertex list

◆ GetSubspansByAngle()

void FEdgeSpan::GetSubspansByAngle ( double  AngleThresholdDeg,
int32  MinSpanSize,
TArray< FEdgeSpan > &  OutSpans 
) const

Split a single EdgeSpan into multiple subspans based on an edge angle threshold. Subspans are copied out, the original span is not modified.

Parameters
AngleThresholdDegmax angle between adjacant edges to mark a vertex as a "corner" (in degrees). Angle is measured between edge vectors extending from their common vertex, so a value of 180 means all vertices would be labelled as corners.
MinSpanSizeminimum number of edges necessary for a subspan, regardless of angles between edges. Subspans that would be too small are merged to adjacent subspans.
OutSpanoutput subspans

◆ GetVertex()

FVector3d UE::Geometry::FEdgeSpan::GetVertex ( int  SpanIndex) const
inline
Returns
vertex position in span at the given SpanIndex

◆ GetVertexCount()

int UE::Geometry::FEdgeSpan::GetVertexCount ( ) const
inline
Returns
number of vertices in the span

◆ Initialize()

void FEdgeSpan::Initialize ( const FDynamicMesh3 mesh,
const TArray< int > &  vertices,
const TArray< int > &  edges,
const TArray< int > *  BowtieVerticesIn = nullptr 
)

Initialize the loop data

◆ InitializeFromEdges() [1/2]

void UE::Geometry::FEdgeSpan::InitializeFromEdges ( const FDynamicMesh3 MeshIn,
const TArray< int > &  EdgesIn 
)
inline

Construct an FEdgeSpan from a list of edges of the mesh

Parameters
MeshInthe mesh the edges exist on
EdgesInlist of sequential connected edges

◆ InitializeFromEdges() [2/2]

void FEdgeSpan::InitializeFromEdges ( const TArray< int > &  EdgesIn)

Construct an FEdgeSpan from a list of edges of the mesh

Parameters
EdgesInlist of sequential connected edges

◆ InitializeFromVertices() [1/2]

bool UE::Geometry::FEdgeSpan::InitializeFromVertices ( const FDynamicMesh3 MeshIn,
const TArray< int > &  VerticesIn,
bool  bAutoOrient = true 
)
inline

Construct EdgeSpan from list of vertices of mesh

Parameters
MeshInMesh that contains the span
VerticesInlist of vertices that are sequentially connected by edges
bAutoOrientif true, and any of the edges are boundary edges, we will re-orient the span to be consistent with boundary edges
Returns
false if we found any parts of VerticesIn that are not connected by an edge

◆ InitializeFromVertices() [2/2]

bool FEdgeSpan::InitializeFromVertices ( const TArray< int > &  VerticesIn,
bool  bAutoOrient = true 
)

Construct EdgeSpan from list of vertices of mesh

Parameters
VerticesInlist of vertices that are sequentially connected by edges
bAutoOrientif true, and any of the edges are boundary edges, we will re-orient the span to be consistent with boundary edges
Returns
false if we found any parts of VerticesIn that are not connected by an edge

◆ IsBoundaryspan()

bool FEdgeSpan::IsBoundaryspan ( const FDynamicMesh3 TestMesh = nullptr) const
Parameters
TestMeshuse this mesh instead of the internal Mesh pointer
Returns
true if all edges of this span are boundary edges

◆ IsInternalspan()

bool FEdgeSpan::IsInternalspan ( ) const
Returns
true if all edges of this span are internal edges, ie not on the mesh boundary

◆ Reverse()

void UE::Geometry::FEdgeSpan::Reverse ( )
inline

Reverse order of vertices and edges in span

◆ SetBowtieVertices()

void UE::Geometry::FEdgeSpan::SetBowtieVertices ( const TArray< int > &  Bowties)
inline

Set the bowtie vertices

◆ SetCorrectOrientation()

bool FEdgeSpan::SetCorrectOrientation ( )

If any edges if the span are on a mesh boundary, we can check that the span is oriented such that it corresponds with the boundary edges, and if not, reverse it.

Returns
true if the span was reversed

◆ VertexSpanToEdgeSpan()

void FEdgeSpan::VertexSpanToEdgeSpan ( const FDynamicMesh3 Mesh,
const TArray< int > &  VertexSpan,
TArray< int > &  OutEdgeSpan 
)
static

Utility function to convert a vertex span to an edge span

Parameters
Meshmesh to operate on
Vertexspanordered list of vertices
OutEdgeSpancomputed list of sequential connected vertices

Member Data Documentation

◆ bBowtiesCalculated

bool UE::Geometry::FEdgeSpan::bBowtiesCalculated = false

If true, then BowtieVertices list is valid

◆ BowtieVertices

TArray<int> UE::Geometry::FEdgeSpan::BowtieVertices

List of bowtie vertices. This list is only valid if bBowtiesCalculated = true.

◆ Edges

TArray<int> UE::Geometry::FEdgeSpan::Edges

Ordered list of edges forming the EdgeSpan

◆ Mesh

const FDynamicMesh3* UE::Geometry::FEdgeSpan::Mesh

The Mesh that contains this EdgeSpan

◆ Vertices

TArray<int> UE::Geometry::FEdgeSpan::Vertices

Ordered list of vertices forming the EdgeSpan


The documentation for this class was generated from the following files: