0024035: Intersector is not symmetrical
authorika <ika@opencascade.com>
Thu, 27 Jun 2013 06:08:14 +0000 (10:08 +0400)
committerika <ika@opencascade.com>
Thu, 27 Jun 2013 09:56:52 +0000 (13:56 +0400)
asymmetrical check in  Standard_Boolean IntCurve_IntPolyPolyGen::findIntersect was changed to symmetrical.
fix wrong calculation of approx parameter on curve for last polygon segment
Added test case bugs/modalg_5/bug24035
Modified TODO in "de" test cases because there are small differences with old behaviour
Modified test case heal/split_closed_faces/G5 because of corrections in intersector's behavior, which lead to changes in checkshape

18 files changed:
src/IntCurve/IntCurve_IntPolyPolyGen.gxx
tests/bugs/modalg_5/bug24035 [new file with mode: 0644]
tests/de/iges_1/J9
tests/de/iges_1/K3
tests/de/iges_1/L8
tests/de/iges_1/P5
tests/de/iges_1/R8
tests/de/iges_2/A1
tests/de/iges_2/B8
tests/de/iges_2/C5
tests/de/iges_2/G5
tests/de/iges_3/A2
tests/de/step_1/D7
tests/de/step_2/A6
tests/de/step_3/C6
tests/de/step_3/D9
tests/de/step_3/E6
tests/heal/split_closed_faces/G5

