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

#include <MeshRegionBoundaryLoops.h>

Public Types

template<typename ElementType >
using ElementIDAndValue = TPair< int32, ElementType >
 
template<typename ElementType >
using VidOverlayMap = TMap< int32, ElementIDAndValue< ElementType > >
 

Public Member Functions

 FMeshRegionBoundaryLoops ()
 
GEOMETRYCORE_API FMeshRegionBoundaryLoops (const FDynamicMesh3 *MeshIn, const TArray< int > &RegionTris, bool bAutoCompute=true)
 
GEOMETRYCORE_API void SetMesh (const FDynamicMesh3 *MeshIn, const TArray< int > &RegionTris)
 
GEOMETRYCORE_API bool Compute ()
 
int32 GetLoopCount () const
 
int32 Num () const
 
const FEdgeLoopoperator[] (int Index) const
 
const TArray< FEdgeLoop > & GetLoops () const
 
GEOMETRYCORE_API int GetMaxVerticesLoopIndex () const
 
template<typename StorageType , int ElementSize, typename ElementType >
GEOMETRYCORE_API bool GetLoopOverlayMap (const FEdgeLoop &LoopIn, const TDynamicMeshOverlay< StorageType, ElementSize > &Overlay, VidOverlayMap< ElementType > &LoopVidsToOverlayElementsOut)
 
template<typename StorageType , int ElementSize, typename ElementType >
GEOMETRYCORE_API void UpdateLoopOverlayMapValidity (VidOverlayMap< ElementType > &LoopVidsToOverlayElements, const TDynamicMeshOverlay< StorageType, ElementSize > &Overlay)
 
template<typename StorageType , int ElementSize, typename ElementType >
bool GetLoopOverlayMap (const FEdgeLoop &LoopIn, const TDynamicMeshOverlay< StorageType, ElementSize > &Overlay, VidOverlayMap< ElementType > &LoopVidsToOverlayElementsOut)
 
template<typename StorageType , int ElementSize, typename ElementType >
void UpdateLoopOverlayMapValidity (VidOverlayMap< ElementType > &LoopVidsToOverlayElements, const TDynamicMeshOverlay< StorageType, ElementSize > &Overlay)
 

Static Public Member Functions

static GEOMETRYCORE_API bool GetTriangleSetBoundaryLoop (const FDynamicMesh3 &Mesh, const TArray< int32 > &Tris, FEdgeLoop &Loop)
 

Public Attributes

const FDynamicMesh3Mesh = nullptr
 
TArray< FEdgeLoopLoops
 
bool bFailed = false
 

Protected Member Functions

bool IsEdgeOnBoundary (int eid) const
 
GEOMETRYCORE_API bool IsEdgeOnBoundary (int eid, int &tid_in, int &tid_out) const
 
GEOMETRYCORE_API FIndex2i GetOrientedEdgeVerts (int eID, int tid_in)
 
GEOMETRYCORE_API int GetVertexBoundaryEdges (int vID, int &e0, int &e1)
 
GEOMETRYCORE_API int GetAllVertexBoundaryEdges (int vID, TArray< int > &e)
 
GEOMETRYCORE_API FVector3d GetVertexNormal (int vid)
 
GEOMETRYCORE_API int FindLeftTurnEdge (int incoming_e, int bowtie_v, TArray< int > &bdry_edges, int bdry_edges_count, const FIndexFlagSet &used_edges)
 
GEOMETRYCORE_API bool TryExtractSubloops (TArray< int > &loopV, const TArray< int > &loopE, const TArray< int > &bowties, TArray< FEdgeLoop > &SubLoopsOut)
 

Protected Attributes

FIndexFlagSet Triangles
 
FIndexFlagSet Edges
 
TArray< int > edges_roi
 

Detailed Description

Extract FEdgeLoops on the boundary of a set of triangles of a mesh.

Member Typedef Documentation

◆ ElementIDAndValue

template<typename ElementType >
using UE::Geometry::FMeshRegionBoundaryLoops::ElementIDAndValue = TPair<int32, ElementType>

◆ VidOverlayMap

Constructor & Destructor Documentation

◆ FMeshRegionBoundaryLoops() [1/2]

UE::Geometry::FMeshRegionBoundaryLoops::FMeshRegionBoundaryLoops ( )
inline

◆ FMeshRegionBoundaryLoops() [2/2]

FMeshRegionBoundaryLoops::FMeshRegionBoundaryLoops ( const FDynamicMesh3 MeshIn,
const TArray< int > &  RegionTris,
bool  bAutoCompute = true 
)

Member Function Documentation

◆ Compute()

bool FMeshRegionBoundaryLoops::Compute ( )

Find set of FEdgeLoops on the border of the input triangle set

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

◆ FindLeftTurnEdge()

int FMeshRegionBoundaryLoops::FindLeftTurnEdge ( int  incoming_e,
int  bowtie_v,
TArray< int > &  bdry_edges,
int  bdry_edges_count,
const FIndexFlagSet used_edges 
)
protected

◆ GetAllVertexBoundaryEdges()

int FMeshRegionBoundaryLoops::GetAllVertexBoundaryEdges ( int  vID,
TArray< int > &  e 
)
protected

◆ GetLoopCount()

int32 UE::Geometry::FMeshRegionBoundaryLoops::GetLoopCount ( ) const
inline
Returns
number of loops found by Compute()

◆ GetLoopOverlayMap() [1/2]

