]> OCCT Git - occt-copy.git/commitdiff
0024789: BOPAlgo_Builder produces invalid result on planar, conical and spherical...
authoremv <emv@opencascade.com>
Thu, 3 Sep 2020 11:37:29 +0000 (14:37 +0300)
committerbugmaster <bugmaster@opencascade.com>
Fri, 18 Sep 2020 14:46:50 +0000 (17:46 +0300)
BOPAlgo_PaveFiller::MakeBlocks() - Improve Face/Face post treatment procedure by:
* Adding more existing edge for intersection with section edges to resolve all possible intersections.
* Using tree for edges selection.
* Avoiding intersection of the existing edges among themselves.

IntPatch_ImpImpIntersection::CyCyNoGeometric - add more points to wline to make it more smooth.

15 files changed:
src/BOPAlgo/BOPAlgo_PaveFiller.cxx
src/BOPAlgo/BOPAlgo_PaveFiller.hxx
src/BOPAlgo/BOPAlgo_PaveFiller_5.cxx
src/BOPAlgo/BOPAlgo_PaveFiller_6.cxx
src/BOPAlgo/BOPAlgo_WireSplitter_1.cxx
src/BOPTools/BOPTools_AlgoTools.cxx
src/IntPatch/IntPatch_ImpImpIntersection_4.gxx
src/IntTools/IntTools_BeanFaceIntersector.cxx
src/IntTools/IntTools_BeanFaceIntersector.hxx
src/IntTools/IntTools_EdgeFace.cxx
src/IntTools/IntTools_EdgeFace.hxx
tests/boolean/bopfuse_complex/F1
tests/boolean/boptuc_complex/B5
tests/bugs/modalg_7/bug24789 [new file with mode: 0644]
tests/bugs/modalg_7/bug31662

index a12e527c4df1c20cbb2c3fb22e6b2b6f87102565..faf4ce3ee973870aba0c3c2af3e729caf221abcb 100644 (file)
@@ -57,7 +57,8 @@ BOPAlgo_PaveFiller::BOPAlgo_PaveFiller
   BOPAlgo_Algo(theAllocator),
   myFPBDone(1, theAllocator),
   myIncreasedSS(1, theAllocator),
-  myVertsToAvoidExtension(1, theAllocator)
+  myVertsToAvoidExtension(1, theAllocator),
+  myDistances(1, theAllocator)
 {
   myDS = NULL;
   myIterator = NULL;
index b31a11a79df9bfc891a0f2c4ab4431468c66068a..307f2e5031bfe1b10c7ba6d066d8809adeedff1c 100644 (file)
@@ -35,6 +35,7 @@
 #include <BOPDS_PDS.hxx>
 #include <BOPDS_PIterator.hxx>
 #include <BOPDS_VectorOfCurve.hxx>
+#include <BOPTools_BoxTree.hxx>
 #include <IntSurf_ListOfPntOn2S.hxx>
 #include <IntTools_ShrunkRange.hxx>
 #include <NCollection_BaseAllocator.hxx>
@@ -319,7 +320,9 @@ protected:
   //! created the section curve.
   Standard_EXPORT Standard_Boolean IsExistingPaveBlock
     (const Handle(BOPDS_PaveBlock)& thePB, const BOPDS_Curve& theNC,
-     const Standard_Real theTolR3D, const BOPDS_IndexedMapOfPaveBlock& theMPB,
+     const Standard_Real theTolR3D,
+     const BOPDS_IndexedMapOfPaveBlock& theMPB,
+     BOPTools_BoxTree& thePBTree,
      const BOPDS_MapOfPaveBlock& theMPBCommon,
      Handle(BOPDS_PaveBlock)& thePBOut, Standard_Real& theTolNew);
 
@@ -412,6 +415,21 @@ protected:
                                 TColStd_DataMapOfIntegerListOfInteger& aDMVLV,
                                 const Standard_Integer aType = 0);
   
+  //! Adds the existing edges for intersection with section edges
+  //! by checking the possible intersection with the faces comparing
+  //! pre-saved E-F distances with new tolerances.
+  Standard_EXPORT void ProcessExistingPaveBlocks (const Standard_Integer theInt,
+                                                  const Standard_Integer theCur,
+                                                  const Standard_Integer nF1,
+                                                  const Standard_Integer nF2,
+                                                  const TopoDS_Edge& theES,
+                                                  const BOPDS_IndexedMapOfPaveBlock& theMPBOnIn,
+                                                  BOPTools_BoxTree& thePBTree,
+                                                  BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks& theMSCPB,
+                                                  TopTools_DataMapOfShapeInteger& theMVI,
+                                                  BOPDS_ListOfPaveBlock& theLPBC,
+                                                  BOPAlgo_DataMapOfPaveBlockListOfInteger& thePBFacesMap,
+                                                  BOPDS_MapOfPaveBlock& theMPB);
 
   //! Adds the existing edges from the map <theMPBOnIn> which interfere
   //! with the vertices from <theMVB> map to the post treatment of section edges.
@@ -419,12 +437,12 @@ protected:
                                                   const Standard_Integer nF1,
                                                   const Standard_Integer nF2,
                                                   const BOPDS_IndexedMapOfPaveBlock& theMPBOnIn,
+                                                  BOPTools_BoxTree& thePBTree,
                                                   const TColStd_DataMapOfIntegerListOfInteger& theDMBV,
                                                   BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks& theMSCPB,
                                                   TopTools_DataMapOfShapeInteger& theMVI,
                                                   BOPAlgo_DataMapOfPaveBlockListOfInteger& thePBFacesMap,
                                                   BOPDS_MapOfPaveBlock& theMPB);
-  
 
   //! Replaces existing pave block <thePB> with new pave blocks <theLPB>.
   //! The list <theLPB> contains images of <thePB> which were created in
@@ -599,6 +617,22 @@ protected:
   //! Check all edges on the micro status and remove the positive ones
   Standard_EXPORT void RemoveMicroEdges();
 
+  //! Auxiliary structure to hold the edge distance to the face
+  struct EdgeRangeDistance
+  {
+    Standard_Real First;
+    Standard_Real Last;
+    Standard_Real Distance;
+
+    EdgeRangeDistance (const Standard_Real theFirst = 0.0,
+                       const Standard_Real theLast = 0.0,
+                       const Standard_Real theDistance = RealLast())
+      : First (theFirst), Last (theLast), Distance (theDistance)
+    {}
+  };
+
+protected: //! Fields
+
   TopTools_ListOfShape myArguments;
   BOPDS_PDS myDS;
   BOPDS_PIterator myIterator;
