0024684: Command fixshape hangs up on the attached shape
authornbv <nbv@opencascade.com>
Thu, 27 Mar 2014 12:56:42 +0000 (16:56 +0400)
committerbugmaster <bugmaster@opencascade.com>
Fri, 28 Mar 2014 11:55:18 +0000 (15:55 +0400)
Algorithm of seeking of any internal point into given face is corrected.
Test case for issue CR24684

src/BRepClass3d/BRepClass3d_SolidExplorer.cxx
tests/bugs/modalg_5/bug24684 [new file with mode: 0644]

index 403e0e4..3814bec 100644 (file)
@@ -174,7 +174,7 @@ Standard_Boolean BRepClass3d_SolidExplorer::FindAPointInTheFace
       }
     }
 
-    if (APointExist)
+    while (APointExist)
     { 
       ParamInit *= 0.41234;
       u_ = P.X() + ParamInit* T.X();
@@ -190,7 +190,12 @@ Standard_Boolean BRepClass3d_SolidExplorer::FindAPointInTheFace
       BRepAdaptor_Surface s;
       s.Initialize (face, Standard_False);
       s.D1 (u_, v_, APoint_, theVecD1U, theVecD1V);
-      return Standard_True;
+
+      if(theVecD1U.CrossMagnitude(theVecD1V) > gp::Resolution())
+        return Standard_True;
+
+      if(ParamInit < Precision::PConfusion())
+        return Standard_False;
     }
   }
   return Standard_False;
diff --git a/tests/bugs/modalg_5/bug24684 b/tests/bugs/modalg_5/bug24684
new file mode 100644 (file)
index 0000000..ee30114
--- /dev/null
@@ -0,0 +1,29 @@
+puts "============"
+puts "OCC24684"
+puts "============"
+puts ""
+############################################################################
+# Command fixshape hangs up on the attached shape
+############################################################################
+
+pload XSDRAW
+
+restore [locate_data_file bug24684_r.brep] a
+
+cpulimit 60
+
+fixshape result a
+
+set square 337959
+
+set nb_v_good 300
+set nb_e_good 443
+set nb_w_good 171
+set nb_f_good 149
+set nb_sh_good 85
+set nb_sol_good 15
+set nb_compsol_good 0
+set nb_compound_good 3
+set nb_shape_good 1166
+
+set 2dviewer 1