From c888decadbf1728d71b0fe5bc0ec23db7d5eb44c Mon Sep 17 00:00:00 2001 From: Roman Lygin Date: Fri, 28 Dec 2012 18:11:58 +0400 Subject: [PATCH] 0023622: IGES import produces invalid shape with parameter read.iges.bspline.continuity=0 Adding test cases for this fix --- src/IGESToBRep/IGESToBRep_BasicSurface.cxx | 1 - tests/bugs/iges/bug23622_1 | 32 ++++++++++++++++++++ tests/bugs/iges/bug23622_2 | 34 ++++++++++++++++++++++ 3 files changed, 66 insertions(+), 1 deletion(-) create mode 100755 tests/bugs/iges/bug23622_1 create mode 100755 tests/bugs/iges/bug23622_2 diff --git a/src/IGESToBRep/IGESToBRep_BasicSurface.cxx b/src/IGESToBRep/IGESToBRep_BasicSurface.cxx index 6901b263b4..562a17364f 100755 --- a/src/IGESToBRep/IGESToBRep_BasicSurface.cxx +++ b/src/IGESToBRep/IGESToBRep_BasicSurface.cxx @@ -910,7 +910,6 @@ Handle(Geom_BSplineSurface) IGESToBRep_BasicSurface::TransferBSplineSurface // =============================== Standard_Integer icont = GetContinuity(); - if ( icont < 1) return res; //Standard_Boolean isC1 = Standard_True, isC2 = Standard_True; //szv#4:S4163:12Mar99 not needed i = res->LastUKnotIndex(); diff --git a/tests/bugs/iges/bug23622_1 b/tests/bugs/iges/bug23622_1 new file mode 100755 index 0000000000..2d6890fef4 --- /dev/null +++ b/tests/bugs/iges/bug23622_1 @@ -0,0 +1,32 @@ +puts "============" +puts "OCC23622" +puts "============" +puts "" +####################################################################### +# IGES import produces invalid shape with parameter read.iges.bspline.continuity=0 +####################################################################### + +igesbrep [locate_data_file bug23622_seatmotor2.igs] s1 397 + +renamevar s1_1 result + +nbshapes result + +set nb_v_good 4 +set nb_e_good 5 +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 11 + +set tol [tolerance result ] +regexp { *Tolerance +MAX=([-0-9.+eE]+)} ${tol} full max_tol +puts "max_tol=${max_tol}" +if {${max_tol} > 0.02} { + puts "Error : Bad tolerance" +} + +set 3dviewer 1 diff --git a/tests/bugs/iges/bug23622_2 b/tests/bugs/iges/bug23622_2 new file mode 100755 index 0000000000..d5973988b4 --- /dev/null +++ b/tests/bugs/iges/bug23622_2 @@ -0,0 +1,34 @@ +puts "============" +puts "OCC23622" +puts "============" +puts "" +####################################################################### +# IGES import produces invalid shape with parameter read.iges.bspline.continuity=0 +####################################################################### + +param read.iges.bspline.continuity 0 + +igesbrep [locate_data_file bug23622_seatmotor2.igs] s1 397 + +renamevar s1_1 result + +nbshapes result + +set nb_v_good 4 +set nb_e_good 5 +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 11 + +set tol [tolerance result ] +regexp { *Tolerance +MAX=([-0-9.+eE]+)} ${tol} full max_tol +puts "max_tol=${max_tol}" +if {${max_tol} > 0.02} { + puts "Error : Bad tolerance" +} + +set 3dviewer 1