]> OCCT Git - occt-copy.git/commitdiff
BRepOffset_Analyse::Perform() - Added processing of the cases when more than two...
authoremv <emv@opencascade.com>
Tue, 14 Jun 2016 13:13:39 +0000 (16:13 +0300)
committeremv <emv@opencascade.com>
Fri, 17 Jun 2016 05:45:08 +0000 (08:45 +0300)
BRepOffset_MakeOffset - Added protection from the Infinite edges.
BOPAlgo_PaveFiller::MakeSplitEdges() - Remove PaveBlocks with same parameters on paves.
BOPAlgo_PaveFiller::PerformVE() - Added protection from edges with no PaveBlocks.

src/BOPAlgo/BOPAlgo_Builder_1.cxx
src/BOPAlgo/BOPAlgo_PaveFiller_2.cxx
src/BOPAlgo/BOPAlgo_PaveFiller_7.cxx
src/BRepOffset/BRepOffset_Analyse.cxx
src/BRepOffset/BRepOffset_Inter3d.cxx
src/BRepOffset/BRepOffset_MakeOffset.cxx

index fd628c75006bce122f066c8d55cba6b6df587b7b..8688c16bd276c9fb525f72267ca27bf9b8c0e91f 100644 (file)
@@ -89,7 +89,9 @@
         const Handle(BOPDS_PaveBlock)& aPB=aItPB.Value();
         const Handle(BOPDS_PaveBlock)& aPBR=myDS->RealPaveBlock(aPB);
         //
-        nSpR=aPBR->Edge();
+        if (!aPBR->HasEdge(nSpR)) {
+          continue;
+        }
         const TopoDS_Shape& aSpR=myDS->Shape(nSpR);
         aLS.Append(aSpR);
         myOrigins.Bind(aSpR, aE);
index 69cfa25e3813f113df91387ffeb0ba773b372eec..2008f76ecc9ffdd621289febfd13c6142289214e 100644 (file)
@@ -185,6 +185,11 @@ void BOPAlgo_PaveFiller::PerformVE()
       continue;
     }
     //
+    BOPDS_ListOfPaveBlock& aLPB=myDS->ChangePaveBlocks(nE);
+    if (aLPB.IsEmpty()) {
+      continue;
+    }
+    //
     const TopoDS_Edge& aE=(*(TopoDS_Edge *)(&aSIE.Shape())); 
     const TopoDS_Vertex& aV=(*(TopoDS_Vertex *)(&myDS->Shape(nVx))); 
     //
@@ -217,8 +222,8 @@ void BOPAlgo_PaveFiller::PerformVE()
       // 2
       myDS->AddInterf(nV, nE);
       // 3
-      BOPDS_ListOfPaveBlock& aLPB=myDS->ChangePaveBlocks(nE);
-      Handle(BOPDS_PaveBlock)& aPB=*((Handle(BOPDS_PaveBlock)*)&aLPB.First());
+      const BOPDS_ListOfPaveBlock& aLPB=myDS->PaveBlocks(nE);
+      const Handle(BOPDS_PaveBlock)& aPB=*((Handle(BOPDS_PaveBlock)*)&aLPB.First());
       // 
       aPave.SetIndex(nVx);
       aPave.SetParameter(aT);
index 07a16ee7ee5f5c73d4903d5725a61a696f178685..983f38f3c3250474766ffd76da99f8f3e0bebdc8 100644 (file)
@@ -360,7 +360,7 @@ void BOPAlgo_PaveFiller::MakeSplitEdges()
     }
     //
     aItPB.Initialize(aLPB);
