0025272: Regression in BRepOffsetAPI_MakePipe: invalid shape is created
authorjgv <jgv@opencascade.com>
Thu, 2 Oct 2014 11:35:38 +0000 (15:35 +0400)
committerbugmaster <bugmaster@opencascade.com>
Thu, 2 Oct 2014 11:36:28 +0000 (15:36 +0400)
Fix of regressions
Test-case for issue #25272

src/BRepFill/BRepFill_Sweep.cxx
tests/bugs/modalg_5/bug25272 [new file with mode: 0644]

index 93e3d95..617500e 100644 (file)
@@ -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 (file)
index 0000000..5953c68
--- /dev/null
@@ -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"
+}