]> OCCT Git - occt-copy.git/commitdiff
0029093: BOP PaveFiller hungs and constantly consumes memory CR29093_2
authornbv <nbv@opencascade.com>
Fri, 22 Sep 2017 08:24:35 +0000 (11:24 +0300)
committernbv <nbv@opencascade.com>
Tue, 26 Sep 2017 10:21:26 +0000 (13:21 +0300)
Method IntWalk_PWalking::ExtendLineInCommonZone(...) now is not called if the already found intersection point is on surface boundary.
As result, the intersection line going along any boundary will never be extended. It is appropriate for high-level OCCT-algorithm because they will take the boundary (not computed line) as intersection result.

src/IntWalk/IntWalk_PWalking.cxx
tests/perf/modalg/bug29093_1 [new file with mode: 0644]
tests/perf/modalg/bug29093_2 [new file with mode: 0644]

index eed1c6334a320f690755d1aced5cbe5fe51a3f9e..ecc3c271fe4c3d8d2b1716c43621b6c8f20a56d9 100644 (file)
@@ -1653,6 +1653,20 @@ void IntWalk_PWalking::Perform(const TColStd_Array1OfReal& ParDep,
 Standard_Boolean IntWalk_PWalking::ExtendLineInCommonZone(const IntImp_ConstIsoparametric theChoixIso,
                                                           const Standard_Boolean          theDirectionFlag) 
 {
+  // Caro1 and Caro2
+  const Handle(Adaptor3d_HSurface)& Caro1 = myIntersectionOn2S.Function().AuxillarSurface1();
+  const Handle(Adaptor3d_HSurface)& Caro2 = myIntersectionOn2S.Function().AuxillarSurface2();
+  //
+  const Standard_Real UFirst1 = Adaptor3d_HSurfaceTool::FirstUParameter(Caro1);
+  const Standard_Real VFirst1 = Adaptor3d_HSurfaceTool::FirstVParameter(Caro1);
+  const Standard_Real ULast1 = Adaptor3d_HSurfaceTool::LastUParameter(Caro1);
+  const Standard_Real VLast1 = Adaptor3d_HSurfaceTool::LastVParameter(Caro1);
+
+  const Standard_Real UFirst2 = Adaptor3d_HSurfaceTool::FirstUParameter(Caro2);
+  const Standard_Real VFirst2 = Adaptor3d_HSurfaceTool::FirstVParameter(Caro2);
+  const Standard_Real ULast2 = Adaptor3d_HSurfaceTool::LastUParameter(Caro2);
+  const Standard_Real VLast2 = Adaptor3d_HSurfaceTool::LastVParameter(Caro2);
+
   Standard_Boolean bOutOfTangentZone = Standard_False;
   Standard_Boolean bStop = !myIntersectionOn2S.IsTangent();
   Standard_Integer dIncKey = 1;
@@ -1664,6 +1678,42 @@ Standard_Boolean IntWalk_PWalking::ExtendLineInCommonZone(const IntImp_ConstIsop
   Standard_Integer uvit = 0;
   IntSurf_SequenceOfPntOn2S aSeqOfNewPoint;
 
+  previousPoint.Parameters(Param(1), Param(2), Param(3), Param(4));
+
+  if (Param(1) - UFirst1 < ResoU1)
+  {
+    return bOutOfTangentZone;
+  }
+  else if (Param(2) - VFirst1 < ResoV1)
+  {
+    return bOutOfTangentZone;
+  }
+  else if (Param(3) - UFirst2 < ResoU2)
+  {
+    return bOutOfTangentZone;
+  }
+  else if (Param(4) - VFirst2 < ResoV2)
+  {
+    return bOutOfTangentZone;
+  }
+
+  if (Param(1) - ULast1 > -ResoU1)
+  {
+    return bOutOfTangentZone;
+  }
+  else if (Param(2) - VLast1 > -ResoV1)
+  {
+    return bOutOfTangentZone;
+  }
+  else if (Param(3) - ULast2 > -ResoU2)
+  {
+    return bOutOfTangentZone;
+  }
+  else if (Param(4) - VLast2 > -ResoV2)
+  {
+    return bOutOfTangentZone;
+  }
+
   while (!bStop) {
     nbIterWithoutAppend++;
 
diff --git a/tests/perf/modalg/bug29093_1 b/tests/perf/modalg/bug29093_1
new file mode 100644 (file)
index 0000000..e5af0ec
--- /dev/null
@@ -0,0 +1,39 @@
+puts "========"
+puts "OCC29093"
+puts "========"
+puts ""
+#################################
+# BOP PaveFiller hungs and constantly consumes memory
+#################################
+
+puts "TODO OCC28989 ALL : Error! Big tolerance value!"
+
+bclearobjects;
+bcleartools;
+
+restore [locate_data_file bug29093_hung.brep] a
+explode a So
+baddobjects a_1
+baddtools a_2 a_3 a_4 a_5 a_6 a_7 a_8 a_9 a_10 a_11 a_12 a_13 a_14
+
+dchrono cr restart
+
+bfillds
+bbop result 4
+
+dchrono cr stop counter bbuild
+
+regexp {Tolerance +MAX=([-0-9.+eE]+)} [tolerance result] full MaxTol
+
+# Maximal tolerance value must be updated after the fix.
+# Current tolerance value is 803.89403359886296.
+
+if {${MaxTol} > 1.0e-4} {
+  puts "Error! Big tolerance value!"
+}
+
+smallview
+donly result
+fit
+
+checkview -screenshot -2d -path ${imagedir}/${test_image}.png
\ No newline at end of file
diff --git a/tests/perf/modalg/bug29093_2 b/tests/perf/modalg/bug29093_2
new file mode 100644 (file)
index 0000000..85296cc
--- /dev/null
@@ -0,0 +1,32 @@
+puts "========"
+puts "OCC29093"
+puts "========"
+puts ""
+#################################
+# BOP PaveFiller hungs and constantly consumes memory
+#################################
+
+puts "TODO OCC29145 ALL : Faulty shapes in variables faulty_1 to faulty_"
+
+bclearobjects;
+bcleartools;
+
+restore [locate_data_file bug29093_hung2.brep] a
+explode a So
+baddobjects a_1
+baddtools a_2 a_3 a_4 a_5 a_6 a_7 a_8 a_9 a_10 a_11 a_12 a_13 a_14
+
+dchrono cr restart
+
+bfillds
+bbuild result
+
+dchrono cr stop counter bbuild
+
+checkshape result
+
+smallview
+donly result
+fit
+
+checkview -screenshot -2d -path ${imagedir}/${test_image}.png
\ No newline at end of file