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... | |
![]() | |
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... | |
unsigned long 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... | |
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 | |
![]() | |
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()
|
virtual |
Destruction.
Member Function Documentation
◆ Fit()
|
virtual |
Fit a sphere into the given points.
If the fit fails FLOAT_MAX is returned.
Implements MeshCore::Approximation.
References MeshCore::Approximation::AddPoints(), MeshCoreFit::SphereFit::ComputeApproximations(), Base::Console(), MeshCore::Approximation::CountPoints(), MeshCoreFit::SphereFit::Fit(), MeshCoreFit::SphereFit::GetCenter(), MeshCoreFit::SphereFit::GetNumIterations(), MeshCoreFit::SphereFit::GetRadius(), MeshCoreFit::SphereFit::GetStdDeviation(), GetStdDeviation(), and Base::ConsoleSingleton::Message().
Referenced by MeshCore::SphereSurfaceFit::Fit(), MeshGui::SphereFitParameter::getParameter(), and ReverseEngineeringGui::SegmentationManual::on_sphereDetect_clicked().
◆ GetCenter()
Base::Vector3f SphereFit::GetCenter | ( | ) | const |
◆ 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()
float SphereFit::GetRadius | ( | ) | const |
◆ 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:
- src/Mod/Mesh/App/Core/Approximation.h
- src/Mod/Mesh/App/Core/Approximation.cpp