0024242: Hang-up during classification a 3D point relative to a solid
authorpkv <pkv@opencascade.com>
Thu, 17 Oct 2013 08:19:24 +0000 (12:19 +0400)
committerbugmaster <bugmaster@opencascade.com>
Thu, 17 Oct 2013 08:20:17 +0000 (12:20 +0400)
v0.0

I. New features:
no new features

II. Changes:
II.1. class BRepClass3d
   - method:
Standard_Integer BRepClass3d_SolidExplorer::OtherSegment(const gp_Pnt& P,
 gp_Lin& L,  Standard_Real& _Par)
The condition to prevent infinite loop has been added.

III. Modified entities:
packages:
BRepClass3d

Added test case bugs/modalg_5/bug24242

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

index ebcc0e2..eb52042 100755 (executable)
@@ -580,9 +580,18 @@ Standard_Integer BRepClass3d_SolidExplorer::OtherSegment(const gp_Pnt& P,
     else if(myParamOnEdge==0.2)  myParamOnEdge = 0.8; 
     else if(myParamOnEdge==0.8)  myParamOnEdge = 0.1; 
     else if(myParamOnEdge==0.1)  myParamOnEdge = 0.9;
-    else { myParamOnEdge*=0.5; } 
-    
-    
+    //
+    else {
+      myParamOnEdge*=0.5;  
+      if(myParamOnEdge < 0.0001) { 
+       gp_Pnt PBidon(P.X()+1.0,P.Y(),P.Z());
+       gp_Vec V(P,PBidon);
+       Par= 1.0;
+       _Par=Par;
+       L  = gp_Lin(P,V);
+       return 0;
+      }
+    }
   } //-- for(;;) { ...  } 
 }
 
diff --git a/tests/bugs/modalg_5/bug24242 b/tests/bugs/modalg_5/bug24242
new file mode 100644 (file)
index 0000000..6e951a7
--- /dev/null
@@ -0,0 +1,11 @@
+puts "============"
+puts "OCC24242"
+puts "============"
+puts ""
+############################################################################
+# Hang-up during classification a 3D point relative to a solid
+############################################################################
+
+restore [locate_data_file bug24242_sx] b1
+point p 14.3213918 20. 20.
+bclassify b1 p