diff --git a/src/BRepFill/BRepFill_Sweep.cxx b/src/BRepFill/BRepFill_Sweep.cxx index 5e014f12ca..03fb5a311e 100644 --- a/src/BRepFill/BRepFill_Sweep.cxx +++ b/src/BRepFill/BRepFill_Sweep.cxx @@ -2092,11 +2092,11 @@ BRepFill_Sweep::BRepFill_Sweep(const Handle(BRepFill_SectionLaw)& Section, BRep_Builder B; Standard_Integer NbPath = ILast - IFirst; Standard_Integer NbLaw = mySec->NbLaw(); - Standard_Boolean uclose, vclose, constSection, hasdegen = Standard_False; + Standard_Boolean uclose, vclose, global_vclose, constSection, hasdegen = Standard_False; constSection = mySec->IsConstant(); uclose = mySec->IsUClosed(); - vclose = (mySec->IsVClosed() && myLoc->IsClosed()) && - (NbPath == myLoc->NbLaw()) && (myLoc->IsG1(0, myTol3d)>= 0); + global_vclose = (myLoc->IsClosed()) && (myLoc->IsG1(0, myTol3d)>= 0); + vclose = global_vclose && (mySec->IsVClosed()) && (NbPath == myLoc->NbLaw()); Error = 0.; // (1) Construction of all surfaces @@ -2675,7 +2675,10 @@ BRepFill_Sweep::BRepFill_Sweep(const Handle(BRepFill_SectionLaw)& Section, myTol3d); else { - if (ipath != NbPath || vclose) + if (ipath != NbPath || + vclose || + (global_vclose && ILast == myLoc->NbLaw()+1)) + UpdateEdge(TopoDS::Edge(VEdge(isec, ipath+1)), S, exuv, VLast); else //ipath == NbPath && !vclose => rebuild last edge diff --git a/tests/bugs/modalg_7/bug29813_1 b/tests/bugs/modalg_7/bug29813_1 new file mode 100644 index 0000000000..aa35f55d5b --- /dev/null +++ b/tests/bugs/modalg_7/bug29813_1 @@ -0,0 +1,19 @@ +puts "==============================================================" +puts "OCC29813: BRepFill_PipeShell algorithm produces invalid result" +puts "==============================================================" +puts "" + +binrestore [locate_data_file cut_extrudewire_1.bin] sw +binrestore [locate_data_file cut_toolwire_1.bin] tw + +mksweep sw +addsweep tw +buildsweep result -R + +checkshape result + +checknbshapes result -vertex 42 -edge 78 -wire 35 -face 35 -shell 1 + +checkprops result -s 3841.56 + +checkview -display result -2d -path ${imagedir}/${test_image}.png diff --git a/tests/bugs/modalg_7/bug29813_2 b/tests/bugs/modalg_7/bug29813_2 new file mode 100644 index 0000000000..43f92349ff --- /dev/null +++ b/tests/bugs/modalg_7/bug29813_2 @@ -0,0 +1,19 @@ +puts "==============================================================" +puts "OCC29813: BRepFill_PipeShell algorithm produces invalid result" +puts "==============================================================" +puts "" + +binrestore [locate_data_file cut_extrudewire_2.bin] sw +binrestore [locate_data_file cut_toolwire_1.bin] tw + +mksweep sw +addsweep tw +buildsweep result -R + +checkshape result + +checknbshapes result -vertex 60 -edge 112 -wire 50 -face 50 -shell 1 + +checkprops result -s 5327.76 + +checkview -display result -2d -path ${imagedir}/${test_image}.png diff --git a/tests/bugs/modalg_7/bug29813_3 b/tests/bugs/modalg_7/bug29813_3 new file mode 100644 index 0000000000..a6524312d0 --- /dev/null +++ b/tests/bugs/modalg_7/bug29813_3 @@ -0,0 +1,19 @@ +puts "==============================================================" +puts "OCC29813: BRepFill_PipeShell algorithm produces invalid result" +puts "==============================================================" +puts "" + +binrestore [locate_data_file cut_extrudewire_3.bin] sw +binrestore [locate_data_file cut_toolwire_3.bin] tw + +mksweep sw +addsweep tw +buildsweep result -R + +checkshape result + +checknbshapes result -vertex 66 -edge 123 -wire 55 -face 55 -shell 1 + +checkprops result -s 15065.5 + +checkview -display result -2d -path ${imagedir}/${test_image}.png