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

#include <MeshBoundaryLoops.h>

Classes

struct  Subloops
 

Public Types

enum class  ESpanBehaviors { Ignore , Abort , Compute }
 
enum class  EFailureBehaviors { Abort , ConvertToOpenSpan }
 

Public Member Functions

 FMeshBoundaryLoops ()
 
 FMeshBoundaryLoops (const FDynamicMesh3 *MeshIn, bool bAutoCompute=true)
 
void SetMesh (const FDynamicMesh3 *MeshIn)
 
GEOMETRYCORE_API bool Compute ()
 
int GetLoopCount () const
 
int GetSpanCount () const
 
const FEdgeLoopoperator[] (int Index) const
 
GEOMETRYCORE_API int GetMaxVerticesLoopIndex () const
 
GEOMETRYCORE_API int GetLongestLoopIndex () const
 
GEOMETRYCORE_API FIndex2i FindVertexInLoop (int VertexID) const
 
GEOMETRYCORE_API int FindLoopContainingVertex (int VertexID) const
 
GEOMETRYCORE_API int FindLoopContainingEdge (int EdgeID) const
 
GEOMETRYCORE_API int FindLoopTrianglesHint (const TArray< int > &BorderHintTris) const
 
GEOMETRYCORE_API int FindLoopEdgesHint (const TSet< int > &BorderHintEdges) const
 
GEOMETRYCORE_API int FindSpanContainingEdge (int EdgeID) const
 

Public Attributes

const FDynamicMesh3Mesh = nullptr
 
TArray< FEdgeLoopLoops
 
TArray< FEdgeSpanSpans
 
bool bAborted = false
 
bool bSawOpenSpans = false
 
bool bFellBackToSpansOnFailure = false
 
ESpanBehaviors SpanBehavior = ESpanBehaviors::Compute
 
EFailureBehaviors FailureBehavior = EFailureBehaviors::ConvertToOpenSpan
 
TFunction< bool(int)> EdgeFilterFunc = nullptr
 
TArray< int > FailureBowties
 
bool bOnlyComputeSpans = false
 

Protected Member Functions

GEOMETRYCORE_API FVector3d GetVertexNormal (int vid)
 
GEOMETRYCORE_API int FindLeftTurnEdge (int incoming_e, int bowtie_v, TArray< int > &bdry_edges, int bdry_edges_count, TArray< bool > &used_edges)
 
GEOMETRYCORE_API bool ExtractSubloops (TArray< int > &loopV, TArray< int > &loopE, TArray< int > &bowties, Subloops &SubloopsOut)
 

Static Protected Member Functions

static GEOMETRYCORE_API bool IsSimpleBowtieLoop (const TArray< int > &LoopVerts, const TArray< int > &BowtieVerts, int BowtieVertex, int &start_i, int &end_i)
 
static GEOMETRYCORE_API bool IsSimplePath (const TArray< int > &LoopVerts, const TArray< int > &BowtieVerts, int BowtieVertex, int i1, int i2)
 
static GEOMETRYCORE_API void ExtractSpan (TArray< int > &Loop, int i0, int i1, bool bMarkInvalid, TArray< int > &OutSpan)
 
static GEOMETRYCORE_API int CountSpan (const TArray< int > &Loop, int i0, int i1)
 
static GEOMETRYCORE_API int FindIndex (const TArray< int > &Loop, int Start, int Item)
 
static GEOMETRYCORE_API int CountInList (const TArray< int > &Loop, int Item)
 

Protected Attributes

TArray< int > VerticesTemp
 

Friends

class FMeshRegionBoundaryLoops
 

Member Enumeration Documentation

◆ EFailureBehaviors

Enumerator
Abort 
ConvertToOpenSpan 

◆ ESpanBehaviors

Enumerator
Ignore 
Abort 
Compute 

Constructor & Destructor Documentation

◆ FMeshBoundaryLoops() [1/2]

UE::Geometry::FMeshBoundaryLoops::FMeshBoundaryLoops ( )
inline

◆ FMeshBoundaryLoops() [2/2]

UE::Geometry::FMeshBoundaryLoops::FMeshBoundaryLoops ( const FDynamicMesh3 MeshIn,
bool  bAutoCompute = true 
)
inline

Member Function Documentation

◆ Compute()

bool FMeshBoundaryLoops::Compute ( )

Find the set of boundary EdgeLoops and EdgeSpans. .SpanBehavior and .FailureBehavior control what happens if we run into problem cases

Returns
false if errors occurred, in this case output set is incomplete

◆ CountInList()

int FMeshBoundaryLoops::CountInList ( const TArray< int > &  Loop,
int  Item 
)
staticprotected

◆ CountSpan()

int FMeshBoundaryLoops::CountSpan ( const TArray< int > &  Loop,
int  i0,
int  i1 
)
staticprotected

◆ ExtractSpan()

void FMeshBoundaryLoops::ExtractSpan ( TArray< int > &  Loop,
int  i0,
int  i1,
bool  bMarkInvalid,
TArray< int > &  OutSpan 
)
staticprotected

◆ ExtractSubloops()

bool FMeshBoundaryLoops::ExtractSubloops ( TArray< int > &  loopV,
TArray< int > &  loopE,
TArray< int > &  bowties,
Subloops SubloopsOut 
)
protected

◆ FindIndex()

int FMeshBoundaryLoops::FindIndex ( const TArray< int > &  Loop,
int  Start,
int  Item 
)
staticprotected

◆ FindLeftTurnEdge()

