]> OCCT Git - occt-copy.git/commitdiff
0027441: The method IntTools_Context::IsVertexOnLine incorrectly computes parameter...
authoremv <emv@opencascade.com>
Wed, 27 Apr 2016 13:28:52 +0000 (16:28 +0300)
committeremv <emv@opencascade.com>
Mon, 3 Jul 2017 09:50:43 +0000 (12:50 +0300)
Choosing the closest bound to the checking point.

Test cases for the issue.

Updating test cases for the current behavior.

13 files changed:
src/IntTools/IntTools_Context.cxx
tests/boolean/gdml_private/W6
tests/boolean/gdml_private/W8
tests/boolean/gdml_private/ZC6
tests/boolean/gdml_private/ZC8
tests/boolean/gdml_private/ZD1
tests/boolean/gdml_private/ZD9
tests/boolean/gdml_private/ZE2
tests/bugs/grids.list
tests/bugs/modalg_6/bug27441 [new file with mode: 0644]
tests/bugs/modalg_7/begin [new file with mode: 0644]
tests/bugs/modalg_7/bug28883_1 [new file with mode: 0644]
tests/bugs/modalg_7/bug28883_2 [new file with mode: 0644]

index 32cfb7bfe3688af7fa6ce39562c3d0e2bbdeccfe..d1f1a7eb80d4fd591a3cd677b7bb7a58721b0fc3 100644 (file)
@@ -866,14 +866,20 @@ Standard_Boolean IntTools_Context::IsVertexOnLine
   aFirst=aC3D->FirstParameter();
   aLast =aC3D->LastParameter();
   //
