MeshLib
 
Loading...
Searching...
No Matches
PointCloud

Classes

struct  MR::PointCloud
 
struct  MR::PointCloudRelaxParams
 
struct  MR::PointCloudApproxRelaxParams
 
class  MR::RegularMapMesher
 Class for making mesh from regular distance map. More...
 

Functions

MRMESH_API bool MR::improveSampling (const PointCloud &cloud, VertBitSet &samples, const ImproveSamplingSettings &settings)
 
MRMESH_API std::optional< VertNormalsMR::makeUnorientedNormals (const PointCloud &pointCloud, float radius, const ProgressCallback &progress={}, OrientNormals orient=OrientNormals::Smart)
 Makes normals for valid points of given point cloud by directing them along the normal of best plane through the neighbours.
 
MRMESH_API std::optional< VertNormalsMR::makeUnorientedNormals (const PointCloud &pointCloud, const AllLocalTriangulations &triangs, const ProgressCallback &progress={}, OrientNormals orient=OrientNormals::Smart)
 Makes normals for valid points of given point cloud by averaging neighbor triangle normals weighted by triangle's angle \triangs triangulation neighbours of each point.
 
MRMESH_API std::optional< VertNormalsMR::makeUnorientedNormals (const PointCloud &pointCloud, const Buffer< VertId > &closeVerts, int numNei, const ProgressCallback &progress={}, OrientNormals orient=OrientNormals::Smart)
 Makes normals for valid points of given point cloud by directing them along the normal of best plane through the neighbours.
 
MRMESH_API bool MR::orientNormals (const PointCloud &pointCloud, VertNormals &normals, float radius, const ProgressCallback &progress={})
 Select orientation of given normals to make directions of close points consistent;.
 
MRMESH_API bool MR::orientNormals (const PointCloud &pointCloud, VertNormals &normals, const AllLocalTriangulations &triangs, const ProgressCallback &progress={})
 Select orientation of given normals to make directions of close points consistent;.
 
MRMESH_API bool MR::orientNormals (const PointCloud &pointCloud, VertNormals &normals, const Buffer< VertId > &closeVerts, int numNei, const ProgressCallback &progress={})
 Select orientation of given normals to make directions of close points consistent;.
 
MRMESH_API std::optional< VertNormalsMR::makeOrientedNormals (const PointCloud &pointCloud, float radius, const ProgressCallback &progress={})
 Makes normals for valid points of given point cloud; directions of close points are selected to be consistent;.
 
MRMESH_API std::optional< VertNormalsMR::makeOrientedNormals (const PointCloud &pointCloud, AllLocalTriangulations &triangs, const ProgressCallback &progress={})
 Makes normals for valid points of given point cloud; directions of close points are selected to be consistent; \triangs triangulation neighbours of each point, which are oriented during the call as well.
 
MRMESH_API VertNormals MR::makeNormals (const PointCloud &pointCloud, int avgNeighborhoodSize=48)
 Makes consistent normals for valid points of given point cloud.
 
MRMESH_API float MR::findAvgPointsRadius (const PointCloud &pointCloud, int avgPoints, int samples=1024)
 Finds the radius of ball, so on average that ball contained avgPoints excluding the central point.
 
MRMESH_API bool MR::relax (PointCloud &pointCloud, const PointCloudRelaxParams &params={}, ProgressCallback cb={})
 
MRMESH_API bool MR::relaxKeepVolume (PointCloud &pointCloud, const PointCloudRelaxParams &params={}, ProgressCallback cb={})
 
MRMESH_API bool MR::relaxApprox (PointCloud &pointCloud, const PointCloudApproxRelaxParams &params={}, ProgressCallback cb={})
 
MRMESH_API std::optional< VertBitSetMR::pointUniformSampling (const PointCloud &pointCloud, const UniformSamplingSettings &settings)
 
MRMESH_API std::optional< PointCloudMR::makeUniformSampledCloud (const PointCloud &pointCloud, const UniformSamplingSettings &settings)
 

Detailed Description

Function Documentation

◆ findAvgPointsRadius()

MRMESH_API float MR::findAvgPointsRadius ( const PointCloud & pointCloud,
int avgPoints,
int samples = 1024 )

Finds the radius of ball, so on average that ball contained avgPoints excluding the central point.

Parameters
samplesthe number of test points to find given number of samples in each

◆ improveSampling()

MRMESH_API bool MR::improveSampling ( const PointCloud & cloud,
VertBitSet & samples,
const ImproveSamplingSettings & settings )

Finds more representative sampling starting from a given one following k-means method;

Parameters
samplesinput and output selected sample points from
cloud;
Returns
false if it was terminated by the callback

◆ makeNormals()

MRMESH_API VertNormals MR::makeNormals ( const PointCloud & pointCloud,
int avgNeighborhoodSize = 48 )

Makes consistent normals for valid points of given point cloud.

Parameters
avgNeighborhoodSizeavg num of neighbors of each individual point

◆ makeOrientedNormals() [1/2]

MRMESH_API std::optional< VertNormals > MR::makeOrientedNormals ( const PointCloud & pointCloud,
AllLocalTriangulations & triangs,
const ProgressCallback & progress = {} )
nodiscard

