Approximation of a quadratic surface into a given set of points. More...
#include <Approximation.h>
Public Member Functions | |
void | CalcEigenValues (double &dLambda1, double &dLambda2, double &dLambda3, Base::Vector3f &clEV1, Base::Vector3f &clEV2, Base::Vector3f &clEV3) const |
Compute form matrix A and calculate Eigenvalues. More... | |
void | CalcZValues (double x, double y, double &dZ1, double &dZ2) const |
float | Fit () |
Invocation of fitting algorithm. More... | |
double | GetCoeff (unsigned long ulIndex) const |
Get the quadric coefficients. More... | |
const double & | GetCoeffArray () const |
Get the quadric coefficients as reference to the internal array. More... | |
bool | GetCurvatureInfo (double x, double y, double z, double &rfCurv0, double &rfcurv1) |
bool | GetCurvatureInfo (double x, double y, double z, double &rfCurv0, double &rfCurv1, Base::Vector3f &rkDir0, Base::Vector3f &rkDir1, double &dDistance) |
Calculate the curvatures of the quadric at a given point. More... | |
QuadraticFit () | |
Construction. More... | |
virtual | ~QuadraticFit () |
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... | |
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 | |
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 quadratic surface into a given set of points.
The implicit form of the surface is defined by F(x,y,z) = a * x^2 + b * y^2 + c * z^2 + 2d * x * y + 2e * x * z + 2f * y * z + g * x + h * y + * i * z + k = 0 Depending on the parameters (a,..,k) this surface defines a sphere, ellipsoid, cylinder, cone and so on.
Constructor & Destructor Documentation
◆ QuadraticFit()
MeshCore::QuadraticFit::QuadraticFit | ( | ) |
Construction.
◆ ~QuadraticFit()
|
virtual |
Destruction.
Member Function Documentation
◆ CalcEigenValues()
void QuadraticFit::CalcEigenValues | ( | double & | dLambda1, |
double & | dLambda2, | ||
double & | dLambda3, | ||
Base::Vector3f & | clEV1, | ||
Base::Vector3f & | clEV2, | ||
Base::Vector3f & | clEV3 | ||
) | const |
Compute form matrix A and calculate Eigenvalues.
- Parameters
-
dLambda1 Eigenvalue 1 dLambda2 Eigenvalue 2 dLambda3 Eigenvalue 3 clEV1 Eigenvector 1 clEV2 Eigenvector 2 clEV3 Eigenvector 3
◆ CalcZValues()
void QuadraticFit::CalcZValues | ( | double | x, |
double | y, | ||
double & | dZ1, | ||
double & | dZ2 | ||
) | const |
◆ Fit()
|
virtual |
Invocation of fitting algorithm.
- Returns
- float Quality of fit.
Implements MeshCore::Approximation.
References MeshCore::Approximation::CountPoints(), and MeshCore::Approximation::GetMgcVectorArray().
◆ GetCoeff()
double QuadraticFit::GetCoeff | ( | unsigned long | ulIndex | ) | const |
Get the quadric coefficients.
- Parameters
-
ulIndex Number of coefficient (0..9)
- Returns
- double value of coefficient
◆ GetCoeffArray()
const double & QuadraticFit::GetCoeffArray | ( | ) | const |
Get the quadric coefficients as reference to the internal array.
- Returns
- const double& Reference to the double array
◆ GetCurvatureInfo() [1/2]
bool QuadraticFit::GetCurvatureInfo | ( | double | x, |
double | y, | ||
double | z, | ||
double & | rfCurv0, | ||
double & | rfcurv1 | ||
) |
References MeshCore::FunctionContainer::CurvatureInfo().
◆ GetCurvatureInfo() [2/2]
bool QuadraticFit::GetCurvatureInfo | ( | double | x, |
double | y, | ||
double | z, | ||
double & | rfCurv0, | ||
double & | rfCurv1, | ||
Base::Vector3f & | rkDir0, | ||
Base::Vector3f & | rkDir1, | ||
double & | dDistance | ||
) |
Calculate the curvatures of the quadric at a given point.
- Parameters
-
x X-coordinate y Y-coordinate z Z-coordinate rfCurv0 1. principal curvature rfCurv1 2. principal curvature rkDir0 Direction of 1. principal curvature rkDir1 Direction of 2. principal curvature dDistance
- Returns
- bool Success = true, otherwise false
References MeshCore::FunctionContainer::CurvatureInfo(), MeshCore::FunctionContainer::GetGradient(), and Base::Vector3< _Precision >::Length().
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