From d3dfddaebcf0ff7acbcdae1d55d0584f8490018b Mon Sep 17 00:00:00 2001 From: jgv Date: Thu, 2 Oct 2014 15:35:38 +0400 Subject: [PATCH] 0025272: Regression in BRepOffsetAPI_MakePipe: invalid shape is created Fix of regressions Test-case for issue #25272 --- src/BRepFill/BRepFill_Sweep.cxx | 6 +++++- tests/bugs/modalg_5/bug25272 | 18 ++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 tests/bugs/modalg_5/bug25272 diff --git a/src/BRepFill/BRepFill_Sweep.cxx b/src/BRepFill/BRepFill_Sweep.cxx index 93e3d951dc..617500ec3e 100644 --- a/src/BRepFill/BRepFill_Sweep.cxx +++ b/src/BRepFill/BRepFill_Sweep.cxx @@ -2489,9 +2489,13 @@ BRepFill_Sweep::BRepFill_Sweep(const Handle(BRepFill_SectionLaw)& Section, if (VEdge(isec, ipath).IsNull()) VEdge(isec, ipath) = aNewFirstEdge; else //rebuild first edge + { RebuildTopOrBottomEdge(aNewFirstEdge, TopoDS::Edge(VEdge(isec, ipath)), ReversedEdges); + if (ReversedEdges.Contains(VEdge(isec, ipath))) + StartEdges(isec).Reverse(); + } } else UpdateEdge(TopoDS::Edge(VEdge(isec, ipath)), @@ -2660,7 +2664,7 @@ BRepFill_Sweep::BRepFill_Sweep(const Handle(BRepFill_SectionLaw)& Section, for (j = 1; j <= NbPath; j++) Tapes(StartEdges(isec))->SetValue(6, j, myFaces->Value(isec, j)); TopoDS_Vertex Vfirst, Vlast; - TopExp::Vertices(TopoDS::Edge(StartEdges(isec)), Vfirst, Vlast); + TopExp::Vertices(TopoDS::Edge(StartEdges(isec)), Vfirst, Vlast, Standard_True); //with orientation if (!Rails.IsBound(Vfirst)) { Handle(TopTools_HArray2OfShape) anArray = new TopTools_HArray2OfShape(1, 2, 1, NbPath+1); diff --git a/tests/bugs/modalg_5/bug25272 b/tests/bugs/modalg_5/bug25272 new file mode 100644 index 0000000000..5953c68cb5 --- /dev/null +++ b/tests/bugs/modalg_5/bug25272 @@ -0,0 +1,18 @@ +puts "========" +puts "OCC25272" +puts "========" +puts "" +################################################################## +# Regression in BRepOffsetAPI_MakePipe: invalid shape is created +################################################################## + +restore [locate_data_file bug25272_base.brep] b +restore [locate_data_file bug25272_path.brep] p + +pipe r p b + +set bug_info [checkshape r] +if {[string compare $bug_info "This shape seems to be valid"] != 0} { + puts "ERROR: OCC25272 is reproduced" + puts " shape result is invalid" +} -- 2.20.1