-    for (; aItPB.More(); aItPB.Next()) {
+    for (; aItPB.More(); ) {
       aPB=aItPB.Value();
       const Handle(BOPDS_CommonBlock)& aCB=myDS->CommonBlock(aPB);
       bCB=!aCB.IsNull();
@@ -369,10 +369,15 @@ void BOPAlgo_PaveFiller::MakeSplitEdges()
         aPB=aCB->PaveBlock1();
       }
       //
+      aPB->Range(aT1, aT2);
+      if (aT2 - aT1 < Precision::PConfusion()) {
+        aLPB.Remove(aItPB);
+        continue;
+      }
+      //
       if (aMPB.Add(aPB)) {
         nE=aPB->OriginalEdge();
         aPB->Indices(nV1, nV2);
-        aPB->Range(aT1, aT2);
         //
         aE=(*(TopoDS_Edge *)(&myDS->Shape(nE))); 
         aE.Orientation(TopAbs_FORWARD);
@@ -392,6 +397,7 @@ void BOPAlgo_PaveFiller::MakeSplitEdges()
         }
         aBSE.SetProgressIndicator(myProgressIndicator);
       }
+      aItPB.Next();
     } // for (; aItPB.More(); aItPB.Next()) {
   }  // for (i=0; i<aNbPBP; ++i) {      
   //
index a78d0b9f411b9b111e014f19bd2332c8b51d453d..ace0e7ca22ff88877a49009b0142d8f60651dc43 100644 (file)
@@ -210,6 +210,20 @@ void BRepOffset_Analyse::Perform (const TopoDS_Shape& S,
 #ifdef OCCT_DEBUG
        cout <<"edge shared by more than two faces"<<endl;
 #endif 
+        // analyze each intersection
+        BRepOffset_ListOfInterval& aLEI = mapEdgeType(E);
+        TopTools_ListIteratorOfListOfShape aIt1, aIt2;
+        aIt1.Initialize(L);
+        for (; aIt1.More(); aIt1.Next()) {
+          const TopoDS_Face& F1 = TopoDS::Face(aIt1.Value());
+          //
+          aIt2 = aIt1;
+          for (aIt2.Next(); aIt2.More(); aIt2.Next()) {
+            const TopoDS_Face& F2 = TopoDS::Face(aIt2.Value());
+            //
+            EdgeAnalyse(E,F1,F2,SinTol,aLEI);
+          }
+        }
       }
     }
   }
index f1f5d11fdb028c4bfc6a8f177c07d4bbdb57310e..9bf9919a2e2da343e7faa0b7979dc1f81d76febf 100644 (file)
@@ -20,6 +20,7 @@
 #include <BRepOffset_Tool.hxx>
 #include <BRepOffset_Interval.hxx>
 #include <BRepOffset_ListOfInterval.hxx>
+#include <BRepOffset_ListIteratorOfListOfInterval.hxx>
 #include <BRepOffset_DataMapOfShapeOffset.hxx>
 #include <BRepOffset_Offset.hxx>
 #include <BRepAdaptor_Curve.hxx>
@@ -528,26 +529,42 @@ void BRepOffset_Inter3d::ConnexIntByInt
         continue;
       }
       //
