]> OCCT Git - occt-copy.git/commitdiff
0028492: Boolean common does not produce expected result CR0-700-FIXWET
authornbv <nbv@opencascade.com>
Mon, 13 Mar 2017 13:03:07 +0000 (16:03 +0300)
committernbv <nbv@opencascade.com>
Thu, 16 Mar 2017 06:57:05 +0000 (09:57 +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/blend/simple/Q6
tests/boolean/bopfuse_complex/J6
tests/bugs/modalg_6/bug28492_1 [new file with mode: 0644]
tests/bugs/modalg_6/bug28492_2 [new file with mode: 0644]
tests/chamfer/data/complex/C1

index 244c5d1e86e080be497f121030f36ab253edb2be..4390ac2721a9aa9ba8f0553724cfd29fdbad6353 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;
             }
@@ -2815,7 +2823,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 1f3e4adb1376ef5f1e24676ff368ed0722e7a304..bd97b465d29061180e7c94b5b7d576b344fe64c1 100644 (file)
@@ -3,4 +3,4 @@ tscale s 0 0 0 SCALE
 explode s E
 blend result s SCALE*2 s_5
  
-checkprops result -s 1.65391e+08 -eps 0.1
+checkprops result -s 1.65391e+08
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
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
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"
+  }
 }