const gp_Torus& S,
const Standard_Real Tol)
{
+ const Standard_Real tol2 = Tol*Tol;
myDone = Standard_False;
myNbExt = 0;
-
+
// Projection of P in plane XOY ...
gp_Ax3 Pos = S.Position();
gp_Pnt O = Pos.Location();
// Calculation of extrema ...
gp_Vec OPp (O,Pp);
Standard_Real R2 = OPp.SquareMagnitude();
- if (R2 < Tol * Tol) { return; }
+ if (R2 < tol2) { return; }
gp_Vec myZ = Pos.XDirection()^Pos.YDirection();
Standard_Real U1 = gp_Vec(Pos.XDirection()).AngleWithRef(OPp,myZ);
gp_Pnt O1 = O.Translated(OO1);
gp_Pnt O2 = O.Translated(OO2);
- if(O1.SquareDistance(P) < Tol) { return; }
- if(O2.SquareDistance(P) < Tol) { return; }
+ if(O1.SquareDistance(P) < tol2) { return; }
+ if(O2.SquareDistance(P) < tol2) { return; }
Standard_Real V1 = OPp.AngleWithRef(gp_Vec(O1,P),OPp.Crossed(OZ));
if (V1 > -ExtPElS_MyEps && V1 < ExtPElS_MyEps) { V1 = 0.; }
--- /dev/null
+puts "========"
+puts "OCC28692"
+puts "========"
+puts ""
+####################################################################################
+## Projection failed (projponf)
+####################################################################################
+
+restore [locate_data_file bug28692_shapes.brep] bi3
+point p -0.0153 0 0.017
+set dist -1
+regexp {proj dist = ([-0-9.+eE]+)} [projponf bi3 p] full dist
+if { $dist < 0 || $dist > 1.e-7 } {
+ puts "Error : Projection failed "
+}
+