]> OCCT Git - occt.git/commitdiff
0028492: Boolean common does not produce expected result
authornbv <nbv@opencascade.com>
Mon, 13 Mar 2017 13:03:07 +0000 (16:03 +0300)
committerbugmaster <bugmaster@opencascade.com>
Thu, 16 Mar 2017 10:31:01 +0000 (13:31 +0300)
Generation of 3D-steps shorter than 3D tolerance has been allowed in the fix to build Walking-line.

Now, 3D-step is limited by Precision::Confusion value.

src/IntWalk/IntWalk_PWalking.cxx
tests/boolean/bopfuse_complex/J6
tests/bugs/modalg_5/bug25319_1
tests/bugs/modalg_5/bug25319_2
tests/bugs/modalg_6/bug27896
tests/bugs/modalg_6/bug28492_1 [new file with mode: 0644]
tests/bugs/modalg_6/bug28492_2 [new file with mode: 0644]
tests/bugs/modalg_6/bug28492_3 [new file with mode: 0644]
tests/chamfer/data/complex/C1

index a655f7706b7a4e6a366dee55c931188d44370644..f6234e1e5b9b8e4a83dd79980e505e484d2f7b8f 100644 (file)
@@ -721,7 +721,7 @@ void IntWalk_PWalking::Perform(const TColStd_Array1OfReal& ParDep,
 
   AddAPoint(line,previousPoint);
   //
-  IntWalk_StatusDeflection Status = IntWalk_OK;
+  IntWalk_StatusDeflection Status = IntWalk_OK, aPrevStatus = IntWalk_OK;
   Standard_Boolean NoTestDeflection = Standard_False;
   Standard_Real SvParam[4], f;
   Standard_Integer LevelOfEmptyInmyIntersectionOn2S=0;
@@ -736,6 +736,8 @@ void IntWalk_PWalking::Perform(const TColStd_Array1OfReal& ParDep,
   Arrive = Standard_False;
   while(!Arrive) //010
   {
+    aPrevStatus = Status;
+
     LevelOfIterWithoutAppend++;
     if(LevelOfIterWithoutAppend>20)
     {
@@ -1126,7 +1128,13 @@ void IntWalk_PWalking::Perform(const TColStd_Array1OfReal& ParDep,
               Param(3)=SvParam[2];
               Param(4)=SvParam[3];
 
-              LevelOfIterWithoutAppend = 0;
+              // In order to avoid cyclic changes
+              // (PasTropGrand --> Decrease step --> 
+              // StepTooSmall --> Increase step --> PasTropGrand...)
+              // nullify LevelOfIterWithoutAppend only if the condition
+              // is satisfied:
+              if (aPrevStatus != IntWalk_PasTropGrand)
+                LevelOfIterWithoutAppend = 0;
 
               break;
             }
@@ -2952,7 +2960,7 @@ IntWalk_StatusDeflection  IntWalk_PWalking::TestDeflection(const IntImp_ConstIso
     SquareDistance(CurrentPoint.Value());
 
 
-  if (aSqDist < tolconf*tolconf) { 
+  if (aSqDist < Precision::SquareConfusion()) { 
     pasInit[0] = Max(pasInit[0], 5.0*ResoU1);
     pasInit[1] = Max(pasInit[1], 5.0*ResoV1);
     pasInit[2] = Max(pasInit[2], 5.0*ResoU2);
index f2d8d188a22dc617097c28b314e1158cfdde35ef..b714d0f729d17f6de64fd588ac01e5634b76b5b5 100644 (file)
@@ -1,10 +1,8 @@
-puts "TODO #22911 ALL: Error : The area of result shape is"
-
 restore [locate_data_file a350] a
 restore [locate_data_file b350] b
 
 bop a b
 bopfuse result
 
-checkprops result -s 0
+checkprops result -s 120.576
 checkview -display result -2d -otherwise { a b } -s -path ${imagedir}/${test_image}.png
index 1cfc1e5cba96fb2dcaf01806e8491a1b87ac4b7f..1ac303b1c32f86a1449664b36b249e492ca23b18 100644 (file)
@@ -14,5 +14,5 @@ bcommon result b1 b2
 checkprops result -s 1690.81 
 checkshape result
 
-checknbshapes result -vertex 21 -edge 32 -wire 13 -face 13 -shell 1 -solid 1 -compsolid 0 -compound 1 -shape 82
+checknbshapes result -vertex 20 -edge 31 -wire 13 -face 13 -shell 1 -solid 1 -compsolid 0 -compound 1 -shape 80
 checkview -display result -2d -path ${imagedir}/${test_image}.png
index 8072e1f329693269c4d09beef0ffc886ad89ac3b..0430e7dbfa7d9ac0ef32e15d2369937ba3cfb696 100644 (file)
@@ -17,5 +17,5 @@ bcommon result b1 b2
 checkprops result -s 1690.81 
 checkshape result
 
-checknbshapes result -vertex 21 -edge 32 -wire 13 -face 13 -shell 1 -solid 1 -compsolid 0 -compound 1 -shape 82
+checknbshapes result -vertex 20 -edge 31 -wire 13 -face 13 -shell 1 -solid 1 -compsolid 0 -compound 1 -shape 80
 checkview -display result -2d -path ${imagedir}/${test_image}.png
index 47e1c18bc981a7b3d2cc9b5a638fb4cdebe618bf..a0af479d00ac9bcd3329a3cd5bee6b3730172da5 100644 (file)
@@ -26,7 +26,7 @@ regexp {Tolerance Reached=+([-0-9.+eE]+)\n+([-0-9.+eE]+)} ${log1} full Tolerance
 regexp {Tolerance Reached=+([-0-9.+eE]+)\n+([-0-9.+eE]+)} ${log2} full Tolerance_Reached2 NbCurv2
 
 set expected_Tolerance_Reached1 2.2611960020325053e-007
-set expected_Tolerance_Reached2 5.6963104817869286e-006
+set expected_Tolerance_Reached2 7.6423429413334924e-006
 
 checkreal "Tolerance Reached" ${Tolerance_Reached1} ${expected_Tolerance_Reached1} ${tol_abs_Tolerance_Reached} ${tol_rel_Tolerance_Reached}
 checkreal "Tolerance Reached" ${Tolerance_Reached2} ${expected_Tolerance_Reached2} ${tol_abs_Tolerance_Reached} ${tol_rel_Tolerance_Reached}
diff --git a/tests/bugs/modalg_6/bug28492_1 b/tests/bugs/modalg_6/bug28492_1
new file mode 100644 (file)
index 0000000..7941703
--- /dev/null
@@ -0,0 +1,21 @@
+puts "========"
+puts "OCC28492"
+puts "========"
+puts ""
+##########################################
+## Boolean common does not produce expected result
+##########################################
+
+restore [locate_data_file bug28492_case1.brep] a
+explode a
+bcommon result a_1 a_2
+
+checknbshapes result -wire 2 -face 1 -t
+checkprops result -s 1882.29
+checkshape result
+
+if {! [regexp "to be valid for BOP" [bopargcheck result] ] } {
+  puts "Error: bopargcheck failed"
+}
+
+checkview -display result -2d -path ${imagedir}/${test_image}.png
\ No newline at end of file
diff --git a/tests/bugs/modalg_6/bug28492_2 b/tests/bugs/modalg_6/bug28492_2
new file mode 100644 (file)
index 0000000..1668abf
--- /dev/null
@@ -0,0 +1,21 @@
+puts "========"
+puts "OCC28492"
+puts "========"
+puts ""
+##########################################
+## Boolean common does not produce expected result
+##########################################
+
+restore [locate_data_file bug28492_case2.brep] a
+explode a
+bcommon result a_1 a_2
+
+checknbshapes result -wire 1 -face 1 -t
+checkprops result -s 77.8077
+checkshape result
+
+if {! [regexp "to be valid for BOP" [bopargcheck result] ] } {
+  puts "Error: bopargcheck failed"
+}
+
+checkview -display result -2d -path ${imagedir}/${test_image}.png
\ No newline at end of file
diff --git a/tests/bugs/modalg_6/bug28492_3 b/tests/bugs/modalg_6/bug28492_3
new file mode 100644 (file)
index 0000000..de64049
--- /dev/null
@@ -0,0 +1,27 @@
+puts "========"
+puts "OCC28492"
+puts "========"
+puts ""
+##########################################
+## Boolean common does not produce expected result
+##########################################
+
+restore [locate_data_file a350] a
+restore [locate_data_file b350] b
+
+bclearobjects
+bcleartools
+baddobjects a
+baddtools b
+bfillds
+bbuild result
+
+checknbshapes result -solid 3 -shell 3 -t
+checkprops result -s 253.741 -v 82.9156
+checkshape result
+
+if {! [regexp "to be valid for BOP" [bopargcheck result] ] } {
+  puts "Error: bopargcheck failed"
+}
+
+checkview -display result -2d -path ${imagedir}/${test_image}.png
\ No newline at end of file
index 22a9c542412cbb28a4a78c20160baebed20d5ce8..636f90bf01b29be54892013f436819cf3dda1543 100644 (file)
@@ -4,5 +4,7 @@ set chamf_dist_angle [list "0.01    30" "0.008    30" "0.01    60" "0.015    60"
 set chamf_dist_dist  [list "0.01 0.006" "0.008 0.006" "0.01 0.012" "0.015 0.012" "0.01 0.006" "0.008 0.006" "0.01 0.012" "0.008 0.012"]
 set chamf_equal_dist [list "0.01      " "0.008      " "0.01      " "0.015      " "0.01      " "0.008      " "0.01      " "0.008      "]
 if { [string compare $command chamf] == 0 } {
-  puts "TODO OCC22909 All:chamfer is not done. compute of chamfer failed"
+  if { [string compare $group equal_dist] != 0 } {
+    puts "TODO OCC22909 All:chamfer is not done. compute of chamfer failed"
+  }
 }