0030090: Modeling Algorithms - BRepLib::FindValidRange does not find valid range...
authoremv <emv@opencascade.com>
Tue, 28 Aug 2018 09:22:01 +0000 (12:22 +0300)
committerbugmaster <bugmaster@opencascade.com>
Sat, 1 Sep 2018 08:10:22 +0000 (11:10 +0300)
BRepLib::FindValidRange - check each sampling point to be out of tolerance sphere of the vertex.
Test case for the issue.

src/BRepLib/BRepLib_1.cxx
tests/bugs/modalg_7/bug30090 [new file with mode: 0644]

index 5366ebf..a5cca92 100644 (file)
@@ -101,7 +101,8 @@ static Standard_Boolean findNearestValidPoint(
         // cycle to go out of local singularity
         gp_Vec aD1;
         theCurve.D1(anUOut, aP, aD1);
-        if (aD1.SquareMagnitude() < aD1Mag)
+        isOut = (aP.SquareDistance(theVertPnt) > aSqTol);
+        if (!isOut && aD1.SquareMagnitude() < aD1Mag)
         {
           aStepLocal *= 2.;
           anUOut += aStepLocal;
diff --git a/tests/bugs/modalg_7/bug30090 b/tests/bugs/modalg_7/bug30090
new file mode 100644 (file)
index 0000000..59c7dd2
--- /dev/null
@@ -0,0 +1,12 @@
+puts "========"
+puts "OCC30090: Modeling Algorithms - BRepLib::FindValidRange does not find valid range for the edge"
+puts "========"
+puts ""
+
+restore [locate_data_file bug30090_edge.brep] e
+if {[regexp {([-0-9.+eE]+) ([-0-9.+eE]+)} [validrange e] full first last]} {
+  checkreal First $first 0.043210875526017684 1.e-7 0
+  checkreal Last $last 0.98374162670821774 1.e-7 0
+} else {
+  puts "Error: valid range is not found"
+}