@@ -615,6 +649,11 @@ protected:
                                                 //! which has already been extended to cover the real intersection
                                                 //! points, and should not be extended any longer to be put
                                                 //! on a section curve.
+  
+  NCollection_DataMap <BOPDS_Pair,
+                       NCollection_List<EdgeRangeDistance>,
+                       BOPDS_PairMapHasher> myDistances; //!< Map to store minimal distances between shapes
+                                                         //!  which have no real intersections
 
 };
 
index f06e5a5860aac67f7a3ea588983ece4a35f6c46e..550744b742bc227d69b6caf484c9f3019c40ab59 100644 (file)
@@ -300,12 +300,6 @@ void BOPAlgo_PaveFiller::PerformEF()
       continue;
     }
     //
-    const IntTools_SequenceOfCommonPrts& aCPrts=aEdgeFace.CommonParts();
-    aNbCPrts = aCPrts.Length();
-    if (!aNbCPrts) {
-      continue;
-    }
-    //
     aEdgeFace.Indices(nE, nF);
     //
     const TopoDS_Edge& aE=aEdgeFace.Edge();
@@ -313,6 +307,23 @@ void BOPAlgo_PaveFiller::PerformEF()
     //
     aTolE=BRep_Tool::Tolerance(aE);
     aTolF=BRep_Tool::Tolerance(aF);
+    //
+    const IntTools_SequenceOfCommonPrts& aCPrts=aEdgeFace.CommonParts();
+    aNbCPrts = aCPrts.Length();
+    if (!aNbCPrts) {
+      if (aEdgeFace.MinimalDistance() < RealLast() &&
+          aEdgeFace.MinimalDistance() > aTolE + aTolF)
+      {
+        const Handle(BOPDS_PaveBlock)& aPB=aEdgeFace.PaveBlock();
+        aPB->Range(aT1, aT2);
+        NCollection_List<EdgeRangeDistance>* pList = myDistances.ChangeSeek (BOPDS_Pair (nE, nF));
+        if (!pList)
+          pList = myDistances.Bound (BOPDS_Pair (nE, nF), NCollection_List<EdgeRangeDistance>());
+        pList->Append (EdgeRangeDistance (aT1, aT2, aEdgeFace.MinimalDistance()));
+      }
+      continue;
+    }
+    //
     const IntTools_Range& anewSR=aEdgeFace.NewSR();
     Handle(BOPDS_PaveBlock)& aPB=aEdgeFace.PaveBlock();
     //
index e5689c50c9ac980344c9942480fc3d31113c594c..799709a2bf12d4e4fcdddec5f71ac995fdd20e2a 100644 (file)
@@ -38,7 +38,9 @@
 #include <BOPDS_VectorOfPoint.hxx>
 #include <BOPTools_AlgoTools.hxx>
 #include <BOPTools_AlgoTools3D.hxx>
+#include <BOPTools_BoxSelector.hxx>
 #include <BOPTools_Parallel.hxx>
+#include <Bnd_Tools.hxx>
 #include <BRep_Builder.hxx>
 #include <BRep_TEdge.hxx>
 #include <BRep_Tool.hxx>
@@ -500,7 +502,6 @@ void BOPAlgo_PaveFiller::MakeBlocks()
     myDS->SubShapesOnIn(nF1, nF2, aMVOnIn, aMVCommon, aMPBOnIn, aMPBCommon);
     myDS->SharedEdges(nF1, nF2, aLSE, aAllocator);
     //
-    Standard_Boolean bHasRealSectionEdge = Standard_False;
     // 1. Treat Points
     for (j=0; j<aNbP; ++j) {
       TopoDS_Vertex aV;
@@ -573,6 +574,27 @@ void BOPAlgo_PaveFiller::MakeBlocks()
       BOPDS_Curve& aNC=aVC.ChangeValue(j);
       PutClosingPaveOnCurve (aNC);
     }
+    //
+
+    BOPTools_BoxTree aPBTree;
+    {
+      // Fill the tree with boxes of pave blocks ON/IN
+      // Tree will be build on first selection from the tree.
+      const Standard_Integer aNbPB = aMPBOnIn.Extent();
+      aPBTree.SetSize (aNbPB);
+      for (Standard_Integer iPB = 1; iPB <= aNbPB; ++iPB)
+      {
+        const Handle(BOPDS_PaveBlock)& aPB = aMPBOnIn (iPB);
+        if (!aPB->HasEdge())
+          continue;
+
+        if (myDS->ShapeInfo (aPB->OriginalEdge()).HasFlag())
+          continue;
+
+        aPBTree.Add (iPB, Bnd_Tools::Bnd2BVH (myDS->ShapeInfo (aPB->Edge()).Box()));
+      }
+    }
+
     //
     // 3. Make section edges
     for (j=0; j<aNbC; ++j) {
@@ -640,7 +662,7 @@ void BOPAlgo_PaveFiller::MakeBlocks()
           continue;
         }
         //
-        bExist = IsExistingPaveBlock(aPB, aNC, aTolR3D, aMPBOnIn, aMPBCommon, aPBOut, aTolNew);
+        bExist = IsExistingPaveBlock(aPB, aNC, aTolR3D, aMPBOnIn, aPBTree, aMPBCommon, aPBOut, aTolNew);
         if (bExist)
         {
           Standard_Boolean bInF1 = (aFI1.PaveBlocksOn().Contains(aPBOut) ||
@@ -670,23 +692,24 @@ void BOPAlgo_PaveFiller::MakeBlocks()
             if (pFaces->IsEmpty() || !pFaces->Contains(nF))
               pFaces->Append(nF);
 
+            // Try fusing the vertices of the existing pave block
+            // with the vertices put on the real section curve (except
+            // for technological vertices, which will be removed)
+            Standard_Integer nVOut1, nVOut2;
+            aPBOut->Indices(nVOut1, nVOut2);
+            if (nV1 != nVOut1 && nV1 != nVOut2 && !aMVBounds.Contains(nV1))
+            {
+              aVertsOnRejectedPB.Add(aV1);
+            }
+            if (nV2 != nVOut1 && nV2 != nVOut2 && !aMVBounds.Contains(nV2))
+            {
+              aVertsOnRejectedPB.Add(aV2);
+            }
+
             if (aMPBAdd.Add(aPBOut))
             {
               // Add edge for processing as the section edge
               PreparePostTreatFF(i, j, aPBOut, aMSCPB, aMVI, aLPBC);
-              // Try fusing the vertices of the existing pave block
-              // with the vertices put on the real section curve (except
-              // for technological vertices, which will be removed)
-              Standard_Integer nVOut1, nVOut2;
-              aPBOut->Indices(nVOut1, nVOut2);
-              if (nV1 != nVOut1 && nV1 != nVOut2 && !aMVBounds.Contains(nV1))
-              {
-                aVertsOnRejectedPB.Add(aV1);
-              }
-              if (nV2 != nVOut1 && nV2 != nVOut2 && !aMVBounds.Contains(nV2))
-              {
-                aVertsOnRejectedPB.Add(aV2);
-              }
             }
           }
           continue;
@@ -715,8 +738,10 @@ void BOPAlgo_PaveFiller::MakeBlocks()
         //
         aMVTol.UnBind(nV1);
         aMVTol.UnBind(nV2);
-        //
-        bHasRealSectionEdge = Standard_True;
+
+        // Add existing pave blocks for post treatment
+        ProcessExistingPaveBlocks (i, j, nF1, nF2, aES, aMPBOnIn, aPBTree,
+                                   aMSCPB, aMVI, aLPBC, aPBFacesMap, aMPBAdd);
       }
       //
       aLPBC.RemoveFirst();
