0024218: ShapeFix_Face requires double execution to produce valid shape when FixSplit...
authorika <ika@opencascade.com>
Thu, 24 Apr 2014 12:31:26 +0000 (16:31 +0400)
committerbugmaster <bugmaster@opencascade.com>
Thu, 24 Apr 2014 12:50:20 +0000 (16:50 +0400)
Test case for issues CR24218

src/ShapeFix/ShapeFix_Face.cxx
tests/bugs/heal/bug24218 [new file with mode: 0644]

index 23a6ebc..b3bf90e 100644 (file)
@@ -2266,7 +2266,16 @@ Standard_Boolean ShapeFix_Face::FixSplitFace(const TopTools_DataMapOfShapeListOf
       const TopTools_ListOfShape& IntWires = MapWires.Find(wire);
       TopTools_ListIteratorOfListOfShape liter(IntWires);
       for( ; liter.More(); liter.Next()) {
-        B.Add(tmpFace,liter.Value());
+        TopoDS_Shape aShape = tmpFace.EmptyCopied();
+        TopoDS_Face aFace = TopoDS::Face ( aShape );
+        aFace.Orientation ( TopAbs_FORWARD );
+        B.Add (aFace,liter.Value());
+        BRepTopAdaptor_FClass2d clas (aFace,::Precision::PConfusion());
+        TopAbs_State staout = clas.PerformInfinitePoint();
+        if (staout == TopAbs_IN) 
+          B.Add(tmpFace,liter.Value());
+        else
+          B.Add(tmpFace,liter.Value().Reversed());                
         NbWiresNew++;
       }
       if(!myFwd) tmpFace.Orientation(TopAbs_REVERSED);
diff --git a/tests/bugs/heal/bug24218 b/tests/bugs/heal/bug24218
new file mode 100644 (file)
index 0000000..32bab7b
--- /dev/null
@@ -0,0 +1,19 @@
+puts "============"
+puts "OCC24218"
+puts "============"
+puts ""
+#######################################################################
+## ShapeFix_Face requires double execution to produce valid shape when FixSplitFaceMode is in effect
+#######################################################################
+
+restore [locate_data_file bug24218_f.brep] f
+
+decho off
+checkshape f
+decho on
+
+fixshape r f +o
+checkshape r
+
+fixshape rr r +o
+checkshape rr