const Bnd_Sphere& aSph = mySphereArray->Value(theInd);
Standard_Real aCurDist;
- if ( (aCurDist = aSph.SquareDistance(myXYZ.XYZ())) < mySol.SquareDistance(myXYZ.XYZ()) )
+// if ( (aCurDist = aSph.SquareDistance(myXYZ.XYZ())) < mySol.SquareDistance(myXYZ.XYZ()) )
+ if ( (aCurDist = aSph.Distance(myXYZ.XYZ())) < mySol.Distance(myXYZ.XYZ()) )
{
mySol = aSph;
if ( aCurDist < myMinDist )
const Bnd_Sphere& aSph = mySphereArray->Value(theInd);
Standard_Real aCurDist;
- if ( (aCurDist = aSph.SquareDistance(myXYZ.XYZ())) > mySol.SquareDistance(myXYZ.XYZ()) )
+// if ( (aCurDist = aSph.SquareDistance(myXYZ.XYZ())) > mySol.SquareDistance(myXYZ.XYZ()) )
+ if ( (aCurDist = aSph.Distance(myXYZ.XYZ())) > mySol.Distance(myXYZ.XYZ()) )
{
mySol = aSph;
if ( aCurDist > myMaxDist )
if ( ! mySphereUBTree.IsNull() )
return;
+ if (myS->GetType() == GeomAbs_BSplineSurface) {
+ Handle(Geom_BSplineSurface) aBspl = myS->BSpline();
+ Standard_Integer aUValue = aBspl->UDegree() * aBspl->NbUKnots();
+ Standard_Integer aVValue = aBspl->VDegree() * aBspl->NbVKnots();
+ if (aUValue > myusample)
+ myusample = aUValue;
+ if (aVValue > myvsample)
+ myvsample = aVValue;
+ }
+
Standard_Real PasU = myusup - myumin;
Standard_Real PasV = myvsup - myvmin;
Standard_Real U0 = PasU / myusample / 100.;
Tol(2) = mytolv;
math_Vector UV(1, 2);
-
theParams.Parameter(UV(1), UV(2));
math_Vector UVinf(1,2), UVsup(1,2);
UVsup(1) = myusup;
UVsup(2) = myvsup;
- math_Vector errors(1,2);
- math_Vector root(1, 2);
-
- Standard_Integer aNbMaxIter = 100;
+ const Standard_Integer aNbMaxIter = 100;
+ math_FunctionSetRoot S (myF, UV, Tol, UVinf, UVsup, aNbMaxIter);
- gp_Pnt PStart = theParams.Value();
-
- math_FunctionSetRoot S (myF,UV,Tol,UVinf,UVsup, aNbMaxIter);
-
myDone = Standard_True;
}
}
//=============================================================================
-Extrema_POnSurf Extrema_GenExtPS::Point (const Standard_Integer N) const
+const Extrema_POnSurf& Extrema_GenExtPS::Point (const Standard_Integer N) const
{
if (!IsDone()) { StdFail_NotDone::Raise(); }
return myF.Point(N);