@@ -744,29 +769,7 @@ void BOPAlgo_PaveFiller::MakeBlocks()
         aDMVLV.UnBind(nV1);
     }
     //
-    ProcessExistingPaveBlocks(i, nF1, nF2, aMPBOnIn, aDMBV, aMSCPB, aMVI, aPBFacesMap, aMPBAdd);
-    //
-    // If the pair of faces has produced any real section edges
-    // it is necessary to check if these edges do not intersect
-    // any common IN edges of the faces. For that, all such edges
-    // are added for Post Treatment along with sections edges.
-    if (bHasRealSectionEdge) {
-      const BOPDS_IndexedMapOfPaveBlock& aMPBIn1 = aFI1.PaveBlocksIn();
-      const BOPDS_IndexedMapOfPaveBlock& aMPBIn2 = aFI2.PaveBlocksIn();
-      //
-      // For simplicity add all IN edges into the first set of section curves.
-      // These existing edges will be removed from the set on the post treatment
-      // stage in the UpdateFaceInfo function.
-      BOPDS_ListOfPaveBlock& aLPBC = aVC.ChangeValue(0).ChangePaveBlocks();
-      //
-      Standard_Integer aNbIn1 = aMPBIn1.Extent();
-      for (j = 1; j <= aNbIn1; ++j) {
-        const Handle(BOPDS_PaveBlock)& aPB = aMPBIn1(j);
-        if (aMPBIn2.Contains(aPB) && aMPBAdd.Add(aPB)) {
-          PreparePostTreatFF(i, 0, aPB, aMSCPB, aMVI, aLPBC);
-        }
-      }
-    }
+    ProcessExistingPaveBlocks(i, nF1, nF2, aMPBOnIn, aPBTree, aDMBV, aMSCPB, aMVI, aPBFacesMap, aMPBAdd);
   }//for (i=0; i<aNbFF; ++i) {
 
   // Remove "micro" section edges
@@ -928,10 +931,17 @@ void BOPAlgo_PaveFiller::PostTreatFF
   }
   //
   // 1 prepare arguments
+  // Avoid intersection of existing edges among themselves
+  TopoDS_Compound anExistingEdges;
+  BRep_Builder().MakeCompound (anExistingEdges);
   TopTools_MapOfShape anAddedSD;
   for (k = aNbS; k > 0; --k) {
     const TopoDS_Shape& aS=theMSCPB.FindKey(k);
-    aLS.Append(aS);
+    const Handle(BOPDS_PaveBlock)& aPB = theMSCPB (k).PaveBlock1();
+    if (!aPB.IsNull() && aPB->HasEdge())
+      BRep_Builder().Add (anExistingEdges, aS);
+    else
+      aLS.Append(aS);
     // add vertices-candidates for SD from the map aDMNewSD,
     // so that they took part in fuse operation.
     TopoDS_Iterator itV(aS);
@@ -948,6 +958,8 @@ void BOPAlgo_PaveFiller::PostTreatFF
       }
     }
   }
+  if (anExistingEdges.NbChildren() > 0)
+    aLS.Append (anExistingEdges);
   //
   // The section edges considered as a micro should be
   // specially treated - their vertices should be united and
