From 404d419daaaa578c7bf8e6f2927d44b9c0e759d7 Mon Sep 17 00:00:00 2001 From: ika Date: Thu, 27 Jun 2013 10:08:14 +0400 Subject: [PATCH] 0024035: Intersector is not symmetrical 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 --- src/IntCurve/IntCurve_IntPolyPolyGen.gxx | 12 ++++----- tests/bugs/modalg_5/bug24035 | 31 ++++++++++++++++++++++++ tests/de/iges_1/J9 | 4 +-- tests/de/iges_1/K3 | 3 ++- tests/de/iges_1/L8 | 6 +++-- tests/de/iges_1/P5 | 2 +- tests/de/iges_1/R8 | 2 +- tests/de/iges_2/A1 | 2 +- tests/de/iges_2/B8 | 2 +- tests/de/iges_2/C5 | 2 +- tests/de/iges_2/G5 | 2 +- tests/de/iges_3/A2 | 2 +- tests/de/step_1/D7 | 2 -- tests/de/step_2/A6 | 2 -- tests/de/step_3/C6 | 3 +-- tests/de/step_3/D9 | 2 +- tests/de/step_3/E6 | 2 +- tests/heal/split_closed_faces/G5 | 1 + 18 files changed, 55 insertions(+), 27 deletions(-) create mode 100644 tests/bugs/modalg_5/bug24035 diff --git a/src/IntCurve/IntCurve_IntPolyPolyGen.gxx b/src/IntCurve/IntCurve_IntPolyPolyGen.gxx index 0fb97a7db8..e0a0bc67ac 100755 --- a/src/IntCurve/IntCurve_IntPolyPolyGen.gxx +++ b/src/IntCurve/IntCurve_IntPolyPolyGen.gxx @@ -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 index 0000000000..d45dd33cee --- /dev/null +++ b/tests/bugs/modalg_5/bug24035 @@ -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" +} diff --git a/tests/de/iges_1/J9 b/tests/de/iges_1/J9 index 7fae5a3b8d..4bb3a9d159 100644 --- a/tests/de/iges_1/J9 +++ b/tests/de/iges_1/J9 @@ -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 diff --git a/tests/de/iges_1/K3 b/tests/de/iges_1/K3 index ed3f605c1f..a1f4346cbe 100644 --- a/tests/de/iges_1/K3 +++ b/tests/de/iges_1/K3 @@ -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 diff --git a/tests/de/iges_1/L8 b/tests/de/iges_1/L8 index d5ca56d162..bc56415a9f 100644 --- a/tests/de/iges_1/L8 +++ b/tests/de/iges_1/L8 @@ -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 diff --git a/tests/de/iges_1/P5 b/tests/de/iges_1/P5 index 283a2cf51b..1b3ef496a4 100644 --- a/tests/de/iges_1/P5 +++ b/tests/de/iges_1/P5 @@ -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 diff --git a/tests/de/iges_1/R8 b/tests/de/iges_1/R8 index e19db512b4..a9ec11e01a 100644 --- a/tests/de/iges_1/R8 +++ b/tests/de/iges_1/R8 @@ -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 diff --git a/tests/de/iges_2/A1 b/tests/de/iges_2/A1 index 42debde47a..d6aeb92ecb 100644 --- a/tests/de/iges_2/A1 +++ b/tests/de/iges_2/A1 @@ -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 diff --git a/tests/de/iges_2/B8 b/tests/de/iges_2/B8 index 93cd275066..148311e129 100644 --- a/tests/de/iges_2/B8 +++ b/tests/de/iges_2/B8 @@ -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 diff --git a/tests/de/iges_2/C5 b/tests/de/iges_2/C5 index 13be1c651b..5ceae213fb 100644 --- a/tests/de/iges_2/C5 +++ b/tests/de/iges_2/C5 @@ -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 diff --git a/tests/de/iges_2/G5 b/tests/de/iges_2/G5 index 81f4191139..93b0930e06 100644 --- a/tests/de/iges_2/G5 +++ b/tests/de/iges_2/G5 @@ -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 diff --git a/tests/de/iges_3/A2 b/tests/de/iges_3/A2 index f353495c37..ba61150ed4 100644 --- a/tests/de/iges_3/A2 +++ b/tests/de/iges_3/A2 @@ -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 diff --git a/tests/de/step_1/D7 b/tests/de/step_1/D7 index 35ffcbd122..e0e2f226e8 100644 --- a/tests/de/step_1/D7 +++ b/tests/de/step_1/D7 @@ -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 diff --git a/tests/de/step_2/A6 b/tests/de/step_2/A6 index f31ba5e6ee..a0cede5126 100644 --- a/tests/de/step_2/A6 +++ b/tests/de/step_2/A6 @@ -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 { diff --git a/tests/de/step_3/C6 b/tests/de/step_3/C6 index b5b2fd3843..f1045c951d 100644 --- a/tests/de/step_3/C6 +++ b/tests/de/step_3/C6 @@ -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 diff --git a/tests/de/step_3/D9 b/tests/de/step_3/D9 index 7d3df41834..edb2c5e21d 100644 --- a/tests/de/step_3/D9 +++ b/tests/de/step_3/D9 @@ -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 diff --git a/tests/de/step_3/E6 b/tests/de/step_3/E6 index 07efe2e145..964b2f5674 100644 --- a/tests/de/step_3/E6 +++ b/tests/de/step_3/E6 @@ -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 diff --git a/tests/heal/split_closed_faces/G5 b/tests/heal/split_closed_faces/G5 index 3a4b784619..ae80cdd8c9 100644 --- a/tests/heal/split_closed_faces/G5 +++ b/tests/heal/split_closed_faces/G5 @@ -1 +1,2 @@ +puts "TODO OCC24035 ALL: Faulty shapes in variables faulty_1 to faulty_" restore [locate_data_file wrong_checkshape_2.brep] a