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

#include <EmbedSurfacePath.h>

Public Member Functions

 FMeshSurfacePath (FDynamicMesh3 *Mesh)
 
virtual ~FMeshSurfacePath ()
 
GEOMETRYCORE_API bool IsConnected () const
 
bool IsClosed () const
 
void Reset ()
 
GEOMETRYCORE_API bool AddViaPlanarWalk (int StartTri, int StartVID, FVector3d StartPt, int EndTri, int EndVertID, FVector3d EndPt, FVector3d WalkPlaneNormal, TFunction< FVector3d(const FDynamicMesh3 *, int)> VertexToPosnFn=nullptr, bool bAllowBackwardsSearch=true, double AcceptEndPtOutsideDist=FMathd::ZeroTolerance, double PtOnPlaneThresholdSq=FMathf::ZeroTolerance *100, double BackwardsTolerance=FMathd::ZeroTolerance *10)
 
GEOMETRYCORE_API bool ClosePath ()
 
virtual EOperationValidationResult Validate ()
 
GEOMETRYCORE_API bool EmbedSimplePath (bool bUpdatePath, TArray< int > &PathVertices, bool bDoNotDuplicateFirstVertexID=true, double SnapElementThresholdSq=FMathf::ZeroTolerance *100)
 ‍**
 

Public Attributes

FDynamicMesh3Mesh
 
TArray< TPair< FMeshSurfacePoint, int > > Path
 
bool bIsClosed
 

Detailed Description

Walk the surface of an FDynamicMesh to try find a planar path connecting two points. Paths include every vertex and edge they need to cross. Greedy algorithm will only return one path if there are multiple. Represent a path on the surface of a mesh via barycentric coordinates and triangle references

Constructor & Destructor Documentation

◆ FMeshSurfacePath()

UE::Geometry::FMeshSurfacePath::FMeshSurfacePath ( FDynamicMesh3 Mesh)
inline

Cut mesh with plane. Assumption is that plane normal is Z value.

◆ ~FMeshSurfacePath()

virtual UE::Geometry::FMeshSurfacePath::~FMeshSurfacePath ( )
inlinevirtual

Member Function Documentation

◆ AddViaPlanarWalk()

bool FMeshSurfacePath::AddViaPlanarWalk ( int  StartTri,
int  StartVID,
FVector3d  StartPt,
int  EndTri,
int  EndVertID,
FVector3d  EndPt,
FVector3d  WalkPlaneNormal,
TFunction< FVector3d(const FDynamicMesh3 *, int)>  VertexToPosnFn = nullptr,
bool  bAllowBackwardsSearch = true,
double  AcceptEndPtOutsideDist = FMathd::ZeroTolerance,
double  PtOnPlaneThresholdSq = FMathf::ZeroTolerance*100,
double  BackwardsTolerance = FMathd::ZeroTolerance*10 
)

◆ ClosePath()

GEOMETRYCORE_API bool UE::Geometry::FMeshSurfacePath::ClosePath ( )

Make the embedded path into a closed loop. Only succeeds if path start and end already share a triangle!

Returns
true if succeeded

◆ EmbedSimplePath()

bool FMeshSurfacePath::EmbedSimplePath ( bool  bUpdatePath,
TArray< int > &  PathVertices,
bool  bDoNotDuplicateFirstVertexID = true,
double  SnapElementThresholdSq = FMathf::ZeroTolerance*100 
)

‍**

Embed a surface path in mesh provided that the path only crosses vertices and edges except at the start and end, so we can add the path easily with local edge splits and possibly two triangle pokes (rather than needing general remeshing machinery)

Parameters
bUpdatePathUpdating the Path array with the new vertices (if false, the path will no longer be valid after running this function)
PathVerticesIndices of the vertices on the path after embedding succeeds; NOTE these will not be 1:1 with the input Path
Returns
true if embedding succeeded.

Embed a surface path in mesh provided that the path only crosses vertices and edges except at the start and end, so we can add the path easily with local edge splits and possibly two triangle pokes (rather than needing general remeshing machinery) Also assumes triangles are only crossed over once (except possibly to loop around to the start triangle on the end triangle) Planar walks naturally create simple paths, so this function can be used on any paths created by single planar walks.

Parameters
bUpdatePathUpdating the Path array with the new vertices (if false, the path will no longer be valid after running this function)\
PathVerticesIndices of the vertices on the path after embedding succeeds; NOTE these will not be 1:1 with the input Path
Returns
true if embedding succeeded.

◆ IsClosed()

bool UE::Geometry::FMeshSurfacePath::IsClosed ( ) const
inline

◆ IsConnected()

bool FMeshSurfacePath::IsConnected ( ) const
Returns
True if the Path exactly sticks to the mesh surface, and never jumps to disconnected elements

◆ Reset()

void UE::Geometry::FMeshSurfacePath::Reset ( )
inline

◆ Validate()

virtual EOperationValidationResult UE::Geometry::FMeshSurfacePath::Validate ( )
inlinevirtual
Returns
EOperationValidationResult::Ok if we can apply operation, or error code if we cannot

Member Data Documentation

◆ bIsClosed

bool UE::Geometry::FMeshSurfacePath::bIsClosed

◆ Mesh

FDynamicMesh3* UE::Geometry::FMeshSurfacePath::Mesh

◆ Path

TArray<TPair<FMeshSurfacePoint, int> > UE::Geometry::FMeshSurfacePath::Path

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