BRepLib/BRepLib_FindSurface.cxx = removing very small values from coordinate of normal
bug32859 - test case added
if (!isSolved)
return;
-
+ //Removing very small values
+ Standard_Real aMaxV = Max(Abs(aVec(1)), Max(Abs(aVec(2)), Abs(aVec(3))));
+ Standard_Real eps = Epsilon(aMaxV);
+ for (i = 1; i <= 3; ++i)
+ {
+ if (Abs(aVec(i)) <= eps)
+ aVec(i) = 0.;
+ }
gp_Vec aN (aVec (1), aVec (2), aVec (3));
Handle(Geom_Plane) aPlane = new Geom_Plane (aBaryCenter, aN);
myTolReached = Controle (aPoints, aPlane);
--- /dev/null
+puts "============================================================================================="
+puts "0032859: Modeling Algorithms - BRepLib_FindSurface not return an expect plane"
+puts "============================================================================================="
+puts ""
+
+vertex v1 -500 25 -6
+vertex v2 -450 -25 -6
+vertex v3 450 -25 -6
+vertex v4 500 25 -6
+edge e1 v1 v2
+edge e2 v2 v3
+edge e3 v3 v4
+edge e4 v4 v1
+
+wire w e1 e2 e3 e4
+mkplane p w
+mksurface s p
+set log [eval dump s]
+if {[regexp "Axis :0, 0, 1" ${log}] != 1} {
+ puts "Error: BRepLib_FindSurface algorithm does not return valid result"
+}
\ No newline at end of file