MeshLib Documentation
Loading...
Searching...
No Matches
MR::PointAccumulator Class Reference

Class to accumulate points and make best line / plane approximation. More...

#include <MRBestFit.h>

Public Member Functions

MRMESH_API void addPoint (const Vector3d &pt)
 
MRMESH_API void addPoint (const Vector3d &pt, double weight)
 
void addPoint (const Vector3f &pt)
 
void addPoint (const Vector3f &pt, float weight)
 
MRMESH_API Plane3d getBestPlane () const
 computes the best approximating plane from the accumulated points
 
Plane3f getBestPlanef () const
 
MRMESH_API Line3d getBestLine () const
 computes the best approximating line from the accumulated points
 
Line3f getBestLinef () const
 
MRMESH_API bool getCenteredCovarianceEigen (Vector3d &centroid, Matrix3d &eigenvectors, Vector3d &eigenvalues) const
 computes centroid and eigenvectors/eigenvalues of the covariance matrix of the accumulated points
 
MRMESH_API bool getCenteredCovarianceEigen (Vector3f &centroid, Matrix3f &eigenvectors, Vector3f &eigenvalues) const
 
MRMESH_API AffineXf3d getBasicXf () const
 
AffineXf3f getBasicXf3f () const
 
MRMESH_API std::array< AffineXf3d, 4 > get4BasicXfs () const
 
MRMESH_API std::array< AffineXf3f, 4 > get4BasicXfs3f () const
 
bool valid () const
 

Detailed Description

Class to accumulate points and make best line / plane approximation.

Member Function Documentation

◆ addPoint() [1/4]

MRMESH_API void MR::PointAccumulator::addPoint ( const Vector3d & pt)

◆ addPoint() [2/4]

MRMESH_API void MR::PointAccumulator::addPoint ( const Vector3d & pt,
double weight )

◆ addPoint() [3/4]

void MR::PointAccumulator::addPoint ( const Vector3f & pt)
inline

◆ addPoint() [4/4]

void MR::PointAccumulator::addPoint ( const Vector3f & pt,
float weight )
inline

◆ get4BasicXfs()

MRMESH_API std::array< AffineXf3d, 4 > MR::PointAccumulator::get4BasicXfs ( ) const

returns 4 transformations, each maps (0,0,0) into point centroid, and maps vectors (1,0,0), (0,1,0), (0,0,1) into +/- first, +/- second, +/- third eigenvectors (forming positive reference frame) corresponding to ascending eigenvalues

◆ get4BasicXfs3f()

MRMESH_API std::array< AffineXf3f, 4 > MR::PointAccumulator::get4BasicXfs3f ( ) const

◆ getBasicXf()

MRMESH_API AffineXf3d MR::PointAccumulator::getBasicXf ( ) const

returns the transformation that maps (0,0,0) into point centroid, and maps vectors (1,0,0), (0,1,0), (0,0,1) into first, second, third eigenvectors corresponding to ascending eigenvalues

◆ getBasicXf3f()

AffineXf3f MR::PointAccumulator::getBasicXf3f ( ) const
inline

◆ getBestLine()

MRMESH_API Line3d MR::PointAccumulator::getBestLine ( ) const

computes the best approximating line from the accumulated points

◆ getBestLinef()

Line3f MR::PointAccumulator::getBestLinef ( ) const
inline

◆ getBestPlane()

MRMESH_API Plane3d MR::PointAccumulator::getBestPlane ( ) const

computes the best approximating plane from the accumulated points

◆ getBestPlanef()

Plane3f MR::PointAccumulator::getBestPlanef ( ) const
inline

◆ getCenteredCovarianceEigen() [1/2]

MRMESH_API bool MR::PointAccumulator::getCenteredCovarianceEigen ( Vector3d & centroid,
Matrix3d & eigenvectors,
Vector3d & eigenvalues ) const

computes centroid and eigenvectors/eigenvalues of the covariance matrix of the accumulated points

◆ getCenteredCovarianceEigen() [2/2]

MRMESH_API bool MR::PointAccumulator::getCenteredCovarianceEigen ( Vector3f & centroid,
Matrix3f & eigenvectors,
Vector3f & eigenvalues ) const

◆ valid()

bool MR::PointAccumulator::valid ( ) const
inline

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