+ get initial plane fit from B-Spline fit if required
This commit is contained in:
parent
25fd2adb03
commit
8645d56acf
|
@ -693,6 +693,22 @@ Base::Vector3d ParameterCorrection::GetGravityPoint() const
|
||||||
return Base::Vector3d(x/ulSize, y/ulSize, z/ulSize);
|
return Base::Vector3d(x/ulSize, y/ulSize, z/ulSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ParameterCorrection::ProjectControlPointsOnPlane()
|
||||||
|
{
|
||||||
|
Base::Vector3d base = GetGravityPoint();
|
||||||
|
for (unsigned j=0;j<_usUCtrlpoints;j++) {
|
||||||
|
for (unsigned k=0;k<_usVCtrlpoints;k++) {
|
||||||
|
gp_Pnt pole = _vCtrlPntsOfSurf(j,k);
|
||||||
|
Base::Vector3d pnt(pole.X(), pole.Y(), pole.Z());
|
||||||
|
pnt.ProjToPlane(base, _clW);
|
||||||
|
pole.SetX(pnt.x);
|
||||||
|
pole.SetY(pnt.y);
|
||||||
|
pole.SetZ(pnt.z);
|
||||||
|
_vCtrlPntsOfSurf(j,k) = pole;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Handle(Geom_BSplineSurface) ParameterCorrection::CreateSurface(const TColgp_Array1OfPnt& points,
|
Handle(Geom_BSplineSurface) ParameterCorrection::CreateSurface(const TColgp_Array1OfPnt& points,
|
||||||
int iIter,
|
int iIter,
|
||||||
bool bParaCor,
|
bool bParaCor,
|
||||||
|
@ -704,6 +720,7 @@ Handle(Geom_BSplineSurface) ParameterCorrection::CreateSurface(const TColgp_Arra
|
||||||
delete _pvcUVParam;
|
delete _pvcUVParam;
|
||||||
_pvcUVParam = NULL;
|
_pvcUVParam = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
_pvcPoints = new TColgp_Array1OfPnt(points.Lower(), points.Upper());
|
_pvcPoints = new TColgp_Array1OfPnt(points.Lower(), points.Upper());
|
||||||
*_pvcPoints = points;
|
*_pvcPoints = points;
|
||||||
_pvcUVParam = new TColgp_Array1OfPnt2d(points.Lower(), points.Upper());
|
_pvcUVParam = new TColgp_Array1OfPnt2d(points.Lower(), points.Upper());
|
||||||
|
@ -713,6 +730,16 @@ Handle(Geom_BSplineSurface) ParameterCorrection::CreateSurface(const TColgp_Arra
|
||||||
if (!DoInitialParameterCorrection(fSizeFactor))
|
if (!DoInitialParameterCorrection(fSizeFactor))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
// Erzeuge die Approximations-Ebene als B-Spline-Flaeche
|
||||||
|
if (iIter < 0) {
|
||||||
|
bParaCor = false;
|
||||||
|
ProjectControlPointsOnPlane();
|
||||||
|
}
|
||||||
|
// Keine weiteren Parameterkorrekturen
|
||||||
|
else if (iIter == 0) {
|
||||||
|
bParaCor = false;
|
||||||
|
}
|
||||||
|
|
||||||
if (bParaCor)
|
if (bParaCor)
|
||||||
DoParameterCorrection(iIter);
|
DoParameterCorrection(iIter);
|
||||||
|
|
||||||
|
|
|
@ -274,6 +274,11 @@ protected:
|
||||||
*/
|
*/
|
||||||
virtual void CalcEigenvectors();
|
virtual void CalcEigenvectors();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Projiziert die Kontrollpunkte auf die Fit-Ebene
|
||||||
|
*/
|
||||||
|
void ProjectControlPointsOnPlane();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Berechnet eine initiale Flaeche zu Beginn des Algorithmus. Dazu wird die Ausgleichsebene zu der
|
* Berechnet eine initiale Flaeche zu Beginn des Algorithmus. Dazu wird die Ausgleichsebene zu der
|
||||||
* Punktwolke berechnet.
|
* Punktwolke berechnet.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user