From: ifv Date: Thu, 30 Mar 2017 13:44:21 +0000 (+0300) Subject: 0027981: BRepExtrema_DistShapeShape returns not null distance on interfered shapes X-Git-Tag: V7_2_0_beta~160 X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=5be09a153b97ae7eb9428a290807ad02dd001563;p=occt-copy.git 0027981: BRepExtrema_DistShapeShape returns not null distance on interfered shapes The reason of the bug is bad start points on surfaces, which are used by searching roots algorithm as start points for iteration process. Starting with these points algorithm for searching roots of set of equations cannot reach correct root. To find correct start points increasing number of sampling points is applied. --- diff --git a/src/Extrema/Extrema_ExtSS.cxx b/src/Extrema/Extrema_ExtSS.cxx index 88b32de34f..bf6451a64d 100644 --- a/src/Extrema/Extrema_ExtSS.cxx +++ b/src/Extrema/Extrema_ExtSS.cxx @@ -106,7 +106,7 @@ void Extrema_ExtSS::Perform(const Adaptor3d_Surface& S1, mySqDist.Clear(); Standard_Integer i; GeomAbs_SurfaceType myS1type = S1.GetType(); - Standard_Integer NbU = 10, NbV = 10; + const Standard_Integer NbU = 20, NbV = 20; switch(myS1type) { diff --git a/tests/bugs/modalg_6/bug27981 b/tests/bugs/modalg_6/bug27981 new file mode 100644 index 0000000000..14b68ef5f3 --- /dev/null +++ b/tests/bugs/modalg_6/bug27981 @@ -0,0 +1,17 @@ +puts "========" +puts "OCC27981" +puts "========" +puts "" +################################################# +# BRepExtrema_DistShapeShape returns not null distance on interfered shapes +################################################# + +restore [locate_data_file bug27981_a.brep] a +restore [locate_data_file bug27981_b.brep] b + +distmini dd a b +set dist [dval dd_val] +if {$dist > 1.e-7} { + puts "\nError: invalid distance.\n" +} +