MeshCore::PlaneFit Class Reference

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

#include <Approximation.h>

Public Member Functions

void Dimension (float &length, float &width) const
 Get the dimension of the fitted plane. More...
 
float Fit ()
 Fit a plane into the given points. More...
 
Base::Vector3f GetBase () const
 
Base::BoundBox3f GetBoundings () const
 Returns the local bounding box of the transformed points relative to the coordinate system of the plane. More...
 
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. More...
 
std::vector< Base::Vector3fGetLocalPoints () const
 Returns an array of the transformed points relative to the coordinate system of the plane. More...
 
Base::Vector3f GetNormal () const
 Returns the normal of the fitted plane. More...
 
float GetSignedStdDeviation () const
 Returns the standard deviation from the points to the fitted plane with respect to the orientation of the plane's normal. More...
 
float GetStdDeviation () const
 Returns the standard deviation from the points to the fitted plane. More...
 
 PlaneFit ()
 Construction. More...
 
void ProjectToPlane ()
 Projects the points onto the fitted plane. More...
 
virtual ~PlaneFit ()
 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 plane into a given set of points.

Constructor & Destructor Documentation

◆ PlaneFit()

PlaneFit::PlaneFit ( )

Construction.

◆ ~PlaneFit()

PlaneFit::~PlaneFit ( )
virtual

Destruction.

Member Function Documentation

◆ Dimension()

◆ Fit()

◆ GetBase()

◆ GetBoundings()

Base::BoundBox3f PlaneFit::GetBoundings ( ) const

Returns the local bounding box of the transformed points relative to the coordinate system of the plane.

If this method is called before the plane is computed an invalid bounding box is returned.

References Base::BoundBox3< _Precision >::Add(), and GetLocalPoints().

◆ GetDirU()

◆ GetDirV()

◆ GetDistanceToPlane()

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.

Referenced by MeshCore::MeshPlaneVisitor::AllowVisit(), MeshCore::PlaneSurfaceFit::GetDistanceToSurface(), GetSignedStdDeviation(), GetStdDeviation(), and MeshCore::MeshDistancePlanarSegment::TestFacet().

◆ GetLocalPoints()

std::vector< Base::Vector3f > PlaneFit::GetLocalPoints ( ) const

Returns an array of the transformed points relative to the coordinate system of the plane.

If this method is called before the plane is computed an empty array is returned.

References Base::Vector3< _Precision >::TransformToCoordinateSystem(), Base::Vector3< _Precision >::x, Base::Vector3< _Precision >::y, and Base::Vector3< _Precision >::z.

Referenced by GetBoundings().

◆ GetNormal()

◆ GetSignedStdDeviation()

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.

References MeshCore::Approximation::CountPoints(), GetDistanceToPlane(), and GetNormal().

◆ GetStdDeviation()

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.

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

◆ ProjectToPlane()

void PlaneFit::ProjectToPlane ( )

Projects the points onto the fitted plane.

References MeshCore::Approximation::GetGravity(), and GetNormal().


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