@@ -1029,6 +1041,12 @@ void BOPAlgo_PaveFiller::PostTreatFF
   aItLS.Initialize(aLS);
   for (; aItLS.More(); aItLS.Next()) {
     const TopoDS_Shape& aSx=aItLS.Value();
+    if (aSx.ShapeType() == TopAbs_COMPOUND)
+    {
+      for (TopoDS_Iterator itC (aSx); itC.More(); itC.Next())
+        aLS.Append (itC.Value());
+      continue;
+    }
     nSx=aPDS->Index(aSx);
     const BOPDS_ShapeInfo& aSIx=aPDS->ShapeInfo(nSx);
     //
@@ -1596,108 +1614,124 @@ Standard_Boolean BOPAlgo_PaveFiller::IsExistingPaveBlock
      const BOPDS_Curve& theNC,
      const Standard_Real theTolR3D,
      const BOPDS_IndexedMapOfPaveBlock& theMPBOnIn,
+     BOPTools_BoxTree& thePBTree,
      const BOPDS_MapOfPaveBlock& theMPBCommon,
      Handle(BOPDS_PaveBlock)& aPBOut,
      Standard_Real& theTolNew)
 {
-  Standard_Boolean bRet;
-  Standard_Real aT1, aT2, aTm, aTx, aTolCheck;
-  Standard_Integer nSp, iFlag1, iFlag2, nV11, nV12, nV21, nV22, i, aNbPB;
-  gp_Pnt aP1, aPm, aP2;
-  Bnd_Box aBoxP1, aBoxPm, aBoxP2, aBoxTmp;
-  //
-  bRet=Standard_False;
-  aTolCheck = theTolR3D + myFuzzyValue;
   const IntTools_Curve& aIC=theNC.Curve();
-  //
+
+  Standard_Real aT1, aT2;
   thePB->Range(aT1, aT2);
-  thePB->Indices(nV11, nV12);
-  const Standard_Real aTolV11 = BRep_Tool::Tolerance(TopoDS::Vertex(myDS->Shape(nV11)));
-  const Standard_Real aTolV12 = BRep_Tool::Tolerance(TopoDS::Vertex(myDS->Shape(nV12)));
-  const Standard_Real aTolV1 = Max(aTolV11, aTolV12) + myFuzzyValue;
+
+  Standard_Integer nV11, nV12;
+  thePB->Indices (nV11, nV12);
 
   //first point
-  aIC.D0(aT1, aP1);
-  aBoxP1.Add(aP1);
-  aBoxP1.Enlarge(aTolV11);
+  Bnd_Box aBoxP1;
+  gp_Pnt aP1;
+  aIC.D0 (aT1, aP1);
+  aBoxP1.Add (aP1);
+  const Standard_Real aTolV11 = BRep_Tool::Tolerance (TopoDS::Vertex (myDS->Shape (nV11)));
+  aBoxP1.Enlarge (aTolV11);
+
+  // Find edges intersecting by AABB with the first point
+  BOPTools_BoxTreeSelector aSelector;
+  aSelector.SetBox (Bnd_Tools::Bnd2BVH (aBoxP1));
+  aSelector.SetBVHSet (&thePBTree);
+  if (!aSelector.Select())
+    return Standard_False;
+
   //intermediate point
-  aTm=IntTools_Tools::IntermediatePoint (aT1, aT2);
+  Bnd_Box aBoxPm;
+  Standard_Real aTm = IntTools_Tools::IntermediatePoint (aT1, aT2);
+  gp_Pnt aPm;
   aIC.D0(aTm, aPm);
-  aBoxPm.Add(aPm);
-  //last point
-  aIC.D0(aT2, aP2);
-  aBoxP2.Add(aP2);
-  aBoxP2.Enlarge(aTolV12);
-  //
+  aBoxPm.Add (aPm);
+
+  // last point
+  Bnd_Box aBoxP2;
+  gp_Pnt aP2;
+  aIC.D0 (aT2, aP2);
+  aBoxP2.Add (aP2);
+  const Standard_Real aTolV12 = BRep_Tool::Tolerance (TopoDS::Vertex (myDS->Shape (nV12)));
+  aBoxP2.Enlarge (aTolV12);
+
+  const Standard_Real aTolV1 = Max(aTolV11, aTolV12) + myFuzzyValue;
+
+  Standard_Real aTolCheck = theTolR3D + myFuzzyValue;
+
   // Look for the existing pave block closest to the section curve
+  Standard_Boolean bFound = Standard_False;
   theTolNew = ::RealLast();
 
-  aNbPB = theMPBOnIn.Extent();
-  for (i = 1; i <= aNbPB; ++i) {
-    const Handle(BOPDS_PaveBlock)& aPB = theMPBOnIn(i);
-    aPB->Indices(nV21, nV22);
-    const Standard_Real aTolV21 = BRep_Tool::Tolerance(TopoDS::Vertex(myDS->Shape(nV21)));
-    const Standard_Real aTolV22 = BRep_Tool::Tolerance(TopoDS::Vertex(myDS->Shape(nV22)));
-    const Standard_Real aTolV2 = Max(aTolV21, aTolV22) + myFuzzyValue;
-    nSp=aPB->Edge();
-    if (nSp < 0)
+  for (TColStd_ListOfInteger::Iterator it (aSelector.Indices()); it.More(); it.Next())
+  {
+    const Handle (BOPDS_PaveBlock)& aPB = theMPBOnIn (it.Value());
+
+    Standard_Integer nV21, nV22;
+    aPB->Indices (nV21, nV22);
+
+    const Standard_Real aTolV21 = BRep_Tool::Tolerance (TopoDS::Vertex (myDS->Shape (nV21)));
+    const Standard_Real aTolV22 = BRep_Tool::Tolerance (TopoDS::Vertex (myDS->Shape (nV22)));
+    const Standard_Real aTolV2 = Max (aTolV21, aTolV22) + myFuzzyValue;
+
+    const BOPDS_ShapeInfo& aSISp = myDS->ChangeShapeInfo (aPB->Edge());
+    const TopoDS_Edge& aSp = (*(TopoDS_Edge *)(&aSISp.Shape()));
+    const Bnd_Box& aBoxSp = aSISp.Box();
+
+    Standard_Integer iFlag1 = (nV11 == nV21 || nV11 == nV22) ? 2 : 1;
+    Standard_Integer iFlag2 = (nV12 == nV21 || nV12 == nV22) ? 2 : (!aBoxSp.IsOut (aBoxP2) ? 1 : 0);
+    if (!iFlag2)
       continue;
-    const BOPDS_ShapeInfo& aSISp=myDS->ChangeShapeInfo(nSp);
-    const TopoDS_Edge& aSp=(*(TopoDS_Edge *)(&aSISp.Shape()));
-    const Bnd_Box& aBoxSp=aSISp.Box();
-    //
-    iFlag1 = (nV11 == nV21 || nV11 == nV22) ? 2 : 
-      (!aBoxSp.IsOut(aBoxP1) ? 1 : 0);
-    iFlag2 = (nV12 == nV21 || nV12 == nV22) ? 2 : 
-      (!aBoxSp.IsOut(aBoxP2) ? 1 : 0);
-    if (iFlag1 && iFlag2) {
-      Standard_Real aDist = 0.;
-
-      Standard_Real aRealTol = aTolCheck;
-      if (myDS->IsCommonBlock(aPB))
-      {
-        aRealTol = Max(aRealTol, Max(aTolV1, aTolV2));
-        if (theMPBCommon.Contains(aPB))
-          // for an edge, which is a common block with a face,
-          // increase the chance to coincide with section curve
-          aRealTol *= 2.;
-      }
+
+    Standard_Real aDist = 0.;
+
+    Standard_Real aRealTol = aTolCheck;
+    if (myDS->IsCommonBlock(aPB))
+    {
+      aRealTol = Max(aRealTol, Max(aTolV1, aTolV2));
+      if (theMPBCommon.Contains(aPB))
+        // for an edge, which is a common block with a face,
+        // increase the chance to coincide with section curve
+        aRealTol *= 2.;
+    }
       
-      aBoxTmp = aBoxPm;
-      aBoxTmp.Enlarge(aRealTol);
-
-      Standard_Real aDistToSp = 0.;
-      if (aBoxSp.IsOut(aBoxTmp) || myContext->ComputePE(aPm, 
-                                                        aRealTol,
-                                                        aSp, 
-                                                        aTx, aDistToSp)) {
-        continue;
-      }
-      //
-      if (iFlag1 == 1) {
-        iFlag1 = !myContext->ComputePE(aP1, aRealTol, aSp, aTx, aDist);
-        if (iFlag1 && aDistToSp < aDist)
-          aDistToSp = aDist;
-      }
-      //
-      if (iFlag2 == 1) {
-        iFlag2 = !myContext->ComputePE(aP2, aRealTol, aSp, aTx, aDist);
-        if (iFlag2 && aDistToSp < aDist)
-          aDistToSp = aDist;
-      }
-      //
-      if (iFlag1 && iFlag2)
+    Bnd_Box aBoxTmp = aBoxPm;
+    aBoxTmp.Enlarge(aRealTol);
+
+    Standard_Real aDistToSp = 0.;
+    Standard_Real aTx;
+    if (aBoxSp.IsOut(aBoxTmp) || myContext->ComputePE(aPm, 
+                                                      aRealTol,
+                                                      aSp, 
+                                                      aTx, aDistToSp)) {
+      continue;
+    }
+    //
+    if (iFlag1 == 1) {
+      iFlag1 = !myContext->ComputePE(aP1, aRealTol, aSp, aTx, aDist);
+      if (iFlag1 && aDistToSp < aDist)
+        aDistToSp = aDist;
+    }
+    //
+    if (iFlag2 == 1) {
+      iFlag2 = !myContext->ComputePE(aP2, aRealTol, aSp, aTx, aDist);
+      if (iFlag2 && aDistToSp < aDist)
+        aDistToSp = aDist;
+    }
+    //
+    if (iFlag1 && iFlag2)
+    {
+      if (aDistToSp < theTolNew)
       {
-        if (aDistToSp < theTolNew)
-        {
-          aPBOut = aPB;
-          theTolNew = aDistToSp;
-          bRet = Standard_True;
-        }
+        aPBOut = aPB;
+        theTolNew = aDistToSp;
+        bFound = Standard_True;
       }
     }
   }
-  return bRet;
+  return bFound;
 }
 
 //=======================================================================
@@ -2476,6 +2510,96 @@ void BOPAlgo_PaveFiller::PutPaveOnCurve
   }
 }
 
