]> OCCT Git - occt-copy.git/commitdiff
BRepOffset_MakeOffset::IntersectFaces() - When treating invalid faces intersect only...
authoremv <emv@opencascade.com>
Tue, 15 Mar 2016 14:14:31 +0000 (17:14 +0300)
committermsv <msv@opencascade.com>
Fri, 22 Apr 2016 12:48:10 +0000 (15:48 +0300)
src/BRepOffset/BRepOffset_MakeOffset.cxx

index 555bf151d3265c65309fbcebbaf5a993ba0b9b64..05bff3a23009b6621f8a71ae89cc86051f748533 100644 (file)
@@ -4994,21 +4994,20 @@ void IntersectFaces(const TopTools_IndexedDataMapOfShapeListOfShape& theFToRebui
   }
   //
   // Collect vertices to avoid while trimming the edges
-  TopTools_MapOfShape aMVInv, aMVRInv;
+  TopTools_MapOfShape aMVInv, aMVRInv, aMVInvAll;
   //
   // get vertices from invalid edges
   aNbInv = theInvEdges.Extent();
   for (i = 1; i <= aNbInv; ++i) {
     const TopoDS_Shape& aEInv = theInvEdges(i);
-    //
-    if (theValidEdges.Contains(aEInv)) {
-      continue;
-    }
-    //
+    Standard_Boolean bValid = theValidEdges.Contains(aEInv);
     TopExp_Explorer aExp(aEInv, TopAbs_VERTEX);
     for (; aExp.More(); aExp.Next()) {
       const TopoDS_Shape& aV = aExp.Current();
-      aMVInv.Add(aV);
+      aMVInvAll.Add(aV);
+      if (!bValid) {
+        aMVInv.Add(aV);
+      }
     }
   }
   //
@@ -5109,18 +5108,31 @@ void IntersectFaces(const TopTools_IndexedDataMapOfShapeListOfShape& theFToRebui
       //
       // Using the map <aME> find chain of faces to be intersected;
       TopTools_ListOfShape aLFInt;
-      TopTools_IndexedMapOfShape aMFInt;
+      TopTools_IndexedMapOfShape aMFInt, aMFAvoid;
       Standard_Integer aNbE = aME.Extent();
       for (i = 1; i <= aNbE; ++i) {
-        const TopoDS_Shape& aE = aME(i);
-        if (aDMEF.IsBound(aE)) {
-          const TopTools_ListOfShape& aLF = aDMEF.Find(aE);
+        const TopoDS_Shape& aS = aME(i);
+        if (aDMEF.IsBound(aS)) {
+          const TopTools_ListOfShape& aLF = aDMEF.Find(aS);
           aItLE.Initialize(aLF);
           for (; aItLE.More(); aItLE.Next()) {
             const TopoDS_Shape& aF = aItLE.Value();
             if (!aMFInt.Contains(aF)) {
+              const TopTools_ListOfShape& aLFIm = theDMFFIm.FindFromKey(aF);
+              // check if this face is close to invalidity
+              if (theArtInvFaces.IsBound(aFInv) && theArtInvFaces.IsBound(aF)) {
+                if (aS.ShapeType() != TopAbs_EDGE && !aMVInvAll.Contains(aS)) {
+                  aMFAvoid.Add(aF);
+                }
+              }
+              //
               aMFInt.Add(aF);
-              aLFInt.Append(aF);
+              // Debug
+              TopTools_ListIteratorOfListOfShape aItLFIm(aLFIm);
+              for (; aItLFIm.More(); aItLFIm.Next()) {
+                const TopoDS_Shape& aFIm = aItLFIm.Value();
+                aLFInt.Append(aFIm);
+              }
             }
           }
         }
@@ -5303,6 +5315,10 @@ void IntersectFaces(const TopTools_IndexedDataMapOfShapeListOfShape& theFToRebui
             continue;
           }
           //
+          if (aMFAvoid.Contains(aFi) || aMFAvoid.Contains(aFj)) {
+            continue;
+          }
+          //
           aLFDone.Append(aFj);
           aMDone.ChangeFind(aFj).Append(aFi);
           //