]> OCCT Git - occt.git/commitdiff
0032915: Geom2dAPI_InterCurveCurve, The algorithm lost an intersection point. CR0-WEEK-25 IR-2022-06-24
authorazv <azv@opencascade.com>
Fri, 8 Apr 2022 08:03:53 +0000 (11:03 +0300)
committerafokin <afokin@opencascade.com>
Thu, 23 Jun 2022 17:40:07 +0000 (20:40 +0300)
Get rid of strange code: preliminary check of self-intersections is made on a polygonal representation of a curve, it is able to find possible intersections, but after that it filter out segments neighbor to the pair of non-intersected segments.

Test case de step_4 I1 has been marked BAD, because the self-intersection is treated correctly, but the projection algorithm generates such crooked 2D curve.

Reference data in test cases heal split_angle_advanced ZA5 and ZA6 has been updated, because those shapes have self-intersected edges, which are being detected now.

src/IntCurve/IntCurve_IntPolyPolyGen.gxx
tests/bugs/modalg_8/bug32915 [new file with mode: 0644]
tests/de/step_4/I1
tests/heal/data/advanced/ZA5
tests/heal/data/advanced/ZA6

index 6675efbb858e17a51fd9a80bfda975b7eb0e34a6..96dbc6243c933b428ef46aed58892f2181a863bf 100644 (file)
@@ -388,9 +388,6 @@ void IntCurve_IntPolyPolyGen::Perform( const TheCurve& C1
       }
     }
 
-    Standard_Integer Nelarg=(Poly1.NbSegments()/20);
-    if(Nelarg<2) Nelarg=2;
-
     for(Standard_Integer sp=1; sp <= Nbsp; sp++) {
       if(TriIndex[sp]>0) { 
              const Intf_SectionPoint& SPnt = InterPP.PntValue(TriIndex[sp]);
@@ -401,20 +398,7 @@ void IntCurve_IntPolyPolyGen::Perform( const TheCurve& C1
              if(Abs(SegIndex1-SegIndex2)>1) { 
          
                EIP.Perform(Poly1,Poly1,SegIndex1,SegIndex2,ParamOn1,ParamOn2);
-               if(EIP.NbRoots()==0) {
-                 //-- All neighbor segments are removed 
-                 for(Standard_Integer k=sp+1;k<=Nbsp;k++) { 
-                   Standard_Integer kk=TriIndex[k];
-                   // --- avoid negative indices as well as in outer done
-                   if( kk > 0 ) {
-                           if(   Abs(SegIndex1-PtrSegIndex1[kk])< Nelarg
-                              && Abs(SegIndex2-PtrSegIndex2[kk])< Nelarg) { 
-                             TriIndex[k]=-k;
-                           }
-              }
-                 }
-               }         
-               else if(EIP.NbRoots()>=1) { 
+               if(EIP.NbRoots()>=1) { 
                  //--------------------------------------------------------------------
                  //-- It is checked if the found point is a root
                  //--------------------------------------------------------------------
diff --git a/tests/bugs/modalg_8/bug32915 b/tests/bugs/modalg_8/bug32915
new file mode 100644 (file)
index 0000000..a6ffebb
--- /dev/null
@@ -0,0 +1,18 @@
+puts "================================================="
+puts "0032915: Geom2dAPI_InterCurveCurve, The algorithm lost an intersection point."
+puts "================================================="
+puts ""
+
+restore [locate_data_file bug32915.brep] e
+mkcurve c3d e
+plane p 0 0 1
+project c2d c3d p
+
+set inter [2dintersect c2d]
+if {[regexp -all "Intersection point" $inter] != 29} {
+  puts "Error: Wrong number of self-intersections (expected 29 points)."
+}
+
+v2d
+2dfit
+checkview -screenshot -2d -path ${imagedir}/${test_image}.png
index 97c04743c8dfd949082006469cc1df8681e2f849..dd5aad33ad9212b1bde8e5ffae861e048b4eec7e 100644 (file)
@@ -1,4 +1,5 @@
 # !!!! This file is generated automatically, do not edit manually! See end script
+puts "TODO ALL: Error : 1 differences with reference data found"
 
 set filename PRO7187.stp
 
index 3ded5f2d5caa8105a3401aced42dfcaf5eb799fb..6f79cc914b01441df168a9f41a1bba8e7cc26143 100644 (file)
@@ -1,5 +1,5 @@
 if {[string compare $command "SplitAngle"] == 0 } {
-    puts "TODO OCC23127 ALL: Faulty shapes in variables faulty_1 to faulty_"
+    puts "TODO OCC23127 ALL: Faulty shapes in variables faulty_1 to faulty_"
 }
 restore [locate_data_file SEB-1.brep] a
 
index ae6df8112e0e5cfe33b17bbadc844db12df08075..86ae5b50c2f2d257928311264aaf7327bdb47d18 100644 (file)
@@ -1,5 +1,5 @@
 if {[string compare $command "SplitAngle"] == 0 } {
-    puts "TODO OCC23127 ALL: Faulty shapes in variables faulty_1 to faulty_"
+    puts "TODO OCC23127 ALL: Faulty shapes in variables faulty_1 to faulty_"
 }
 restore [locate_data_file SEB-1B.brep] a