+//=======================================================================
+//function : ProcessExistingPaveBlocks
+//purpose  : 
+//=======================================================================
+void BOPAlgo_PaveFiller::ProcessExistingPaveBlocks (const Standard_Integer theInt,
+                                                    const Standard_Integer theCur,
+                                                    const Standard_Integer nF1,
+                                                    const Standard_Integer nF2,
+                                                    const TopoDS_Edge& theES,
+                                                    const BOPDS_IndexedMapOfPaveBlock& theMPBOnIn,
+                                                    BOPTools_BoxTree& thePBTree,
+                                                    BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks& theMSCPB,
+                                                    TopTools_DataMapOfShapeInteger& theMVI,
+                                                    BOPDS_ListOfPaveBlock& theLPBC,
+                                                    BOPAlgo_DataMapOfPaveBlockListOfInteger& thePBFacesMap,
+                                                    BOPDS_MapOfPaveBlock& theMPB)
+{
+  Bnd_Box aBoxES;
+  BRepBndLib::Add (theES, aBoxES, false);
+
+  BOPTools_BoxTreeSelector aSelector;
+  aSelector.SetBox (Bnd_Tools::Bnd2BVH (aBoxES));
+  aSelector.SetBVHSet (&thePBTree);
+  if (!aSelector.Select())
+    return;
+
+  const Standard_Real aTolES = BRep_Tool::Tolerance (theES);
+
+  const BOPDS_FaceInfo& aFI1 = myDS->FaceInfo (nF1);
+  const BOPDS_FaceInfo& aFI2 = myDS->FaceInfo (nF2);
+
+  for (TColStd_ListOfInteger::Iterator itPB (aSelector.Indices()); itPB.More(); itPB.Next())
+  {
+    const Handle(BOPDS_PaveBlock)& aPBF = theMPBOnIn (itPB.Value());
+    if (theMPB.Contains (aPBF))
+      continue;
+
+    Standard_Boolean bInF1 = (aFI1.PaveBlocksOn().Contains(aPBF) ||
+                              aFI1.PaveBlocksIn().Contains(aPBF));
+    Standard_Boolean bInF2 = (aFI2.PaveBlocksOn().Contains(aPBF) ||
+                              aFI2.PaveBlocksIn().Contains(aPBF));
+    if (bInF1 && bInF2)
+    {
+      // Add all common edges for post treatment
+      theMPB.Add (aPBF);
+      PreparePostTreatFF (theInt, theCur, aPBF, theMSCPB, theMVI, theLPBC);
+      continue;
+    }
+
+    const Standard_Integer nF = bInF1 ? nF2 : nF1;
+    const NCollection_List<EdgeRangeDistance>* pList = myDistances.Seek (BOPDS_Pair (aPBF->OriginalEdge(), nF));
+    if (!pList)
+      continue;
+
+    Standard_Real aT1, aT2;
+    aPBF->Range (aT1, aT2);
+
+    Standard_Real aDist = RealLast();
+    for (NCollection_List<EdgeRangeDistance>::Iterator itR (*pList); itR.More(); itR.Next())
+    {
+      const EdgeRangeDistance& aRangeDist = itR.Value();
+      if ((aT1 <= aRangeDist.First && aRangeDist.First <= aT2) ||
+          (aT1 <= aRangeDist.Last && aRangeDist.Last <= aT2) ||
+          (aRangeDist.First <= aT1 && aT1 <= aRangeDist.Last) ||
+          (aRangeDist.First <= aT2 && aT2 <= aRangeDist.Last))
+      {
+        aDist = aRangeDist.Distance;
+        break;
+      }
+    }
+    if (aDist < RealLast())
+    {
+      const TopoDS_Edge& aEF = TopoDS::Edge (myDS->Shape (aPBF->Edge()));
+      const Standard_Real aTolSum = aTolES + BRep_Tool::Tolerance (aEF);
+
+      if (aDist <= aTolSum)
+      {
+        theMPB.Add (aPBF);
+        PreparePostTreatFF (theInt, theCur, aPBF, theMSCPB, theMVI, theLPBC);
+
+        TColStd_ListOfInteger* pFaces = thePBFacesMap.ChangeSeek(aPBF);
+        if (!pFaces)
+          pFaces = thePBFacesMap.Bound (aPBF, TColStd_ListOfInteger());
+        if (pFaces->IsEmpty() || !pFaces->Contains (nF))
+          pFaces->Append (nF);
+      }
+    }
+  }
+}
+
 //=======================================================================
 //function : ProcessExistingPaveBlocks
 //purpose  : 
@@ -2485,6 +2609,7 @@ void BOPAlgo_PaveFiller::ProcessExistingPaveBlocks
      const Standard_Integer nF1,
      const Standard_Integer nF2,
      const BOPDS_IndexedMapOfPaveBlock& aMPBOnIn,