index 0fb97a7..e0a0bc6 100755 (executable)
@@ -967,12 +967,12 @@ Standard_Boolean IntCurve_IntPolyPolyGen::findIntersect(
       Standard_Real _PolyUInf,_PolyVInf;
 
       SPnt1.InfoFirst(Type,SegIndex1onP1,ParamOnLine);
-      if(SegIndex1onP1 >= thePoly1.NbSegments()) { SegIndex1onP1--; ParamOnLine = 1.0; }
+      if(SegIndex1onP1 > thePoly1.NbSegments()) { SegIndex1onP1--; ParamOnLine = 1.0; }
       if(SegIndex1onP1 <= 0) { SegIndex1onP1=1; ParamOnLine = 0.0; }
       _PolyUInf = thePoly1.ApproxParamOnCurve(SegIndex1onP1,ParamOnLine);
       
       SPnt1.InfoSecond(Type,SegIndex1onP2,ParamOnLine);
-      if(SegIndex1onP2 >= thePoly2.NbSegments()) { SegIndex1onP2--; ParamOnLine = 1.0; }
+      if(SegIndex1onP2 > thePoly2.NbSegments()) { SegIndex1onP2--; ParamOnLine = 1.0; }
       if(SegIndex1onP2 <= 0) { SegIndex1onP2=1; ParamOnLine = 0.0; }
       _PolyVInf = thePoly2.ApproxParamOnCurve(SegIndex1onP2,ParamOnLine);
       
@@ -1094,16 +1094,16 @@ Standard_Boolean IntCurve_IntPolyPolyGen::findIntersect(
 
 
        if(Pos1==IntRes2d_Middle && Pos2!=IntRes2d_Middle) { 
-         PolyUInf=TheProjPCur::FindParameter( C1,P2,D1.FirstParameter(),D1.LastParameter(),TheCurveTool::EpsX(C1));
+         PolyUSup=TheProjPCur::FindParameter( C1,P2,D1.FirstParameter(),D1.LastParameter(),TheCurveTool::EpsX(C1));
        }
        else if(Pos1!=IntRes2d_Middle && Pos2==IntRes2d_Middle) { 
-         PolyVInf=TheProjPCur::FindParameter( C2,P1,D2.FirstParameter(),D2.LastParameter(),TheCurveTool::EpsX(C2));
+         PolyVSup=TheProjPCur::FindParameter( C2,P1,D2.FirstParameter(),D2.LastParameter(),TheCurveTool::EpsX(C2));
        }
        else if(Abs(ParamInfOnCurve1-ParamSupOnCurve1) > Abs(ParamInfOnCurve2-ParamSupOnCurve2)) { 
-         PolyVInf=TheProjPCur::FindParameter( C2,P1,D2.FirstParameter(),D2.LastParameter(),TheCurveTool::EpsX(C2));
+         PolyVSup=TheProjPCur::FindParameter( C2,P1,D2.FirstParameter(),D2.LastParameter(),TheCurveTool::EpsX(C2));
        }
        else { 
-         PolyUInf=TheProjPCur::FindParameter( C1,P2,D1.FirstParameter(),D1.LastParameter(),TheCurveTool::EpsX(C1));
+         PolyUSup=TheProjPCur::FindParameter( C1,P2,D1.FirstParameter(),D1.LastParameter(),TheCurveTool::EpsX(C1));
        }
        
        if(IntImpParGen::DetermineTransition( Pos1,Tan1,Trans1,Pos2,Tan2,Trans2,TolConf)
diff --git a/tests/bugs/modalg_5/bug24035 b/tests/bugs/modalg_5/bug24035
new file mode 100644 (file)
index 0000000..d45dd33
--- /dev/null
@@ -0,0 +1,31 @@
+puts "============"
+puts "OCC24035"
+puts "============"
+puts ""
+######################################################
+# Intersector is not symmetrical
+######################################################
+
+restore [locate_data_file bug24035_face1] face1
+restore [locate_data_file bug24035_face2] face2
+
+decho off
+set info1 [checkshape face1]
+set info2 [checkshape face2]
+decho on
+
+set status 0
+if { [regexp "Faulty shapes in variables faulty_1 to faulty_2" $info1] != 1 } {
+    puts "Error : There is no 2 mistakes by checkshape on face1
+    set status 1
+}
+if { [regexp "Faulty shapes in variables faulty_1 to faulty_2" $info2] != 1 } {
+    puts "Error : There is no 2 mistakes by checkshape on face2
+    set stauts 1
+}
+
+if { $status != 0 } {
+    puts "Error : Intersector is not symmetrical"
+} else {
+    puts "OK : Intersector is symmetrical"
+}
index 7fae5a3..4bb3a9d 100644 (file)
@@ -1,7 +1,5 @@
 # !!!! This file is generated automatically, do not edit manually! See end script
-puts "TODO CR23096 ALL: TPSTAT : Faulty" 
-puts "TODO CR23096 ALL: CHECKSHAPE : Faulty" 
-
+puts "TODO CR23096 ALL: TPSTAT : Faulty"
 
 set filename CTS21655.igs
 
index ed3f605..a1f4346 100644 (file)
@@ -1,5 +1,6 @@
 # !!!! This file is generated automatically, do not edit manually! See end script
-puts "TODO CR23096 ALL: LABELS : Faulty" 
+puts "TODO CR23096 ALL: LABELS : Faulty"
+puts "TODO OCC24035 ALL: Error : 1 differences with reference data"
 
 
 set filename FRA62468-1.igs
index d5ca56d..bc56415 100644 (file)
@@ -1,6 +1,8 @@
 # !!!! This file is generated automatically, do not edit manually! See end script
-puts "TODO CR23096 ALL: LABELS : Faulty" 
-puts "TODO CR23096 Mandriva2010: Error : 3 differences with reference data found :"
+puts "TODO CR23096 ALL: LABELS : Faulty"
+puts "TODO OCC24035 ALL: CHECKSHAPE : Faulty"
+puts "TODO OCC24035 ALL: NBSHAPES : Faulty"
+puts "TODO OCC24035 ALL: Error : 4 differences with reference data"
 
 set LinuxDiff 3
 set filename PRO14319.igs
index 283a2cf..1b3ef49 100644 (file)
@@ -1,6 +1,6 @@
 # !!!! This file is generated automatically, do not edit manually! See end script
 puts "TODO CR23096 ALL: LABELS : Faulty" 
-puts "TODO CR23096 Mandriva2010: Error : 2 differences with reference data found :"
+puts "TODO OCC24035 ALL: Error : 2 differences with reference data"
 
 set LinuxDiff 2
 set filename brazo1.igs
index e19db51..a9ec11e 100644 (file)
@@ -1,6 +1,6 @@
 # !!!! This file is generated automatically, do not edit manually! See end script
 puts "TODO CR23096 ALL: LABELS : Faulty" 
-puts "TODO CR23096 Mandriva2010: Error : 5 differences with reference data found :"
+puts "TODO OCC24035 ALL: Error : 5 differences with reference data"
 
 set LinuxDiff 5
 set filename BUC60743.igs
index 42debde..d6aeb92 100644 (file)
@@ -1,6 +1,6 @@
 # !!!! This file is generated automatically, do not edit manually! See end script
 puts "TODO CR23096 ALL: STATSHAPE : Faulty" 
-
+puts "TODO OCC24035 ALL: Error : 3 differences with reference data"
 
 set filename CCI60011.igs
 
index 93cd275..148311e 100644 (file)
@@ -1,7 +1,7 @@
 # !!!! This file is generated automatically, do not edit manually! See end script
 puts "TODO CR23096 ALL: CHECKSHAPE : Faulty" 
 puts "TODO CR23096 ALL: LABELS : Faulty" 
-puts "TODO CR23096 Mandriva2010: Error : 1 differences with reference data found :"
+puts "TODO OCC24035 ALL: Error : 1 differences with reference data"
 
 set LinuxDiff 1
 set filename FRA62468-2.igs
index 13be1c6..5ceae21 100644 (file)
@@ -1,7 +1,7 @@
 # !!!! This file is generated automatically, do not edit manually! See end script
 puts "TODO CR23096 ALL: NBSHAPES : Faulty" 
 puts "TODO CR23096 ALL: TOLERANCE : Faulty" 
-
+puts "TODO OCC24035 ALL: Error : 3 differences with reference data"
 
 set filename sim6049.igs
 
index 81f4191..93b0930 100644 (file)
@@ -2,7 +2,7 @@
 puts "TODO CR23096 ALL: CHECKSHAPE : Faulty" 
 puts "TODO CR23096 ALL: LABELS : Faulty" 
 puts "TODO CR23096 ALL: COLORS : Faulty" 
-puts "TODO CR23096 Mandriva2010: Error : 4 differences with reference data found :"
+puts "TODO OCC24035 ALL: Error : 3 differences with reference data"
 
 set LinuxDiff 4
 set filename PRO11641.igs
index f353495..ba61150 100644 (file)
@@ -2,7 +2,7 @@
 puts "TODO CR23096 ALL: LABELS : Faulty" 
 puts "TODO CR23096 ALL: COLORS : Faulty" 
 puts "TODO CR23096 ALL: LAYERS : Faulty" 
-puts "TODO CR23096 Mandriva2010: Error : 5 differences with reference data found :"
+puts "TODO OCC24035 ALL: Error : 3 differences with reference data"
 
 set LinuxDiff 5
 set filename UKI60094.igs
index 35ffcbd..e0e2f22 100644 (file)
@@ -1,7 +1,5 @@
 # !!!! This file is generated automatically, do not edit manually! See end script
 puts "TODO CR23096 ALL: TPSTAT : Faulty" 
-puts "TODO CR23096 ALL: TOLERANCE : Faulty" 
-
 
 set filename obtu.stp
 
index f31ba5e..a0cede5 100644 (file)
@@ -1,8 +1,6 @@
 # !!!! This file is generated automatically, do not edit manually! See end script
-puts "TODO CR23096 ALL: CHECKSHAPE : Faulty" 
 puts "TODO CR23096 ALL: NBSHAPES : Faulty" 
 
-
 set filename t3d_opt.stp
 
 set ref_data {
index b5b2fd3..f1045c9 100644 (file)
@@ -1,7 +1,6 @@
 # !!!! This file is generated automatically, do not edit manually! See end script
 puts "TODO CR23096 ALL: CHECKSHAPE : Faulty" 
-puts "TODO CR23096 ALL: TOLERANCE : Faulty" 
-
+puts "TODO OCC24035 ALL: Error : 3 differences with reference data"
 
 set filename trj3_pm1-ug-203.stp
 
index 7d3df41..edb2c5e 100644 (file)
@@ -3,7 +3,7 @@ puts "TODO CR23096 ALL: TPSTAT : Faulty"
 puts "TODO CR23096 ALL: NBSHAPES : Faulty" 
 puts "TODO CR23096 ALL: STATSHAPE : Faulty" 
 puts "TODO CR23096 ALL: TOLERANCE : Faulty" 
-puts "TODO CR23096 Mandriva2010: Error : 3 differences with reference data found :"
+puts "TODO OCC24035 ALL: Error : 2 differences with reference data"
 
 set LinuxDiff 3
 set filename 53921163S0.stp
index 07efe2e..964b2f5 100644 (file)
@@ -2,7 +2,7 @@
 puts "TODO CR23096 ALL: TPSTAT : Faulty" 
 puts "TODO CR23096 ALL: STATSHAPE : Faulty" 
 puts "TODO ?CR23096 ALL: TOLERANCE : Faulty" 
-puts "TODO CR23096 Mandriva2010: Error : 3 differences with reference data found :"
+puts "TODO OCC24035 ALL: Error : 2 differences with reference data"
 
 set LinuxDiff 3
 set filename Z8M6SAT.stp
index 3a4b784..ae80cdd 100644 (file)
@@ -1 +1,2 @@
+puts "TODO OCC24035 ALL: Faulty shapes in variables faulty_1 to faulty_"
 restore [locate_data_file wrong_checkshape_2.brep] a