Approximation of a plane into a given set of points. More...
#include <Approximation.h>
Public Member Functions | |
float | Fit () |
Fit a plane into the given points. | |
Base::Vector3f | GetBase () const |
Base::Vector3f | GetDirU () const |
Base::Vector3f | GetDirV () const |
float | GetDistanceToPlane (const Base::Vector3f &rcPoint) const |
Returns the distance from the point rcPoint to the fitted plane. | |
Base::Vector3f | GetNormal () const |
Returns the normal of the fitted plane. | |
float | GetSignedStdDeviation () const |
Returns the standard deviation from the points to the fitted plane with respect to the orientation of the plane's normal. | |
float | GetStdDeviation () const |
Returns the standard deviation from the points to the fitted plane. | |
PlaneFit () | |
Construction. | |
void | ProjectToPlane () |
Projects the points onto the fitted plane. | |
virtual | ~PlaneFit () |
Destruction. | |
Protected Attributes | |
Base::Vector3f | _vBase |
Base vector of the plane. | |
Base::Vector3f | _vDirU |
Base::Vector3f | _vDirV |
Base::Vector3f | _vDirW |
Normal of the plane. |
Approximation of a plane into a given set of points.
Definition at line 128 of file Approximation.h.
MeshCore::PlaneFit::PlaneFit | ( | ) | [inline] |
Construction.
Definition at line 134 of file Approximation.h.
virtual MeshCore::PlaneFit::~PlaneFit | ( | ) | [inline, virtual] |
Destruction.
Definition at line 138 of file Approximation.h.
float PlaneFit::Fit | ( | ) | [virtual] |
Fit a plane into the given points.
We must have at least three non-collinear points to succeed. If the fit fails FLOAT_MAX is returned.
Implements MeshCore::Approximation.
Reimplemented in MeshCore::SurfaceFit.
Definition at line 142 of file Approximation.cpp.
References MeshCore::Approximation::_bIsFitted, MeshCore::Approximation::_fLastResult, _vBase, _vDirU, _vDirV, _vDirW, MeshCore::Approximation::_vPoints, MeshCore::Approximation::CountPoints(), Wm4::Vector3< Real >::Dot(), Wm4::Matrix3< Real >::EigenDecomposition(), SketcherExample::f, FLOAT_MAX, Wm4::Matrix3< Real >::GetColumn(), Base::Vector3< _Precision >::Set(), KDL::sqrt(), boost::numeric::bindings::lapack::detail::syev(), RobotExample::w, Wm4::Vector3< Real >::X(), Wm4::Vector3< Real >::Y(), and Wm4::Vector3< Real >::Z().
Referenced by CmdApproxPlane::activated(), MeshCore::MeshPlaneVisitor::AllowVisit(), Reen::ParameterCorrection::CalcEigenvectors(), MeshCore::MeshEigensystem::CalculateLocalSystem(), MeshCore::MeshRefPointToPoints::GetNormal(), MeshCore::AbstractPolygonTriangulator::GetTransformToFitPlane(), best_fit::PointCloud_Coarse(), MeshCore::SurfaceFit::PolynomFit(), and MeshCore::MeshSmoothing::Smooth().
Base::Vector3f PlaneFit::GetBase | ( | ) | const |
Definition at line 243 of file Approximation.cpp.
References MeshCore::Approximation::_bIsFitted, and _vBase.
Referenced by CmdApproxPlane::activated(), MeshCore::MeshEigensystem::CalculateLocalSystem(), and MeshCore::AbstractPolygonTriangulator::GetTransformToFitPlane().
Base::Vector3f PlaneFit::GetDirU | ( | ) | const |
Definition at line 251 of file Approximation.cpp.
References MeshCore::Approximation::_bIsFitted, and _vDirU.
Referenced by Reen::ParameterCorrection::CalcEigenvectors(), MeshCore::MeshEigensystem::CalculateLocalSystem(), MeshCore::AbstractPolygonTriangulator::GetTransformToFitPlane(), and best_fit::PointCloud_Coarse().
Base::Vector3f PlaneFit::GetDirV | ( | ) | const |
Definition at line 259 of file Approximation.cpp.
References MeshCore::Approximation::_bIsFitted, and _vDirV.
Referenced by Reen::ParameterCorrection::CalcEigenvectors(), MeshCore::MeshEigensystem::CalculateLocalSystem(), MeshCore::AbstractPolygonTriangulator::GetTransformToFitPlane(), and best_fit::PointCloud_Coarse().
float PlaneFit::GetDistanceToPlane | ( | const Base::Vector3f & | rcPoint | ) | const |
Returns the distance from the point rcPoint to the fitted plane.
If Fit() has not been called FLOAT_MAX is returned.
Definition at line 275 of file Approximation.cpp.
References MeshCore::Approximation::_bIsFitted, _vBase, _vDirW, and FLOAT_MAX.
Referenced by MeshCore::MeshPlaneVisitor::AllowVisit(), GetSignedStdDeviation(), and GetStdDeviation().
Base::Vector3f PlaneFit::GetNormal | ( | ) | const |
Returns the normal of the fitted plane.
If Fit() has not been called the null vector is returned.
Definition at line 267 of file Approximation.cpp.
References MeshCore::Approximation::_bIsFitted, and _vDirW.
Referenced by CmdApproxPlane::activated(), Reen::ParameterCorrection::CalcEigenvectors(), MeshCore::MeshEigensystem::CalculateLocalSystem(), MeshCore::MeshRefPointToPoints::GetNormal(), GetSignedStdDeviation(), MeshCore::AbstractPolygonTriangulator::GetTransformToFitPlane(), best_fit::PointCloud_Coarse(), ProjectToPlane(), and MeshCore::MeshSmoothing::Smooth().
float PlaneFit::GetSignedStdDeviation | ( | ) | const |
Returns the standard deviation from the points to the fitted plane with respect to the orientation of the plane's normal.
If Fit() has not been called FLOAT_MAX is returned.
Definition at line 308 of file Approximation.cpp.
References MeshCore::Approximation::_bIsFitted, MeshCore::Approximation::_vPoints, MeshCore::Approximation::CountPoints(), SketcherExample::f, FLOAT_MAX, GetDistanceToPlane(), GetNormal(), Base::Length, and KDL::sqrt().
float PlaneFit::GetStdDeviation | ( | ) | const |
Returns the standard deviation from the points to the fitted plane.
If Fit() has not been called FLOAT_MAX is returned.
Definition at line 283 of file Approximation.cpp.
References MeshCore::Approximation::_bIsFitted, MeshCore::Approximation::_vPoints, MeshCore::Approximation::CountPoints(), FLOAT_MAX, GetDistanceToPlane(), and KDL::sqrt().
void PlaneFit::ProjectToPlane | ( | ) |
Projects the points onto the fitted plane.
Definition at line 349 of file Approximation.cpp.
References MeshCore::Approximation::_vPoints, MeshCore::Approximation::GetGravity(), and GetNormal().
Base::Vector3f MeshCore::PlaneFit::_vBase [protected] |
Base vector of the plane.
Definition at line 173 of file Approximation.h.
Referenced by Fit(), GetBase(), GetDistanceToPlane(), and MeshCore::SurfaceFit::PolynomFit().
Base::Vector3f MeshCore::PlaneFit::_vDirU [protected] |
Definition at line 174 of file Approximation.h.
Referenced by Fit(), GetDirU(), and MeshCore::SurfaceFit::PolynomFit().
Base::Vector3f MeshCore::PlaneFit::_vDirV [protected] |
Definition at line 175 of file Approximation.h.
Referenced by Fit(), GetDirV(), and MeshCore::SurfaceFit::PolynomFit().
Base::Vector3f MeshCore::PlaneFit::_vDirW [protected] |
Normal of the plane.
Definition at line 176 of file Approximation.h.
Referenced by Fit(), GetDistanceToPlane(), GetNormal(), and MeshCore::SurfaceFit::PolynomFit().