MeshCore::SphereFit Class Reference

Approximation of a sphere into a given set of points. More...

#include <Approximation.h>

Public Member Functions

float Fit ()
 Fit a sphere into the given points. More...
 
Base::Vector3f GetCenter () const
 
float GetDistanceToSphere (const Base::Vector3f &rcPoint) const
 Returns the distance from the point rcPoint to the fitted sphere. More...
 
float GetRadius () const
 
float GetStdDeviation () const
 Returns the standard deviation from the points to the fitted sphere. More...
 
void ProjectToSphere ()
 Projects the points onto the fitted sphere. More...
 
 SphereFit ()
 Construction. More...
 
virtual ~SphereFit ()
 Destruction. More...
 
- Public Member Functions inherited from MeshCore::Approximation
void AddPoint (const Base::Vector3f &rcVector)
 Add point for the fit algorithm. More...
 
void AddPoints (const MeshPointArray &points)
 Add points for the fit algorithm. More...
 
void AddPoints (const std::list< Base::Vector3f > &rsPointList)
 Add points for the fit algorithm. More...
 
void AddPoints (const std::set< Base::Vector3f > &rsPointSet)
 Add points for the fit algorithm. More...
 
void AddPoints (const std::vector< Base::Vector3f > &rvPointVect)
 Add points for the fit algorithm. More...
 
 Approximation ()
 Construction. More...
 
void Clear ()
 Deletes the inserted points and frees any allocated resources. More...
 
std::size_t CountPoints () const
 Determines the number of the current added points. More...
 
bool Done () const
 Returns true if Fit() has been called for the current set of points, false otherwise. More...
 
virtual float Fit ()=0
 Pure virtual function to fit the geometry to the given points. More...
 
Base::Vector3f GetGravity () const
 Returns the center of gravity of the current added points. More...
 
float GetLastResult () const
 Returns the result of the last fit. More...
 
const std::list< Base::Vector3f > & GetPoints () const
 Get all added points. More...
 
virtual ~Approximation ()
 Destroys the object and frees any allocated resources. More...
 

Additional Inherited Members

- Protected Member Functions inherited from MeshCore::Approximation
void GetMgcVectorArray (std::vector< Wm4::Vector3< double > > &rcPts) const
 Creates a vector of Wm4::Vector3 elements. More...
 

Detailed Description

Approximation of a sphere into a given set of points.

Constructor & Destructor Documentation

◆ SphereFit()

SphereFit::SphereFit ( )

Construction.

◆ ~SphereFit()

SphereFit::~SphereFit ( )
virtual

Destruction.

Member Function Documentation

◆ Fit()

◆ GetCenter()

◆ GetDistanceToSphere()

float SphereFit::GetDistanceToSphere ( const Base::Vector3f rcPoint) const

Returns the distance from the point rcPoint to the fitted sphere.

If Fit() has not been called FLOAT_MAX is returned.

References Base::Vector3< _Precision >::Length().

Referenced by GetStdDeviation().

◆ GetRadius()

◆ GetStdDeviation()

float SphereFit::GetStdDeviation ( ) const

Returns the standard deviation from the points to the fitted sphere.

If Fit() has not been called FLOAT_MAX is returned.

References MeshCore::Approximation::CountPoints(), and GetDistanceToSphere().

Referenced by Fit().

◆ ProjectToSphere()

void SphereFit::ProjectToSphere ( )

Projects the points onto the fitted sphere.

References Base::Vector3< _Precision >::z.


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