+     BOPTools_BoxTree& thePBTree,
      const TColStd_DataMapOfIntegerListOfInteger& aDMBV,
      BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks& aMSCPB,
      TopTools_DataMapOfShapeInteger& aMVI,
@@ -2496,7 +2621,7 @@ void BOPAlgo_PaveFiller::ProcessExistingPaveBlocks
   }
   //
   Standard_Real aT, dummy;
-  Standard_Integer i, nV, nE, iC, aNbPB, iFlag;
+  Standard_Integer nV, nE, iC, iFlag;
   TColStd_ListIteratorOfListOfInteger aItLI;
   TColStd_DataMapIteratorOfDataMapOfIntegerListOfInteger aItBV;
   //
@@ -2507,8 +2632,6 @@ void BOPAlgo_PaveFiller::ProcessExistingPaveBlocks
   const BOPDS_FaceInfo& aFI1 = myDS->FaceInfo(nF1);
   const BOPDS_FaceInfo& aFI2 = myDS->FaceInfo(nF2);
   //
-  aNbPB = aMPBOnIn.Extent();
-  //
   aItBV.Initialize(aDMBV);
   for (; aItBV.More(); aItBV.Next()) {
     iC = aItBV.Key();
@@ -2527,8 +2650,15 @@ void BOPAlgo_PaveFiller::ProcessExistingPaveBlocks
         continue;
       }
       //
-      for (i = 1; i <= aNbPB; ++i) {
-        const Handle(BOPDS_PaveBlock)& aPB = aMPBOnIn(i);
+      BOPTools_BoxTreeSelector aSelector;
+      aSelector.SetBox (Bnd_Tools::Bnd2BVH (aBoxV));
+      aSelector.SetBVHSet (&thePBTree);
+      if (!aSelector.Select())
+        continue;
+
+      for (TColStd_ListOfInteger::Iterator it (aSelector.Indices()); it.More(); it.Next())
+      {
+        const Handle(BOPDS_PaveBlock)& aPB = aMPBOnIn (it.Value());
         if (aPB->Pave1().Index() == nV || aPB->Pave2().Index() == nV) {
           continue;
         }
@@ -2536,18 +2666,8 @@ void BOPAlgo_PaveFiller::ProcessExistingPaveBlocks
         if (aMPB.Contains(aPB)) {
           continue;
         }
-        if (myDS->ShapeInfo(aPB->OriginalEdge()).HasFlag()) { // skip degenerated edges
-          continue;
-        }
-        //
         nE = aPB->Edge();
         const BOPDS_ShapeInfo& aSIE = myDS->ShapeInfo(nE);
-        const Bnd_Box& aBoxE = aSIE.Box();
-        //
-        if (aBoxV.IsOut(aBoxE)) {
-          continue;
-        }
-        //
         const TopoDS_Edge& aE = *(TopoDS_Edge*)&aSIE.Shape();
         //
         iFlag = myContext->ComputeVE(aV, aE, aT, dummy, myFuzzyValue);
index 0fd3e771b0ba5de58db6d6fdfd4b1f7b7f69da29..37ed067bce28c6de8135e8475a3c4038e890d50d 100644 (file)
@@ -786,7 +786,7 @@ Standard_Integer NbWaysOut(const BOPAlgo_ListOfEdgeInfo& aLEInfo)
   //for case chl/927/r9
   aTX=0.05*(aLast - aFirst);//aTX=0.25*(aLast - aFirst);  
   if (aTX < 5.e-5) {
-    aTX = 5.e-5;
+    aTX = Min (5.e-5, (aLast - aFirst) / 2.);
   }
   if(dt > aTX) {
     // to save direction of the curve as much as it possible
index 3a037f4761b122f136eab0476ccb0d45905984ed..bf1891b02b148db5bb4db532007a444601e54398 100644 (file)
@@ -825,7 +825,8 @@ Standard_Boolean BOPTools_AlgoTools::IsInternalFace
       const TopoDS_Face& aF2=(*(TopoDS_Face*)(&aLF.Last()));
       iRet=BOPTools_AlgoTools::IsInternalFace(theFace, aE, aF1, aF2,
                                               theContext);
-      break;
+      if (iRet != 2)
+        break;
     }
   }//for(; aExp.More(); aExp.Next()) {
   //
@@ -901,8 +902,6 @@ Standard_Integer BOPTools_AlgoTools::IsInternalFace
    const TopoDS_Face& theFace2,
    const Handle(IntTools_Context)& theContext)
 {
-  Standard_Boolean bRet;
-  Standard_Integer iRet;
   TopoDS_Edge aE1, aE2;
   TopoDS_Face aFOff;
   BOPTools_ListOfCoupleOfShape theLCSOff;
@@ -931,17 +930,15 @@ Standard_Integer BOPTools_AlgoTools::IsInternalFace
   aCS2.SetShape2(theFace2);
   theLCSOff.Append(aCS2);
   //
-  bRet=GetFaceOff(aE1, theFace1, theLCSOff, aFOff, theContext);
-  //
-  iRet=0; // theFace is not internal
-  if (theFace.IsEqual(aFOff)) {
+  Standard_Integer iRet = 0; // theFace is not internal
+  Standard_Boolean isDone = GetFaceOff (aE1, theFace1, theLCSOff, aFOff, theContext);
+  if (!isDone)
+    // error, unable to classify face by this edge
+    iRet = 2;
+  else if (theFace.IsEqual (aFOff))
     // theFace is internal
-    iRet=1;  
-    if (!bRet) {
-      // theFace seems to be internal  
-      iRet=2;
-    }
-  }
+    iRet = 1;
+
   return iRet;
 }
 //=======================================================================
