/Engine/Plugins/Runtime/GeometryProcessing/Source/DynamicMesh/Public/Operations/PolyModeling/PolyModelingFaceUtil.h
Try to compute a good "Frame" for the selected Triangles of the Mesh. Only the largest triangle-connected-component of Triangles is considered. The Frame Z is aligned with the area-weighted average normal of the connected triangles. Initially the Frame is placed at the area-weighted centroid of the connected triangles. Rays are cast along Z in both directions, if either hits, the Frame is translated to the nearer hit.
namespace UE { namespace Geometry { [FFrame3d](API\Runtime\GeometryCore\FFrame3d_1) UE::Geometry::ComputeFaceSelectionFrame ( const [FDynamicMesh3](API\Runtime\GeometryCore\DynamicMesh\FDynamicMesh3) & Mesh, const [TArray](API\Runtime\Core\Containers\TArray)< int32 > & Triangles, bool bIsDefinitelySingleComponent ) } }