-  //Checking extermities first
+  Standard_Boolean bIsClosed = IntTools_Tools::IsClosed(aC3D);
+  // Checking extermities first
+  // It is necessary to chose the closest bound to the point
+  Standard_Boolean bFirstValid = Standard_False;
+  Standard_Real aFirstDist = Precision::Infinite();
+  //
   if (!Precision::IsInfinite(aFirst)) {
     gp_Pnt aPCFirst=aC3D->Value(aFirst);
-    aDist=aPv.Distance(aPCFirst);
-    if (aDist < aTolSum) {
+    aFirstDist = aPv.Distance(aPCFirst);
+    if (aFirstDist < aTolSum) {
+      bFirstValid = Standard_True;
       aT=aFirst;
       //
-      if(aDist > aTolV) {
+      if (aFirstDist > aTolV) {
         Extrema_LocateExtPC anExt(aPv, aGAC, aFirst, 1.e-10);
         
         if(anExt.IsDone()) {
@@ -887,14 +893,19 @@ Standard_Boolean IntTools_Context::IsVertexOnLine
         }
       }
       //
-      return Standard_True;
+      if (bIsClosed) {
+        return Standard_True;
+      }
     }
   }
   //
-  //if (!Precision::IsInfinite(aFirst)) {
   if (!Precision::IsInfinite(aLast)) {
     gp_Pnt aPCLast=aC3D->Value(aLast);
     aDist=aPv.Distance(aPCLast);
+    if (bFirstValid && (aFirstDist < aDist)) {
+      return Standard_True;
+    }
+    //
     if (aDist < aTolSum) {
       aT=aLast;
       //
@@ -915,6 +926,9 @@ Standard_Boolean IntTools_Context::IsVertexOnLine
       return Standard_True;
     }
   }
+  else if (bFirstValid) {
+    return Standard_True;
+  }
   //
   GeomAPI_ProjectPointOnCurve& aProjector=ProjPT(aC3D);
   aProjector.Perform(aPv);
index 1147039c3eae980eab2163b1720c136ae28cad61..39b185e8e1f7f6bdea940398fd5763ec1b097716 100644 (file)
@@ -1,2 +1,4 @@
+puts "TODO ?OCC26619 ALL: Faulty shapes in variables faulty_1 to faulty_"
+
 source [locate_data_file 200A0-1_BE.asm.1.gdml.tcl]
 
index 478cc03c126fa7d327ee86a492da4691c0a30e11..0eb736e2c3f30dacad65beba88e7f8ef1e048970 100644 (file)
@@ -1,2 +1,4 @@
+puts "TODO ?OCC26619 ALL: Faulty shapes in variables faulty_1 to faulty_"
+
 source [locate_data_file 200a0-1_be_piquage.prt.1.gdml.tcl]
 
index f7356da6757443008981ce995afcdff983e78e3c..d83faeed866f55dce4f2ba765a5eecd175cc23ff 100644 (file)
@@ -1,2 +1,4 @@
+puts "TODO ?OCC26619 ALL: Faulty shapes in variables faulty_1 to faulty_"
+
 source [locate_data_file 200a0-1_sid_piquage.prt.1.gdml.tcl]
 
index dc678c12cc29dd114e5293f3cb917dff5c9fbe19..4661e67360d900cb8c09d3fe9c23b1d56cc79244 100644 (file)
@@ -1,2 +1,4 @@
+puts "TODO ?OCC26619 ALL: Faulty shapes in variables faulty_1 to faulty_"
+
 source [locate_data_file 200a0-1_sopac-dn200.asm.1.gdml.tcl]
 
index bffc5c6a4fe29f54303d58c52d55b81328e97005..011a9b953186e9a4c07bbabb05e21dcbab0a11b8 100644 (file)
@@ -1,2 +1,4 @@
+puts "TODO ?OCC26619 ALL: Faulty shapes in variables faulty_1 to faulty_"
+
 source [locate_data_file 200a0-1_sopac-dn200_piquage.prt.1.gdml.tcl]
 
index cff3161f5d9ae5fb4c6dc806c93b2ddb36249e09..8b7d69d522e0d629dabb8742db3dbad95c379c57 100644 (file)
@@ -1,2 +1,4 @@
+puts "TODO ?OCC26619 ALL: Faulty shapes in variables faulty_1 to faulty_"
+
 source [locate_data_file 200a0-1_spec.asm.1.gdml.tcl]
 
index 0bba5386ae712fd00a29018cc2972605e9f6e6eb..48b09a85ecb4e51c0fce793ff99033d32ede742b 100644 (file)
@@ -1,2 +1,4 @@
+puts "TODO ?OCC26619 ALL: Faulty shapes in variables faulty_1 to faulty_"
+
 source [locate_data_file 200a0-1_spec_piquage.prt.1.gdml.tcl]
 
index d90570731e938172a54df56980631a46f41adb52..534a46e17fdeeec9d61ad5af7ca65a313a12b5d4 100755 (executable)
@@ -9,11 +9,12 @@
 009 modalg_4
 010 modalg_5
 011 modalg_6
-012 moddata_1
-013 moddata_2
-014 moddata_3
-015 step
-016 caf
-017 mesh
-018 heal
-019 stlvrml
+012 modalg_7
+013 moddata_1
+014 moddata_2
+015 moddata_3
+016 step
+017 caf
+018 mesh
+019 heal
+020 stlvrml
diff --git a/tests/bugs/modalg_6/bug27441 b/tests/bugs/modalg_6/bug27441
new file mode 100644 (file)
index 0000000..1489df5
--- /dev/null
@@ -0,0 +1,16 @@
+puts "============"
+puts "OCC27441"
+puts "============"
+puts ""
+###############################
+## The method IntTools_ContextIsVertexOnLine incorrectly computes parameter of the point on the curve
+###############################
+
+restore [locate_data_file bug27428_shapes.brep] b
+explode b
+bsection result b_1 b_2
+set bcheck [bopcheck result]
+puts $bcheck
+if {![regexp {This shape seems to be OK.} $bcheck]} {
+    puts "Error: bopcheck failed"
+}
diff --git a/tests/bugs/modalg_7/begin b/tests/bugs/modalg_7/begin
new file mode 100644 (file)
index 0000000..5a5d7f9
--- /dev/null
@@ -0,0 +1 @@
+set subgroup modalg
diff --git a/tests/bugs/modalg_7/bug28883_1 b/tests/bugs/modalg_7/bug28883_1
new file mode 100644 (file)
index 0000000..38d3a43
--- /dev/null
@@ -0,0 +1,21 @@
+puts "======="
+puts "OCC28883"
+puts "======="
+puts ""
+##################################################
+# Invalid result of Section operation
+##################################################
+
+restore [locate_data_file bug28883_Prism.brep] b1
+restore [locate_data_file bug28883_LES_2d_shell.brep] b2
+
+explode b1 f; copy b1_51 b1
+explode b2 f; copy b2_8 b2
+
+bsection result b1 b2
+
+checkshape result
+checksection result
+
+checknbshapes result -edge 1 -vertex 2
+set length 7.13116e-007
diff --git a/tests/bugs/modalg_7/bug28883_2 b/tests/bugs/modalg_7/bug28883_2
new file mode 100644 (file)
index 0000000..913c4f9
--- /dev/null
@@ -0,0 +1,18 @@
+puts "======="
+puts "OCC28883"
+puts "======="
+puts ""
+##################################################
+# Invalid result of Section operation
+##################################################
+
+restore [locate_data_file bug28883_Prism.brep] b1
+restore [locate_data_file bug28883_LES_2d_shell.brep] b2
+
+bsection result b1 b2
+
+checkshape result
+checksection result
+
+checknbshapes result -edge 133 -vertex 134
+set length 2.20769