@@ -957,7 +954,7 @@ Standard_Boolean BOPTools_AlgoTools::GetFaceOff
 {
   Standard_Boolean bRet, bIsComputed;
   Standard_Real aT, aT1, aT2, aAngle, aTwoPI, aAngleMin, aDt3D;
-  Standard_Real aUmin, aUsup, aVmin, aVsup, aPA;
+  Standard_Real aUmin, aUsup, aVmin, aVsup;
   gp_Pnt aPn1, aPn2, aPx;
   gp_Dir aDN1, aDN2, aDBF, aDBF2, aDTF;
   gp_Vec aVTgt;
@@ -967,7 +964,6 @@ Standard_Boolean BOPTools_AlgoTools::GetFaceOff
   BOPTools_ListIteratorOfListOfCoupleOfShape aIt;
   GeomAPI_ProjectPointOnSurf aProjPL;
   //
-  aPA=Precision::Angular();
   aAngleMin=100.;
   aTwoPI=M_PI+M_PI;
   aC3D =BRep_Tool::Curve(theE1, aT1, aT2);
@@ -994,6 +990,10 @@ Standard_Boolean BOPTools_AlgoTools::GetFaceOff
   //
   aDTF=aDN1^aDBF;
   //
+  // The difference between faces should be obvious enough
+  // to guarantee the correctness of the classification
+  Standard_Real anAngleCriteria = Precision::Confusion();
+
   bRet=Standard_True;
   aIt.Initialize(theLCSOff);
   for (; aIt.More(); aIt.Next()) {
@@ -1012,11 +1012,7 @@ Standard_Boolean BOPTools_AlgoTools::GetFaceOff
     //Angle
     aAngle=AngleWithRef(aDBF, aDBF2, aDTF);
     //
-    if(aAngle<0.) {
-      aAngle=aTwoPI+aAngle;
-    }
-    //
-    if (aAngle<aPA) {
+    if (Abs(aAngle) < Precision::Angular()) {
       if (aF2==theF1) {
         aAngle=M_PI;
       }
@@ -1025,19 +1021,21 @@ Standard_Boolean BOPTools_AlgoTools::GetFaceOff
       }
     }
     //
-    if (fabs(aAngle-aAngleMin)<aPA) {
+    if (Abs(aAngle) < anAngleCriteria ||
+        Abs (aAngle-aAngleMin) < anAngleCriteria) {
       // the minimal angle can not be found
       bRet=Standard_False; 
     }
     //
+    if (aAngle < 0.)
+    {
+      aAngle = aTwoPI + aAngle;
+    }
+    //
     if (aAngle<aAngleMin){
       aAngleMin=aAngle;
       theFOff=aF2;
     }
-    else if (aAngle==aAngleMin) {
-      // the minimal angle can not be found
-      bRet=Standard_False;  
-    }
   }
   return bRet;
 }
index 48ec695541d2cb8ba777b955bcb378fa3c218069..d30c1e22f751e28c4d1f7b93724fd3a5065be216 100644 (file)
@@ -2164,10 +2164,6 @@ static void SeekAdditionalPoints( const IntSurf_Quadric& theQuad1,
     return;
   
   Standard_Integer aNbPoints = theEndPointOnLine - theStartPointOnLine + 1;
-  if(aNbPoints >= theMinNbPoints)
-  {
-    return;
-  }
 
   Standard_Real aMinDeltaParam = theTol2D;
 
@@ -2192,7 +2188,7 @@ static void SeekAdditionalPoints( const IntSurf_Quadric& theQuad1,
   Standard_Real U1prec = 0.0, V1prec = 0.0, U2prec = 0.0, V2prec = 0.0;
 
   Standard_Integer aNbPointsPrev = 0;
-  while(aNbPoints < theMinNbPoints && (aNbPoints != aNbPointsPrev))
+  do
   {
     aNbPointsPrev = aNbPoints;
     for(Standard_Integer fp = theStartPointOnLine, lp = 0; fp < aLastPointIndex; fp = lp + 1)
@@ -2269,7 +2265,7 @@ static void SeekAdditionalPoints( const IntSurf_Quadric& theQuad1,
     {
       return;
     }
-  }
+  } while(aNbPoints < theMinNbPoints && (aNbPoints != aNbPointsPrev));
 }
 
 //=======================================================================
@@ -3564,7 +3560,7 @@ static IntPatch_ImpImpIntersection::IntStatus
         }
 
 #ifdef INTPATCH_IMPIMPINTERSECTION_DEBUG
-        //aWLine[i]->Dump();
+        aWLine[i]->Dump(0);
 #endif
       }
     }
index 323e249f88f631257ce9a6ee1b7956fa27153b62..513e3e5c2a5463b847b1ef417275b2a75fe44386 100644 (file)
@@ -125,7 +125,8 @@ myVMinParameter(0.),
 myVMaxParameter(0.),
 myBeanTolerance(0.),
 myFaceTolerance(0.),
-myIsDone(Standard_False)
+myIsDone(Standard_False),
+myMinSqDistance(RealLast())
 {
   myCriteria        = Precision::Confusion();
   myCurveResolution = Precision::PConfusion();
@@ -146,7 +147,8 @@ IntTools_BeanFaceIntersector::IntTools_BeanFaceIntersector(const TopoDS_Edge& th
        myVMaxParameter(0.),
        myBeanTolerance(0.),
        myFaceTolerance(0.),
-       myIsDone(Standard_False)
+       myIsDone(Standard_False),
+       myMinSqDistance(RealLast())
 {
   Init(theEdge, theFace);
 }
@@ -165,7 +167,8 @@ IntTools_BeanFaceIntersector::IntTools_BeanFaceIntersector(const BRepAdaptor_Cur
        myUMaxParameter(0.),
        myVMinParameter(0.),
        myVMaxParameter(0.),
-       myIsDone(Standard_False)
+       myIsDone(Standard_False),
+       myMinSqDistance(RealLast())
 {
   Init(theCurve, theSurface, theBeanTolerance, theFaceTolerance);
 }
@@ -192,7 +195,8 @@ IntTools_BeanFaceIntersector::IntTools_BeanFaceIntersector(const BRepAdaptor_Cur
        myVMaxParameter(theVMaxParameter),
        myBeanTolerance(theBeanTolerance),
        myFaceTolerance(theFaceTolerance),
-       myIsDone(Standard_False)
+       myIsDone(Standard_False),
+       myMinSqDistance(RealLast())
 {
   myCurve = theCurve;
   
@@ -651,9 +655,14 @@ void IntTools_BeanFaceIntersector::ComputeAroundExactIntersection()
         ComputeRangeFromStartPoint(Standard_False, aPoint.W(), U, V);
         ComputeRangeFromStartPoint(Standard_True, aPoint.W(), U, V);
         
-        if(aNbRanges == myRangeManager.Length()) {  
+        if(aNbRanges == myRangeManager.Length())
+        {
           SetEmptyResultRange(aPoint.W(), myRangeManager);
-        } // end if(aNbRanges == myRangeManager.Length())
+        }
+        else
+        {
+          myMinSqDistance = 0.0;
+        }
       }
     }
     
@@ -669,6 +678,7 @@ void IntTools_BeanFaceIntersector::ComputeAroundExactIntersection()
 
       ComputeRangeFromStartPoint(Standard_False, aPoint1.W(), aPoint1.U(), aPoint1.V());
       ComputeRangeFromStartPoint(Standard_True,  aPoint2.W(), aPoint2.U(), aPoint2.V());
+      myMinSqDistance = 0.0;
     }
   }
 }