int FMeshBoundaryLoops::FindLeftTurnEdge ( int  incoming_e,
int  bowtie_v,
TArray< int > &  bdry_edges,
int  bdry_edges_count,
TArray< bool > &  used_edges 
)
protected

◆ FindLoopContainingEdge()

int FMeshBoundaryLoops::FindLoopContainingEdge ( int  EdgeID) const
Returns
index of loop that contains edge, or -1 if not found

◆ FindLoopContainingVertex()

int FMeshBoundaryLoops::FindLoopContainingVertex ( int  VertexID) const
Returns
index of loop that contains vertex, or -1 if not found

◆ FindLoopEdgesHint()

int FMeshBoundaryLoops::FindLoopEdgesHint ( const TSet< int > &  BorderHintEdges) const
Returns
index of loop that best matches input edges, or -1 if not found

◆ FindLoopTrianglesHint()

int FMeshBoundaryLoops::FindLoopTrianglesHint ( const TArray< int > &  BorderHintTris) const
Returns
index of loop that best matches input triangles, or -1 if not found

◆ FindSpanContainingEdge()

int FMeshBoundaryLoops::FindSpanContainingEdge ( int  EdgeID) const
Returns
index of span that contains edge, or -1 if not found

◆ FindVertexInLoop()

FIndex2i FMeshBoundaryLoops::FindVertexInLoop ( int  VertexID) const
Returns
pair (LoopIndex,VertexIndexInLoop) of VertexID in EdgeLoops, or FIndex2i::Invalid if not found

◆ GetLongestLoopIndex()

int FMeshBoundaryLoops::GetLongestLoopIndex ( ) const
Returns
index of loop with longest arc length, or -1 if no loops

◆ GetLoopCount()

int UE::Geometry::FMeshBoundaryLoops::GetLoopCount ( ) const
inline
Returns
number of loops found by Compute()

◆ GetMaxVerticesLoopIndex()

int FMeshBoundaryLoops::GetMaxVerticesLoopIndex ( ) const
Returns
index of loop with maximum number of vertices

◆ GetSpanCount()

int UE::Geometry::FMeshBoundaryLoops::GetSpanCount ( ) const
inline
Returns
number of spans found by Compute()

◆ GetVertexNormal()

FVector3d FMeshBoundaryLoops::GetVertexNormal ( int  vid)
protected

◆ IsSimpleBowtieLoop()

bool FMeshBoundaryLoops::IsSimpleBowtieLoop ( const TArray< int > &  LoopVerts,
const TArray< int > &  BowtieVerts,
int  BowtieVertex,
int &  start_i,
int &  end_i 
)
staticprotected

◆ IsSimplePath()

bool FMeshBoundaryLoops::IsSimplePath ( const TArray< int > &  LoopVerts,
const TArray< int > &  BowtieVerts,
int  BowtieVertex,
int  i1,
int  i2 
)
staticprotected

◆ operator[]()

const FEdgeLoop & UE::Geometry::FMeshBoundaryLoops::operator[] ( int  Index) const
inline
Returns
Loop at the given index

◆ SetMesh()

void UE::Geometry::FMeshBoundaryLoops::SetMesh ( const FDynamicMesh3 MeshIn)
inline

Friends And Related Symbol Documentation

◆ FMeshRegionBoundaryLoops

Member Data Documentation

◆ bAborted

bool UE::Geometry::FMeshBoundaryLoops::bAborted = false

If true, we aborted computation due to unrecoverable errors

◆ bFellBackToSpansOnFailure

bool UE::Geometry::FMeshBoundaryLoops::bFellBackToSpansOnFailure = false

If true, we had to call back to spans because of failures during Compute(). This happens if we cannot extract simple loops from a loop with bowties.

◆ bOnlyComputeSpans

bool UE::Geometry::FMeshBoundaryLoops::bOnlyComputeSpans = false

After finding spans of connected edges, don't convert them to loops – just leave them all as spans

◆ bSawOpenSpans

bool UE::Geometry::FMeshBoundaryLoops::bSawOpenSpans = false

If true, we found at least one open span during Compute(). This can occur in failure cases or if the search is restricted to a subset using EdgeFilterFunc

◆ EdgeFilterFunc

TFunction<bool(int)> UE::Geometry::FMeshBoundaryLoops::EdgeFilterFunc = nullptr

If non-null, then only edges that pass this filter are considered. This may result in open spans.

◆ FailureBehavior

EFailureBehaviors UE::Geometry::FMeshBoundaryLoops::FailureBehavior = EFailureBehaviors::ConvertToOpenSpan

What Compute() will do if it encounters unrecoverable errors while walking around a loop

◆ FailureBowties

TArray<int> UE::Geometry::FMeshBoundaryLoops::FailureBowties

If we encountered unrecoverable errors, it is generally due to bowtie vertices. The problematic bowties will be returned here so that the client can try repairing these vertices.

◆ Loops

TArray<FEdgeLoop> UE::Geometry::FMeshBoundaryLoops::Loops

Resulting set of loops filled by Compute()

◆ Mesh

const FDynamicMesh3* UE::Geometry::FMeshBoundaryLoops::Mesh = nullptr

Mesh we are finding loops on

◆ SpanBehavior

ESpanBehaviors UE::Geometry::FMeshBoundaryLoops::SpanBehavior = ESpanBehaviors::Compute

What Compute() will do if it encounter open spans

◆ Spans

TArray<FEdgeSpan> UE::Geometry::FMeshBoundaryLoops::Spans

Resulting set of spans filled by Compute(), if SpanBehavior == Compute

◆ VerticesTemp

TArray<int> UE::Geometry::FMeshBoundaryLoops::VerticesTemp
protected

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