0026671: Infinite loop in ShapeFix_Wire::FixSelfIntersection()
authorabv <abv@opencascade.com>
Mon, 21 Sep 2015 03:08:22 +0000 (06:08 +0300)
committerkgv <kgv@opencascade.com>
Thu, 24 Sep 2015 11:14:42 +0000 (14:14 +0300)
Avoid possible infinite loops in ShapeFix_Wire::FixSelfIntersection() -- when needed, fix is repeated once instead of going back in the loop

src/ShapeFix/ShapeFix_Wire.cxx
tests/bugs/heal/bug26671 [new file with mode: 0644]
tests/de/iges_3/A4

index 34e732b..d161e60 100644 (file)
@@ -908,7 +908,8 @@ Standard_Boolean ShapeFix_Wire::FixSelfIntersection()
         //%15 pdn 06.04.99 repeat until fixed CTS18546-2 entity 777
         
         // if the tolerance was modified we should recheck the result, if it was enough
-        if ( LastFixStatus ( ShapeExtend_DONE7 ) ) num--;
+        if ( LastFixStatus ( ShapeExtend_DONE7 ) ) //num--;
+          FixIntersectingEdges ( num );
         continue;
       }
 
@@ -926,10 +927,10 @@ Standard_Boolean ShapeFix_Wire::FixSelfIntersection()
       else {
        //#86 rln 22.03.99
        //%15 pdn 06.04.99 repeat until fixed CTS18546-2 entity 777
-       //FixIntersectingEdges ( num );
+       FixIntersectingEdges ( num );
        /*if ( LastFixStatus ( ShapeExtend_DONE7 ) )*/
         // Always revisit the fixed edge
-        num--;
+        //num--;
       }
     }
   }
diff --git a/tests/bugs/heal/bug26671 b/tests/bugs/heal/bug26671
new file mode 100644 (file)
index 0000000..2fcf478
--- /dev/null
@@ -0,0 +1,11 @@
+puts "========================"                                                                                      
+puts "0026671: Infinite loop in ShapeFix_Wire::FixSelfIntersection()"
+puts "========================"                                                                                      
+
+cpulimit 20
+igesbrep [locate_data_file bug26671.igs] result *
+
+checkshape result
+tolerance result
+
+set 2dviewer 1
index 4597216..4ed0b58 100755 (executable)
@@ -5,19 +5,17 @@ puts "TODO CR23096 ALL: STATSHAPE : Faulty"
 puts "TODO CR23096 ALL: LABELS : Faulty" 
 puts "TODO CR23096 ALL: COLORS : Faulty" 
 puts "TODO CR23096 ALL: LAYERS : Faulty" 
-puts "TODO CR25013 ALL: Error : 3 differences with reference data found" 
-
 
 set filename BUC40132.igs
 
 set ref_data {
 DATA        : Faulties = 6  ( 0 )  Warnings = 0  ( 0 )  Summary  = 6  ( 0 )
 TPSTAT      : Faulties = 12  ( 238 )  Warnings = 470  ( 2529 )  Summary  = 482  ( 2767 )
-CHECKSHAPE  : Wires    = 3  ( 3 )  Faces    = 3  ( 3 )  Shells   = 0  ( 0 )   Solids   = 0 ( 0 )
-NBSHAPES    : Solid    = 0  ( 0 )  Shell    = 0  ( 0 )  Face     = 1346  ( 1345 )   Summary  = 22209  ( 22292 )
-STATSHAPE   : Solid    = 0  ( 0 )  Shell    = 0  ( 0 )  Face     = 1346  ( 1345 )   FreeWire = 96  ( 170 )   FreeEdge  = 1061 ( 1061 )   SharedEdge = 9267  ( 9277 )
+CHECKSHAPE  : Wires    = 4  ( 4 )  Faces    = 4  ( 4 )  Shells   = 0  ( 0 )   Solids   = 0 ( 0 )
+NBSHAPES    : Solid    = 0  ( 0 )  Shell    = 0  ( 0 )  Face     = 1346  ( 1345 )   Summary  = 22215  ( 22296 )
+STATSHAPE   : Solid    = 0  ( 0 )  Shell    = 0  ( 0 )  Face     = 1346  ( 1345 )   FreeWire = 96  ( 170 )   FreeEdge  = 1061 ( 1061 )   SharedEdge = 9271  ( 9280 )
 TOLERANCE   : MaxTol   =   0.8099726869  (    1.367966665 )  AvgTol   =  0.008047307184  (  0.008376960654 )
-LABELS      : N0Labels = 27  ( 27 )  N1Labels = 2100  ( 6101 )  N2Labels = 0  ( 0 )   TotalLabels = 2127  ( 6128 )   NameLabels = 2127  ( 2596 )   ColorLabels = 2114  ( 6127 )   LayerLabels = 2114  ( 6127 )
+LABELS      : N0Labels = 27  ( 27 )  N1Labels = 2100  ( 6107 )  N2Labels = 0  ( 0 )   TotalLabels = 2127  ( 6134 )   NameLabels = 2127  ( 2596 )   ColorLabels = 2114  ( 6133 )   LayerLabels = 2114  ( 6133 )
 PROPS       : Centroid = 0  ( 0 )  Volume   = 0  ( 0 )  Area     = 0  ( 0 )
 NCOLORS     : NColors  = 11  ( 12 )
 COLORS      : Colors   = BLUE1 CYAN1 CYAN2 DARKGOLDENROD GREEN MAGENTA1 PALEVIOLETRED1 RED TURQUOISE2 WHITE YELLOW  ( BLUE1 CYAN1 CYAN2 DARKGOLDENROD GRAY53 GREEN MAGENTA1 PALEVIOLETRED1 RED TURQUOISE2 WHITE YELLOW )