From: pkv Date: Thu, 17 Oct 2013 08:19:24 +0000 (+0400) Subject: 0024242: Hang-up during classification a 3D point relative to a solid X-Git-Tag: V6_7_0_beta~69 X-Git-Url: http://git.dev.opencascade.org/gitweb/?p=occt.git;a=commitdiff_plain;h=1da5279e08b2b4e3e6b68c29f278a966289519bb 0024242: Hang-up during classification a 3D point relative to a solid 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 --- diff --git a/src/BRepClass3d/BRepClass3d_SolidExplorer.cxx b/src/BRepClass3d/BRepClass3d_SolidExplorer.cxx index ebcc0e2572..eb52042103 100755 --- a/src/BRepClass3d/BRepClass3d_SolidExplorer.cxx +++ b/src/BRepClass3d/BRepClass3d_SolidExplorer.cxx @@ -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 index 0000000000..6e951a72a1 --- /dev/null +++ b/tests/bugs/modalg_5/bug24242 @@ -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