]> OCCT Git - occt.git/commitdiff
0032333: Modeling Algorithms - Empty(wrong) result of offset operation in mode "Compl...
authoremv <emv@opencascade.com>
Tue, 11 Jan 2022 15:10:23 +0000 (18:10 +0300)
committersmoskvin <smoskvin@opencascade.com>
Mon, 31 Jan 2022 15:23:59 +0000 (18:23 +0300)
Add more faces for intersection in rebuilding process basing on the connection of the splits of offset faces (special treatment for the artificially invalid faces).
When rebuilding faces add vertices common for faces for trimming the new intersection edges.

Adjust existing and create new test cases.

27 files changed:
src/BRepOffset/BRepOffset_MakeOffset_1.cxx
tests/offset/shape_type_i_c/K9
tests/offset/shape_type_i_c/P8
tests/offset/shape_type_i_c/Q9
tests/offset/shape_type_i_c/XB7
tests/offset/shape_type_i_c/XB8
tests/offset/shape_type_i_c/XB9
tests/offset/shape_type_i_c/XD3
tests/offset/shape_type_i_c/XJ7
tests/offset/shape_type_i_c/XM1
tests/offset/shape_type_i_c/XU4 [new file with mode: 0644]
tests/offset/shape_type_i_c/XU5 [new file with mode: 0644]
tests/offset/shape_type_i_c/XY4
tests/offset/shape_type_i_c/XY5
tests/offset/shape_type_i_c/XY9 [new file with mode: 0644]
tests/offset/shape_type_i_c/XZ3 [new file with mode: 0644]
tests/offset/shape_type_i_c/XZ4 [new file with mode: 0644]
tests/offset/shape_type_i_c/XZ5 [new file with mode: 0644]
tests/offset/shape_type_i_c/XZ6 [new file with mode: 0644]
tests/offset/shape_type_i_c/XZ7 [new file with mode: 0644]
tests/offset/shape_type_i_c/XZ8 [new file with mode: 0644]
tests/offset/shape_type_i_c/XZ9 [new file with mode: 0644]
tests/offset/shape_type_i_c/Z4
tests/offset/shape_type_i_c/ZB4
tests/offset/shape_type_i_c/ZC8
tests/offset/shape_type_i_c/ZD9
tests/offset/shape_type_i_c_multi/B7

index b4c9f1224337df87105edd6ef4659749026e6190..dab0aac318bddbf4cd80e752b255dc0df9658097 100644 (file)
@@ -52,6 +52,7 @@
 #include <BOPAlgo_PaveFiller.hxx>
 #include <BOPAlgo_Section.hxx>
 #include <BOPAlgo_Splitter.hxx>
+#include <BOPAlgo_BOP.hxx>
 
 #include <TopTools_ListOfShape.hxx>
 #include <TopTools_DataMapOfShapeShape.hxx>
@@ -107,6 +108,19 @@ namespace {
   {
     BRep_Builder().Add (theSOut, theS);
   }
+  static void AddToContainer (const TopoDS_Shape& theKey,
+                              const TopoDS_Shape& theValue,
+                              TopTools_DataMapOfShapeListOfShape& theMap)
+  {
+    if (TopTools_ListOfShape* pList = theMap.ChangeSeek (theKey))
+    {
+      pList->Append (theValue);
+    }
+    else
+    {
+      theMap.Bound (theKey, TopTools_ListOfShape())->Append (theValue);
+    }
+  }
 
   //=======================================================================
   //function : TakeModified
@@ -617,7 +631,9 @@ private: //! @name Intersection and post-treatment of edges
 
   //! Filtering the invalid edges according to currently invalid faces
   void FilterInvalidEdges (const BRepOffset_DataMapOfShapeIndexedMapOfShape& theDMFMIE,
-                           const TopTools_IndexedMapOfShape& theMERemoved);
+                           const TopTools_IndexedMapOfShape& theMERemoved,
+                           const TopTools_IndexedMapOfShape& theMEInside,
+                           TopTools_MapOfShape& theMEUseInRebuild);
 
 private: //! @name Checking faces
 
@@ -766,6 +782,7 @@ private: //! @name Checking faces
                               const TopTools_MapOfShape& theVertsToAvoid,
                               const TopTools_MapOfShape& theNewVertsToAvoid,
                               const TopTools_MapOfShape& theMECheckExt,
+                              const TopTools_DataMapOfShapeListOfShape* theSSInterfs,
                               TopTools_MapOfShape& theMVBounds,
                               TopTools_DataMapOfShapeListOfShape& theEImages);
 
@@ -877,16 +894,18 @@ private:
   TopTools_IndexedMapOfShape myEdgesToAvoid;  //!< Splits of edges to be avoided when building splits of faces
   TopTools_MapOfShape myLastInvEdges;         //!< Edges marked invalid on the current step and to be avoided on the next step
   TopTools_MapOfShape myModifiedEdges;        //!< Edges to be used for building splits
+  TopTools_IndexedMapOfShape myInsideEdges;   //!< Edges located fully inside solids built from the splits of offset faces
 
   TopTools_IndexedDataMapOfShapeListOfShape myInvalidFaces; //!< Invalid faces - splits of offset faces consisting of invalid edges
-  TopTools_DataMapOfShapeShape myArtInvalidFaces;           //!< Artificially invalid faces - valid faces intentionally marked invalid
-                                                            //!  to be rebuilt on the future steps in the situations when invalid edges
-                                                            //!  are present, but invalid faces not
+  BRepOffset_DataMapOfShapeIndexedMapOfShape myArtInvalidFaces; //!< Artificially invalid faces - valid faces intentionally marked invalid
+                                                                //!  to be rebuilt on the future steps in the situations when invalid edges
+                                                                //!  are present, but invalid faces not
   TopTools_DataMapOfShapeInteger myAlreadyInvFaces;         //!< Count number of the same face being marked invalid to avoid infinite
                                                             //!  rebuilding of the same face
   TopTools_DataMapOfShapeListOfShape myFNewHoles;           //!< Images of the hole faces of the original face
 
   TopTools_DataMapOfShapeListOfShape mySSInterfs; //!< Intersection information, used to collect intersection pairs during rebuild
+  TopTools_DataMapOfShapeListOfShape mySSInterfsArt; //!< Intersection information, used to collect intersection pairs during rebuild
   NCollection_DataMap <TopoDS_Shape,
     BRepOffset_DataMapOfShapeMapOfShape,
     TopTools_ShapeMapHasher> myIntersectionPairs; //!< All possible intersection pairs, used to avoid some of the intersections
