From d3c5411b4858351f0e2fc88b3b5945a4514eead3 Mon Sep 17 00:00:00 2001 From: emv Date: Thu, 15 Aug 2013 16:23:41 +0400 Subject: [PATCH] 0024105: ShapeFix algorithm produces not correct result. Small correction. Adding test cases for issue CR24105 --- src/ShapeFix/ShapeFix_Face.cxx | 6 ++++-- tests/bugs/heal/bug24105_1 | 30 ++++++++++++++++++++++++++++++ tests/bugs/heal/bug24105_2 | 30 ++++++++++++++++++++++++++++++ tests/bugs/heal/bug24111 | 27 +++++++++++++++++++++++++++ 4 files changed, 91 insertions(+), 2 deletions(-) create mode 100755 tests/bugs/heal/bug24105_1 create mode 100755 tests/bugs/heal/bug24105_2 create mode 100755 tests/bugs/heal/bug24111 diff --git a/src/ShapeFix/ShapeFix_Face.cxx b/src/ShapeFix/ShapeFix_Face.cxx index 0412c3732e..108d47f878 100755 --- a/src/ShapeFix/ShapeFix_Face.cxx +++ b/src/ShapeFix/ShapeFix_Face.cxx @@ -443,7 +443,7 @@ Standard_Boolean ShapeFix_Face::Perform() } if ( theAdvFixWire->Perform() ) { //fixed = Standard_True; - isfixReorder = ((theAdvFixWire->StatusReorder(ShapeExtend_DONE) && !theAdvFixWire->StatusReorder(ShapeExtend_DONE5)) || isfixReorder); + isfixReorder = (theAdvFixWire->StatusReorder(ShapeExtend_DONE) || isfixReorder); fixed = (theAdvFixWire->StatusSmall(ShapeExtend_DONE) || theAdvFixWire->StatusConnected(ShapeExtend_DONE) || theAdvFixWire->StatusEdgeCurves(ShapeExtend_DONE) || @@ -480,7 +480,9 @@ Standard_Boolean ShapeFix_Face::Perform() } if(fixed || isfixReorder) { myFace = tmpFace; - myStatus |= ShapeExtend::EncodeStatus ( ShapeExtend_DONE1 ); + if (!theAdvFixWire->StatusReorder(ShapeExtend_DONE5)) { + myStatus |= ShapeExtend::EncodeStatus ( ShapeExtend_DONE1 ); + } } } diff --git a/tests/bugs/heal/bug24105_1 b/tests/bugs/heal/bug24105_1 new file mode 100755 index 0000000000..d77be6d7c6 --- /dev/null +++ b/tests/bugs/heal/bug24105_1 @@ -0,0 +1,30 @@ +puts "================" +puts "OCC24105" +puts "================" +puts "" +###################################################################################### +# ShapeFix algorithm produces not correct result +# 1. geom/imps7/H6 +###################################################################################### + +catch {pload XDE} + +restore [locate_data_file bug24105_shape.brep] s + +settolerance s 1.e-7 + +fixshape result s + +set square 313292 + +set nb_v_good 12 +set nb_e_good 20 +set nb_w_good 9 +set nb_f_good 9 +set nb_sh_good 1 +set nb_sol_good 1 +set nb_compsol_good 0 +set nb_compound_good 0 +set nb_shape_good 52 + +set 2dviewer 1 diff --git a/tests/bugs/heal/bug24105_2 b/tests/bugs/heal/bug24105_2 new file mode 100755 index 0000000000..fcb2067ba4 --- /dev/null +++ b/tests/bugs/heal/bug24105_2 @@ -0,0 +1,30 @@ +puts "================" +puts "OCC24105" +puts "================" +puts "" +###################################################################################### +# ShapeFix algorithm produces not correct result +# 2. geom/SWIG_scripts/C9 +###################################################################################### + +catch {pload XDE} + +restore [locate_data_file bug24105_shape1.brep] s + +settolerance s 1.e-7 + +fixshape result s + +set square 123446 + +set nb_v_good 33 +set nb_e_good 52 +set nb_w_good 23 +set nb_f_good 21 +set nb_sh_good 1 +set nb_sol_good 1 +set nb_compsol_good 0 +set nb_compound_good 1 +set nb_shape_good 132 + +set 2dviewer 1 diff --git a/tests/bugs/heal/bug24111 b/tests/bugs/heal/bug24111 new file mode 100755 index 0000000000..e9de63c42b --- /dev/null +++ b/tests/bugs/heal/bug24111 @@ -0,0 +1,27 @@ +puts "================" +puts "OCC24111" +puts "================" +puts "" +###################################################################################### +# Shape Healing produces invalid face +###################################################################################### + +catch {pload XDE} + +restore [locate_data_file bug24111_shape.brep] a + +fixshape result a + +set square 15902.8 + +set nb_v_good 14 +set nb_e_good 15 +set nb_w_good 1 +set nb_f_good 1 +set nb_sh_good 0 +set nb_sol_good 0 +set nb_compsol_good 0 +set nb_compound_good 0 +set nb_shape_good 31 + +set 2dviewer 1 -- 2.39.5