diff --git a/src/BRepFill/BRepFill_OffsetWire.cxx b/src/BRepFill/BRepFill_OffsetWire.cxx index 8566b6c6fc..77e45e39a6 100644 --- a/src/BRepFill/BRepFill_OffsetWire.cxx +++ b/src/BRepFill/BRepFill_OffsetWire.cxx @@ -1938,7 +1938,7 @@ void MakeOffset (const TopoDS_Edge& E, Standard_Real Crossed = Xd.X()*Yd.Y()-Xd.Y()*Yd.X(); Standard_Real Signe = ( Crossed > 0.) ? 1. : -1.; - if (anOffset*Signe < AC.Circle().Radius()) { + if (anOffset*Signe < AC.Circle().Radius() - Precision::Confusion()) { Handle(Geom2dAdaptor_HCurve) AHC = new Geom2dAdaptor_HCurve(G2d); diff --git a/tests/bugs/modalg_4/bug745_4 b/tests/bugs/modalg_4/bug745_4 index ac5ea4047c..be4147ce2e 100755 --- a/tests/bugs/modalg_4/bug745_4 +++ b/tests/bugs/modalg_4/bug745_4 @@ -1,12 +1,3 @@ -puts "TODO ?OCC23748 ALL: An exception was caught" -puts "TODO ?OCC23748 ALL: \\*\\* Exception " -puts "TODO ?OCC23748 ALL: Error: Offset is not done." -puts "TODO ?OCC23748 ALL: Faulty OCC745" -puts "TODO ?OCC12345 ALL: Exception: result is not a topological shape!!!" -puts "TODO ?OCC12345 ALL: TEST INCOMPLETE" - -pload QAcommands - puts "========" puts "OCC745" puts "========" @@ -15,6 +6,8 @@ puts "" # Exception Standard_NullValue while performing the offset: ########################################### +pload QAcommands + restore [locate_data_file OCC745_pocket1.brep] a checkshape a @@ -47,6 +40,5 @@ if { [catch { mkoffset result a 1 -10 } status] } { } } -set length 0 +set length 511.416 set 2dviewer 0 - diff --git a/tests/bugs/modalg_5/bug25225_1 b/tests/bugs/modalg_5/bug25225_1 new file mode 100755 index 0000000000..057095e2db --- /dev/null +++ b/tests/bugs/modalg_5/bug25225_1 @@ -0,0 +1,29 @@ +puts "============" +puts "OCC25225" +puts "============" +puts "" +####################################################################### +# Failure of 2d offset algorithm on two wires with arc +####################################################################### + +restore [locate_data_file bug25225_2869_open.brep] a + +if [catch { mkoffset resoffset a 1 10} ] { + puts "Error : mkoffset is wrong" +} else { + renamevar resoffset_1 result + + set length 416.777 + + set nb_v_good 7 + set nb_e_good 7 + set nb_w_good 1 + set nb_f_good 0 + set nb_sh_good 0 + set nb_sol_good 0 + set nb_compsol_good 0 + set nb_compound_good 0 + set nb_shape_good 15 +} + +set 2dviewer 1 diff --git a/tests/bugs/modalg_5/bug25225_2 b/tests/bugs/modalg_5/bug25225_2 new file mode 100755 index 0000000000..90605cbb3c --- /dev/null +++ b/tests/bugs/modalg_5/bug25225_2 @@ -0,0 +1,29 @@ +puts "============" +puts "OCC25225" +puts "============" +puts "" +####################################################################### +# Failure of 2d offset algorithm on two wires with arc +####################################################################### + +restore [locate_data_file bug25225_2869_open.brep] a + +if [catch { mkoffset resoffset a 1 -10} ] { + puts "Error : mkoffset is wrong" +} else { + renamevar resoffset_1 result + + set length 416.777 + + set nb_v_good 7 + set nb_e_good 7 + set nb_w_good 1 + set nb_f_good 0 + set nb_sh_good 0 + set nb_sol_good 0 + set nb_compsol_good 0 + set nb_compound_good 0 + set nb_shape_good 15 +} + +set 2dviewer 1 diff --git a/tests/bugs/modalg_5/bug25225_3 b/tests/bugs/modalg_5/bug25225_3 new file mode 100755 index 0000000000..5255be955b --- /dev/null +++ b/tests/bugs/modalg_5/bug25225_3 @@ -0,0 +1,29 @@ +puts "============" +puts "OCC25225" +puts "============" +puts "" +####################################################################### +# Failure of 2d offset algorithm on two wires with arc +####################################################################### + +restore [locate_data_file bug25225_2869_closed.brep] a + +if [catch { mkoffset resoffset a 1 -10} ] { + puts "Error : mkoffset is wrong" +} else { + renamevar resoffset_1 result + + set length 192.023 + + set nb_v_good 3 + set nb_e_good 3 + set nb_w_good 1 + set nb_f_good 0 + set nb_sh_good 0 + set nb_sol_good 0 + set nb_compsol_good 0 + set nb_compound_good 0 + set nb_shape_good 7 +} + +set 2dviewer 1