mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-04 13:13:25 +03:00
0022907: The function 'distmini' produces wrong result.
This commit is contained in:
parent
85b70a3baa
commit
408ecc39f3
@ -1,5 +1,5 @@
|
||||
#include <Standard_TypeMismatch.hxx>
|
||||
|
||||
#include <Precision.hxx>
|
||||
#define delta 1.e-9
|
||||
#define Tol 1.e-20
|
||||
|
||||
@ -73,16 +73,23 @@ Standard_Boolean Extrema_FuncExtPC::Value (const Standard_Real U, Standard_Real&
|
||||
Tool::D1(*((Curve*)myC),myU,myPc,D1c);
|
||||
Standard_Real Ndu = D1c.Magnitude();
|
||||
if (Ndu <= Tol) { // Cas Singulier (PMN 22/04/1998)
|
||||
Pnt P1, P2;
|
||||
P2 = Tool::Value(*((Curve*)myC),myU+delta);
|
||||
P1 = Tool::Value(*((Curve*)myC),myU-delta);
|
||||
Vec V(P1,P2);
|
||||
D1c = V;
|
||||
Ndu = D1c.Magnitude();
|
||||
if (Ndu <= Tol) {
|
||||
return Standard_False;
|
||||
Pnt P1, P2;
|
||||
P2 = Tool::Value(*((Curve*)myC),myU + delta);
|
||||
P1 = Tool::Value(*((Curve*)myC),myU - delta);
|
||||
Vec V(P1,P2);
|
||||
D1c = V;
|
||||
Ndu = D1c.Magnitude();
|
||||
if (Ndu <= Tol) {
|
||||
Vec aD2;
|
||||
Tool::D2(*((Curve*)myC),myU,myPc,D1c,aD2);
|
||||
Ndu = aD2.Magnitude();
|
||||
|
||||
if(Ndu <= Tol)
|
||||
return Standard_False;
|
||||
D1c = aD2;
|
||||
}
|
||||
}
|
||||
|
||||
Vec PPc (myP,myPc);
|
||||
F = PPc.Dot(D1c)/Ndu;
|
||||
return Standard_True;
|
||||
|
Loading…
x
Reference in New Issue
Block a user