]> OCCT Git - occt-copy.git/commitdiff
Treatment of the shells with free edges has been changed to keep the faces with inter...
authoremv <emv@opencascade.com>
Wed, 17 Jun 2015 08:30:10 +0000 (11:30 +0300)
committeremv <emv@opencascade.com>
Wed, 17 Jun 2015 08:32:02 +0000 (11:32 +0300)
src/BRepAlgo/BRepAlgo_Tool.cxx

index bc4a6f662bfca298512252973603847f8914f96b..da5138939c1da4ad493967bdf27cdf9ff4824be2 100644 (file)
@@ -34,7 +34,7 @@
 //=======================================================================
 
 TopoDS_Shape BRepAlgo_Tool::Deboucle3D(const TopoDS_Shape& S,
-                                        const TopTools_MapOfShape& Boundary)
+                                         const TopTools_MapOfShape& Boundary)
 {
   TopoDS_Shape SS;
 
@@ -52,12 +52,20 @@ TopoDS_Shape BRepAlgo_Tool::Deboucle3D(const TopoDS_Shape& S,
       
       Standard_Boolean JeGarde = Standard_True;
       for ( Standard_Integer i = 1; i <= Map.Extent() && JeGarde; i++) {
-       if (Map(i).Extent() < 2) {
-         const TopoDS_Edge& anEdge = TopoDS::Edge(Map.FindKey(i));
-         if (!Boundary.Contains(anEdge)  && 
-             !BRep_Tool::Degenerated(anEdge) )
-           JeGarde = Standard_False;
-       }
+        const TopTools_ListOfShape& aLF = Map(i);
+        if (aLF.Extent() < 2) {
+          const TopoDS_Edge& anEdge = TopoDS::Edge(Map.FindKey(i));
+          if (anEdge.Orientation() == TopAbs_INTERNAL) {
+            const TopoDS_Face& aFace = TopoDS::Face(aLF.First());
+            if (aFace.Orientation() != TopAbs_INTERNAL) {
+              continue;
+            }
+          }
+          //
+          if (!Boundary.Contains(anEdge)  && 
+              !BRep_Tool::Degenerated(anEdge) )
+            JeGarde = Standard_False;
+        }
       }
       if ( JeGarde) SS = S;
     }
@@ -71,18 +79,18 @@ TopoDS_Shape BRepAlgo_Tool::Deboucle3D(const TopoDS_Shape& S,
       Standard_Boolean NbSub = 0;
       BRep_Builder B;
       if (S.ShapeType() == TopAbs_COMPOUND) {
-       B.MakeCompound(TopoDS::Compound(SS));
+        B.MakeCompound(TopoDS::Compound(SS));
       }
       else {
-       B.MakeSolid(TopoDS::Solid(SS));
+        B.MakeSolid(TopoDS::Solid(SS));
       }
       for ( ; it.More(); it.Next()) {
-       const TopoDS_Shape& CurS = it.Value();
-       SubShape = Deboucle3D(CurS,Boundary);
-       if ( !SubShape.IsNull()) {
-         B.Add(SS, SubShape);
-         NbSub++;
-       }
+        const TopoDS_Shape& CurS = it.Value();
+        SubShape = Deboucle3D(CurS,Boundary);
+        if ( !SubShape.IsNull()) {
+          B.Add(SS, SubShape);
+          NbSub++;
+        }
       }
       if (NbSub == 0)
         {