MeshLib Documentation
Loading...
Searching...
No Matches

Collection of functions and structures needed for PointCloud triangulation . More...

Classes

struct  MR::TriangulationHelpers::TriangulatedFanData
 Data with caches for optimizing fan triangulation. More...
 

Functions

MRMESH_API float MR::TriangulationHelpers::updateNeighborsRadius (const VertCoords &points, VertId v, VertId boundaryV, const std::vector< VertId > &fan, float baseRadius)
 Finds max radius of neighbors search, for possible better local triangulation.
 
MRMESH_API void MR::TriangulationHelpers::findNeighborsInBall (const PointCloud &pointCloud, VertId v, float radius, std::vector< VertId > &neighbors)
 Finds all neighbors of v in given radius (v excluded)
 
MRMESH_API float MR::TriangulationHelpers::findNumNeighbors (const PointCloud &pointCloud, VertId v, int numNeis, std::vector< VertId > &neighbors, FewSmallest< PointsProjectionResult > &tmp, float upDistLimitSq=FLT_MAX)
 Finds at most given number of neighbors of v (v excluded)
 
MRMESH_API void MR::TriangulationHelpers::filterNeighbors (const VertNormals &normals, VertId v, std::vector< VertId > &neighbors)
 Filter neighbors with crossing normals.
 
MRMESH_API bool MR::TriangulationHelpers::isBoundaryPoint (const PointCloud &cloud, VertId v, const Settings &settings, TriangulatedFanData &fanData)
 Checks if given vertex is on boundary of the point cloud, by constructing local triangulation around it.
 

Detailed Description

Collection of functions and structures needed for PointCloud triangulation .

Function Documentation

◆ filterNeighbors()

MRMESH_API void MR::TriangulationHelpers::filterNeighbors ( const VertNormals & normals,
VertId v,
std::vector< VertId > & neighbors )

Filter neighbors with crossing normals.

◆ findNeighborsInBall()

MRMESH_API void MR::TriangulationHelpers::findNeighborsInBall ( const PointCloud & pointCloud,
VertId v,
float radius,
std::vector< VertId > & neighbors )

Finds all neighbors of v in given radius (v excluded)

◆ findNumNeighbors()

MRMESH_API float MR::TriangulationHelpers::findNumNeighbors ( const PointCloud & pointCloud,
VertId v,
int numNeis,
std::vector< VertId > & neighbors,
FewSmallest< PointsProjectionResult > & tmp,
float upDistLimitSq = FLT_MAX )

Finds at most given number of neighbors of v (v excluded)

Parameters
tmptemporary storage to avoid its allocation
upDistLimitSqupper limit on the distance in question, points with larger distance than it will not be returned
Returns
maxDistSq to the furthest returned neighbor (or 0 if no neighbours are returned)

◆ isBoundaryPoint()

MRMESH_API bool MR::TriangulationHelpers::isBoundaryPoint ( const PointCloud & cloud,
VertId v,
const Settings & settings,
TriangulatedFanData & fanData )
nodiscard

Checks if given vertex is on boundary of the point cloud, by constructing local triangulation around it.

Parameters
cloudinput point cloud
vvertex id to check
settingsall parameters of the computation
fanDatacache structure for neighbors, not to allocate for multiple calls
Returns
true if vertex is boundary, false otherwise

◆ updateNeighborsRadius()

MRMESH_API float MR::TriangulationHelpers::updateNeighborsRadius ( const VertCoords & points,
VertId v,
VertId boundaryV,
const std::vector< VertId > & fan,
float baseRadius )

Finds max radius of neighbors search, for possible better local triangulation.

Parameters
borderVfirst boundary vertex in
fan(next VertId in fan is also boundary but first is enough)