@@ -1004,6 +1023,7 @@ void BRepOffset_BuildOffsetFaces::BuildSplitsOfExtendedFaces (const Message_Prog
     myInvalidEdges.Clear();
     myInvertedEdges.Clear();
     mySSInterfs.Clear();
+    mySSInterfsArt.Clear();
     myIntersectionPairs.Clear();
     mySolids.Nullify();
     myFacesToRebuild.Clear();
@@ -1299,9 +1319,8 @@ void BRepOffset_BuildOffsetFaces::BuildSplitsOfFaces (const Message_ProgressRang
       //
       if (bArtificialCase)
       {
-        TopTools_IndexedMapOfShape aMEInv;
         // make the face invalid
-        myArtInvalidFaces.Bind (aF, aCE);
+        TopTools_IndexedMapOfShape aMEInv;
         //
         *pLFIm = aLFImages;
         TopTools_ListIteratorOfListOfShape aItLFIm (aLFImages);
@@ -1324,6 +1343,7 @@ void BRepOffset_BuildOffsetFaces::BuildSplitsOfFaces (const Message_ProgressRang
           }
         }
         //
+        myArtInvalidFaces.Bind (aF, aMEInv);
         aDMFMIE.Bind (aF, aMEInv);
         aLFDone.Append (aF);
         //
@@ -1519,9 +1539,8 @@ void BRepOffset_BuildOffsetFaces::BuildSplitsOfFaces (const Message_ProgressRang
   RemoveInvalidSplitsFromValid (aDMFMVIE);
   //
   // remove inside faces
-  TopTools_IndexedMapOfShape aMEInside;
   RemoveInsideFaces (anInvertedFaces, aMFToCheckInt, aMFInvInHole, aFHoles,
-                     aMERemoved, aMEInside, aPSOuter.Next (5.));
+                     aMERemoved, myInsideEdges, aPSOuter.Next (5.));
   //
   // make compound of valid splits
   TopoDS_Compound aCFIm;
@@ -1546,7 +1565,7 @@ void BRepOffset_BuildOffsetFaces::BuildSplitsOfFaces (const Message_ProgressRang
   FilterEdgesImages (aCFIm);
   //
   // filter invalid faces
-  FilterInvalidFaces (aDMEF, aMEInside);
+  FilterInvalidFaces (aDMEF, aMERemoved.Extent() ? myInsideEdges : aMERemoved);
   aNb = myInvalidFaces.Extent();
   if (!aNb)
   {
@@ -1572,7 +1591,10 @@ void BRepOffset_BuildOffsetFaces::BuildSplitsOfFaces (const Message_ProgressRang
 #endif
   //
   // filter invalid edges
-  FilterInvalidEdges (aDMFMIE, aMERemoved);
+  TopTools_MapOfShape aMEUseInRebuild;
+  FilterInvalidEdges (aDMFMIE, aMERemoved,
+                      aMERemoved.Extent() ? myInsideEdges : aMERemoved,
+                      aMEUseInRebuild);
   //
   // Check additionally validity of edges originated from vertices.
   CheckEdgesCreatedByVertex();
@@ -1594,8 +1616,11 @@ void BRepOffset_BuildOffsetFaces::BuildSplitsOfFaces (const Message_ProgressRang
   for (i = 1; i <= aNb; ++i)
   {
     const TopoDS_Shape& aE = myInvalidEdges (i);
-    myEdgesToAvoid.Add (aE);
     myLastInvEdges.Add (aE);
+    if (!aMEUseInRebuild.Contains(aE))
+    {
+      myEdgesToAvoid.Add (aE);
+    }
   }
   //
   aNb = myInvalidFaces.Extent();
@@ -1793,11 +1818,10 @@ Standard_Boolean BRepOffset_BuildOffsetFaces::CheckIfArtificial (const TopoDS_Sh
   {
     const TopoDS_Edge& aE = TopoDS::Edge (aItLE.Value());
     //
-    if (myOEImages.IsBound (aE))
+    if (const TopTools_ListOfShape* pLEIm = myOEImages.Seek (aE))
     {
       Standard_Boolean bChecked = Standard_False;
-      const TopTools_ListOfShape& aLEIm = myOEImages.Find (aE);
-      TopTools_ListIteratorOfListOfShape aItLEIm (aLEIm);
+      TopTools_ListIteratorOfListOfShape aItLEIm (*pLEIm);
       for (; aItLEIm.More(); aItLEIm.Next())
       {
         const TopoDS_Edge& aEIm = TopoDS::Edge (aItLEIm.Value());
@@ -4165,6 +4189,7 @@ void BRepOffset_BuildOffsetFaces::RemoveInsideFaces (const TopTools_ListOfShape&
   RemoveInvalidSplits (aMFToRem, aMV, theMERemoved);
   //
   // Get inside faces from the removed ones comparing them with boundary edges
+  theMEInside.Clear();
   aNb = theMERemoved.Extent();
   for (i = 1; i <= aNb; ++i)
   {
@@ -4189,6 +4214,28 @@ void BRepOffset_BuildOffsetFaces::RemoveInsideFaces (const TopTools_ListOfShape&
 void BRepOffset_BuildOffsetFaces::ShapesConnections (const TopTools_DataMapOfShapeShape& theDMFOr,
                                                      BOPAlgo_Builder& theBuilder)
 {
+  // Make connexity blocks from invalid edges to use the whole block
+  // to which the edge is connected instead of the single edge.
+  TopoDS_Compound aCEInv;
+  BRep_Builder().MakeCompound(aCEInv);
+  for (Standard_Integer i = 1; i <= myInvalidEdges.Extent(); ++i)
+  {
+    AddToContainer (myInvalidEdges(i), aCEInv);
+  }
+
+  TopTools_ListOfShape aLCB;
+  BOPTools_AlgoTools::MakeConnexityBlocks (aCEInv, TopAbs_VERTEX, TopAbs_EDGE, aLCB);
+
+  // Binding from the edge to the block
+  TopTools_DataMapOfShapeShape aECBMap;
+  for (TopTools_ListOfShape::Iterator itCB(aLCB); itCB.More(); itCB.Next())
+  {
+    for (TopoDS_Iterator itE(itCB.Value()); itE.More(); itE.Next())
+    {
+      aECBMap.Bind(itE.Value(), itCB.Value());
+    }
+  }
+
   // update invalid edges with images and keep connection to original edge
   TopTools_DataMapOfShapeListOfShape aDMEOr;
   Standard_Integer aNb = myInvalidEdges.Extent();
@@ -4206,13 +4253,7 @@ void BRepOffset_BuildOffsetFaces::ShapesConnections (const TopTools_DataMapOfSha
     for (; aItLEIm.More(); aItLEIm.Next())
     {
       const TopoDS_Shape& aEIm = aItLEIm.Value();
-      //
-      TopTools_ListOfShape* pLEOr = aDMEOr.ChangeSeek (aEIm);
-      if (!pLEOr)
-      {
-        pLEOr = aDMEOr.Bound (aEIm, TopTools_ListOfShape());
-      }
-      AppendToList (*pLEOr, aEInv);
+      AddToContainer (aEIm, aEInv, aDMEOr);
     }
   }
   //
@@ -4365,6 +4406,121 @@ void BRepOffset_BuildOffsetFaces::ShapesConnections (const TopTools_DataMapOfSha
         AppendToList (*pLF, aFOp);
       }
     }
+
+    // Treatment for the artificial case - check if one of the faces is artificially invalid
+    for (Standard_Integer iF = 0; iF < 2; ++iF)
+    {
+      const TopoDS_Shape& aFArt = !iF ? *pF1 : *pF2;
+      const TopoDS_Shape& aFOpposite = !iF ? *pF2 : *pF1;
+
+      if (!myArtInvalidFaces.IsBound (aFArt))
+        continue;
+
+      if (myInvalidFaces.Contains (aFOpposite) && !myArtInvalidFaces.IsBound (aFOpposite))
+        continue;
+
+      // Collect own invalid edges of the face and the invalid edges connected to those
+      // own invalid edges to be avoided in the check for intersection.
+      TopTools_IndexedMapOfShape aMEAvoid;
+      if (const TopTools_IndexedMapOfShape* pFEInv = myArtInvalidFaces.Seek (aFOpposite))
+      {
+        for (Standard_Integer iE = 1; iE <= pFEInv->Extent(); ++iE)
+        {
+          if (const TopoDS_Shape* pCB = aECBMap.Seek (pFEInv->FindKey(iE)))
+          {
+            TopExp::MapShapes (*pCB, TopAbs_EDGE, aMEAvoid);
+          }
+        }
+      }
+      else if (const TopTools_ListOfShape* pLFIm = myOFImages.Seek (aFOpposite))
+      {
+        for (TopTools_ListOfShape::Iterator itLFIm (*pLFIm); itLFIm.More(); itLFIm.Next())
+        {
+          for (TopExp_Explorer expE (itLFIm.Value(), TopAbs_EDGE); expE.More(); expE.Next())
+          {
+            if (const TopoDS_Shape* pCB = aECBMap.Seek (expE.Current()))
+            {
+              TopExp::MapShapes (*pCB, TopAbs_EDGE, aMEAvoid);
+            }
+          }
+        }
+      }
+
+      const TopoDS_Shape& aFArtIm = !iF ? aFIm1 : aFIm2;
+      const TopoDS_Shape& aFOppositeIm = !iF ? aFIm2 : aFIm1;
+
+      // Check if there are any intersections between edges of artificially
+      // invalid face and opposite face
+      const Standard_Integer nFOp = pDS->Index (aFOppositeIm);
+
+      for (TopExp_Explorer expE (aFArtIm, TopAbs_EDGE); expE.More(); expE.Next())
+      {
+        const TopoDS_Shape& aE = expE.Current();
+        if (!myInvalidEdges.Contains (aE) || myInvertedEdges.Contains (aE) || aMEAvoid.Contains (aE))
+        {
+          continue;
+        }
+        const Standard_Integer nE = pDS->Index (aE);
+        if (nE < 0)
+        {
+          continue;
+        }
+
+        if (!pDS->HasInterf(nE, nFOp))
+        {
+          continue;
+        }
+
+        TopTools_ListOfShape aLV;
+        const BOPDS_VectorOfInterfEF& aEFs = pDS->InterfEF();
+        for (Standard_Integer iEF = 0; iEF < aEFs.Size(); ++iEF)
+        {
+          const BOPDS_InterfEF& aEF = aEFs (iEF);
+          if (aEF.Contains (nE) && aEF.Contains(nFOp))
+          {
+            if (aEF.CommonPart().Type() == TopAbs_VERTEX)
+              aLV.Append (pDS->Shape (aEF.IndexNew()));
+          }
+        }
+
+        if (aLV.IsEmpty())
+        {
+          continue;
+        }
+
+        // Make sure that there is an opposite intersection exists, i.e. some of the edges
+        // of the opposite face intersect the artificially invalid face.
+        const Standard_Integer nFArt = pDS->Index (aFArtIm);
+        TopExp_Explorer expEOp (aFOppositeIm, TopAbs_EDGE);
+        for (; expEOp.More(); expEOp.Next())
+        {
+          const TopoDS_Shape& aEOp = expEOp.Current();
+          const Standard_Integer nEOp = pDS->Index (aEOp);
+          if (pDS->HasInterf(nEOp, nFArt))
+          {
+            break;
+          }
+        }
+        if (!expEOp.More())
+        {
+          continue;
+        }
+
+        // Intersection is present - add connection between offset faces.
+        AddToContainer (aFArt, aFOpposite, mySSInterfsArt);
+
+        // Add connection between edge and opposite face
+        AddToContainer (aE, aFOpposite, mySSInterfsArt);
+
+        // Along with the opposite face, save the intersection vertices to
+        // be used for trimming the intersection edge in the rebuilding process
+        for (TopTools_ListOfShape::Iterator itLV (aLV); itLV.More(); itLV.Next())
+        {
+          // Add connection to intersection vertex
+          AddToContainer (aE, itLV.Value(), mySSInterfsArt);
+        }
+      }
+    }
   }
 }
 
@@ -4960,7 +5116,9 @@ void BRepOffset_BuildOffsetFaces::CheckEdgesCreatedByVertex()
 //purpose  : Filtering the invalid edges according to currently invalid faces
 //=======================================================================
 void BRepOffset_BuildOffsetFaces::FilterInvalidEdges (const BRepOffset_DataMapOfShapeIndexedMapOfShape& theDMFMIE,
-                                                      const TopTools_IndexedMapOfShape& theMERemoved)
+                                                      const TopTools_IndexedMapOfShape& theMERemoved,
+                                                      const TopTools_IndexedMapOfShape& theMEInside,
+                                                      TopTools_MapOfShape& theMEUseInRebuild)
 {
   TopoDS_Compound aCEInv;
   TopTools_IndexedMapOfShape aMEInv;
@@ -5023,14 +5181,16 @@ void BRepOffset_BuildOffsetFaces::FilterInvalidEdges (const BRepOffset_DataMapOf
     const TopoDS_Shape& aF = myInvalidFaces.FindKey (i);
     if (myArtInvalidFaces.IsBound (aF))
     {
-      const TopTools_IndexedMapOfShape& aMIE = theDMFMIE.Find (aF);
-      const Standard_Integer aNbIE = aMIE.Extent();
-      for (Standard_Integer iE = 1; iE <= aNbIE; ++iE)
+      if (const TopTools_IndexedMapOfShape* aMIE = theDMFMIE.Seek (aF))
       {
-        const TopoDS_Shape& aE = aMIE (iE);
-        if (aMEInv.Contains (aE) && !aMEInvToAvoid.Contains (aE))
+        const Standard_Integer aNbIE = aMIE->Extent();
+        for (Standard_Integer iE = 1; iE <= aNbIE; ++iE)
         {
-          aReallyInvEdges.Add (aE);
+          const TopoDS_Shape& aE = aMIE->FindKey (iE);
+          if (aMEInv.Contains (aE) && !aMEInvToAvoid.Contains (aE))
+          {
+            aReallyInvEdges.Add (aE);
+          }
         }
       }
     }
@@ -5053,8 +5213,46 @@ void BRepOffset_BuildOffsetFaces::FilterInvalidEdges (const BRepOffset_DataMapOf
       }
     }
   }
-  //
+
   myInvalidEdges = aReallyInvEdges;
+
+  // Check if any of the currently invalid edges may be used for
+  // rebuilding splits of invalid faces.
+  // For that the edge should be inside and not connected to invalid
+  // boundary edges of the same origin.
+
+  aNb = myInvalidEdges.Extent();
+  for (i = 1; i <= aNb; ++i)
+  {
+    const TopoDS_Shape& aE = myInvalidEdges (i);
+    if (!theMEInside.Contains (aE) || !myValidEdges.Contains (aE))
+    {
+      continue;
+    }
+
+    const TopTools_ListOfShape* pEOrigins = myOEOrigins.Seek (aE);
+    if (!pEOrigins)
+    {
+      theMEUseInRebuild.Add (aE);
+      continue;
+    }
+
+    Standard_Boolean bHasInvOutside = Standard_False;
+    for (TopTools_ListOfShape::Iterator itEOr (*pEOrigins); !bHasInvOutside && itEOr.More(); itEOr.Next())
+    {
+      if (const TopTools_ListOfShape* pEIms = myOEImages.Seek (itEOr.Value()))
+      {
+        for (TopTools_ListOfShape::Iterator itEIms (*pEIms); !bHasInvOutside && itEIms.More(); itEIms.Next())
+        {
+          bHasInvOutside = myInvalidEdges.Contains (itEIms.Value()) && !theMEInside.Contains (itEIms.Value());
+        }
+      }
+    }
+    if (!bHasInvOutside)
+    {
+      theMEUseInRebuild.Add (aE);
+    }
+  }
 }
 
 //=======================================================================
@@ -5116,7 +5314,7 @@ void BRepOffset_BuildOffsetFaces::FindFacesToRebuild()
       aDMFLV.Bind (aF, aLVAvoid);
     }
     //
-    const TopTools_ListOfShape* pLF = mySSInterfs.Seek (aF);
+    const TopTools_ListOfShape* pLF = !myArtInvalidFaces.IsBound(aF) ? mySSInterfs.Seek (aF) : mySSInterfsArt.Seek(aF);
     if (pLF)
     {
       TopTools_ListIteratorOfListOfShape aItLFE (*pLF);
@@ -5275,7 +5473,7 @@ void BRepOffset_BuildOffsetFaces::IntersectFaces (TopTools_MapOfShape& theVertsT
   TopTools_DataMapOfShapeShape aDMFImF;
   TopoDS_Compound aCFArt;
   BRep_Builder().MakeCompound (aCFArt);
-  TopTools_DataMapIteratorOfDataMapOfShapeShape aItM (myArtInvalidFaces);
+  BRepOffset_DataMapOfShapeIndexedMapOfShape::Iterator aItM (myArtInvalidFaces);
   for (; aItM.More(); aItM.Next())
   {
     const TopoDS_Shape& aF = aItM.Key();
@@ -5597,9 +5795,13 @@ void BRepOffset_BuildOffsetFaces::IntersectFaces (TopTools_MapOfShape& theVertsT
             continue;
           }
           //
-          const TopTools_ListOfShape& aLFImi = myOFImages.FindFromKey (aFi);
+          const TopTools_ListOfShape* aLFImi = myOFImages.Seek (aFi);
+          if (!aLFImi)
+            continue;
           //
-          TopTools_ListOfShape& aLFEi = aFLE.ChangeFromKey (aFi);
+          TopTools_ListOfShape* aLFEi = aFLE.ChangeSeek (aFi);
+          if (!aLFEi)
+            continue;
           //
           TopTools_ListOfShape& aLFDone = aMDone.ChangeFind (aFi);
           //
@@ -5618,20 +5820,42 @@ void BRepOffset_BuildOffsetFaces::IntersectFaces (TopTools_MapOfShape& theVertsT
             if (pInterFi && !pInterFi->Contains (aFj))
               continue;
 
-            const TopTools_ListOfShape& aLFImj = myOFImages.FindFromKey (aFj);
+            const TopTools_ListOfShape* aLFImj = myOFImages.Seek(aFj);
+            if (!aLFImj)
+              continue;
             //
-            TopTools_ListOfShape& aLFEj = aFLE.ChangeFromKey (aFj);
+            TopTools_ListOfShape* aLFEj = aFLE.ChangeSeek (aFj);
+            if (!aLFEj)
+              continue;
+
             //
             // if there are some common edges between faces
             // we should use these edges and do not intersect again.
             TopTools_ListOfShape aLEC;
-            FindCommonParts (aLFImi, aLFImj, aLEC);
+            FindCommonParts (*aLFImi, *aLFImj, aLEC);
             //
             if (aLEC.Extent())
             {
               // no need to intersect if we have common edges between faces
               Standard_Boolean bForceUse = aMFIntExt.Contains (aFi) || aMFIntExt.Contains (aFj);
-              ProcessCommonEdges (aLEC, aME, aMEInfETrim, aMAllInvs, bForceUse, aMECV, aMECheckExt, aDMEETrim, aLFEi, aLFEj, aMEToInt);
+              ProcessCommonEdges (aLEC, aME, aMEInfETrim, aMAllInvs, bForceUse, aMECV, aMECheckExt, aDMEETrim, *aLFEi, *aLFEj, aMEToInt);
+
+              // Add common vertices not belonging to the common edges for trimming the intersection edges
+              TopTools_IndexedMapOfShape aMVOnCE;
+              for (TopTools_ListOfShape::Iterator itE (aLEC); itE.More(); itE.Next())
+              {
+                TopExp::MapShapes (itE.Value(), TopAbs_VERTEX, aMVOnCE);
+              }
+
+              TopTools_ListOfShape aLEV;
+              FindCommonParts (*aLFImi, *aLFImj, aLEV, TopAbs_VERTEX);
+              for (TopTools_ListOfShape::Iterator itV (aLEV); itV.More(); itV.Next())
+              {
+                if (!aMVOnCE.Contains (itV.Value()))
+                {
+                  aMECV.Add (itV.Value());
+                }
+              }
               continue;
             }
             //
@@ -5657,7 +5881,7 @@ void BRepOffset_BuildOffsetFaces::IntersectFaces (TopTools_MapOfShape& theVertsT
             {
               // use intersection line obtained on the previous steps
               // plus, find new origins for these lines
-              UpdateIntersectedFaces (aFInv, aFi, aFj, aLFInv, aLFImi, aLFImj, aLFEi, aLFEj, aMEToInt);
+              UpdateIntersectedFaces (aFInv, aFi, aFj, aLFInv, *aLFImi, *aLFImj, *aLFEi, *aLFEj, aMEToInt);
               continue;
             }
             //
@@ -5669,13 +5893,14 @@ void BRepOffset_BuildOffsetFaces::IntersectFaces (TopTools_MapOfShape& theVertsT
             aLFDone.Append (aFj);
             aMDone.ChangeFind (aFj).Append (aFi);
             //
-            IntersectFaces (aFInv, aFi, aFj, aLFInv, aLFImi, aLFImj, aLFEi, aLFEj, aMECV, aMEToInt);
+            IntersectFaces (aFInv, aFi, aFj, aLFInv, *aLFImi, *aLFImj, *aLFEi, *aLFEj, aMECV, aMEToInt);
           }
         }
         //
         // intersect and trim edges for this chain
         IntersectAndTrimEdges (aMFInt, aMEToInt, aDMEETrim, aME, aMECV,
-                               aMVInv, aMVRInv, aMECheckExt, aMVBounds, aEImages);
+                               aMVInv, aMVRInv, aMECheckExt, bArtificial ? &mySSInterfsArt : 0,
+                               aMVBounds, aEImages);
         //
         Standard_Integer iE, aNbEToInt = aMEToInt.Extent();
         for (iE = 1; iE <= aNbEToInt; ++iE)
@@ -5956,12 +6181,8 @@ void BRepOffset_BuildOffsetFaces::FindFacesForIntersection (const TopoDS_Shape&
     }
   }
   //
-  if (theArtCase)
-  {
-    return;
-  }
-  //
-  const TopTools_ListOfShape* pLFInv = mySSInterfs.Seek (theFInv);
+  const TopTools_DataMapOfShapeListOfShape& aSSInterfsMap = theArtCase ? mySSInterfsArt : mySSInterfs;
+  const TopTools_ListOfShape* pLFInv = aSSInterfsMap.Seek (theFInv);
   if (!pLFInv)
   {
     return;
@@ -5985,7 +6206,7 @@ void BRepOffset_BuildOffsetFaces::FindFacesForIntersection (const TopoDS_Shape&
   for (i = 1; i <= aNbE; ++i)
   {
     const TopoDS_Shape& aS = theME (i);
-    const TopTools_ListOfShape* pLF = mySSInterfs.Seek (aS);
+    const TopTools_ListOfShape* pLF = aSSInterfsMap.Seek (aS);
     if (!pLF)
     {
       continue;
@@ -6002,30 +6223,33 @@ void BRepOffset_BuildOffsetFaces::FindFacesForIntersection (const TopoDS_Shape&
       //
       // check if the face has some connection to already added for intersection faces
       const TopTools_ListOfShape& aLFIm = myOFImages.FindFromKey (aF);
-      TopTools_ListIteratorOfListOfShape aItLFIm (aLFIm);
-      for (; aItLFIm.More(); aItLFIm.Next())
+      if (!theArtCase)
       {
-        const TopoDS_Shape& aFIm = aItLFIm.Value();
-        TopExp_Explorer aExp (aFIm, TopAbs_EDGE);
-        for (; aExp.More(); aExp.Next())
+        TopTools_ListIteratorOfListOfShape aItLFIm (aLFIm);
+        for (; aItLFIm.More(); aItLFIm.Next())
         {
-          if (aMShapes.Contains (aExp.Current()))
+          const TopoDS_Shape& aFIm = aItLFIm.Value();
+          TopExp_Explorer aExp (aFIm, TopAbs_EDGE);
+          for (; aExp.More(); aExp.Next())
+          {
+            if (aMShapes.Contains (aExp.Current()))
+            {
+              break;
+            }
+          }
+          if (aExp.More())
           {
             break;
           }
         }
-        if (aExp.More())
+        if (!aItLFIm.More())
         {
-          break;
+          continue;
         }
       }
-      if (!aItLFIm.More())
-      {
-        continue;
-      }
       //
       aMFToAdd.Add (aF);
-      aItLFIm.Initialize (aLFIm);
+      TopTools_ListIteratorOfListOfShape aItLFIm (aLFIm);
       for (; aItLFIm.More(); aItLFIm.Next())
       {
         const TopoDS_Shape& aFIm = aItLFIm.Value();
@@ -6423,6 +6647,7 @@ void BRepOffset_BuildOffsetFaces::IntersectAndTrimEdges (const TopTools_IndexedM
                                                          const TopTools_MapOfShape& theVertsToAvoid,
                                                          const TopTools_MapOfShape& theNewVertsToAvoid,
                                                          const TopTools_MapOfShape& theMECheckExt,
+                                                         const TopTools_DataMapOfShapeListOfShape* theSSInterfs,
                                                          TopTools_MapOfShape& theMVBounds,
                                                          TopTools_DataMapOfShapeListOfShape& theEImages)
 {
@@ -6468,30 +6693,39 @@ void BRepOffset_BuildOffsetFaces::IntersectAndTrimEdges (const TopTools_IndexedM
   aNb = theMSInv.Extent();
   for (i = 1; i <= aNb; ++i)
   {
-    const TopoDS_Shape& aV = theMSInv (i);
-    if (aV.ShapeType() != TopAbs_VERTEX)
+    const TopoDS_Shape& aS = theMSInv(i);
+    // edge case
+    if (theSSInterfs)
     {
-      continue;
-    }
-    //
-    TopTools_ListOfShape* pLVE = aDMVE.ChangeSeek (aV);
-    if (!pLVE)
-    {
-      continue;
+      if (const TopTools_ListOfShape* pLV = theSSInterfs->Seek (aS))
+      {
+        // Add vertices from intersection info to trim section edges of artificial faces
+        for (TopTools_ListOfShape::Iterator itLV (*pLV); itLV.More(); itLV.Next())
+        {
+          if (itLV.Value().ShapeType() == TopAbs_VERTEX)
+          {
+            aLArgs.Append (itLV.Value());
+          }
+        }
+      }
     }
-    //
-    aIt.Initialize (*pLVE);
-    for (; aIt.More(); aIt.Next())
+
+    // vertex case
+    if (const TopTools_ListOfShape* pLVE = aDMVE.ChangeSeek(aS))
     {
-      const TopoDS_Shape& aE = aIt.Value();
-      //
-      aExp.Init (aE, TopAbs_VERTEX);
-      for (; aExp.More(); aExp.Next())
+      aIt.Initialize(*pLVE);
+      for (; aIt.More(); aIt.Next())
       {
-        const TopoDS_Shape& aV1 = aExp.Current();
-        if (!theVertsToAvoid.Contains (aV1) && aMFence.Add (aV1))
+        const TopoDS_Shape& aE = aIt.Value();
+        //
+        aExp.Init(aE, TopAbs_VERTEX);
+        for (; aExp.More(); aExp.Next())
         {
-          aLArgs.Append (aV1);
+          const TopoDS_Shape& aV1 = aExp.Current();
+          if (!theVertsToAvoid.Contains(aV1) && aMFence.Add(aV1))
+          {
+            aLArgs.Append(aV1);
+          }
         }
       }
     }
@@ -7137,9 +7371,19 @@ void BRepOffset_BuildOffsetFaces::UpdateValidEdges (const TopTools_IndexedDataMa
       TopExp::MapShapes (aItSpIm.Value(), TopAbs_EDGE, aNewEdges);
     }
   }
+
+  TopoDS_Compound anInsideEdges;
+  BRep_Builder().MakeCompound (anInsideEdges);
+  for (Standard_Integer iE = 1; iE <= myInsideEdges.Extent(); ++iE)
+  {
+    BRep_Builder().Add (anInsideEdges, myInsideEdges (iE));
+  }
+
   //
   // Rebuild the map of edges to avoid, using the intersection results
   TopTools_IndexedMapOfShape aMEAvoid;
+  TopoDS_Compound aCEAvoid;
+  BRep_Builder().MakeCompound (aCEAvoid);
   // GF's data structure
   const BOPDS_PDS& pDS = aGF.PDS();
 
@@ -7175,7 +7419,7 @@ void BRepOffset_BuildOffsetFaces::UpdateValidEdges (const TopTools_IndexedDataMa
     if (bKeep)
     {
       // keep the original edge
-      aMEAvoid.Add (aE);
+      AddToContainer (aE, aMEAvoid);
       continue;
     }
 
@@ -7184,9 +7428,41 @@ void BRepOffset_BuildOffsetFaces::UpdateValidEdges (const TopTools_IndexedDataMa
     {
       const TopoDS_Shape& aEIm = aItLEIm.Value();
       if (!aNewEdges.Contains (aEIm))
-        aMEAvoid.Add (aEIm);
+      {
+        AddToContainer(aEIm, aCEAvoid);
+      }
     }
   }
+
+  Standard_Boolean isCut = Standard_False;
+  if (aCEAvoid.NbChildren() > 0)
+  {
+    // Perform intersection with the small subset of the edges to make
+    // it possible to use the inside edges for building new splits.
+    BOPAlgo_BOP aBOP;
+    aBOP.AddArgument (aCEAvoid);
+    aBOP.AddTool (anInsideEdges);
+    aBOP.SetOperation (BOPAlgo_CUT);
+    aBOP.Perform();
+    isCut = !aBOP.HasErrors();
+
+    if (isCut)
+    {
+      for (TopoDS_Iterator itCE (aCEAvoid); itCE.More(); itCE.Next())
+      {
+        if (!aBOP.IsDeleted (itCE.Value()))
+        {
+          aMEAvoid.Add (itCE.Value());
+        }
+      }
+    }
+  }
+
+  if (!isCut)
+  {
+    TopExp::MapShapes (aCEAvoid, TopAbs_EDGE, aMEAvoid);
+  }
+
   myEdgesToAvoid = aMEAvoid;
 }
 
index d12e87d13b098d641fcb87554353ac8dd71636a6..a809443e799dc776c328144a9060d7a15385635e 100644 (file)
@@ -1,7 +1,11 @@
 restore  [locate_data_file bug25926_before_offset.brep] s
 
-OFFSETSHAPE 50 {} $calcul $type
+explode s so
+offsetparameter 1e-7 c i r
+offsetload s_1 50
+offsetperform result
 
-checkprops result -v 3.68672e+008
+checkprops result -s 4.96128e+06 -v 3.68655e+08
 
-checknbshapes result -shell 1
+unifysamedom result_unif result
+checknbshapes result_unif -wire 12 -face 12 -shell 1 -solid 1
index 278e3aa7d1078cba63a4a9d912341248bc4c57cb..888cc53164174b4a15e0a3be5c960e7b9118fc62 100644 (file)
@@ -1,8 +1,10 @@
 restore [locate_data_file bug25926_before_offset_trim1.brep] s
 
-OFFSETSHAPE 50 {} $calcul $type
+offsetparameter 1e-7 c i r
+offsetload s 50
+offsetperform result
 
-checkprops result -v 3.61993e+007
-checkprops result -s 696458
+checkprops result -s 694900 -v 3.6175e+07
 
-checknbshapes result -shell 1
+unifysamedom result_unif result
+checknbshapes result_unif -wire 9 -face 9 -shell 1 -solid 1
index fef564f485ecf9b0501e7630c64edeff732d7cbd..a2a2378f4fbd400d11a3002d0cd5d9cd4f41cb74 100755 (executable)
@@ -7,7 +7,7 @@ restore [locate_data_file bug25926_offset_shape_trim3.brep]  s
 
 OFFSETSHAPE 12 {} $calcul $type
 
-checkprops result -v 948181 -s 66208.6 
+checkprops result -v 948181 -s 66208.6 -deps 1.e-3
 
 unifysamedom result_unif result
 checknbshapes result_unif -shell 1 -face 14
index d00ec1d446181dc15a223cbb482f46b0158c94be..25ae9e9d556615b966ca25009e265aa5033d0aa3 100644 (file)
@@ -1,5 +1,3 @@
-puts "TODO CR27414 ALL: Error :  is WRONG because number of FACE entities in shape"
-
 restore [locate_data_file bug26917_dom-8092_trim3.brep] s
 
 offsetparameter 1e-7 $calcul $type
index 1fa5bdadbf0d6833eaea22b197cd50e4eeb5004c..8b3a0e5e32e8b2a93b1885f84829d1666688c5ea 100644 (file)
@@ -1,5 +1,3 @@
-puts "TODO CR27414 ALL: Error :  is WRONG because number of FACE entities in shape"
-
 restore [locate_data_file bug26917_dom-8092_trim4.brep] s
 
 offsetparameter 1e-7 $calcul $type
index 0b53c2669c3ee0abd7025f270b213fd57c51e524..9474d4ff32dbc6e7f86fb9db1a00bff27e3869b9 100644 (file)
@@ -1,5 +1,3 @@
-puts "TODO CR27414 ALL: Error :  is WRONG because number of FACE entities in shape"
-
 restore [locate_data_file bug26917_dom-8092_simple.brep] s
 
 offsetparameter 1e-7 $calcul $type
index 910ba6654c9da4218bd11dcb73c5eabea0ccb87f..7ee106c5460cd11c25109742d21887586bbf77cd 100755 (executable)
@@ -7,7 +7,7 @@ restore [locate_data_file bug26917_25926_offset_shape_trim4.brep] s
 
 OFFSETSHAPE 12 {} $calcul $type
 
-checkprops result -v 643336 -s 45602.9
+checkprops result -v 643336 -s 45602.9 -deps 1.e-3
 
 unifysamedom result_unif result
 checknbshapes result_unif -shell 1 -face 8
index 3d8ab32dce0e9d3b70c162812e4105a650b253f6..71a3fdfa43b22a5e40874ed0f0cc0bacabc2fe0f 100644 (file)
@@ -1,6 +1,6 @@
-puts "TODO OCC27414 ALL: Error: The command cannot be built"
-puts "TODO OCC27414 ALL: Tcl Exception"
-puts "TODO OCC27414 ALL: TEST INCOMPLETE"
+puts "TODO OCC27414 ALL: Error :  is WRONG because number of"
+puts "TODO OCC27414 ALL: Error : The area of result shape is"
+puts "TODO OCC27414 ALL: Error : The volume of result shape is"
 
 restore [locate_data_file bug26917_dom-8092.t6c1_trim5_with_faces.brep] c
 
index f84299b5160cb8b202b5eec5c241fbfff043d8ca..e1677e64d6a88d7311475f2ad6ffb6dc16778d3e 100644 (file)
@@ -4,9 +4,9 @@ offsetparameter 1e-7 c i r
 offsetload s 8
 offsetperform result
 
-checkprops result -v 4.40128e+007 -s 1.81672e+006
+checkprops result -s 1.81645e+06 -v 4.40127e+07
 
 unifysamedom result_unif result
-checknbshapes result_unif -edge 186 -face 64 -shell 1
+checknbshapes result_unif -wire 62 -face 62 -shell 1
 
 checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/XU4 b/tests/offset/shape_type_i_c/XU4
new file mode 100644 (file)
index 0000000..609293a
--- /dev/null
@@ -0,0 +1,17 @@
+puts "============================================================================================="
+puts "0032333: Modeling Algorithms - Empty(wrong) result of offset operation in mode \"Complete\" join type \"Intersection\""
+puts "============================================================================================="
+puts ""
+
+restore [locate_data_file bug32333_Z4_trim.brep] s
+
+offsetparameter 1e-7 c i r
+offsetload s 9.5
+offsetperform result
+
+checkprops result -s 88948.9 -v 1.11587e+06
+
+unifysamedom result_unif result
+checknbshapes result_unif -wire 15 -face 15 -shell 1 -solid 1
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/XU5 b/tests/offset/shape_type_i_c/XU5
new file mode 100644 (file)
index 0000000..e46970e
--- /dev/null
@@ -0,0 +1,31 @@
+puts "TODO CR27414 ALL: Error: operation with offset value 7 has failed"
+puts "TODO CR27414 ALL: Error: operation with offset value 8 has failed"
+puts "TODO CR27414 ALL: Error: operation with offset value 9 has failed"
+puts "TODO CR27414 ALL: Error: operation with offset value 10 has failed"
+puts "TODO CR27414 ALL: Error: operation with offset value 11 has failed"
+puts "TODO CR27414 ALL: Error: operation with offset value 12 has failed"
+puts "TODO CR27414 ALL: Operations with following offset values have failed: 7 8 9 10 11 12"
+puts "TODO CR27414 ALL: Error : The offset cannot be built"
+
+puts "============================================================================================="
+puts "0032333: Modeling Algorithms - Empty(wrong) result of offset operation in mode \"Complete\" join type \"Intersection\""
+puts "============================================================================================="
+puts ""
+
+# This is a simplified version of XZ7 case
+
+restore [locate_data_file bug32333_178_trim4.brep] s
+
+set ref_values { { 94323.2 1.42329e+06 14 14 } \
+                 { 98288.3 1.51959e+06 14 14 } \
+                 { 102311  1.61989e+06 14 14 } \
+                 { 106392  1.72423e+06 14 14 } \
+                 { 110531  1.83269e+06 14 14 } \
+                 { 114728  1.94532e+06 14 14 } }
+
+perform_offset_increasing s 7 12 1 $ref_values
+
+#copy r10 result
+#copy r10_unif result_unif
+
+#checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
index d78a593eb033961a8782af58c3c4be75a0d46311..32a76b7194a763ec75c6b7beb49e49ce87bee1fa 100644 (file)
@@ -1,7 +1,4 @@
-puts "TODO CR32333 ALL: Error : The area of result shape is"
-puts "TODO CR32333 ALL: Error : The command is not valid."
-puts "TODO CR32333 ALL: Error : The volume of result shape is"
-puts "TODO CR32333 ALL: Error :  is WRONG because number of"
+puts "TODO CR27414 ALL: Error :  is WRONG because number of"
 
 puts "============================================================================================="
 puts "0032088: Modeling Algorithms - Empty result of offset operation in mode \"Complete\" join type \"Intersection\""
@@ -17,6 +14,6 @@ offsetperform result
 checkprops result -s 3.1312e+06 -v 5.77267e+07
 
 unifysamedom result_unif result
-checknbshapes result_unif -wire 492 -face 492 -shell 1 -solid 1
+checknbshapes result_unif -wire 491 -face 492 -shell 1 -solid 1
 
 checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
index 51160a7074d56f268640af8d6e556c24423b9f7e..be307a8570ea6ee089ddd75309a7f30d8f4c88f7 100644 (file)
@@ -1,7 +1,3 @@
-puts "TODO OCC32333 ALL: Error: The command cannot be built"
-puts "TODO OCC32333 ALL: gives an empty result"
-puts "TODO OCC32333 ALL: TEST INCOMPLETE"
-
 puts "============================================================================================="
 puts "0032088: Modeling Algorithms - Empty result of offset operation in mode \"Complete\" join type \"Intersection\""
 puts "============================================================================================="
diff --git a/tests/offset/shape_type_i_c/XY9 b/tests/offset/shape_type_i_c/XY9
new file mode 100644 (file)
index 0000000..7c06e96
--- /dev/null
@@ -0,0 +1,29 @@
+puts "============================================================================================="
+puts "0032333: Modeling Algorithms - Empty(wrong) result of offset operation in mode \"Complete\" join type \"Intersection\""
+puts "============================================================================================="
+puts ""
+
+restore [locate_data_file bug32333_ZU6_trim.brep] s
+
+set ref_values { { 154279 1.16809e+06 31 31 } \
+                 { 159804 1.32512e+06 31 31 } \
+                 { 165387 1.48771e+06 31 31 } \
+                 { 171028 1.65592e+06 31 31 } \
+                 { 148419 1.82979e+06 29 29 } \
+                 { 132204 1.98042e+06 17 17 } \
+                 { 136267 2.11465e+06 17 17 } \
+                 { 125291 2.25298e+06 13 13 } \
+                 { 129494 2.38037e+06 13 13 } \
+                 { 133767 2.51199e+06 13 13 } \
+                 { 138109 2.64793e+06 13 13 } \
+                 { 142522 2.78824e+06 13 13 } \
+                 { 147004 2.93299e+06 13 13 } \
+                 { 151557 3.08227e+06 13 13 } \
+                 { 156179 3.23613e+06 13 13 } }
+
+perform_offset_increasing s 1 15 1 $ref_values
+
+copy r10 result
+copy r10_unif result_unif
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/XZ3 b/tests/offset/shape_type_i_c/XZ3
new file mode 100644 (file)
index 0000000..263dde8
--- /dev/null
@@ -0,0 +1,30 @@
+puts "TODO CR27414 ALL: Error: number of wire entities in the result"
+puts "TODO CR27414 ALL: Error: number of face entities in the result"
+puts "TODO CR27414 ALL: Error: operation with offset value 9 has failed"
+puts "TODO CR27414 ALL: Error: operation with offset value 10 has failed"
+puts "TODO CR27414 ALL: Operations with following offset values have failed: 9 10"
+
+puts "============================================================================================="
+puts "0032333: Modeling Algorithms - Empty(wrong) result of offset operation in mode \"Complete\" join type \"Intersection\""
+puts "============================================================================================="
+puts ""
+
+restore [locate_data_file bug32333_172.brep] s
+
+set ref_values { { 2.68545e+06  6.72361e+07 386 386 } \
+                 { 2.69691e+06  6.99355e+07 330 330 } \
+                 { 2.73363e+06  7.26508e+07 330 330 } \
+                 { 2.74228e+06  7.54028e+07 166 166 } \
+                 { 2.78873e+06  7.81683e+07 166 166 } \
+                 { 2.82923e+06  8.09803e+07 106 106 } \
+                 { 2.88058e+06  8.38352e+07 106 106 } \
+                 { 2.93204e+06  8.67414e+07 106 106 } \
+                 { 2.65427e+06  8.95363e+07 6   6   } \
+                 { 2.69318e+06  9.22106e+07 6   6   } }
+
+perform_offset_increasing s 1 10 1 $ref_values
+
+copy r5 result
+copy r5_unif result_unif
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/XZ4 b/tests/offset/shape_type_i_c/XZ4
new file mode 100644 (file)
index 0000000..bef4dd7
--- /dev/null
@@ -0,0 +1,30 @@
+puts "TODO CR27414 ALL: Error: number of wire entities in the result"
+puts "TODO CR27414 ALL: Error: number of face entities in the result"
+puts "TODO CR27414 ALL: Error: operation with offset value 9 has failed"
+puts "TODO CR27414 ALL: Error: operation with offset value 10 has failed"
+puts "TODO CR27414 ALL: Operations with following offset values have failed: 9 10"
+
+puts "============================================================================================="
+puts "0032333: Modeling Algorithms - Empty(wrong) result of offset operation in mode \"Complete\" join type \"Intersection\""
+puts "============================================================================================="
+puts ""
+
+restore [locate_data_file bug32333_172_trim1.brep] s
+
+set ref_values { { 171093 2.538e+06   42 42 } \
+                 { 169448 2.70883e+06 41 41 } \
+                 { 174262 2.88068e+06 41 41 } \
+                 { 176065 3.05738e+06 25 25 } \
+                 { 181589 3.2362e+06  25 25 } \
+                 { 185420 3.42058e+06 17 17 } \
+                 { 191400 3.60898e+06 17 17 } \
+                 { 197447 3.8034e+06  17 17 } \
+                { 175027 3.98979e+06 11 11 } \
+                { 179953 4.16727e+06 11 11 } }
+
+perform_offset_increasing s 1 10 1 $ref_values
+
+copy r5 result
+copy r5_unif result_unif
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/XZ5 b/tests/offset/shape_type_i_c/XZ5
new file mode 100644 (file)
index 0000000..479f7f8
--- /dev/null
@@ -0,0 +1,27 @@
+puts "TODO CR27414 ALL: Error: operation with offset value 9 has failed"
+puts "TODO CR27414 ALL: Operations with following offset values have failed: 9"
+
+puts "============================================================================================="
+puts "0032333: Modeling Algorithms - Empty(wrong) result of offset operation in mode \"Complete\" join type \"Intersection\""
+puts "============================================================================================="
+puts ""
+
+restore [locate_data_file bug32333_172_trim2.brep] s
+
+set ref_values { { 82542.8 820795       18 18 } \
+                 { 82089.5 903148       19 19 } \
+                 { 86737.5 987555       19 19 } \
+                 { 91176.7 1.07665e+06  15 15 } \
+                 { 95898.3 1.17018e+06  15 15 } \
+                 { 100690  1.26847e+06  15 15 } \
+                 { 105551  1.37158e+06  15 15 } \
+                 { 110483  1.47959e+06  15 15 } \
+                 { 98501.1 1.58422e+06  5  5  } \
+                 { 102414  1.68468e+06  5  5  } }
+
+perform_offset_increasing s 1 10 1 $ref_values
+
+copy r5 result
+copy r5_unif result_unif
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/XZ6 b/tests/offset/shape_type_i_c/XZ6
new file mode 100644 (file)
index 0000000..fe1a690
--- /dev/null
@@ -0,0 +1,21 @@
+puts "============================================================================================="
+puts "0032333: Modeling Algorithms - Empty(wrong) result of offset operation in mode \"Complete\" join type \"Intersection\""
+puts "============================================================================================="
+puts ""
+
+restore [locate_data_file bug32333_178.brep] s
+
+set ref_values { { 6.2988e+06  1.0009e+08  1590 1590 } \
+                 { 6.46295e+06 1.12852e+08 1556 1556 } \
+                 { 6.59935e+06 1.25914e+08 1585 1570 } \
+                 { 5.67319e+06 1.38166e+08 552  552  } \
+                 { 5.52249e+06 1.49358e+08 260  260  } \
+                 { 5.72672e+06 1.60607e+08 260  260  } \
+                 { 4.90877e+06 1.71755e+08 44   44   } }
+
+perform_offset_increasing s 1 13 2 $ref_values
+
+copy r5 result
+copy r5_unif result_unif
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/XZ7 b/tests/offset/shape_type_i_c/XZ7
new file mode 100644 (file)
index 0000000..54ed10b
--- /dev/null
@@ -0,0 +1,37 @@
+puts "TODO CR27414 ALL: Error: operation with offset value 7 has failed"
+puts "TODO CR27414 ALL: Error: operation with offset value 8 has failed"
+puts "TODO CR27414 ALL: Error: operation with offset value 9 has failed"
+puts "TODO CR27414 ALL: Error: operation with offset value 10 has failed"
+puts "TODO CR27414 ALL: Error: operation with offset value 11 has failed"
+puts "TODO CR27414 ALL: Error: operation with offset value 12 has failed"
+puts "TODO CR27414 ALL: Operations with following offset values have failed: 7 8 9 10 11 12"
+
+puts "============================================================================================="
+puts "0032333: Modeling Algorithms - Empty(wrong) result of offset operation in mode \"Complete\" join type \"Intersection\""
+puts "============================================================================================="
+puts ""
+
+restore [locate_data_file bug32333_178_trim1.brep] s
+
+set ref_values { { 237838 3.74252e+06 61 61 } \
+                 { 241858 3.98236e+06 61 61 } \
+                 { 245948 4.22626e+06 59 59 } \
+                 { 250116 4.47428e+06 59 59 } \
+                 { 245191 4.72003e+06 60 60 } \
+                 { 236043 4.96659e+06 29 29 } \
+                 { 241534 5.20537e+06 25 25 } \
+                 { 245656 5.44968e+06 17 17 } \
+                 { 251925 5.69846e+06 17 17 } \
+                 { 258263 5.95355e+06 17 17 } \
+                 { 264668 6.21501e+06 17 17 } \
+                 { 271141 6.48291e+06 17 17 } \
+                 { 243904 6.74052e+06 9  9 } \
+                 { 249735 6.98734e+06 9  9 } \
+                 { 255633 7.24002e+06 9  9 } } 
+
+perform_offset_increasing s 1 15 1 $ref_values
+
+copy r5 result
+copy r5_unif result_unif
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/XZ8 b/tests/offset/shape_type_i_c/XZ8
new file mode 100644 (file)
index 0000000..3c86b6e
--- /dev/null
@@ -0,0 +1,29 @@
+puts "============================================================================================="
+puts "0032333: Modeling Algorithms - Empty(wrong) result of offset operation in mode \"Complete\" join type \"Intersection\""
+puts "============================================================================================="
+puts ""
+
+restore [locate_data_file bug32333_178_trim2.brep] s
+
+set ref_values { { 72863.6 1.02754e+06 24 24 } \
+                 { 75700.8 1.10182e+06 24 24 } \
+                 { 78584.1 1.17895e+06 24 24 } \
+                 { 81513.2 1.259e+06   24 24 } \
+                 { 84488.3 1.342e+06   24 24 } \
+                 { 87509.3 1.42799e+06 24 24 } \
+                 { 90576.3 1.51703e+06 24 24 } \
+                 { 91698.4 1.60916e+06 16 16 } \
+                 { 94791   1.7024e+06  16 16 } \
+                 { 97929.5 1.79876e+06 16 16 } \
+                 { 101114  1.89827e+06 16 16 } \
+                 { 104344  2.001e+06   16 16 } \
+                 { 107621  2.10698e+06 16 16 } \
+                 { 110943  2.21626e+06 16 16 } \
+                 { 114311  2.32888e+06 16 16 } }
+
+perform_offset_increasing s 1 15 1 $ref_values
+
+copy r5 result
+copy r5_unif result_unif
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/XZ9 b/tests/offset/shape_type_i_c/XZ9
new file mode 100644 (file)
index 0000000..6e29048
--- /dev/null
@@ -0,0 +1,17 @@
+puts "============================================================================================="
+puts "0032333: Modeling Algorithms - Empty(wrong) result of offset operation in mode \"Complete\" join type \"Intersection\""
+puts "============================================================================================="
+puts ""
+
+restore [locate_data_file bug32333_178_trim3.brep] s
+
+offsetparameter 1e-7 c i r
+offsetload s 15
+offsetperform result
+
+checkprops result -s 117600 -v 2.73811e+06
+
+unifysamedom result_unif result
+checknbshapes result_unif -wire 7 -face 7 -shell 1 -solid 1
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
index 708afe4351fd000153d9cb2ef2a592daa59cdd19..f4c74d6e70bbd94121e6eecc8583dc1b27da017c 100644 (file)
@@ -1,7 +1,10 @@
 restore [locate_data_file bug26917_M2_trim4.brep] s
 
-OFFSETSHAPE 8 {} $calcul $type
+offsetparameter 1e-7 c i r
+offsetload s 8
+offsetperform result
 
-checkprops result -v 4.65244e+006
+checkprops result -s 279365 -v 4.65244e+06
 
-checknbshapes result -shell 1
+unifysamedom result_unif result
+checknbshapes result_unif -wire 72 -face 72 -shell 1 -solid 1
index 63cfa23845aecadaea3635a99e1fe4c988e6601d..b49bd979d023817fffc2c3b1f8a93b261965825a 100644 (file)
@@ -1,10 +1,13 @@
-puts "TODO CR27414 ALL: Error : The area of result shape is"
-puts "TODO CR27414 ALL: Error : The volume of result shape is"
+puts "TODO OCC27414 ALL: Error :  is WRONG because number of"
+puts "TODO OCC27414 ALL: Error : The area of result shape is"
+puts "TODO OCC27414 ALL: Error : The volume of result shape is"
+puts "TODO OCC27414 ALL: Error: bsection of the result and s is not equal to zero"
 
 restore [locate_data_file bug26917_M2_trim22.brep] s
 
 OFFSETSHAPE 8 {} $calcul $type
 
-checkprops result -v 1.1318e+006 -s 69137.2
+checkprops result -s 69299.9 -v 1.08094e+06 -deps 1.e-3
 
-checknbshapes result -shell 1
+unifysamedom result_unif result
+checknbshapes result_unif -wire 19 -face 19 -shell 1 -solid 1
index ad84f9346c3018b20254d7132d2cd240af70fe03..39ac3f62cbc61eef275dea85225b7a7d112c5346 100644 (file)
@@ -1,11 +1,12 @@
-puts "TODO OCC27414 ALL: Error: The command cannot be built"
-puts "TODO OCC27414 ALL: gives an empty result"
-puts "TODO OCC27414 ALL: TEST INCOMPLETE"
+puts "TODO OCC27414 ALL: Error :  is WRONG because number of"
+puts "TODO OCC27414 ALL: Error : The area of result shape is"
+puts "TODO OCC27414 ALL: Error : The volume of result shape is"
 
 restore [locate_data_file bug26917_M2_trim35.brep] s
 
 OFFSETSHAPE 8 {} $calcul $type
 
-checkprops result -v 0
+checkprops result -s 30085.9 -v 282977 -deps 1.e-3
 
-checknbshapes result -shell 1
+unifysamedom result_unif result
+checknbshapes result_unif -wire 9 -face 9 -shell 1 -solid 1
index 22b45bf1ad506221dd1f7945b96114a14517f371..ce3362e29a3debf92cbcba291bf13a2a3da2ec0b 100755 (executable)
@@ -1,11 +1,12 @@
-puts "TODO OCC27414 ALL: Error: The command cannot be built"
-puts "TODO OCC27414 ALL: gives an empty result"
-puts "TODO OCC27414 ALL: TEST INCOMPLETE"
+puts "TODO OCC27414 ALL: Error :  is WRONG because number of"
+puts "TODO OCC27414 ALL: Error : The area of result shape is"
+puts "TODO OCC27414 ALL: Error : The volume of result shape is"
 
 restore [locate_data_file bug26917_M2_trim9.brep] s
 
 OFFSETSHAPE 15  {} $calcul $type
 
-checkprops result -s 0 -v 0
+checkprops result -s 29576.6 -v 276693
 
-checknbshapes result -shell 1
+unifysamedom result_unif result
+checknbshapes result_unif -wire 16 -face 16 -shell 1 -solid 1
index 66745247b037e3d939a464e4c12740a4e6e32978..2e963d6a97bc640819ff2aec52da73a34a2335b0 100644 (file)
@@ -21,7 +21,7 @@ restore [locate_data_file bug31148_plate_split.brep] s
 
 perform_offset_multi_with_ref r0_01 s 0 {6 10 14} {1 5 1} {464 244 26 26} 1; # BAD (null shape)
 perform_offset_multi_with_ref r0_02 s 0 {9 11} {5 5} {448 244 24 23} 1; # BAD (filled part)
-perform_offset_multi_with_ref r0_03 s 0 {6 9 11 14} {1 5 5 1} {464 268 36 35} 1; # BAD (mostly removed)
+perform_offset_multi_with_ref r0_03 s 0 {6 9 11 14} {1 5 5 1} {464 268 36 35} 1; # BAD (internal part is filled)
 perform_offset_multi_with_ref r0_04 s 0 {8 10 12} {5 5 5} {464 276 22 20} 1; # BAD (out of borders)
 perform_offset_multi_with_ref r0_05 s 0 {6 8 10 12 14 } {1 5 5 5 1} {464 292 30 28} 1
 perform_offset_multi_with_ref r0_06 s 0 {7 9 11 13} {1 3 3 1} {424 236 28 27} 1