]> OCCT Git - occt-copy.git/commitdiff
Fix for the issue #29260
authornbv <nbv@opencascade.com>
Thu, 26 Oct 2017 07:44:50 +0000 (10:44 +0300)
committernbv <nbv@opencascade.com>
Wed, 1 Nov 2017 07:49:54 +0000 (10:49 +0300)
Improvements (as test result only; indeed the tests are bad as before)
boolean gdml_private  ZI7  ZJ7

12 files changed:
src/Adaptor3d/Adaptor3d_TopolTool.cxx
tests/bugs/modalg_1/bug10160_6
tests/bugs/modalg_1/bug10160_8
tests/bugs/modalg_5/bug24585_1
tests/bugs/modalg_6/bug26132
tests/bugs/modalg_6/bug26151_1
tests/bugs/modalg_6/bug26151_2
tests/bugs/modalg_6/bug29260_1 [new file with mode: 0644]
tests/bugs/modalg_6/bug29260_2 [new file with mode: 0644]
tests/bugs/modalg_6/bug29260_3 [new file with mode: 0644]
tests/bugs/modalg_6/bug29260_4 [new file with mode: 0644]
tests/bugs/step/bug11856

index 1d9a5754d17b32f248da52203282918fb134f275..16c78b0158796c082ae7b6a33d31e657f59c2f61 100644 (file)
@@ -943,14 +943,25 @@ void Adaptor3d_TopolTool::BSplSamplePnts(const Standard_Real theDefl,
 
   Standard_Integer i, k, j = 1;
   Standard_Real t1, t2, dt;
-  Standard_Integer ui1 = aBS->FirstUKnotIndex();
-  Standard_Integer ui2 = aBS->LastUKnotIndex();
-  Standard_Integer vi1 = aBS->FirstVKnotIndex();
-  Standard_Integer vi2 = aBS->LastVKnotIndex();
+
+  const Standard_Integer aNbUi = myS->NbUIntervals(GeomAbs_C2),
+    aNbVi = myS->NbVIntervals(GeomAbs_C2);
+
+  TColStd_Array1OfReal aUKnots(1, aNbUi + 1);
+  TColStd_Array1OfReal aVKnots(1, aNbVi + 1);
+
+  myS->UIntervals(aUKnots, GeomAbs_C2);
+
+  myS->VIntervals(aVKnots, GeomAbs_C2);
+
+  Standard_Integer ui1 = aUKnots.Lower();
+  Standard_Integer ui2 = aUKnots.Upper();
+  Standard_Integer vi1 = aVKnots.Lower();
+  Standard_Integer vi2 = aVKnots.Upper();
 
   for(i = ui1; i < ui2; ++i)
   {
-    if(uinf >= aBS->UKnot(i) && uinf < aBS->UKnot(i + 1))
+    if(uinf >= aUKnots.Value(i) && uinf < aUKnots.Value(i + 1))
     {
       ui1 = i;
       break;
@@ -959,7 +970,7 @@ void Adaptor3d_TopolTool::BSplSamplePnts(const Standard_Real theDefl,
 
   for(i = ui2; i > ui1; --i)
   {
-    if(usup <= aBS->UKnot(i) && usup > aBS->UKnot(i - 1))
+    if(usup <= aUKnots.Value(i) && usup > aUKnots.Value(i - 1))
     {
       ui2 = i;
       break;
@@ -968,7 +979,7 @@ void Adaptor3d_TopolTool::BSplSamplePnts(const Standard_Real theDefl,
 
   for(i = vi1; i < vi2; ++i)
   {
-    if(vinf >= aBS->VKnot(i) && vinf < aBS->VKnot(i + 1))
+    if(vinf >= aVKnots.Value(i) && vinf < aVKnots.Value(i + 1))
     {
       vi1 = i;
       break;
@@ -977,7 +988,7 @@ void Adaptor3d_TopolTool::BSplSamplePnts(const Standard_Real theDefl,
 
   for(i = vi2; i > vi1; --i)
   {
-    if(vsup <= aBS->VKnot(i) && vsup > aBS->VKnot(i - 1))
+    if(vsup <= aVKnots.Value(i) && vsup > aVKnots.Value(i - 1))
     {
       vi2 = i;
       break;
@@ -1051,7 +1062,7 @@ void Adaptor3d_TopolTool::BSplSamplePnts(const Standard_Real theDefl,
     for(i = ui1 + 1; i <= ui2; ++i)
     {
       if(i == ui2) t2 = usup;
-      else t2 = aBS->UKnot(i);
+      else t2 = aUKnots.Value(i);
       dt = (t2 - t1) / nbi;
       j = 1;
       do
@@ -1091,7 +1102,7 @@ void Adaptor3d_TopolTool::BSplSamplePnts(const Standard_Real theDefl,
     for(i = vi1 + 1; i <= vi2; ++i)
     {
       if(i == vi2) t2 = vsup;
-      else t2 = aBS->VKnot(i);
+      else t2 = aVKnots.Value(i);
       dt = (t2 - t1) / nbi;
       j = 1;
       do
@@ -1112,7 +1123,6 @@ void Adaptor3d_TopolTool::BSplSamplePnts(const Standard_Real theDefl,
 
   Standard_Real aDefl2 = Max(theDefl*theDefl, 1.e-9);
   Standard_Real tol = Max(0.01*aDefl2, 1.e-9);
-  Standard_Integer l;
 
   // Calculations of B-spline values will be made using adaptor,
   // because it caches the data for performance
@@ -1150,7 +1160,7 @@ void Adaptor3d_TopolTool::BSplSamplePnts(const Standard_Real theDefl,
 
         gp_Lin lin(p1, gp_Dir(gp_Vec(p1, p2)));
         Standard_Boolean ok = Standard_True;
-        for(l = j + 1; l < k; ++l)
+        for(Standard_Integer l = j + 1; l < k; ++l)
         {
 
           if(anUFlg(l))
@@ -1248,7 +1258,7 @@ void Adaptor3d_TopolTool::BSplSamplePnts(const Standard_Real theDefl,
         //const gp_Lin& lin = MkLin.Value();
         gp_Lin lin(p1, gp_Dir(gp_Vec(p1, p2)));
         Standard_Boolean ok = Standard_True;
-        for(l = j + 1; l < k; ++l)
+        for(Standard_Integer l = j + 1; l < k; ++l)
         {
 
           if(aVFlg(l))
index 94012db7e777e40f2aa42db2c5a67599d5d49ba9..7f5dc5c93814c4fea4a88b78f4aa8433742256dd 100755 (executable)
@@ -1,4 +1,6 @@
 puts "TODO OCC11111 ALL: Error :  is WRONG because number of "
+puts "TODO OCC11111 ALL: Faulty shapes in variables faulty_1 to faulty_ "
+
 puts "============"
 puts "OCC10160"
 puts "============"
index 76755f46837ca0450824e5b12caee60654bf38bc..14cd8007450894057d8fa5eb8c5fa6bfe8e4018a 100755 (executable)
@@ -1,4 +1,6 @@
-puts "TODO OCC11111 ALL: Error :  is WRONG because number of "
+puts "TODO OCC11111 ALL: Error :  is WRONG because number of"
+puts "TODO OCC11111 ALL: Faulty shapes in variables faulty_1 to faulty_"
+
 puts "============"
 puts "OCC10160"
 puts "============"
index 892c758e0e77ac6c8272bdfe15ed834d92717427..b3b4f89ef4126d3af9ee41f60de8a1078123c351 100644 (file)
@@ -6,7 +6,7 @@ puts ""
 # Wrong pcurve of the section curve
 ###########################################################
 
-set ExpectedTol 5.6061116035240048e-005
+set ExpectedTol 6.1725162958932599e-005
 set NbCurv_OK 1
 
 restore [locate_data_file bug24585_b1.brep] b1
index 09eb210f21e9f913afd1959ede5cbb7472f92912..c2971217edf74aa71bedf9bd5fb6b93ca4c09d7e 100755 (executable)
@@ -6,6 +6,8 @@ puts ""
 # Invalid result of boolean operation
 ######################################################
 
+puts "TODO OCC11111 ALL: Error : Boolean operations common is WRONG because number of "
+
 restore [locate_data_file bug26132_shape.brep] c
 
 explode c
index 8f644833efb305301d635dd8e0495771b13b5ba6..36a2d0f59236ae68fe330951174e0b3b18ef9b15 100755 (executable)
@@ -6,6 +6,8 @@ puts ""
 ## Wrong result obtained by intersection algorithm.
 ###############################
 
+puts "TODO OCC11111 ALL: Error : Wrong result obtained by intersection algorithm"
+
 restore [locate_data_file bug26132_shape.brep] q
 
 explode q
index 92b986b5cb872e4c1af6db56f60afa1ba0bb37f1..c794cdd22b5501fe9818debfdf096e536ed5290f 100755 (executable)
@@ -6,6 +6,8 @@ puts ""
 ## Wrong result obtained by intersection algorithm.
 ###############################
 
+puts "TODO OCC11111 ALL: Error : Wrong result obtained by intersection algorithm"
+
 restore [locate_data_file bug26132_shape.brep] q
 
 explode q
diff --git a/tests/bugs/modalg_6/bug29260_1 b/tests/bugs/modalg_6/bug29260_1
new file mode 100644 (file)
index 0000000..8effd39
--- /dev/null
@@ -0,0 +1,43 @@
+puts "================"
+puts "OCC29260"
+puts "================"
+puts ""
+#######################################################################
+# Boolean operation hangs on the intersection stage
+#######################################################################
+
+restore [locate_data_file bug29260_sewedShapeb1.brep] a
+restore [locate_data_file bug29260_cuttingTool1b1.brep] t1
+
+bclearobjects
+bcleartools
+baddobjects a
+baddtools t1
+
+dchrono cr reset
+dchrono cr start
+
+bfillds
+bbop result 2
+
+dchrono cr stop
+
+bbop rs 4
+
+dchrono cr show
+
+if { [string compare -nocase [checksection rs] " nb alone Vertices : 0\n\n"] } {
+  puts "ERROR: the section is not closed"
+} else {
+  puts "The section is OK"
+}
+
+checknbshapes result -solid 1 -shell 1
+checkprops result -s 0.00926451
+checkshape result
+
+smallview
+don result
+fit
+
+checkview -screenshot -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/bugs/modalg_6/bug29260_2 b/tests/bugs/modalg_6/bug29260_2
new file mode 100644 (file)
index 0000000..b63d86b
--- /dev/null
@@ -0,0 +1,46 @@
+puts "================"
+puts "OCC29260"
+puts "================"
+puts ""
+#######################################################################
+# Boolean operation hangs on the intersection stage
+#######################################################################
+
+puts "TODO OCC29260 ALL: Error :  is WRONG because number of"
+puts "TODO OCC29260 ALL: Error : The area of result shape is"
+
+restore [locate_data_file bug29260_sewedShapeb1.brep] a
+restore [locate_data_file bug29260_cuttingTool2b1.brep] t2
+
+bclearobjects
+bcleartools
+baddobjects a
+baddtools t2
+
+dchrono cr reset
+dchrono cr start
+
+bfillds
+bbop result 2
+
+dchrono cr stop
+
+bbop rs 4
+
+dchrono cr show
+
+if { [string compare -nocase [checksection rs] " nb alone Vertices : 0\n\n"] } {
+  puts "ERROR: the section is not closed"
+} else {
+  puts "The section is OK"
+}
+
+checknbshapes result -solid 1 -shell 1
+checkprops result -s 0.00926434
+checkshape result
+
+smallview
+don result
+fit
+
+checkview -screenshot -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/bugs/modalg_6/bug29260_3 b/tests/bugs/modalg_6/bug29260_3
new file mode 100644 (file)
index 0000000..e82c94a
--- /dev/null
@@ -0,0 +1,43 @@
+puts "================"
+puts "OCC29260"
+puts "================"
+puts ""
+#######################################################################
+# Boolean operation hangs on the intersection stage
+#######################################################################
+
+restore [locate_data_file bug29260_sewedShapeb2.brep] a
+restore [locate_data_file bug29260_cuttingTool1b2.brep] t1
+
+bclearobjects
+bcleartools
+baddobjects a
+baddtools t1
+
+dchrono cr reset
+dchrono cr start
+
+bfillds
+bbop result 2
+
+dchrono cr stop
+
+bbop rs 4
+
+dchrono cr show
+
+if { [string compare -nocase [checksection rs] " nb alone Vertices : 0\n\n"] } {
+  puts "ERROR: the section is not closed"
+} else {
+  puts "The section is OK"
+}
+
+checknbshapes result -solid 1 -shell 1
+checkprops result -s 0.0105663
+checkshape result
+
+smallview
+don result
+fit
+
+checkview -screenshot -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/bugs/modalg_6/bug29260_4 b/tests/bugs/modalg_6/bug29260_4
new file mode 100644 (file)
index 0000000..83bbca6
--- /dev/null
@@ -0,0 +1,46 @@
+puts "================"
+puts "OCC29260"
+puts "================"
+puts ""
+#######################################################################
+# Boolean operation hangs on the intersection stage
+#######################################################################
+
+puts "TODO OCC29260 ALL: ERROR: the section is not closed"
+puts "TODO OCC29260 ALL: Error : The area of result shape is"
+
+restore [locate_data_file bug29260_sewedShapeb2.brep] a
+restore [locate_data_file bug29260_cuttingTool2b2.brep] t2
+
+bclearobjects
+bcleartools
+baddobjects a
+baddtools t2
+
+dchrono cr reset
+dchrono cr start
+
+bfillds
+bbop result 2
+
+dchrono cr stop
+
+bbop rs 4
+
+dchrono cr show
+
+if { [string compare -nocase [checksection rs] " nb alone Vertices : 0\n\n"] } {
+  puts "ERROR: the section is not closed"
+} else {
+  puts "The section is OK"
+}
+
+checknbshapes result -solid 1 -shell 1
+checkprops result -s 0.00926451
+checkshape result
+
+smallview
+don result
+fit
+
+checkview -screenshot -2d -path ${imagedir}/${test_image}.png
index 4aa23372bf0e14880e53fb9248271d65aa41bd58..7b10422975c1dbae9a2002db679f2ff6e8ca2ed3 100755 (executable)
@@ -13,7 +13,7 @@ stepread [locate_data_file OCC11856.stp] a *
 
 tpcompound result
 
-checkprops result -s 611185 -eps 0.1
+checkprops result -s 653034
 checkshape result
 checknbshapes result -vertex 684 -edge 1222 -wire 519 -face 512 -shell 1 -solid 1 -compsolid 0 -compound 1 -shape 2940
 checkview -display result -2d -path ${imagedir}/${test_image}.png