]> OCCT Git - occt.git/commitdiff
0032796: Modeling Data - Calculation of distance between two circles crashes
authorvro <vro@opencascade.com>
Tue, 22 Feb 2022 14:00:09 +0000 (17:00 +0300)
committerkgv <kgv@opencascade.com>
Fri, 22 Apr 2022 08:21:30 +0000 (11:21 +0300)
Modified:
- Extrema_ExtCC.cxx, the method PrepareParallelResult() - angular tolerance is increased.

Added:
- A test: lowalgos extcc bug32796

src/Extrema/Extrema_ExtCC.cxx
tests/lowalgos/extcc/bug32796 [new file with mode: 0644]

index dceda51ff50d155a8dfa38cdd04dfc03399ed416..ed158a699d605c52153c1cd458be459761cf01c7 100644 (file)
@@ -674,7 +674,7 @@ void Extrema_ExtCC::PrepareParallelResult(const Standard_Real theUt11,
       //    myIsParallel = TRUE and only the least distance will be returned.
       //4. Arcs are not parallel. Then several (or single) extremas will be returned.
 
-      if (aRng.Delta() > Precision::Angular())
+      if (aRng.Delta() > Precision::Confusion())
       {
         Standard_Real aPar = 0.0;
         aRng.GetIntermediatePoint(0.5, aPar);
@@ -714,7 +714,6 @@ void Extrema_ExtCC::PrepareParallelResult(const Standard_Real theUt11,
             break;
           }
         }
-
         //Nearer solution can be found
       }
       else if (!aRng.IsVoid())
diff --git a/tests/lowalgos/extcc/bug32796 b/tests/lowalgos/extcc/bug32796
new file mode 100644 (file)
index 0000000..bc862c1
--- /dev/null
@@ -0,0 +1,15 @@
+puts "============"
+puts "OCC32796: Modeling Data - Calculation of distance between two circles crashes"
+puts "============"
+puts ""
+
+restore [locate_data_file bug32796e1.brep] e1
+restore [locate_data_file bug32796e2.brep] e2
+mkcurve c1 e1
+mkcurve c2 e2
+
+if [catch { extrema c1 c2 }] {
+  puts "Calculation of distance between two circles crashes"
+} else {
+  puts "Calculation of distance between two circles is OK"
+}