0025242: Wrong result of cut operation.
authorpkv <pkv@opencascade.com>
Thu, 25 Sep 2014 09:30:35 +0000 (13:30 +0400)
committerbugmaster <bugmaster@opencascade.com>
Thu, 25 Sep 2014 11:58:10 +0000 (15:58 +0400)
1. class BOPDS_Iterator
method:
void BOPDS_Iterator::Intersect()
The ttreatment of solid/* interferences has been added.

2 class BOPAlgo_PaveFiller
protected methods:
void BOPAlgo_PaveFiller::PerformVZ()
void BOPAlgo_PaveFiller::PerformEZ()
void BOPAlgo_PaveFiller::PerformFZ()
void BOPAlgo_PaveFiller::PerformZZ()
has been added.
The methods are to Compute
Vertex/Solid
Edge/Solid
Face/Solid
Solid/Solid
interferences.

3. class BOPAlgo_PaveFiller
protected method:
void BOPAlgo_PaveFiller::PerformFF()
Empty interferences has not been added in the interferences' table

4. class BOPAlgo_CheckerSI
protected methods:
void BOPAlgo_CheckerSI::PerformVZ()
void BOPAlgo_CheckerSI:PerformEZ()
void BOPAlgo_CheckerSI::PerformFZ()
void BOPAlgo_CheckerSI::PerformZZ()
has been removed.

5. class BOPAlgo_BOP
protected method:
void BOPAlgo_BOP::BuildRC()
void BOPAlgo_BOP::BuildSolid()
changed to treat non-interferred solids and keep it in the result as they were

Test case for issue #25242

src/BOPAlgo/BOPAlgo_BOP.cxx
src/BOPAlgo/BOPAlgo_CheckerSI.cdl
src/BOPAlgo/BOPAlgo_CheckerSI.cxx
src/BOPAlgo/BOPAlgo_CheckerSI_1.cxx [deleted file]
src/BOPAlgo/BOPAlgo_PaveFiller.cdl
src/BOPAlgo/BOPAlgo_PaveFiller.cxx
src/BOPAlgo/BOPAlgo_PaveFiller_10.cxx [new file with mode: 0644]
src/BOPAlgo/BOPAlgo_PaveFiller_6.cxx
src/BOPAlgo/FILES
src/BOPDS/BOPDS_Iterator.cxx
tests/bugs/modalg_5/bug25242 [new file with mode: 0644]

index b616d2c..c8e7a75 100644 (file)
 
 #include <BRep_Tool.hxx>
 #include <NCollection_IncAllocator.hxx>
+//
+#include <BOPTools_Set.hxx>
+#include <BOPTools_SetMapHasher.hxx>
+#include <NCollection_DataMap.hxx>
+
+typedef NCollection_DataMap  
+  <BOPTools_Set, 
+  TopoDS_Shape, 
+  BOPTools_SetMapHasher> BOPTools_DataMapOfSetShape; 
+//
+typedef BOPTools_DataMapOfSetShape::Iterator 
+  BOPTools_DataMapIteratorOfDataMapOfSetShape; 
 
 static
   TopAbs_ShapeEnum TypeToExplore(const Standard_Integer theDim);
@@ -479,7 +491,10 @@ void BOPAlgo_BOP::BuildRC()
   BRep_Builder aBB;
   TopExp_Explorer aExp;
   BOPCol_DataMapOfShapeShape aDMSSA;
-  BOPCol_ListIteratorOfListOfShape aItLS, aItIm;
+  BOPCol_ListIteratorOfListOfShape aItLS, aItIm; 
+  Standard_Boolean bHasInterf;
+  Standard_Integer iX;
+  BOPTools_DataMapOfSetShape aDMSTS;
   //
   myErrorStatus=0;
   //
@@ -531,6 +546,17 @@ void BOPAlgo_BOP::BuildRC()
       for (; aExp.More(); aExp.Next()) {
         const TopoDS_Shape aSIm=aExp.Current();
         aDMSSA.Bind(aSIm, aSIm);
+        if (aTmin==TopAbs_SOLID) {
+          iX=myDS->Index(aSIm);
+          bHasInterf=myDS->HasInterf(iX);
+          if (!bHasInterf) {
+            BOPTools_Set aST;
+            //
+            aST.Add(aSIm, TopAbs_FACE);
+            //
+            aDMSTS.Bind(aST, aSIm);
+          }
+        }
       }
     }
   } //for (; aItLS.More(); aItLS.Next())
@@ -569,7 +595,7 @@ void BOPAlgo_BOP::BuildRC()
           }
         }
       }
-    }
+    }// if (myImages.IsBound(aST)){
     else {
       aExp.Init(aST, aTmin);
       for (; aExp.More(); aExp.Next()) {
@@ -587,10 +613,32 @@ void BOPAlgo_BOP::BuildRC()
             const TopoDS_Shape& aSImA=aDMSSA.Find(aSIm);
             aBB.Add(aC, aSImA);
           }
+          else {
+             if (aTmin==TopAbs_SOLID) {
+               BOPTools_Set aST;
+               //
+               aST.Add(aSIm, TopAbs_FACE);
+               //
+               if (aDMSTS.IsBound(aST)) {
+                 const TopoDS_Shape& aSImA=aDMSTS.Find(aST);
+                 aBB.Add(aC, aSImA);
+               }
+             }
+          }
         }
         else {// ie cut or cut21
           if (!bIsBound) {
-            aBB.Add(aC, aSIm);
+            if (aTmin==TopAbs_SOLID) {
+              BOPTools_Set aST;
+              //
+              aST.Add(aSIm, TopAbs_FACE);
+              //
+              bIsBound=aDMSTS.IsBound(aST); 
+            }
+            //
+            if (!bIsBound) {
+              aBB.Add(aC, aSIm);
+            }
           }
         }
       }
@@ -739,7 +787,8 @@ void BOPAlgo_BOP::BuildShape()
 //=======================================================================
 void BOPAlgo_BOP::BuildSolid()
 {
-  Standard_Integer i, aNbF, aNbSx, iX, iErr;
+  Standard_Boolean bHasInterf, bHasSharedFaces;
+  Standard_Integer i, aNbF, aNbSx, iX, iErr, aNbZ;
   TopAbs_Orientation aOr, aOr1;
   TopoDS_Iterator aIt;
   TopoDS_Shape aRC;
@@ -749,13 +798,73 @@ void BOPAlgo_BOP::BuildSolid()
   BOPCol_IndexedDataMapOfShapeListOfShape aMFS, aMEF;
   BOPCol_ListIteratorOfListOfShape aItLS;
   BOPCol_ListOfShape aSFS;
-  BOPAlgo_BuilderSolid aSB;
+  BOPAlgo_BuilderSolid aSB; 
+  BOPCol_MapOfShape aMSA, aMZ;
+  BOPTools_DataMapOfSetShape aDMSTS;
+  BOPTools_DataMapIteratorOfDataMapOfSetShape aItDMSTS;
   //
   myErrorStatus=0;
   //
+  // Map of of Solids of Arguments
+  for (i=0; i<2; ++i) {
+    const BOPCol_ListOfShape& aLSA=(i) ? myArguments : myTools;
+    aItLS.Initialize(aLSA);
+    for (; aItLS.More(); aItLS.Next()) {
+      const TopoDS_Shape& aSA=aItLS.Value();
+      aExp.Init(aSA, TopAbs_SOLID);
+      for (; aExp.More(); aExp.Next()) {
+        const TopoDS_Shape& aZA=aExp.Current();
+        aMSA.Add(aZA);
+        //
+        BOPTools::MapShapesAndAncestors(aZA, 
+                                        TopAbs_FACE, 
+                                        TopAbs_SOLID, 
+                                        aMFS);
+      }
+    }
+  }
+  //
+  aNbF=aMFS.Extent();
+  for (i=1; i<aNbF; ++i) {
+    //const TopoDS_Shape& aFA=aMFZA.FindKey(i);
+    const BOPCol_ListOfShape& aLZA=aMFS(i);
+    aNbZ=aLZA.Extent();
+    if (aNbZ > 1) {
+      aItLS.Initialize(aLZA);
+      for(; aItLS.More(); aItLS.Next()) {
+        const TopoDS_Shape& aZA=aItLS.Value();
+        aMZ.Add(aZA);
+      }
+    }
+  }
+  //
+  aMFS.Clear();
+  //
   aIt.Initialize(myRC);
   for (; aIt.More(); aIt.Next()) {
     const TopoDS_Shape& aSx=aIt.Value(); 
+    if (aMSA.Contains(aSx)) {
+      iX=myDS->Index(aSx);
+      bHasInterf=myDS->HasInterf(iX);
+      bHasSharedFaces=aMZ.Contains(aSx);
+      //
+      if (!bHasInterf && !bHasSharedFaces) {
+        // It means that the solid aSx will be added
+        // to the result as is. 
+        // The solid aSx will not participate 
+        // in creation of a new solid(s).
+        BOPTools_Set aST;
+        //
+        aST.Add(aSx, TopAbs_FACE);
+        //
+        if (!aDMSTS.IsBound(aST)) {
+          aDMSTS.Bind(aST, aSx);
+        }
+        
+        continue; 
+      }
+    } 
+    //
     aExp.Init(aSx, TopAbs_FACE);
     for (; aExp.More(); aExp.Next()) {
       const TopoDS_Shape& aFx=aExp.Current();
@@ -783,7 +892,7 @@ void BOPAlgo_BOP::BuildSolid()
         }
       }
     }
-  }
+  } // for (; aIt.More(); aIt.Next()) {
   //faces that will be added in the end;
   BOPCol_ListOfShape aLF, aLFx; 
   // SFS
@@ -845,6 +954,13 @@ void BOPAlgo_BOP::BuildSolid()
     const TopoDS_Shape& aSR=aItLS.Value();
     aBB.Add(aRC, aSR);
   }
+  //
+  aItDMSTS.Initialize(aDMSTS);
+  for (; aItDMSTS.More(); aItDMSTS.Next()) {
+    const TopoDS_Shape& aSx=aItDMSTS.Value();
+    aBB.Add(aRC, aSx);
+  }
+  //
   myShape=aRC;
 }
 //=======================================================================
index 57fff35..9578c09 100644 (file)
@@ -65,28 +65,14 @@ is
     PostTreat  (me:out)  
      is protected;       
     ---Purpose: Provides post-treatment actions   
-    
-    PerformVZ(me:out) 
-      is virtual protected; 
-       --Purpose: Computes Vertex/Solid interferences 
-       
-    PerformEZ(me:out) 
-      is virtual protected;  
-      --Purpose: Computes Edge/Solid interferences 
-     
-    PerformFZ(me:out) 
-      is virtual protected;   
-      --Purpose: Computes Face/Solid interferences 
-    PerformZZ(me:out) 
-      is virtual protected;  
-      --Purpose: Computes Solid/Solid interferences 
-  
     PrepareCopy(me:out) 
       is virtual protected;  
      
     PostTreatCopy (me:out)  
      is protected;       
     ---Purpose: Provides post-treatment actions for the copy  
+
  
 fields
     myLevelOfCheck: Integer from Standard is protected;
index 02693e4..6c314de 100644 (file)
@@ -146,26 +146,6 @@ void BOPAlgo_CheckerSI::Perform()
     BOPAlgo_PaveFiller::Perform();
     iErr=myErrorStatus; 
     //
-    PerformVZ();
-    if (myErrorStatus) {
-      iErr=myErrorStatus; 
-    }
-    //
-    PerformEZ();
-    if (myErrorStatus) {
-      iErr=myErrorStatus; 
-    }
-    //
-    PerformFZ();
-    if (myErrorStatus) {
-      iErr=myErrorStatus; 
-    }
-    //
-    PerformZZ();
-    if (myErrorStatus) {
-      iErr=myErrorStatus; 
-    }
-    // 
     PostTreat();
     if (myErrorStatus) {
       iErr=myErrorStatus; 
diff --git a/src/BOPAlgo/BOPAlgo_CheckerSI_1.cxx b/src/BOPAlgo/BOPAlgo_CheckerSI_1.cxx
deleted file mode 100644 (file)
index 74b8f02..0000000
+++ /dev/null
@@ -1,224 +0,0 @@
-// Created by: Peter KURNEV
-// Copyright (c) 2010-2012 OPEN CASCADE SAS
-// Copyright (c) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
-// Copyright (c) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT,
-//                         EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-//
-// This file is part of Open CASCADE Technology software library.
-//
-// This library is free software; you can redistribute it and/or modify it under
-// the terms of the GNU Lesser General Public License version 2.1 as published
-// by the Free Software Foundation, with special exception defined in the file
-// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-// distribution for complete text of the license and disclaimer of any warranty.
-//
-// Alternatively, this file may be used under the terms of Open CASCADE
-// commercial license or contractual agreement.
-
-#include <BOPAlgo_CheckerSI.ixx>
-
-#include <BOPDS_DS.hxx>
-#include <BOPDS_IteratorSI.hxx>
-#include <IntTools_Context.hxx>
-
-#include <BOPDS_Interf.hxx>
-#include <TopoDS_Solid.hxx>
-#include <BRepClass3d_SolidClassifier.hxx>
-#include <TopoDS_Vertex.hxx>
-#include <gp_Pnt.hxx>
-#include <TopAbs_State.hxx>
-#include <BRep_Tool.hxx>
-#include <BOPDS_VectorOfInterfVZ.hxx>
-
-
-//=======================================================================
-//function : PerformVZ
-//purpose  : 
-//=======================================================================
-void BOPAlgo_CheckerSI::PerformVZ()
-{
-  Standard_Boolean bJustAdd;
-  Standard_Integer iSize, nV, nZ, i;
-  Standard_Real aTol;
-  gp_Pnt aPV;
-  TopAbs_State aState;
-  //
-  myErrorStatus=0;
-  //
-  myIterator->Initialize(TopAbs_VERTEX, TopAbs_SOLID);
-  iSize=myIterator->ExpectedLength();
-  if (!iSize) {
-    return; 
-  }
-  //
-  BOPDS_VectorOfInterfVZ& aVZs=myDS->InterfVZ();
-  aVZs.SetStartSize(iSize);
-  aVZs.SetIncrement(iSize);
-  aVZs.Init();
-  //
-  for (; myIterator->More(); myIterator->Next()) {
-    myIterator->Value(nV, nZ, bJustAdd);
-    if(bJustAdd) {
-      continue;
-    }
-    //
-    const BOPDS_ShapeInfo& aSIV=myDS->ShapeInfo(nV);
-    const BOPDS_ShapeInfo& aSIZ=myDS->ShapeInfo(nZ);
-    //
-    const TopoDS_Vertex& aV=*((TopoDS_Vertex*)&aSIV.Shape()); 
-    const TopoDS_Solid& aZ=*((TopoDS_Solid*)&aSIZ.Shape()); 
-    //
-    BRepClass3d_SolidClassifier& aSC=myContext->SolidClassifier(aZ);
-    //
-    aPV=BRep_Tool::Pnt(aV);
-    aTol=BRep_Tool::Tolerance(aV);
-    //
-    aSC.Perform(aPV, aTol);
-    //
-    aState=aSC.State();
-    if (aState==TopAbs_IN)  {
-      i=aVZs.Append()-1;
-      BOPDS_InterfVZ& aVZ=aVZs(i);
-      aVZ.SetIndices(nV, nZ);
-      //
-      myDS->AddInterf(nV, nZ);
-    }
-  }
-  //
-}
-//=======================================================================
-//function : PerformEZ
-//purpose  : 
-//=======================================================================
-void BOPAlgo_CheckerSI::PerformEZ()
-{
-  Standard_Boolean bJustAdd, bHasInterf;
-  Standard_Integer iSize, nE, nZ, i;
-  //
-  myErrorStatus=0;
-  //
-  myIterator->Initialize(TopAbs_EDGE, TopAbs_SOLID);
-  iSize=myIterator->ExpectedLength();
-  if (!iSize) {
-    return; 
-  }
-  //
-  BOPDS_VectorOfInterfEZ& aEZs=myDS->InterfEZ();
-  aEZs.SetStartSize(iSize);
-  aEZs.SetIncrement(iSize);
-  aEZs.Init();
-  //
-  for (; myIterator->More(); myIterator->Next()) {
-    myIterator->Value(nE, nZ, bJustAdd);
-    if(bJustAdd) {
-      continue;
-    }
-    //
-    bHasInterf=myDS->HasInterfShapeSubShapes(nE, nZ);
-    if (bHasInterf) {
-      continue;
-    }
-    //
-    bHasInterf=myDS->HasInterfShapeSubShapes(nZ, nE);
-    if (!bHasInterf) {
-      continue;
-    }
-    //
-    i=aEZs.Append()-1;
-    BOPDS_InterfEZ& aEZ=aEZs(i);
-    aEZ.SetIndices(nE, nZ);
-    //
-    myDS->AddInterf(nE, nZ);
-  }
-}
-//=======================================================================
-//function : PerformFZ
-//purpose  : 
-//=======================================================================
-void BOPAlgo_CheckerSI::PerformFZ()
-{
-  Standard_Boolean bJustAdd, bHasInterf;
-  Standard_Integer iSize, nF, nZ, i;
-  //
-  myErrorStatus=0;
-  //
-  myIterator->Initialize(TopAbs_FACE, TopAbs_SOLID);
-  iSize=myIterator->ExpectedLength();
-  if (!iSize) {
-    return; 
-  }
-  //
-  BOPDS_VectorOfInterfFZ& aFZs=myDS->InterfFZ();
-  aFZs.SetStartSize(iSize);
-  aFZs.SetIncrement(iSize);
-  aFZs.Init();
-  //
-  for (; myIterator->More(); myIterator->Next()) {
-    myIterator->Value(nF, nZ, bJustAdd);
-    if(bJustAdd) {
-      continue;
-    }
-    //
-    bHasInterf=myDS->HasInterfShapeSubShapes(nF, nZ);
-    if (bHasInterf) {
-      continue;
-    }
-    //
-    bHasInterf=myDS->HasInterfShapeSubShapes(nZ, nF);
-    if (!bHasInterf) {
-      continue;
-    }
-    //
-    i=aFZs.Append()-1;
-    BOPDS_InterfFZ& aFZ=aFZs(i);
-    aFZ.SetIndices(nF, nZ);
-    //
-    myDS->AddInterf(nF, nZ);
-  }
-}
-//=======================================================================
-//function : PerformZZ
-//purpose  : 
-//=======================================================================
-void BOPAlgo_CheckerSI::PerformZZ()
-{
-  Standard_Boolean bJustAdd, bHasInterf, bFlag;
-  Standard_Integer iSize, nZ1, nZ, i;
-  //
-  myErrorStatus=0;
-  //
-  myIterator->Initialize(TopAbs_SOLID, TopAbs_SOLID);
-  iSize=myIterator->ExpectedLength();
-  if (!iSize) {
-    return; 
-  }
-  //
-  BOPDS_VectorOfInterfZZ& aZZs=myDS->InterfZZ();
-  aZZs.SetStartSize(iSize);
-  aZZs.SetIncrement(iSize);
-  aZZs.Init();
-  //
-  bFlag=Standard_False;
-  //
-  for (; myIterator->More(); myIterator->Next()) {
-    myIterator->Value(nZ1, nZ, bJustAdd);
-    if(bJustAdd) {
-      continue;
-    }
-    //
-    bHasInterf=myDS->HasInterfShapeSubShapes(nZ, nZ1, bFlag);
-    if (!bHasInterf) {
-      bHasInterf=myDS->HasInterfShapeSubShapes(nZ1, nZ, bFlag);
-    }
-    if (!bHasInterf) {
-      continue; 
-    }
-    //
-    i=aZZs.Append()-1;
-    BOPDS_InterfZZ& aZZ=aZZs(i);
-    aZZ.SetIndices(nZ1, nZ);
-    //
-    myDS->AddInterf(nZ1, nZ);
-  }
-}
index 846c110..5e64364 100644 (file)
@@ -127,7 +127,23 @@ is
     PerformFF(me:out) 
       is virtual protected;
      
-    
+    --modified by NIZNHY-PKV Fri Sep 12 07:05:37 2014f 
+    PerformVZ(me:out) 
+      is virtual protected; 
+       --Purpose: Computes Vertex/Solid interferences 
+       
+    PerformEZ(me:out) 
+      is virtual protected;  
+      --Purpose: Computes Edge/Solid interferences 
+     
+    PerformFZ(me:out) 
+      is virtual protected;   
+      --Purpose: Computes Face/Solid interferences 
+    PerformZZ(me:out) 
+      is virtual protected;  
+      --Purpose: Computes Solid/Solid interferences  
+    --modified by NIZNHY-PKV Fri Sep 12 07:05:45 2014t 
     TreatVerticesEE(me:out) 
       is protected; 
 
index 37fdae1..a4962d3 100644 (file)
@@ -243,4 +243,27 @@ void BOPAlgo_PaveFiller::PerformInternal()
   if (myErrorStatus) {
     return; 
   }
+  //
+  //modified by NIZNHY-PKV Fri Sep 12 07:06:50 2014f
+  // 03
+  PerformVZ();
+  if (myErrorStatus) {
+    return;
+  }
+  // 13
+  PerformEZ();
+  if (myErrorStatus) {
+    return;
+  }
+  // 23
+  PerformFZ();
+  if (myErrorStatus) {
+    return;
+  }
+  // 33
+  PerformZZ();
+  if (myErrorStatus) {
+    return;
+  }
+  //modified by NIZNHY-PKV Fri Sep 12 07:06:52 2014t
 } 
diff --git a/src/BOPAlgo/BOPAlgo_PaveFiller_10.cxx b/src/BOPAlgo/BOPAlgo_PaveFiller_10.cxx
new file mode 100644 (file)
index 0000000..90787bf
--- /dev/null
@@ -0,0 +1,223 @@
+// Created by: Peter KURNEV
+// Copyright (c) 2010-2014 OPEN CASCADE SAS
+// Copyright (c) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (c) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT,
+//                         EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
+//
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
+
+#include <BOPAlgo_PaveFiller.ixx>
+
+#include <gp_Pnt.hxx>
+
+#include <TopAbs_State.hxx>
+
+#include <TopoDS_Vertex.hxx>
+#include <TopoDS_Solid.hxx>
+#include <BRep_Tool.hxx>
+#include <BRepClass3d_SolidClassifier.hxx>
+
+#include <IntTools_Context.hxx>
+
+#include <BOPDS_DS.hxx>
+#include <BOPDS_IteratorSI.hxx>
+#include <BOPDS_Interf.hxx>
+
+//=======================================================================
+//function : PerformVZ
+//purpose  : 
+//=======================================================================
+void BOPAlgo_PaveFiller::PerformVZ()
+{
+  Standard_Boolean bJustAdd;
+  Standard_Integer iSize, nV, nZ, i;
+  Standard_Real aTol;
+  gp_Pnt aPV;
+  TopAbs_State aState;
+  //
+  myErrorStatus=0;
+  //
+  myIterator->Initialize(TopAbs_VERTEX, TopAbs_SOLID);
+  iSize=myIterator->ExpectedLength();
+  if (!iSize) {
+    return; 
+  }
+  //
+  BOPDS_VectorOfInterfVZ& aVZs=myDS->InterfVZ();
+  aVZs.SetStartSize(iSize);
+  aVZs.SetIncrement(iSize);
+  aVZs.Init();
+  //
+  for (; myIterator->More(); myIterator->Next()) {
+    myIterator->Value(nV, nZ, bJustAdd);
+    if(bJustAdd) {
+      continue;
+    }
+    //
+    const BOPDS_ShapeInfo& aSIV=myDS->ShapeInfo(nV);
+    const BOPDS_ShapeInfo& aSIZ=myDS->ShapeInfo(nZ);
+    //
+    const TopoDS_Vertex& aV=*((TopoDS_Vertex*)&aSIV.Shape()); 
+    const TopoDS_Solid& aZ=*((TopoDS_Solid*)&aSIZ.Shape()); 
+    //
+    BRepClass3d_SolidClassifier& aSC=myContext->SolidClassifier(aZ);
+    //
+    aPV=BRep_Tool::Pnt(aV);
+    aTol=BRep_Tool::Tolerance(aV);
+    //
+    aSC.Perform(aPV, aTol);
+    //
+    aState=aSC.State();
+    if (aState==TopAbs_IN)  {
+      i=aVZs.Append()-1;
+      BOPDS_InterfVZ& aVZ=aVZs(i);
+      aVZ.SetIndices(nV, nZ);
+      //
+      myDS->AddInterf(nV, nZ);
+    }
+  }
+}
+//=======================================================================
+//function : PerformEZ
+//purpose  : 
+//=======================================================================
+void BOPAlgo_PaveFiller::PerformEZ()
+{
+   Standard_Boolean bJustAdd, bHasInterf;
+  Standard_Integer iSize, nE, nZ, i;
+  //
+  myErrorStatus=0;
+  //
+  myIterator->Initialize(TopAbs_EDGE, TopAbs_SOLID);
+  iSize=myIterator->ExpectedLength();
+  if (!iSize) {
+    return; 
+  }
+  //
+  BOPDS_VectorOfInterfEZ& aEZs=myDS->InterfEZ();
+  aEZs.SetStartSize(iSize);
+  aEZs.SetIncrement(iSize);
+  aEZs.Init();
+  //
+  for (; myIterator->More(); myIterator->Next()) {
+    myIterator->Value(nE, nZ, bJustAdd);
+    if(bJustAdd) {
+      continue;
+    }
+    //
+    bHasInterf=myDS->HasInterfShapeSubShapes(nE, nZ);
+    if (bHasInterf) {
+      continue;
+    }
+    //
+    bHasInterf=myDS->HasInterfShapeSubShapes(nZ, nE);
+    if (!bHasInterf) {
+      continue;
+    }
+    //
+    i=aEZs.Append()-1;
+    BOPDS_InterfEZ& aEZ=aEZs(i);
+    aEZ.SetIndices(nE, nZ);
+    //
+    myDS->AddInterf(nE, nZ);
+  }
+}
+//=======================================================================
+//function : PerformFZ
+//purpose  : 
+//=======================================================================
+void BOPAlgo_PaveFiller::PerformFZ()
+{
+  Standard_Boolean bJustAdd, bHasInterf;
+  Standard_Integer iSize, nF, nZ, i;
+  //
+  myErrorStatus=0;
+  //
+  myIterator->Initialize(TopAbs_FACE, TopAbs_SOLID);
+  iSize=myIterator->ExpectedLength();
+  if (!iSize) {
+    return; 
+  }
+  //
+  BOPDS_VectorOfInterfFZ& aFZs=myDS->InterfFZ();
+  aFZs.SetStartSize(iSize);
+  aFZs.SetIncrement(iSize);
+  aFZs.Init();
+  //
+  for (; myIterator->More(); myIterator->Next()) {
+    myIterator->Value(nF, nZ, bJustAdd);
+    if(bJustAdd) {
+      continue;
+    }
+    //
+    bHasInterf=myDS->HasInterfShapeSubShapes(nF, nZ);
+    if (bHasInterf) {
+      continue;
+    }
+    //
+    bHasInterf=myDS->HasInterfShapeSubShapes(nZ, nF);
+    if (!bHasInterf) {
+      continue;
+    }
+    //
+    i=aFZs.Append()-1;
+    BOPDS_InterfFZ& aFZ=aFZs(i);
+    aFZ.SetIndices(nF, nZ);
+    //
+    myDS->AddInterf(nF, nZ);
+  }
+}
+//=======================================================================
+//function : PerformZZ
+//purpose  : 
+//=======================================================================
+void BOPAlgo_PaveFiller::PerformZZ()
+{
+  Standard_Boolean bJustAdd, bHasInterf, bFlag;
+  Standard_Integer iSize, nZ1, nZ, i;
+  //
+  myErrorStatus=0;
+  //
+  myIterator->Initialize(TopAbs_SOLID, TopAbs_SOLID);
+  iSize=myIterator->ExpectedLength();
+  if (!iSize) {
+    return; 
+  }
+  //
+  BOPDS_VectorOfInterfZZ& aZZs=myDS->InterfZZ();
+  aZZs.SetStartSize(iSize);
+  aZZs.SetIncrement(iSize);
+  aZZs.Init();
+  //
+  bFlag=Standard_False;
+  //
+  for (; myIterator->More(); myIterator->Next()) {
+    myIterator->Value(nZ1, nZ, bJustAdd);
+    if(bJustAdd) {
+      continue;
+    }
+    //
+    bHasInterf=myDS->HasInterfShapeSubShapes(nZ, nZ1, bFlag);
+    if (!bHasInterf) {
+      bHasInterf=myDS->HasInterfShapeSubShapes(nZ1, nZ, bFlag);
+    }
+    if (!bHasInterf) {
+      continue; 
+    }
+    //
+    i=aZZs.Append()-1;
+    BOPDS_InterfZZ& aZZ=aZZs(i);
+    aZZ.SetIndices(nZ1, nZ);
+    //
+    myDS->AddInterf(nZ1, nZ);
+  }
+}
index 7a5b84f..9807828 100644 (file)
@@ -300,7 +300,9 @@ void BOPAlgo_PaveFiller::PerformFF()
       aNbCurves=aCvsX.Length();
       aNbPoints=aPntsX.Length();
       //
-      myDS->AddInterf(nF1, nF2);
+      if (aNbCurves || aNbPoints) {
+        myDS->AddInterf(nF1, nF2);
+      } 
       //
       iX=aFFs.Append()-1;
       BOPDS_InterfFF& aFF=aFFs(iX);
index 02e84d5..95396c4 100644 (file)
@@ -6,6 +6,8 @@ BOPAlgo_PaveFiller_5.cxx
 BOPAlgo_PaveFiller_6.cxx
 BOPAlgo_PaveFiller_7.cxx
 BOPAlgo_PaveFiller_8.cxx
+BOPAlgo_PaveFiller_9.cxx
+BOPAlgo_PaveFiller_10.cxx
 BOPAlgo_Builder_1.cxx
 BOPAlgo_Builder_2.cxx
 BOPAlgo_Builder_3.cxx
@@ -13,5 +15,5 @@ BOPAlgo_Builder_4.cxx
 BOPAlgo_BOP_1.cxx
 BOPAlgo_WireSplitter_1.cxx
 BOPAlgo_ListOfCheckResult.hxx
-BOPAlgo_CheckerSI_1.cxx
-BOPAlgo_PaveFiller_9.cxx
+
+
index a33ff83..5b240f9 100644 (file)
@@ -278,7 +278,7 @@ void BOPDS_Iterator::Intersect()
   //
   for (i=0; i<aNb; ++i) {
     const BOPDS_ShapeInfo& aSI=myDS->ShapeInfo(i);
-    bFlag=aSI.HasBRep();
+    bFlag=aSI.IsInterfering();
     //
     BOPDS_TSR& aTSR=aVTSR.Append1();
     //
@@ -308,7 +308,7 @@ void BOPDS_Iterator::Intersect()
     for (i=i1; i<=i2; ++i) {
       const BOPDS_ShapeInfo& aSI=myDS->ShapeInfo(i);
       //
-      if (!aSI.HasBRep()){
+      if (!aSI.IsInterfering()){
         continue;
       }
       //
diff --git a/tests/bugs/modalg_5/bug25242 b/tests/bugs/modalg_5/bug25242
new file mode 100644 (file)
index 0000000..2ad7afc
--- /dev/null
@@ -0,0 +1,23 @@
+puts "================"
+puts "OCC25242"
+puts "================"
+puts ""
+#################################
+# Wrong result of cut operation
+#################################
+
+box a 0 0 0 10 10 10
+box b 20 0 0 10 10 10
+
+bfuse r0 a b
+bcut result r0 a
+
+set nb_v_good 8
+set nb_e_good 12
+set nb_w_good 6
+set nb_f_good 6
+set nb_sh_good 1
+set nb_sol_good 1
+set nb_compsol_good 0
+set nb_compound_good 1
+set nb_shape_good 35