]> OCCT Git - occt-copy.git/commitdiff
0027981: BRepExtrema_DistShapeShape returns not null distance on interfered shapes
authorifv <ifv@opencascade.com>
Thu, 30 Mar 2017 13:44:21 +0000 (16:44 +0300)
committerbugmaster <bugmaster@opencascade.com>
Fri, 5 May 2017 08:27:38 +0000 (11:27 +0300)
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.

src/Extrema/Extrema_ExtSS.cxx
tests/bugs/modalg_6/bug27981 [new file with mode: 0644]

index 88b32de34f25680177db275601abab5176cf3130..bf6451a64dc4f583a764a043a248fa00fef38a2b 100644 (file)
@@ -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 (file)
index 0000000..14b68ef
--- /dev/null
@@ -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"
+}
+