Makes normals for valid points of given point cloud; directions of close points are selected to be consistent; \triangs triangulation neighbours of each point, which are oriented during the call as well.

Returns
nullopt if progress returned false

◆ makeOrientedNormals() [2/2]

MRMESH_API std::optional< VertNormals > MR::makeOrientedNormals ( const PointCloud & pointCloud,
float radius,
const ProgressCallback & progress = {} )
nodiscard

Makes normals for valid points of given point cloud; directions of close points are selected to be consistent;.

Parameters
radiusof neighborhood to consider
Returns
nullopt if progress returned false

◆ makeUniformSampledCloud()

MRMESH_API std::optional< PointCloud > MR::makeUniformSampledCloud ( const PointCloud & pointCloud,
const UniformSamplingSettings & settings )
nodiscard

Composes new point cloud consisting of uniform samples of original point cloud; returns std::nullopt if it was terminated by the callback

◆ makeUnorientedNormals() [1/3]

MRMESH_API std::optional< VertNormals > MR::makeUnorientedNormals ( const PointCloud & pointCloud,
const AllLocalTriangulations & triangs,
const ProgressCallback & progress = {},
OrientNormals orient = OrientNormals::Smart )
nodiscard

Makes normals for valid points of given point cloud by averaging neighbor triangle normals weighted by triangle's angle \triangs triangulation neighbours of each point.

Parameters
orientOrientNormals::Smart here means orientation from normals of neigbour triangles
Returns
nullopt if progress returned false

◆ makeUnorientedNormals() [2/3]

MRMESH_API std::optional< VertNormals > MR::makeUnorientedNormals ( const PointCloud & pointCloud,
const Buffer< VertId > & closeVerts,
int numNei,
const ProgressCallback & progress = {},
OrientNormals orient = OrientNormals::Smart )
nodiscard

Makes normals for valid points of given point cloud by directing them along the normal of best plane through the neighbours.

Parameters
closeVertsa buffer where for every valid point #i its neighbours are stored at indices [i*numNei; (i+1)*numNei)
orientOrientNormals::Smart here means orientation from best fit plane
Returns
nullopt if progress returned false

◆ makeUnorientedNormals() [3/3]

MRMESH_API std::optional< VertNormals > MR::makeUnorientedNormals ( const PointCloud & pointCloud,
float radius,
const ProgressCallback & progress = {},
OrientNormals orient = OrientNormals::Smart )
nodiscard

Makes normals for valid points of given point cloud by directing them along the normal of best plane through the neighbours.

Parameters
radiusof neighborhood to consider
orientOrientNormals::Smart here means orientation from best fit plane
Returns
nullopt if progress returned false

◆ orientNormals() [1/3]

MRMESH_API bool MR::orientNormals ( const PointCloud & pointCloud,
VertNormals & normals,
const AllLocalTriangulations & triangs,
const ProgressCallback & progress = {} )

Select orientation of given normals to make directions of close points consistent;.

Parameters
radiusof neighborhood to consider
Returns
false if progress returned false Unlike simple orientNormals this method constructs local triangulations around each point (with most neighbours within given radius and all neighbours within 2*radius) and considers all triangulation neighbors and not other points from the ball around each point.

◆ orientNormals() [2/3]

MRMESH_API bool MR::orientNormals ( const PointCloud & pointCloud,
VertNormals & normals,
const Buffer< VertId > & closeVerts,
int numNei,
const ProgressCallback & progress = {} )

Select orientation of given normals to make directions of close points consistent;.

Parameters
closeVertsa buffer where for every valid point #i its neighbours are stored at indices [i*numNei; (i+1)*numNei)
Returns
false if progress returned false

◆ orientNormals() [3/3]

MRMESH_API bool MR::orientNormals ( const PointCloud & pointCloud,
VertNormals & normals,
float radius,
const ProgressCallback & progress = {} )

Select orientation of given normals to make directions of close points consistent;.

Parameters
radiusof neighborhood to consider
Returns
false if progress returned false

◆ pointUniformSampling()

MRMESH_API std::optional< VertBitSet > MR::pointUniformSampling ( const PointCloud & pointCloud,
const UniformSamplingSettings & settings )
nodiscard

Sample vertices, removing ones that are too close; returns std::nullopt if it was terminated by the callback

◆ relax()

MRMESH_API bool MR::relax ( PointCloud & pointCloud,
const PointCloudRelaxParams & params = {},
ProgressCallback cb = {} )

applies given number of relaxation iterations to the whole pointCloud ( or some region if it is specified )

Returns
true if was finished successfully, false if was interrupted by progress callback

◆ relaxApprox()

MRMESH_API bool MR::relaxApprox ( PointCloud & pointCloud,
const PointCloudApproxRelaxParams & params = {},
ProgressCallback cb = {} )

applies given number of relaxation iterations to the whole pointCloud ( or some region if it is specified ) approx neighborhoods

Returns
true if was finished successfully, false if was interrupted by progress callback

◆ relaxKeepVolume()

MRMESH_API bool MR::relaxKeepVolume ( PointCloud & pointCloud,
const PointCloudRelaxParams & params = {},
ProgressCallback cb = {} )

applies given number of relaxation iterations to the whole pointCloud ( or some region if it is specified ) do not really keeps volume but tries hard

Returns
true if was finished successfully, false if was interrupted by progress callback