template<typename StorageType , int ElementSize, typename ElementType >
bool UE::Geometry::FMeshRegionBoundaryLoops::GetLoopOverlayMap ( const FEdgeLoop LoopIn,
const TDynamicMeshOverlay< StorageType, ElementSize > &  Overlay,
VidOverlayMap< ElementType > &  LoopVidsToOverlayElementsOut 
)

◆ GetLoopOverlayMap() [2/2]

template<typename StorageType , int ElementSize, typename ElementType >
GEOMETRYCORE_API bool UE::Geometry::FMeshRegionBoundaryLoops::GetLoopOverlayMap ( const FEdgeLoop LoopIn,
const TDynamicMeshOverlay< StorageType, ElementSize > &  Overlay,
VidOverlayMap< ElementType > &  LoopVidsToOverlayElementsOut 
)

Generates a map from vertex ID's of the loop vertices to corresponding overlay element ID's and values. The elements chosen are those associated with the internal triangle whose edge goes out of that vertex in the loop direction. The function is useful in cases where the triangles inside the loop will be deleted and replaced, and we want to keep the same UV's on the border vertices. Does not clear LoopVidsToOverlayElementsOut before use (simply adds to it), so could be used for multiple loops.

Returns
false if there is an error (if the overlay does not have an element for one of the vids)

◆ GetLoops()

const TArray< FEdgeLoop > & UE::Geometry::FMeshRegionBoundaryLoops::GetLoops ( ) const
inline

◆ GetMaxVerticesLoopIndex()

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

◆ GetOrientedEdgeVerts()

FIndex2i FMeshRegionBoundaryLoops::GetOrientedEdgeVerts ( int  eID,
int  tid_in 
)
protected

◆ GetTriangleSetBoundaryLoop()

bool FMeshRegionBoundaryLoops::GetTriangleSetBoundaryLoop ( const FDynamicMesh3 Mesh,
const TArray< int32 > &  Tris,
FEdgeLoop Loop 
)
static

Find the edge loop border around a set of triangles of a Mesh. This is computed via local walk and so does not create any full-mesh data structures. However current implementation may not be efficient for large triangle sets. Algorithm terminates if a non-manifold boundary is detected, and returns false if some triangles are unused.

Parameters
Loopoutput loop will be stored here. This value is garbage if false is returned.
Returns
true if a single well-formed loop was found, false if non-manifold or failure case encountered

◆ GetVertexBoundaryEdges()

int FMeshRegionBoundaryLoops::GetVertexBoundaryEdges ( int  vID,
int &  e0,
int &  e1 
)
protected

◆ GetVertexNormal()

FVector3d FMeshRegionBoundaryLoops::GetVertexNormal ( int  vid)
protected

◆ IsEdgeOnBoundary() [1/2]

bool UE::Geometry::FMeshRegionBoundaryLoops::IsEdgeOnBoundary ( int  eid) const
inlineprotected

◆ IsEdgeOnBoundary() [2/2]

bool FMeshRegionBoundaryLoops::IsEdgeOnBoundary ( int  eid,
int &  tid_in,
int &  tid_out 
) const
protected

◆ Num()

int32 UE::Geometry::FMeshRegionBoundaryLoops::Num ( ) const
inline
Returns
number of loops found by Compute()

◆ operator[]()

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

◆ SetMesh()

void FMeshRegionBoundaryLoops::SetMesh ( const FDynamicMesh3 MeshIn,
const TArray< int > &  RegionTris 
)

◆ TryExtractSubloops()

bool FMeshRegionBoundaryLoops::TryExtractSubloops ( TArray< int > &  loopV,
const TArray< int > &  loopE,
const TArray< int > &  bowties,
TArray< FEdgeLoop > &  SubLoopsOut 
)
protected

◆ UpdateLoopOverlayMapValidity() [1/2]

template<typename StorageType , int ElementSize, typename ElementType >
void UE::Geometry::FMeshRegionBoundaryLoops::UpdateLoopOverlayMapValidity ( VidOverlayMap< ElementType > &  LoopVidsToOverlayElements,
const TDynamicMeshOverlay< StorageType, ElementSize > &  Overlay 
)

◆ UpdateLoopOverlayMapValidity() [2/2]

template<typename StorageType , int ElementSize, typename ElementType >
GEOMETRYCORE_API void UE::Geometry::FMeshRegionBoundaryLoops::UpdateLoopOverlayMapValidity ( VidOverlayMap< ElementType > &  LoopVidsToOverlayElements,
const TDynamicMeshOverlay< StorageType, ElementSize > &  Overlay 
)

Given a map generated by GetLoopOverlayMap(), checks that the overlay elements pointed to by the map still exist in the overlay, and sets the ID to be invalid if not. This can be called after deleting the triangles inside a loop to update the generated map and remove any UV elements that no longer exist (because the vertex was on a UV seam).

Member Data Documentation

◆ bFailed

bool UE::Geometry::FMeshRegionBoundaryLoops::bFailed = false

If true, we did not completely succeed in extracting all loops

◆ Edges

FIndexFlagSet UE::Geometry::FMeshRegionBoundaryLoops::Edges
protected

◆ edges_roi

TArray<int> UE::Geometry::FMeshRegionBoundaryLoops::edges_roi
protected

◆ Loops

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

Resulting set of loops filled by Compute()

◆ Mesh

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

Mesh we are finding loops on

◆ Triangles

FIndexFlagSet UE::Geometry::FMeshRegionBoundaryLoops::Triangles
protected

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