]> OCCT Git - occt.git/commitdiff
0032796: Modeling Data - Calculation of distance between two circles crashes IR-2022-03-05
authorvro <vro@opencascade.com>
Tue, 22 Feb 2022 14:00:09 +0000 (17:00 +0300)
committersmoskvin <smoskvin@opencascade.com>
Sat, 5 Mar 2022 14:33:56 +0000 (17:33 +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 d19c2464726f7bcd9d6e217e60526bed5371b1d6..389e2a0dde39620ffe655bf785b3e23813ec022f 100644 (file)
@@ -663,7 +663,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);
@@ -703,7 +703,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"
+}