@@ -940,6 +950,9 @@ void IntTools_BeanFaceIntersector::ComputeUsingExtremum()
       
       if (myExtrema.IsParallel()) {
         
+        if (myMinSqDistance > myExtrema.SquareDistance (1))
+          myMinSqDistance = myExtrema.SquareDistance (1);
+
         if(myExtrema.SquareDistance(1) < myCriteria * myCriteria) {
           Standard_Real U1, V1, U2, V2;
           Standard_Real adistance1 = Distance(anarg1, U1, V1);
@@ -1022,6 +1035,9 @@ void IntTools_BeanFaceIntersector::ComputeUsingExtremum()
               SetEmptyResultRange(p1.Parameter(), myRangeManager);
             }
           }
+
+          if (myMinSqDistance > myExtrema.SquareDistance (j))
+            myMinSqDistance = myExtrema.SquareDistance (j);
         } //end for
         
         if(!solutionfound) {
index da5f2f4d0a111980a8092da3da0ff9b5b6c81aa0..23284c002080d8d459261816bb83324e96f51056 100644 (file)
@@ -130,17 +130,14 @@ public:
   
   Standard_EXPORT void Result (IntTools_SequenceOfRanges& theResults) const;
 
-
-
-
-protected:
-
-
-
+  //! Returns the minimal distance found between edge and face
+  Standard_Real MinimalSquareDistance() const
+  {
+    return myMinSqDistance;
+  }
 
 
 private:
-
   
   Standard_EXPORT void ComputeAroundExactIntersection();
   
@@ -191,6 +188,7 @@ private:
   Handle(IntTools_Context) myContext;
   IntTools_SequenceOfRanges myResults;
   Standard_Boolean myIsDone;
+  Standard_Real myMinSqDistance;
 
 };
 
index 46fe699b277acbaf4b19e2007ca5c9169f087e51..dffdb25c2cef80bcbd0f2ca01465ed511c49cecd 100644 (file)
@@ -71,6 +71,7 @@ static
   myIsDone=Standard_False;
   myErrorStatus=1;
   myQuickCoincidenceCheck=Standard_False;
+  myMinDistance = RealLast();
 }
 //=======================================================================
 //function :  IsCoincident
@@ -535,7 +536,10 @@ void IntTools_EdgeFace::Perform()
   anIntersector.SetContext(myContext);
   //
   anIntersector.Perform();
-  
+
+  if (anIntersector.MinimalSquareDistance() < RealLast())
+    myMinDistance = Sqrt (anIntersector.MinimalSquareDistance());
+
   if(!anIntersector.IsDone()) {
     return;
   }
index 12c25926e9487a2694084ac305c3a4e53d986fc7..8acc5c190e37cff8d583671c651d9e8734461ad8 100644 (file)
@@ -177,6 +177,11 @@ public: //! @name Obtaining results
     return mySeqOfCommonPrts;
   }
 
+  //! Returns the minimal distance found between edge and face
+  Standard_Real MinimalDistance() const
+  {
+    return myMinDistance;
+  }
 
 protected: //! @name Protected methods performing the intersection
 
@@ -210,6 +215,7 @@ protected:
   IntTools_SequenceOfCommonPrts mySeqOfCommonPrts;
   IntTools_Range myRange;
   Standard_Boolean myQuickCoincidenceCheck;
+  Standard_Real myMinDistance; //!< Minimal distance found
 };
 
 #endif // _IntTools_EdgeFace_HeaderFile
index 4004cd81a768e75262d03b524a3188165b3edfe5..74f78f5da34f2e603eb40f125426a2225bcc1034 100644 (file)
@@ -4,5 +4,6 @@ restore [locate_data_file b60] b
 bop a b
 bopfuse result
 
-checkprops result -s 18750
+checkprops result -s 18750 -v 156250
+checknbshapes result -wire 36 -face 36 -shell 1 -solid 1
 checkview -display result -2d -otherwise { a b } -s -path ${imagedir}/${test_image}.png
index 95afbfe9b5a1dbb0ad88388553bf426f44df515b..b0cf508d1ab2776b83ec5917220e55b19ac4ec7d 100755 (executable)
@@ -4,5 +4,12 @@ restore [locate_data_file b60] b
 bop a b
 boptuc result
 
-checkprops result -s 15000
+checkprops result -s 15000 -v 31250
+checknbshapes result -wire 24 -face 24 -shell 6 -solid 6
+foreach sol [explode result so] {
+  if {![regexp "This shape seems to be OK" [bopcheck $sol]]} {
+    puts "Error: the result solid $sol shape is self-interfered"
+  }
+}
+
 checkview -display result -2d -otherwise { a b } -s -path ${imagedir}/${test_image}.png
diff --git a/tests/bugs/modalg_7/bug24789 b/tests/bugs/modalg_7/bug24789
new file mode 100644 (file)
index 0000000..5477a4c
--- /dev/null
@@ -0,0 +1,32 @@
+puts "============================================================================================="
+puts "0024789: BOPAlgo_Builder produces invalid result on planar, conical and spherical surfaces"
+puts "============================================================================================="
+puts ""
+
+restore [locate_data_file bug24789.brep] c1
+tcopy c1 c2
+
+bclearobjects
+bcleartools
+eval baddobjects [explode c1]
+bfillds
+bbuild result1
+
+checkshape result1
+checknbshapes result1 -shell 16 -solid 16
+checkprops result1 -s 4.91964e+06 -v 6.9691e+08
+if {![regexp "This shape seems to be OK" [bopcheck result1]]} {
+  puts "Error: GF result is self-interfered shape"
+}
+
+
+mkvolume result c2 -c
+
+checkshape result
+checknbshapes result -ref [nbshapes result1]
+checkprops result -equal result1
+if {![regexp "This shape seems to be OK" [bopcheck result]]} {
+  puts "Error: GF result is self-interfered shape"
+}
+
+checkview -display result -2d -path ${imagedir}/${test_image}.png
index 82cfa10e3e72f8512497edf9c68e7c576d64c617..b24071ee9372dbe285a26881047140d680d77ee4 100644 (file)
@@ -21,12 +21,12 @@ checkprops r4 -l 70.3856
 bbuild rgf
 
 checkshape rgf
-checknbshapes rgf -wire 363 -face 363 -shell 2 -solid 0
+checknbshapes rgf -shell 2 -solid 0
 
 mkvolume result rgf -ni
 
 checkshape result
-checknbshapes result -wire 254 -face 254 -shell 1 -solid 1
+checknbshapes result -shell 1 -solid 1
 checkprops result -s 668.352 -v 774.749
 
 checkview -display result -2d -path ${imagedir}/${test_image}.png