0032196: Modeling Algorithms - Invalid section curve
authorjgv <jgv@opencascade.com>
Thu, 20 May 2021 22:54:07 +0000 (01:54 +0300)
committerbugmaster <bugmaster@opencascade.com>
Sat, 22 May 2021 07:36:40 +0000 (10:36 +0300)
Modify the method IntWalk_IWalking::ComputeCloseLine: add condition for check of update of variable containing current solution

src/IntWalk/IntWalk_IWalking_4.gxx
tests/bugs/modalg_7/bug32196 [new file with mode: 0644]

index c2b236a..8965974 100644 (file)
@@ -386,12 +386,16 @@ void IntWalk_IWalking::ComputeCloseLine(const TColStd_SequenceOfReal& Umult,
                 StepSign = -1;
                 StatusPrecedent = IntWalk_OK;
                 PasC = PasSav;
-                if (aStatus == IntWalk_ArretSurPointPrecedent) {
-                  CurrentLine->AddPoint(Psol);
-                  OpenLine(0,Psol,Pnts1,Func,CurrentLine);
-                }
-                else {
-                  OpenLine(-lines.Length()-1,Psol,Pnts1,Func,CurrentLine);
+                //Check if <Psol> has been really updated
+                if (Arrive || Rajout || (!ArretAjout && Cadre && SaveN <= 0))
+                {
+                  if (aStatus == IntWalk_ArretSurPointPrecedent) {
+                    CurrentLine->AddPoint(Psol);
+                    OpenLine(0,Psol,Pnts1,Func,CurrentLine);
+                  }
+                  else {
+                    OpenLine(-lines.Length()-1,Psol,Pnts1,Func,CurrentLine);
+                  }
                 }
                 //Remove <SaveN> from <seqAlone> and, if it is first found point,
                 //from <seqAjout> too
diff --git a/tests/bugs/modalg_7/bug32196 b/tests/bugs/modalg_7/bug32196
new file mode 100644 (file)
index 0000000..07a9fcb
--- /dev/null
@@ -0,0 +1,46 @@
+puts "================================"
+puts " 0032196: Invalid section curve"
+puts "================================"
+puts ""
+
+restore [locate_data_file bug32136_obj.brep] s
+restore [locate_data_file bug32136_tools.brep] t
+
+explode s f
+explode t
+explode t_3 f
+
+set log [bopcurves s_44 t_3_4 -2d]
+
+if {![regexp "has no 3d curves" ${log}] ||
+    ![regexp "has no 3d points" ${log}]} {
+  puts "Error: the result contains curves or points"
+}
+
+set log [bopcurves s_2 t_3_82 -2d]
+
+if {![regexp "has no 3d curves" ${log}] ||
+    ![regexp "has no 3d points" ${log}]} {
+  puts "Error: the result contains curves or points"
+}
+
+set log [bopcurves s_2 t_3_95 -2d]
+
+if {![regexp "has no 3d curves" ${log}] ||
+    ![regexp "has no 3d points" ${log}]} {
+  puts "Error: the result contains curves or points"
+}
+
+set log [bopcurves s_2 t_3_108 -2d]
+
+if {![regexp "has no 3d curves" ${log}] ||
+    ![regexp "has no 3d points" ${log}]} {
+  puts "Error: the result contains curves or points"
+}
+
+set log [bopcurves s_52 t_3_43 -2d]
+
+if {![regexp "has no 3d curves" ${log}] ||
+    ![regexp "has no 3d points" ${log}]} {
+  puts "Error: the result contains curves or points"
+}