+ improve the plane fit from REEN module
This commit is contained in:
@@ -29,6 +29,7 @@
|
||||
|
||||
#include "Approximation.h"
|
||||
|
||||
#include <Base/BoundBox.h>
|
||||
#include <boost/math/special_functions/fpclassify.hpp>
|
||||
#include <Mod/Mesh/App/WildMagic4/Wm4ApprQuadraticFit3.h>
|
||||
#include <Mod/Mesh/App/WildMagic4/Wm4ApprPlaneFit3.h>
|
||||
@@ -360,6 +361,24 @@ void PlaneFit::ProjectToPlane ()
|
||||
}
|
||||
}
|
||||
|
||||
void PlaneFit::Dimension(float& length, float& width) const
|
||||
{
|
||||
const Base::Vector3f& bs = _vBase;
|
||||
const Base::Vector3f& ex = _vDirU;
|
||||
const Base::Vector3f& ey = _vDirV;
|
||||
|
||||
Base::BoundBox3f bbox;
|
||||
std::list<Base::Vector3f>::const_iterator cIt;
|
||||
for (cIt = _vPoints.begin(); cIt != _vPoints.end(); ++cIt) {
|
||||
Base::Vector3f pnt = *cIt;
|
||||
pnt.TransformToCoordinateSystem(bs, ex, ey);
|
||||
bbox.Add(pnt);
|
||||
}
|
||||
|
||||
length = bbox.MaxX - bbox.MinX;
|
||||
width = bbox.MaxY - bbox.MinY;
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------------
|
||||
|
||||
bool QuadraticFit::GetCurvatureInfo(double x, double y, double z,
|
||||
|
||||
Reference in New Issue
Block a user