-      BRepOffset_Type    OT = L.First().Type();
-      if (OT != BRepOffset_Convex && OT != BRepOffset_Concave) {
+      BRepOffset_Type OT = L.First().Type();
+      BRepOffset_ListIteratorOfListOfInterval aItInt(L);
+      for (; aItInt.More(); aItInt.Next()) {
+        OT = aItInt.Value().Type();
+        if (OT == BRepOffset_Convex || OT == BRepOffset_Concave) {
+          break;
+        }
+      }
+      //
+      if (!aItInt.More()) {
         continue;
       }
       //
+      //
       if (OT == BRepOffset_Concave) CurSide = TopAbs_IN;
       else                          CurSide = TopAbs_OUT;
       //-----------------------------------------------------------
       // edge is of the proper type, return adjacent faces.
       //-----------------------------------------------------------
       const TopTools_ListOfShape& Anc = Analyse.Ancestors(E);
-      if (Anc.Extent() != 2) {
+      if (Anc.Extent() < 2) {
         continue;
       }
       //
-      F1 = TopoDS::Face(Anc.First());
-      F2 = TopoDS::Face(Anc.Last());
-      //
-      aLF1.Append(F1);
-      aLF2.Append(F2);
+      it.Initialize(Anc);
+      for (; it.More(); it.Next()) {
+        F1 = TopoDS::Face(it.Value());
+        //
+        it1 = it;
+        for (it1.Next(); it1.More(); it1.Next()) {
+          F2 = TopoDS::Face(it1.Value());
+          //
+          aLF1.Append(F1);
+          aLF2.Append(F2);
+        }
+      }
     }
     else {
       if (!aDMVLF1.IsBound(aS)) {
index a821c3e2b069b998325284cba24f6f905ed33456..ed388d1ae5b7c076f66b6c71e89025c74c3a59ce 100644 (file)
@@ -1403,10 +1403,11 @@ const TopoDS_Shape&  BRepOffset_MakeOffset::Shape() const
 //purpose  : Trim the edge of the largest of descendants in AsDes2d.
 //           Order in AsDes two vertices that have trimmed the edge.
 //=======================================================================
-void TrimEdge(TopoDS_Edge&                  NE,
-              const Handle(BRepAlgo_AsDes)& AsDes2d,
-              Handle(BRepAlgo_AsDes)& AsDes,
-              TopTools_DataMapOfShapeShape& theETrimEInf)
+static 
+  Standard_Boolean TrimEdge(TopoDS_Edge&                  NE,
+                            const Handle(BRepAlgo_AsDes)& AsDes2d,
+                            Handle(BRepAlgo_AsDes)& AsDes,
+                            TopTools_DataMapOfShapeShape& theETrimEInf)
 {
   TopoDS_Edge aSourceEdge;
   TopoDS_Vertex V1,V2;
@@ -1490,6 +1491,7 @@ void TrimEdge(TopoDS_Edge&                  NE,
       theETrimEInf.Bind(NE, aSourceEdge);
     }
   }
+  return bTrim;
 }
 
 //=======================================================================
@@ -4076,12 +4078,13 @@ void TrimEdges(const TopoDS_Shape& theShape,
           theEdgesOrigins.Bind(NE, aLSx);
         }
         //
+        Standard_Boolean bTrimmed = Standard_True;
         if (theMES.IsBound(NE)) {
           NE = theMES(NE);
           NE.Orientation(aS.Orientation());
           if (theNewEdges.Add(NE))
           {
-            TrimEdge (TopoDS::Edge(NE), theAsDes2d, theAsDes, theETrimEInf);
+            bTrimmed = TrimEdge (TopoDS::Edge(NE), theAsDes2d, theAsDes, theETrimEInf);
           } 
         }
         else {
@@ -4093,7 +4096,9 @@ void TrimEdges(const TopoDS_Shape& theShape,
             theETrimEInf.Bind(anEdge, aNewEdge);
           }
         }
-        theAsDes->Add(NF, NE);
+        if (bTrimmed) {
+          theAsDes->Add(NF, NE);
+        }
       } 
     }
   }
@@ -7684,8 +7689,13 @@ void TrimNewIntersectionEdges(const TopTools_ListOfShape& theLE,
       TopoDS_Vertex aV1, aV2;
       TopExp::Vertices(TopoDS::Edge(aE), aV1, aV2);
       //
-      aGFE.AddArgument(aV1);
-      aGFE.AddArgument(aV2);
+      if (!aV1.IsNull()) {
+        aGFE.AddArgument(aV1);
+      }
+      //
+      if (!aV2.IsNull()) {
+        aGFE.AddArgument(aV2);
+      }
       //
       aGFE.Perform();
       //
@@ -7731,7 +7741,14 @@ void TrimNewIntersectionEdges(const TopTools_ListOfShape& theLE,
     //
     TopExp_Explorer aExp(aCEIm, TopAbs_EDGE);
     for (; aExp.More(); aExp.Next()) {
-      const TopoDS_Shape& aEIm = aExp.Current();
+      const TopoDS_Edge& aEIm = TopoDS::Edge(aExp.Current());
+      //
+      // check the split to be trimmed
+      Standard_Real aFirst, aLast;
+      BRep_Tool::Range(aEIm, aFirst, aLast);
+      if (Precision::IsInfinite(aFirst) || Precision::IsInfinite(aLast)) {
+        continue;
+      }
       //
       // check the split not to contain bounding vertices
       TopExp_Explorer aExpV(aEIm, TopAbs_VERTEX);