+ improve the plane fit from REEN module

This commit is contained in:
wmayer
2014-07-28 16:39:34 +02:00
parent c802c4147b
commit 1ca5955389
4 changed files with 80 additions and 15 deletions

View File

@@ -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,