]> OCCT Git - occt-copy.git/commitdiff
0026565: Compsolid after cut becomes compound of solids
authoremv <emv@opencascade.com>
Thu, 1 Oct 2015 11:48:30 +0000 (14:48 +0300)
committerbugmaster <bugmaster@opencascade.com>
Thu, 1 Oct 2015 11:49:29 +0000 (14:49 +0300)
Changed the rules for the types of the arguments for different operations:
1. FUSE:   All arguments and tools should have the same dimension;
2. CUT:    The MAXIMAL dimension of the ARGUMENTS should be less
           or equal to the MINIMAL dimension of the TOOLS;
3. CUT21:  The MINIMAL dimension of ARGUMENTS should be grater
           or equal to the MAXIMAL dimension of the TOOLS;
4. COMMON: The arguments and tools could have any dimensions.

For the arguments of collection type (WIRE, SHELL, COMPSOLID)
the type will be passed into the result of the operation.

The documentation should be updated according to new behavior.

Documentation has been updated.

Implemented suggestions by MSV and some grammar changes.

Test cases for issue CR26565

Correction of test cases for issue CR26565

Correction of test cases for issue CR26565

50 files changed:
.gitignore
dox/user_guides/boolean_operations/boolean_operations.md
dox/user_guides/boolean_operations/images/boolean_image136.png [new file with mode: 0644]
dox/user_guides/boolean_operations/images/boolean_image137.png [new file with mode: 0644]
dox/user_guides/boolean_operations/images/boolean_image138.png [new file with mode: 0644]
samples/tcl/snowflake.tcl
src/BOPAlgo/BOPAlgo_BOP.cxx
tests/boolean/gdml_private/F8
tests/bugs/modalg_1/bug11565_1
tests/bugs/modalg_1/bug11565_2
tests/bugs/modalg_1/bug12507
tests/bugs/modalg_2/bug21460
tests/bugs/modalg_2/bug22356
tests/bugs/modalg_2/bug22790
tests/bugs/modalg_2/bug23100
tests/bugs/modalg_2/bug23470
tests/bugs/modalg_2/bug23676
tests/bugs/modalg_4/bug6538
tests/bugs/modalg_5/bug24092
tests/bugs/modalg_5/bug24187
tests/bugs/modalg_5/bug24746
tests/bugs/modalg_5/bug24811
tests/bugs/modalg_5/bug24825_cut
tests/bugs/modalg_5/bug24851
tests/bugs/modalg_5/bug25163
tests/bugs/modalg_5/bug25237
tests/bugs/modalg_5/bug25263
tests/bugs/modalg_5/bug25337_1
tests/bugs/modalg_5/bug25337_2
tests/bugs/modalg_5/bug25450_1
tests/bugs/modalg_5/bug25450_2
tests/bugs/modalg_5/bug25614_common
tests/bugs/modalg_5/bug25614_cut
tests/bugs/modalg_5/bug25614_cut21
tests/bugs/modalg_5/bug25625
tests/bugs/modalg_5/bug25721
tests/bugs/modalg_6/bug25937_2
tests/bugs/modalg_6/bug26224
tests/bugs/modalg_6/bug26565_1 [new file with mode: 0755]
tests/bugs/modalg_6/bug26565_2 [new file with mode: 0755]
tests/bugs/modalg_6/bug26565_3 [new file with mode: 0755]
tests/bugs/modalg_6/bug26565_4 [new file with mode: 0755]
tests/bugs/modalg_6/bug26565_5 [new file with mode: 0755]
tests/bugs/modalg_6/bug26565_6 [new file with mode: 0755]
tests/bugs/modalg_6/bug26565_7 [new file with mode: 0755]
tests/bugs/modalg_6/bug26565_8 [new file with mode: 0755]
tests/bugs/modalg_6/bug26582
tests/bugs/moddata_3/bug23738
tests/bugs/moddata_3/bug24108
tests/bugs/moddata_3/bug24108_2

index c2da7e3b0343a7f090d30bf75eec47fe1a770789..53cfb10fc1f4d97f2888e2910494ebed8efce1bf 100644 (file)
@@ -58,5 +58,5 @@ Release
 /Makefile
 /libtool
 /stamp*
-/build
+/build*
 /install
index a26fe7595227b912d4e74d58695e87787fef7e60..ccd43d5fcc6c9cff9993af29ccf1445fc718fe0a 100644 (file)
@@ -1050,7 +1050,7 @@ The input data for this step is a *BOPAlgo_Builder* object after building result
 * There are two groups of arguments in BOA:
        * Objects <i>(S1=S11, S12, ...)</i>;
        * Tools <i>(S2=S21, S22, ...)</i>.
-* All arguments in a group should have the same dimension (see the Table).
+* The following table contains the values of dimension for different types of arguments:
 
 | No | Type of Argument        | Index of Type | Dimension |
 | :---- | :---- | :----- | :---- |
@@ -1063,8 +1063,9 @@ The input data for this step is a *BOPAlgo_Builder* object after building result
 | 7 | EDGE | 6 | 1 |
 | 8 | VERTEX | 7 | 0 |
 
-* For Boolean operation Fuse the arguments should have equal dimensions.
-* For Boolean operation Cut the dimension of *S2* should not be less then the dimension of *S1*.
+* For Boolean operation Fuse all arguments should have equal dimensions.
+* For Boolean operation Cut the minimal dimension of *S2* should not be less than the maximal dimension of *S1*.
+* For Boolean operation Common the arguments could have any dimension.
 
 @subsection occt_algorithms_9_3        Results. General Rules
 
@@ -1072,12 +1073,13 @@ The input data for this step is a *BOPAlgo_Builder* object after building result
 * The content of the result depends on the type of the operation (Common, Fuse, Cut12, Cut21) and the dimensions of the arguments. 
 * The result of the operation Fuse is defined for arguments *S1* and *S2* that have the same dimension value : *Dim(S1)=Dim(S2)*. If the arguments have different dimension values the result of the operation Fuse is not defined. The dimension of the result is equal to the dimension of the arguments. For example, it is impossible to fuse an edge and a face.
 * The result of the operation Fuse for arguments *S1* and *S2* contains the parts of arguments that have states **OUT** relative to the opposite arguments.
-* The result of the operations Fuse, Common, Cut12, Cut21  for arguments *S1* and *S2* having dimension value 3 (Solids) is refined by removing all possible internal faces to provide minimal number of solids.
-* The result of the operation Common for arguments *S1* and *S2* is defined for all values of the dimensions of the arguments. The dimension of the result is equal to the lower dimension of the arguments. For example, the result of the operation Common between edges cannot be a vertex. 
+* The result of the operation Fuse for arguments *S1* and *S2* having dimension value 3 (Solids) is refined by removing all possible internal faces to provide minimal number of solids.
+* The result of the operation Common for arguments *S1* and *S2* is defined for all values of the dimensions of the arguments. The result can contain the shapes of different dimension, but the minimal dimension of the result will be equal to the minimal dimension of the arguments. For example, the result of the operation Common between edges cannot be a vertex. 
 * The result of the operation Common for the arguments *S1* and *S2* contains the parts of the argument that have states **IN** and **ON** relative to the opposite argument.
-* The result of the operation Cut is defined for arguments *S1* and *S2* that have values of dimensions *Dim(S2)* that should not be less than *Dim(S1)*. The dimension of the result is equal to *Dim(S1)*. The result of the operation *Cut12* is not defined for other cases. For example, it is impossible to cut an edge from a solid, because a solid without an edge is not defined. 
+* The result of the operation Cut is defined for arguments *S1* and *S2* that have values of dimensions *Dim(S2)* that should not be less than *Dim(S1)*. The result can contain the shapes of different dimension, but the minimal dimension of the result will be equal to the minimal dimension of the objects *Dim(S1)*. The result of the operation *Cut12* is not defined for other cases. For example, it is impossible to cut an edge from a solid, because a solid without an edge is not defined. 
 * The result of the operation *Cut12* for arguments *S1* and *S2* contains the parts of argument *S1* that have state **OUT** relative to the opposite argument *S2*.
 * The result of the operation *Cut21* for arguments *S1* and *S2* contains the parts of argument *S2* that have state **OUT** relative to the opposite argument *S1*.
+* For the argumenst of collection type (WIRE, SHELL, COMPSOLID) the type will be passed in the result. For example, the result of Common operation between Shell and Wire will be compound containing Wire.
 
 @subsection occt_algorithms_9_4 Examples
 
@@ -1522,6 +1524,24 @@ Let us consider two solids *S1* and *S2* that have overlapping vertices:
 
 @figure{/user_guides/boolean_operations/images/boolean_image070.png}
 
+@subsubsection occt_algorithms_9_4_23  Case 23: A Shell and a Wire cut by a Solid.
+
+Let us consider Shell *Sh* and Wire *W* as the objects and Solid *S* as the tool:
+
+@figure{/user_guides/boolean_operations/images/boolean_image136.png}
+
+* The result of *Fuse* operation is not defined as the dimension of the arguments is not the same.
+       
+* The result of *Common* operation is a compound containing the parts of the initial Shell and Wire common for the Solid. The new Shell and Wire are created from the objects.
+
+@figure{/user_guides/boolean_operations/images/boolean_image137.png}   
+
+* The result of *Cut12* operation is a compound containing the parts of the initial Shell and Wire out of the Solid. The new Shell and Wire are created from the objects.
+       
+@figure{/user_guides/boolean_operations/images/boolean_image138.png}   
+       
+* The result of *Cut21* operation is not defined as the objects have lower dimension than the tool. 
+
 
 @subsection occt_algorithms_9_5 Class BOPAlgo_BOP
 
@@ -1554,17 +1574,16 @@ The input data for this step is as follows:
 
 | No | Contents        | Implementation |
 | :---- | :---- | :------ |
-| 1 | For the Type of the Boolean operation Common, Cut and *myDim[0] < 3* | |
-| 1.1 |        Compute minimal dimension *Dmin = min(myDim[0], myDim[1])*      | *BOPAlgo_BOP:: BuildShape()* |
-| 1.2 |        Make connexity blocks from sub-shapes of *myRS*, taking into account the value of *Dmin* |      *BOPTools_Tools::MakeConnexityBlocks()* |
+| 1 | For the Type of the Boolean operation Common, Cut with any dimension and operation Fuse with *myDim[0] < 3* | |
+| 1.1 |        Find containers (WIRE, SHELL, COMPSOLID) in the arguments | *BOPAlgo_BOP:: BuildShape()* |
+| 1.2 |        Make connexity blocks from splits of each container that are in *myRC* |        *BOPTools_Tools::MakeConnexityBlocks()* |
 | 1.3 |        Build the result from shapes made from the connexity blocks | *BOPAlgo_BOP:: BuildShape()* |
-| 2    | For the Type of the Boolean operation Common, Cut and *myDim[0] = 3* | |      
-| 2.1 | *myShape = myRC* | BOPAlgo_BOP::BuildShape () |
-| 3    | For the Type of the Boolean operation Fuse and *myDim[0] = 3* | |     
-| 3.1 |        Find internal faces <i>(FWi)</i> in *myRC* | *BOPAlgo_BOP::BuildSolid()* |
-| 3.2 |        Collect all faces of *myRC* except for internal faces <i>(FWi) -> SFS</i> | *BOPAlgo_BOP::BuildSolid ()* |
-| 3.3 |        Build solids <i>(SDi)</i> from *SFS*. | *BOPAlgo_BuilderSolid* |
-| 3.4 |        Add the solids <i>(SDi)</i> to the result       | |
+| 1.4 |        Add the remaining shapes from *myRC* to the result | *BOPAlgo_BOP:: BuildShape()* |
+| 2    | For the Type of the Boolean operation Fuse with *myDim[0] = 3* | |    
+| 2.1 |        Find internal faces <i>(FWi)</i> in *myRC* | *BOPAlgo_BOP::BuildSolid()* |
+| 2.2 |        Collect all faces of *myRC* except for internal faces <i>(FWi) -> SFS</i> | *BOPAlgo_BOP::BuildSolid ()* |
+| 2.3 |        Build solids <i>(SDi)</i> from *SFS*. | *BOPAlgo_BuilderSolid* |
+| 2.4 |        Add the solids <i>(SDi)</i> to the result       | |
 
 @section occt_algorithms_10a Section Algorithm 
 
diff --git a/dox/user_guides/boolean_operations/images/boolean_image136.png b/dox/user_guides/boolean_operations/images/boolean_image136.png
new file mode 100644 (file)
index 0000000..6c93bc4
Binary files /dev/null and b/dox/user_guides/boolean_operations/images/boolean_image136.png differ
diff --git a/dox/user_guides/boolean_operations/images/boolean_image137.png b/dox/user_guides/boolean_operations/images/boolean_image137.png
new file mode 100644 (file)
index 0000000..a783c0e
Binary files /dev/null and b/dox/user_guides/boolean_operations/images/boolean_image137.png differ
diff --git a/dox/user_guides/boolean_operations/images/boolean_image138.png b/dox/user_guides/boolean_operations/images/boolean_image138.png
new file mode 100644 (file)
index 0000000..d10a5a5
Binary files /dev/null and b/dox/user_guides/boolean_operations/images/boolean_image138.png differ
index 06da6b6d25e8d5de5a1b201271735d14ad367833..8161ee31702d22ef56e9003792f4d65be8d855a2 100644 (file)
@@ -64,7 +64,7 @@ bcut r r f5
 explode r Sh
 renamevar r_1 r
 explode r e
-wire w r_4 r_1 r_7 r_8 r_9 r_10 r_11 r_12 r_13 r_14 r_22 r_23 r_24 r_25 r_19 r_20 r_21 r_26 r_35 r_31 r_32 r_33 r_34 r_36 r_37
+wire w r_4 r_1 r_20 r_21 r_22 r_23 r_24 r_25 r_26 r_7 r_30 r_31 r_32 r_33 r_27 r_28 r_29 r_11 r_38 r_34 r_35 r_36 r_37 r_16 r_17
 tcopy w w1
 tmirror w1 -6 0 0 0 1 0
 wire w w w1
index 0492ef451d55808b841bc7950afa78796b13b04c..f4da3cabe869bbd734737596143d7ebb6169aa6e 100644 (file)
@@ -45,6 +45,10 @@ typedef NCollection_IndexedDataMap
 //
 static
   TopAbs_ShapeEnum TypeToExplore(const Standard_Integer theDim);
+//
+static
+  void CollectContainers(const TopoDS_Shape& theS,
+                         BOPCol_ListOfShape& theLSC);
 
 
 //=======================================================================
@@ -141,7 +145,7 @@ void BOPAlgo_BOP::SetTools(const BOPCol_ListOfShape& theShapes)
 void BOPAlgo_BOP::CheckData()
 {
   Standard_Integer i, j, iDim, aNbArgs, aNbTools;
-  Standard_Boolean bFlag;
+  Standard_Boolean bFlag, bFuse;
   BOPCol_ListIteratorOfListOfShape aItLS;
   //
   myErrorStatus=0;
@@ -179,9 +183,18 @@ void BOPAlgo_BOP::CheckData()
     return;
   }
   //
-  // myDims
-  myDims[0]=-1;
-  myDims[1]=-1;
+  bFuse = (myOperation == BOPAlgo_FUSE);
+  //
+  // The rules for different types of operations are the following:
+  // 1. FUSE:   All arguments and tools should have the same dimension;
+  // 2. CUT:    The MAXIMAL dimension of the ARGUMENTS should be less
+  //            or equal to the MINIMAL dimension of the TOOLS;
+  // 3. CUT21:  The MINIMAL dimension of ARGUMENTS should be grater
+  //            or equal to the MAXIMAL dimension of the TOOLS;
+  // 4. COMMON: The arguments and tools could have any dimensions.
+  //
+  Standard_Integer iDimMin[2], iDimMax[2];
+  //
   for (i=0; i<2; ++i) {
     const BOPCol_ListOfShape& aLS=(!i)? myArguments : myTools;
     aItLS.Initialize(aLS);
@@ -200,11 +213,19 @@ void BOPAlgo_BOP::CheckData()
       }
       //
       if (!j) {
-        myDims[i]=iDim;
+        iDimMin[i] = iDim;
+        iDimMax[i] = iDim;
         continue;
       }
       //
-      if (iDim!=myDims[i]) { 
+      if (iDim < iDimMin[i]) {
+        iDimMin[i] = iDim;
+      }
+      else if (iDim > iDimMax[i]) {
+        iDimMax[i] = iDim;
+      }
+      //
+      if (bFuse && (iDimMin[i] != iDimMax[i])) {
         // non-homogenious argument
         myErrorStatus=13;
         return;
@@ -212,22 +233,16 @@ void BOPAlgo_BOP::CheckData()
     }
   }
   //
-  if (myDims[0]<myDims[1]) {
-    if (myOperation==BOPAlgo_FUSE ||
-        myOperation==BOPAlgo_CUT21) { 
-      // non-licit operation for the arguments
-      myErrorStatus=14;
-      return;
-    }
-  }
-  else if (myDims[0]>myDims[1]) {
-    if (myOperation==BOPAlgo_FUSE ||
-        myOperation==BOPAlgo_CUT) {
-      // non-licit operation for the arguments
-      myErrorStatus=14; 
-      return;
-    }
+  if (((myOperation == BOPAlgo_FUSE)  && (iDimMax[0] != iDimMax[1])) ||
+      ((myOperation == BOPAlgo_CUT)   && (iDimMax[0] >  iDimMin[1])) ||
+      ((myOperation == BOPAlgo_CUT21) && (iDimMin[0] <  iDimMax[1])) ) {
+    // non-licit operation for the arguments
+    myErrorStatus=14;
+    return;
   }
+  //
+  myDims[0] = iDimMin[0];
+  myDims[1] = iDimMin[1];
 }
 //=======================================================================
 //function : Prepare
@@ -500,198 +515,187 @@ void BOPAlgo_BOP::PerformInternal1(const BOPAlgo_PaveFiller& theFiller)
 //=======================================================================
 void BOPAlgo_BOP::BuildRC()
 {
-  Standard_Boolean bFlag1, bFlag2, bIsBound;
-  Standard_Integer aDmin;
-  TopAbs_ShapeEnum aTmin;
+  TopAbs_ShapeEnum aType;
   TopoDS_Compound aC;
   BRep_Builder aBB;
-  TopExp_Explorer aExp;
-  BOPCol_DataMapOfShapeShape aDMSSA;
-  BOPCol_ListIteratorOfListOfShape aItLS, aItIm; 
-  Standard_Boolean bHasInterf;
-  Standard_Integer iX;
-  BOPTools_IndexedDataMapOfSetShape aDMSTS;
   //
-  myErrorStatus=0;
+  myErrorStatus = 0;
   //
   aBB.MakeCompound(aC);
   //
   // A. Fuse
-  if (myOperation==BOPAlgo_FUSE) {
-    aTmin=TypeToExplore(myDims[0]);
-    aExp.Init(myShape, aTmin);
+  if (myOperation == BOPAlgo_FUSE) {
+    BOPCol_MapOfShape aMFence;
+    aType = TypeToExplore(myDims[0]);
+    TopExp_Explorer aExp(myShape, aType);
     for (; aExp.More(); aExp.Next()) {
-      const TopoDS_Shape& aS=aExp.Current();
-      aBB.Add(aC, aS);
+      const TopoDS_Shape& aS = aExp.Current();
+      if (aMFence.Add(aS)) {
+        aBB.Add(aC, aS);
+      }
     }
-    myRC=aC;
+    myRC = aC;
     return;
-  } 
-  //
-  aDmin=myDims[1];
-  if (myDims[0] < myDims[1]) {
-    aDmin=myDims[0];
   }
-  aTmin=TypeToExplore(aDmin);
   //
   // B. Common, Cut, Cut21
   //
-  bFlag1=(myOperation==BOPAlgo_COMMON || myOperation==BOPAlgo_CUT21);
-  bFlag2=(myOperation==BOPAlgo_CUT || myOperation==BOPAlgo_CUT21);
+  Standard_Integer i, j, aNb, iDim;
+  Standard_Boolean bCheckEdges, bContains, bCut21, bCommon;
+  BOPCol_IndexedMapOfShape aMArgs, aMTools;
+  BOPCol_IndexedMapOfShape aMArgsIm, aMToolsIm;
+  BOPCol_ListIteratorOfListOfShape aItLS;
   //
-  const BOPCol_ListOfShape& aLA=( bFlag1) ? myArguments : myTools;
-  aItLS.Initialize(aLA);
-  for (; aItLS.More(); aItLS.Next()) {
-    const TopoDS_Shape& aSA=aItLS.Value();
+  for (i = 0; i < 2; ++i) {
+    const BOPCol_ListOfShape& aLS = !i ? myArguments : myTools;
+    BOPCol_IndexedMapOfShape& aMS = !i ? aMArgs : aMTools;
+    aItLS.Initialize(aLS);
+    for (; aItLS.More(); aItLS.Next()) {
+      const TopoDS_Shape& aS = aItLS.Value();
+      iDim = BOPTools_AlgoTools::Dimension(aS);
+      aType = TypeToExplore(iDim);
+      BOPTools::MapShapes(aS, aType, aMS);
+    }
+  }
+  //
+  bCheckEdges = Standard_False;
+  //
+  for (i = 0; i < 2; ++i) {
+    const BOPCol_IndexedMapOfShape& aMS = !i ? aMArgs : aMTools;
+    BOPCol_IndexedMapOfShape& aMSIm = !i ? aMArgsIm : aMToolsIm;
     //
-    if (myImages.IsBound(aSA)){
-      const BOPCol_ListOfShape& aLSAIm=myImages.Find(aSA);
-      aItIm.Initialize(aLSAIm);
-      for (; aItIm.More(); aItIm.Next()) {
-        const TopoDS_Shape& aSAIm=aItIm.Value();
-        aExp.Init(aSAIm, aTmin);
-        for (; aExp.More(); aExp.Next()) {
-          const TopoDS_Shape aSIm=aExp.Current();
-          aDMSSA.Bind(aSIm, aSIm);
+    aNb = aMS.Extent();
+    for (j = 1; j <= aNb; ++j) {
+      const TopoDS_Shape& aS = aMS(j);
+      aType = aS.ShapeType();
+      if (aType == TopAbs_EDGE) {
+        const TopoDS_Edge& aE = *(TopoDS_Edge*)&aS;
+        bCheckEdges = Standard_True;
+        if (BRep_Tool::Degenerated(aE)) {
+          continue;
         }
       }
-    }
-    //
-    else {
-      aExp.Init(aSA, aTmin);
-      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.Add(aST, aSIm);
-          }
+      //
+      if (myImages.IsBound(aS)) {
+        const BOPCol_ListOfShape& aLSIm = myImages.Find(aS);
+        aItLS.Initialize(aLSIm);
+        for (; aItLS.More(); aItLS.Next()) {
+          const TopoDS_Shape& aSIm = aItLS.Value();
+          aMSIm.Add(aSIm);
         }
       }
+      else {
+        aMSIm.Add(aS);
+      }
     }
-  } //for (; aItLS.More(); aItLS.Next())
+  }
   //
-  const BOPCol_ListOfShape& aLT=(!bFlag1) ? myArguments : myTools;
-  aItLS.Initialize(aLT);
-  for (; aItLS.More(); aItLS.Next()) {
-    const TopoDS_Shape& aTShape =aItLS.Value();
-    if (myImages.IsBound(aTShape)){
-      const BOPCol_ListOfShape& aLSTIm=myImages.Find(aTShape);
-      aItIm.Initialize(aLSTIm);
-      for (; aItIm.More(); aItIm.Next()) {
-        const TopoDS_Shape& aSTIm=aItIm.Value();
-        aExp.Init(aSTIm, aTmin);
-        for (; aExp.More(); aExp.Next()) {
-          const TopoDS_Shape aSIm=aExp.Current();
-          // skip degenerated edges
-          if (aTmin==TopAbs_EDGE) {
-            const TopoDS_Edge& aEIm=*((TopoDS_Edge*)&aSIm);
-            if (BRep_Tool::Degenerated(aEIm)) {
-              continue;
-            }
-          }
-          //
-          bIsBound=aDMSSA.IsBound(aSIm);
-          if (!bFlag2) { // ie common
-            if (bIsBound) {
-              const TopoDS_Shape& aSImA=aDMSSA.Find(aSIm);
-              aBB.Add(aC, aSImA);
-            }
-          }
-          else {// ie cut or cut21
-            if (!bIsBound) {
-              aBB.Add(aC, aSIm);
-            }
-          }
-        }
+  // compare the maps and make the result
+  //
+  Standard_Integer iDimMin, iDimMax;
+  //
+  iDimMin = Min(myDims[0], myDims[1]);
+  bCommon = (myOperation == BOPAlgo_COMMON);
+  bCut21  = (myOperation == BOPAlgo_CUT21);
+  //
+  const BOPCol_IndexedMapOfShape& aMIt = bCut21 ? aMToolsIm : aMArgsIm;
+  const BOPCol_IndexedMapOfShape& aMCheck = bCut21 ? aMArgsIm : aMToolsIm;
+  //
+  BOPCol_IndexedMapOfShape aMCheckExp, aMItExp;
+  //
+  if (bCommon) {
+    aNb = aMIt.Extent();
+    for (i = 1; i <= aNb; ++i) {
+      const TopoDS_Shape& aS = aMIt(i);
+      iDimMax = BOPTools_AlgoTools::Dimension(aS);
+      for (iDim = iDimMin; iDim < iDimMax; ++iDim) {
+        aType = TypeToExplore(iDim);
+        BOPTools::MapShapes(aS, aType, aMItExp);
+      }
+      aMItExp.Add(aS);
+    }
+  }
+  else {
+    aMItExp = aMIt;
+  }
+  //
+  aNb = aMCheck.Extent();
+  for (i = 1; i <= aNb; ++i) {
+    const TopoDS_Shape& aS = aMCheck(i);
+    iDimMax = BOPTools_AlgoTools::Dimension(aS);
+    for (iDim = iDimMin; iDim < iDimMax; ++iDim) {
+      aType = TypeToExplore(iDim);
+      BOPTools::MapShapes(aS, aType, aMCheckExp);
+    }
+    aMCheckExp.Add(aS);
+  }
+  //
+  aNb = aMItExp.Extent();
+  for (i = 1; i <= aNb; ++i) {
+    const TopoDS_Shape& aS = aMItExp(i);
+    //
+    bContains = aMCheckExp.Contains(aS);
+    if (bCommon) {
+      if (bContains) {
+        aBB.Add(aC, aS);
       }
-    }// if (myImages.IsBound(aST)){
+    }
     else {
-      aExp.Init(aTShape, aTmin);
+      if (!bContains) {
+        aBB.Add(aC, aS);
+      }
+    }
+  }
+  //
+  // filter result for COMMON operation
+  if (bCommon) {
+    BOPCol_MapOfShape aMFence;
+    TopExp_Explorer aExp;
+    TopoDS_Compound aCx;
+    aBB.MakeCompound(aCx);
+    //
+    for (iDim = 3; iDim >= iDimMin; --iDim) {
+      aType = TypeToExplore(iDim);
+      aExp.Init(aC, aType);
       for (; aExp.More(); aExp.Next()) {
-        const TopoDS_Shape aSIm=aExp.Current();
-        // skip degenerated edges
-        if (aTmin==TopAbs_EDGE) {
-          const TopoDS_Edge& aEIm=*((TopoDS_Edge*)&aSIm);
-          if (BRep_Tool::Degenerated(aEIm)) {
-            continue;
-          }
-        }
-        bIsBound=aDMSSA.IsBound(aSIm);
-        if (!bFlag2) { // ie common
-          if (bIsBound) {
-            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.Contains(aST)) {
-                 const TopoDS_Shape& aSImA=aDMSTS.FindFromKey(aST);
-                 aBB.Add(aC, aSImA);
-               }
-             }
-          }
-        }
-        else {// ie cut or cut21
-          if (!bIsBound) {
-            if (aTmin==TopAbs_SOLID) {
-              BOPTools_Set aST;
-              //
-              aST.Add(aSIm, TopAbs_FACE);
-              //
-              bIsBound=aDMSTS.Contains(aST); 
-            }
-            //
-            if (!bIsBound) {
-              aBB.Add(aC, aSIm);
-            }
-          }
+        const TopoDS_Shape& aS = aExp.Current();
+        if (aMFence.Add(aS)) {
+          aBB.Add(aCx, aS);
+          BOPTools::MapShapes(aS, aMFence);
         }
       }
     }
-  } //for (; aItLS.More(); aItLS.Next())
+    aC = aCx;
+  }
   //
-  // the squats around degeneracy
-  if (aTmin!=TopAbs_EDGE) {
-    myRC=aC;
+  if (!bCheckEdges) {
+    myRC = aC;
     return;
   }
-  //---------------------------------------------------------
   //
   // The squats around degenerated edges
-  Standard_Integer i, aNbS, nVD;
-  TopAbs_ShapeEnum aType;
+  Standard_Integer nVD;
   BOPCol_IndexedMapOfShape aMVC;
   //
   // 1. Vertices of aC
   BOPTools::MapShapes(aC, TopAbs_VERTEX, aMVC);
   //
   // 2. DE candidates
-  aNbS=myDS->NbSourceShapes();
-  for (i=0; i<aNbS; ++i) {
-    const BOPDS_ShapeInfo& aSI=myDS->ShapeInfo(i);
-    aType=aSI.ShapeType();
-    if (aType!=aTmin) {
+  aNb = myDS->NbSourceShapes();
+  for (i = 0; i < aNb; ++i) {
+    const BOPDS_ShapeInfo& aSI = myDS->ShapeInfo(i);
+    aType = aSI.ShapeType();
+    if (aType != TopAbs_EDGE) {
       continue;
     }
     //
-    const TopoDS_Edge& aE=*((TopoDS_Edge*)&aSI.Shape());
+    const TopoDS_Edge& aE = *((TopoDS_Edge*)&aSI.Shape());
     if (!BRep_Tool::Degenerated(aE)) {
       continue;
     }
     //
-    nVD=aSI.SubShapes().First();
-    const TopoDS_Shape& aVD=myDS->Shape(nVD);
+    nVD = aSI.SubShapes().First();
+    const TopoDS_Shape& aVD = myDS->Shape(nVD);
     //
     if (!aMVC.Contains(aVD)) {
       continue;
@@ -716,86 +720,120 @@ void BOPAlgo_BOP::BuildRC()
 //=======================================================================
 void BOPAlgo_BOP::BuildShape()
 {
-  Standard_Integer aDmin, aNbLCB;
-  TopAbs_ShapeEnum aT1, aT2, aTR;
-  TopoDS_Shape aR, aRC;
+  BuildRC();
+  //
+  if ((myOperation == BOPAlgo_FUSE) && (myDims[0] == 3)) {
+    BuildSolid();
+    return;
+  }
+  //
+  Standard_Integer i;
+  TopAbs_ShapeEnum aType, aT1, aT2;
+  TopTools_ListOfShape aLSC, aLCB;
+  BOPCol_ListIteratorOfListOfShape aItLS, aItLSIm, aItLCB;
   TopoDS_Iterator aIt;
   BRep_Builder aBB;
-  BOPCol_ListOfShape aLCB;
-  BOPCol_ListIteratorOfListOfShape aItLCB;
-  //
-  myErrorStatus=0;
+  TopoDS_Shape aRC, aRCB;
   //
-  BuildRC();
+  TopoDS_Compound aResult;
+  aBB.MakeCompound(aResult);
   //
-  aDmin=myDims[1];
-  if (myDims[0]<myDims[1]) {
-    aDmin=myDims[0];
-  }
+  BOPCol_MapOfShape aMSRC, aMFence;
+  BOPTools::MapShapes(myRC, aMSRC);
   //
-  if (!aDmin) {
-    myShape=myRC;
-    return;
+  // collect images of containers
+  for (i = 0; i < 2; ++i) {
+    const BOPCol_ListOfShape& aLS = !i ? myArguments : myTools;
+    //
+    aItLS.Initialize(aLS);
+    for (; aItLS.More(); aItLS.Next()) {
+      const TopoDS_Shape& aS = aItLS.Value();
+      //
+      CollectContainers(aS, aLSC);
+    }
   }
-  //
-  else if (aDmin==1 || aDmin==2) { //edges, faces 
-    aT1=TopAbs_VERTEX;
-    aT2=TopAbs_EDGE;
-    aTR=TopAbs_WIRE;
-    if (aDmin==2) {
-      aT1=TopAbs_EDGE;
-      aT2=TopAbs_FACE;
-      aTR=TopAbs_SHELL;
+  // make containers
+  aItLS.Initialize(aLSC);
+  for (; aItLS.More(); aItLS.Next()) {
+    const TopoDS_Shape& aSC = aItLS.Value();
+    //
+    BOPTools_AlgoTools::MakeContainer(TopAbs_COMPOUND, aRC);
+    //
+    aIt.Initialize(aSC);
+    for (; aIt.More(); aIt.Next()) {
+      const TopoDS_Shape& aS = aIt.Value();
+      if (myImages.IsBound(aS)) {
+        const TopTools_ListOfShape& aLSIm = myImages.Find(aS);
+        //
+        aItLSIm.Initialize(aLSIm);
+        for (; aItLSIm.More(); aItLSIm.Next()) {
+          const TopoDS_Shape& aSIm = aItLSIm.Value();
+          if (aMSRC.Contains(aSIm) && aMFence.Add(aSIm)) {
+            aBB.Add(aRC, aSIm);
+          }
+        }
+      }
+      else if (aMSRC.Contains(aS) && aMFence.Add(aS)) {
+        aBB.Add(aRC, aS);
+      }
     }
     //
-    BOPTools_AlgoTools::MakeConnexityBlocks
-      (myRC, aT1, aT2, aLCB);
-    aNbLCB=aLCB.Extent();
-    if (!aNbLCB) {
-      myShape=myRC;
-      return;
+    aType = aSC.ShapeType();
+    switch (aType) {
+      case TopAbs_WIRE: {
+        aT1 = TopAbs_VERTEX;
+        aT2 = TopAbs_EDGE;
+        break;
+      }
+      case TopAbs_SHELL: {
+        aT1 = TopAbs_EDGE;
+        aT2 = TopAbs_FACE;
+        break;
+      }
+      default: {
+        aT1 = TopAbs_FACE;
+        aT2 = TopAbs_SOLID;
+      }
     }
     //
-    BOPTools_AlgoTools::MakeContainer(TopAbs_COMPOUND, aRC);  
+    aLCB.Clear();
+    BOPTools_AlgoTools::MakeConnexityBlocks(aRC, aT1, aT2, aLCB);
+    if (aLCB.IsEmpty()) {
+      continue;
+    }
     //
     aItLCB.Initialize(aLCB);
     for (; aItLCB.More(); aItLCB.Next()) {
-      BOPTools_AlgoTools::MakeContainer(aTR, aR);  
+      BOPTools_AlgoTools::MakeContainer(aType, aRCB);
       //
-      const TopoDS_Shape& aCB=aItLCB.Value();
+      const TopoDS_Shape& aCB = aItLCB.Value();
       aIt.Initialize(aCB);
       for (; aIt.More(); aIt.Next()) {
-        const TopoDS_Shape& aS=aIt.Value();
-        aBB.Add(aR, aS);
+        const TopoDS_Shape& aCBS = aIt.Value();
+        aBB.Add(aRCB, aCBS);
       }
       //
-      if (aTR==TopAbs_SHELL) {
-        BOPTools_AlgoTools::OrientFacesOnShell(aR);
+      if (aType == TopAbs_SHELL) {
+        BOPTools_AlgoTools::OrientFacesOnShell(aRCB);
       }
       //
-      aBB.Add(aRC, aR);
+      aBB.Add(aResult, aRCB);
     }
-    myShape=aRC;
-  }// elase if (aDmin==1 || aDmin==2) {
-  
-  else {//aDmin=3
-    Standard_Integer aNbObjs, aNbTools;
-    //
-    aNbObjs=myArguments.Extent();
-    aNbTools=myTools.Extent();
-    //
-    if (aNbObjs==1 && aNbTools==1) {
-      if (myOperation==BOPAlgo_FUSE) {
-        BuildSolid();
-      }
-      else {
-        myShape=myRC;
-      }
-    }
-    else {
-      BuildSolid();
+  }
+  //
+  // add the rest of the shapes into result
+  BOPCol_MapOfShape aMSResult;
+  BOPTools::MapShapes(aResult, aMSResult);
+  //
+  aIt.Initialize(myRC);
+  for (; aIt.More(); aIt.Next()) {
+    const TopoDS_Shape& aS = aIt.Value();
+    if (!aMSResult.Contains(aS)) {
+      aBB.Add(aResult, aS);
     }
   }
+  //
+  myShape = aResult;
 }
 //=======================================================================
 //function : BuildSolid
@@ -1053,3 +1091,29 @@ TopAbs_ShapeEnum TypeToExplore(const Standard_Integer theDim)
   }
   return aRet;
 }
+//=======================================================================
+//function : CollectContainers
+//purpose  : 
+//=======================================================================
+void CollectContainers(const TopoDS_Shape& theS,
+                       BOPCol_ListOfShape& theLSC)
+{
+  TopAbs_ShapeEnum aType = theS.ShapeType();
+  if (aType == TopAbs_WIRE ||
+      aType == TopAbs_SHELL ||
+      aType == TopAbs_COMPSOLID) {
+    theLSC.Append(theS);
+    return;
+  }
+  //
+  if (aType != TopAbs_COMPOUND) {
+    return;
+  }
+  //
+  TopoDS_Iterator aIt(theS);
+  for (; aIt.More(); aIt.Next()) {
+    const TopoDS_Shape& aS = aIt.Value();
+    CollectContainers(aS, theLSC);
+  }
+}
+
index 97f1249ddeaa63a68f7d1489aa34eac6084ce26b..2a2e37e94638d248434a8ab9058ca736feaff55f 100644 (file)
@@ -1,4 +1,4 @@
 source [locate_data_file 20000_et1_401-ta6027.prt.2.gdml.tcl]
 
 ## image is differ from application
-set square 3.52888e+07
+set square 1.26259e+07
index 29a46b572bf60cb7f067cd54e655de6c302de512..6ca06f77c67f6d3b7b42eabf0e0e3d75b8e1a43f 100755 (executable)
@@ -17,11 +17,11 @@ set nb_v_good 12
 set nb_e_good 12
 set nb_w_good 2
 set nb_f_good 1
-set nb_sh_good 1
+set nb_sh_good 0
 set nb_sol_good 0
 set nb_compsol_good 0
 set nb_compound_good 1
-set nb_shape_good 29
+set nb_shape_good 28
 
 set 2dviewer 0
 
index 3a2358bcc2e27fb0ae5d3d9eeac7d9d4e5145725..01bb884cb4c29863efe421d4871c1d83aae44b9d 100755 (executable)
@@ -17,11 +17,11 @@ set nb_v_good 12
 set nb_e_good 12
 set nb_w_good 2
 set nb_f_good 1
-set nb_sh_good 1
+set nb_sh_good 0
 set nb_sol_good 0
 set nb_compsol_good 0
 set nb_compound_good 1
-set nb_shape_good 29
+set nb_shape_good 28
 
 set 2dviewer 0
 
index dbef9be48fb261a16f8dc23a9e255aedd902f735..bd1213fa471df207d43e062c37f2672af509af28 100755 (executable)
@@ -19,12 +19,12 @@ bopfuse result
 
 set nb_v_good 3
 set nb_e_good 4
-set nb_w_good 1
+set nb_w_good 0
 set nb_f_good 0
 set nb_sh_good 0
 set nb_sol_good 0
 set nb_compsol_good 0
 set nb_compound_good 1
-set nb_shape_good 9
+set nb_shape_good 8
 
 set 2dviewer 0
index aeb40c38c2b4c8b0472c987ce5085620cf342404..31956991173bce95365a59d49116e60a51975670 100755 (executable)
@@ -27,12 +27,12 @@ set length 448.285
 
 set nb_v_good 5
 set nb_e_good 4
-set nb_w_good 1
+set nb_w_good 0
 set nb_f_good 0
 set nb_sh_good 0
 set nb_sol_good 0
 set nb_compsol_good 0
 set nb_compound_good 1
-set nb_shape_good 11
+set nb_shape_good 10
 
 set 2dviewer 0
index 748acac8a5720ba68634a58e31bf4bf06b582e0c..f8dfc8ff586aa8e5101288e2e564dac2bf27ad69 100755 (executable)
@@ -25,13 +25,13 @@ set length 300
 
 set nb_v_good 3
 set nb_e_good 2
-set nb_w_good 1
+set nb_w_good 0
 set nb_f_good 0
 set nb_sh_good 0
 set nb_sol_good 0
 set nb_compsol_good 0
 set nb_compound_good 1
-set nb_shape_good 7
+set nb_shape_good 6
 
 
 set 2dviewer 0
index 15712fa3782133b82e979076c7144f69796d1e1d..bf6ed2951d385b9f9fd723d982d5e1b4a35cf3cb 100755 (executable)
@@ -25,11 +25,11 @@ set nb_v_good 11
 set nb_e_good 12
 set nb_w_good 4
 set nb_f_good 2
-set nb_sh_good 1
+set nb_sh_good 0
 set nb_sol_good 0
 set nb_compsol_good 0
 set nb_compound_good 1
-set nb_shape_good 31
+set nb_shape_good 30
 
 set 3dviewer 1
 
index c2a149fb1cebc5b6632c7a742403100535cd5724..a9210fef8c50e716cb1024c42a488942eea709b1 100755 (executable)
@@ -23,10 +23,10 @@ set nb_v_good 34
 set nb_e_good 62
 set nb_w_good 30
 set nb_f_good 29
-set nb_sh_good 1
+set nb_sh_good 0
 set nb_sol_good 0
 set nb_compsol_good 0
 set nb_compound_good 1
-set nb_shape_good 157
+set nb_shape_good 156
 
 set 3dviewer 1
index 1b5405bf91dfa71f8c58c2ca56aff4099cb89e1d..8111768a1f0025ab6ef3653631f309d5efc79caf 100755 (executable)
@@ -13,8 +13,9 @@ bopfuse result
 
 set nb_v_good 2
 set nb_e_good 1
-set nb_w_good 1
-set nb_shape_good 5
+set nb_w_good 0
+set nb_shape_good 4
+
 set length 48.4459
 set command bopfuse
 
index 0edbcb8f422bca9ef4ba8db26f27b64f71629917..d581a5b7c9f684a0e7921ff927bbe12724fab162 100755 (executable)
@@ -17,10 +17,10 @@ bopcut result
 
 set nb_v_good 2
 set nb_e_good 1
-set nb_w_good 1
+set nb_w_good 0
 set nb_f_good 0
 set nb_sh_good 0
 set nb_sol_good 0
 set nb_compsol_good 0
 set nb_compound_good  1
-set nb_shape_good 5
+set nb_shape_good 4
index dec5dfa13e44d6c24382050f6fa25871fcabf675..72f74ceedc341853827b500d7feeb62115b42ed5 100755 (executable)
@@ -33,10 +33,10 @@ set nb_v_good 16
 set nb_e_good 16
 set nb_w_good 1
 set nb_f_good 1
-set nb_sh_good 1
+set nb_sh_good 0
 set nb_sol_good 0
 set nb_compsol_good 0
 set nb_compound_good 1
-set nb_shape_good 36
+set nb_shape_good 35
 
 set 2dviewer 0
index 9e7bbd1b76400c9aefc3ead5957f1304730fbef6..9b737794134498c34b1f0e207281c3761694782f 100644 (file)
@@ -18,10 +18,10 @@ set nb_v_good 9
 set nb_e_good 15
 set nb_w_good 4
 set nb_f_good 4
-set nb_sh_good 1
+set nb_sh_good 0
 set nb_sol_good 0
 set nb_compsol_good 0
 set nb_compound_good 1
-set nb_shape_good 34
+set nb_shape_good 33
 
 set 2dviewer 0
index 54c90778344a269cc9d6a125372a96f162a13b48..5d7781b9a6eabd55229c577c7de609e809c2583e 100644 (file)
@@ -22,12 +22,12 @@ set length 18.5459
 # Analysis of "nbshapes result"
 set nb_v_good 6
 set nb_e_good 4
-set nb_w_good 2
+set nb_w_good 0
 set nb_f_good 0
 set nb_sh_good 0
 set nb_sol_good 0
 set nb_compsol_good 0
 set nb_compound_good 1
-set nb_shape_good 13
+set nb_shape_good 11
 
 set 2dviewer 1
index 57ffe130a310c896b42d218160725e5deb737aad..2db9f01292ffe56adf8323d0f4b7baca0360c056 100644 (file)
@@ -20,12 +20,12 @@ bopcommon result
 
 set nb_v_good 2
 set nb_e_good 1
-set nb_w_good 1
+set nb_w_good 0
 set nb_f_good 0
 set nb_sh_good 0
 set nb_sol_good 0
 set nb_compsol_good 0
 set nb_compound_good 1
-set nb_shape_good 5
+set nb_shape_good 4
 
 set 2dviewer 1
index 1ebb8d2fc79ae9a4a9c3ec192282907a54653ce1..59db6c9b4e34c869fc3c633a0d086b6dea12f80b 100644 (file)
@@ -19,16 +19,15 @@ restore [locate_data_file bug24811_e2.brep] circle
 
 bop curve circle
 bopcut result
-explode result
 
-if { [llength [explode result_1]] != 4 } {
-  puts "Error: wrong number of intersections. Should be result_1_1 result_1_2 result_1_3 result_1_4"
+if { [llength [explode result]] != 4 } {
+  puts "Error: wrong number of intersections. Should be result_1 result_2 result_3 result_4"
 } else {
   puts "OK: right number of intersections"
 }
 
-explode result_1_2
-set info1 [dump result_1_2_1]
+explode result_2
+set info1 [dump result_2_1]
 regexp {Point 3D +: +([-0-9.+eE]+), +([-0-9.+eE]+), +([-0-9.+eE]+)} $info1 full x1 y1 z1
 regexp {Tolerance +: +([-0-9.+eE]+)} $info1 full tol1
 
@@ -49,7 +48,7 @@ if { $p1_3 >= [expr $z1 - $tol1] && $p1_3 <= [expr $z1 + $tol1] } {
 }
 
 
-set info2 [dump result_1_2_2]
+set info2 [dump result_2_2]
 regexp {Point 3D +: +([-0-9.+eE]+), +([-0-9.+eE]+), +([-0-9.+eE]+)} $info2 full x2 y2 z2
 regexp {Tolerance +: +([-0-9.+eE]+)} $info2 full tol2
 
index 4b404481fe20d412701a22ac9f62aa21e94974bd..014b7c0be04670a046312bfd5b47f4ee42b6d4db 100644 (file)
@@ -43,16 +43,16 @@ baddctools b7
 bfillds
 bbop result 2
 
-set square 103838
-
-set nb_v_good 106
-set nb_e_good 164
-set nb_w_good 142
-set nb_f_good 80
-set nb_sh_good 3
-set nb_sol_good 3
+set square 142845
+
+set nb_v_good 108
+set nb_e_good 168
+set nb_w_good 152
+set nb_f_good 86
+set nb_sh_good 7
+set nb_sol_good 7
 set nb_compsol_good 0
 set nb_compound_good 1
-set nb_shape_good 499
+set nb_shape_good 529
 
 set 2dviewer 1
index 51ea4efefc11833e55c653665ab3488c486e7b2b..546e95ae15754d76001f843dcc8e08c844aff8e3 100644 (file)
@@ -18,10 +18,10 @@ set nb_v_good 6
 set nb_e_good 8
 set nb_w_good 2
 set nb_f_good 2
-set nb_sh_good 2
+set nb_sh_good 0
 set nb_sol_good 0
 set nb_compsol_good 0
 set nb_compound_good 1
-set nb_shape_good 21
+set nb_shape_good 19
 
 set 2dviewer 1
index d45aef0bec12384c52e0b28c606b49075a8e5a61..d3a27b8353f6df87173d671e94373886b6d88e09 100644 (file)
@@ -22,10 +22,10 @@ set nb_v_good 4
 set nb_e_good 4
 set nb_w_good 1
 set nb_f_good 1
-set nb_sh_good 1
+set nb_sh_good 0
 set nb_sol_good 0
 set nb_compsol_good 0
 set nb_compound_good 1
-set nb_shape_good 12
+set nb_shape_good 11
 
 set 2dviewer 1
index a3e324da2b82cf1b95f49673e4aa8f8265985d13..818f581b19480d78e618128628fc6caf445639ec 100644 (file)
@@ -14,10 +14,10 @@ bopcommon result
 
 set nb_v_good 2
 set nb_e_good 1
-set nb_w_good 1
+set nb_w_good 0
 set nb_f_good 0
 set nb_sh_good 0
 set nb_sol_good 0
 set nb_compsol_good 0
 set nb_compound_good 1
-set nb_shape_good 5
+set nb_shape_good 4
index dada6b1869118902c03a802e82b85f08d605668c..de01c71d1bc415b34185b97ec04d55b42fbfaab8 100644 (file)
@@ -19,10 +19,10 @@ set nb_v_good 3
 set nb_e_good 4
 set nb_w_good 1
 set nb_f_good 1
-set nb_sh_good 1
+set nb_sh_good 0
 set nb_sol_good 0
 set nb_compsol_good 0
 set nb_compound_good 1
-set nb_shape_good 11
+set nb_shape_good 10
 
 set 2dviewer 1
index 4d15b34ad8d7937fa47f555f639c5de20d52418c..6ff3f9c5e03cd3ca3da32a7e5f434db6227821e3 100644 (file)
@@ -24,10 +24,10 @@ set nb_v_good 4
 set nb_e_good 6
 set nb_w_good 3
 set nb_f_good 3
-set nb_sh_good 1
+set nb_sh_good 0
 set nb_sol_good 0
 set nb_compsol_good 0
 set nb_compound_good 1
-set nb_shape_good 18
+set nb_shape_good 17
 
 set 2dviewer 1
index 6351e020c07494f3c7ebebe9a3cf8dc6fc1b2863..36be0fd87237c63ee761a205a895238c9963002f 100644 (file)
@@ -24,11 +24,11 @@ set nb_v_good 3
 set nb_e_good 3
 set nb_w_good 1
 set nb_f_good 1
-set nb_sh_good 1
+set nb_sh_good 0
 set nb_sol_good 0
 set nb_compsol_good 0
 set nb_compound_good 1
-set nb_shape_good 10
+set nb_shape_good 9
 
 set 2dviewer 1
 
index 16a9f4826fc425ac8542cc9dcbde0333b811dc96..6fada1be7f7688cee249718cd155320cf8226043 100644 (file)
@@ -17,10 +17,10 @@ set nb_v_good 8
 set nb_e_good 12
 set nb_w_good 4
 set nb_f_good 4
-set nb_sh_good 1
+set nb_sh_good 0
 set nb_sol_good 0
 set nb_compsol_good 0
 set nb_compound_good 1
-set nb_shape_good 30
+set nb_shape_good 29
 
 set 3dviewer 1
index fbac40d55cef369a80ff3f8e5218dc00d64c6c57..61b22fd50b0404fb1b77880cef6f6e17589c059c 100644 (file)
@@ -18,10 +18,10 @@ set nb_v_good 4
 set nb_e_good 4
 set nb_w_good 1
 set nb_f_good 1
-set nb_sh_good 1
+set nb_sh_good 0
 set nb_sol_good 0
 set nb_compsol_good 0
 set nb_compound_good 1
-set nb_shape_good 12
+set nb_shape_good 11
 
 set 3dviewer 1
index c1a2c273f832d6ee218f91629fbea6fa063cc319..42c5b195cc4f01be58c1592d52b3ab28aa3d7532 100755 (executable)
@@ -45,13 +45,13 @@ baddctools b2
 bapibop result 0
 
 set nb_v_good 1720
-set nb_e_good 3800
-set nb_w_good 1920
-set nb_f_good 1920
-set nb_sh_good 1
-set nb_sol_good 1
+set nb_e_good 4260
+set nb_w_good 3220
+set nb_f_good 3220
+set nb_sh_good 760
+set nb_sol_good 760
 set nb_compsol_good 0
 set nb_compound_good 1
-set nb_shape_good 9363
+set nb_shape_good 13941
 
 set 3dviewer 1
index b8907e1b5525136d25cdde8c45cc77c723dcef9a..c321a580b28b7852aea0c1798fbfb8d6a8e4e69d 100755 (executable)
@@ -46,12 +46,12 @@ bapibop result 2
 
 set nb_v_good 888
 set nb_e_good 1412
-set nb_w_good 686
-set nb_f_good 686
-set nb_sh_good 82
-set nb_sol_good 82
+set nb_w_good 726
+set nb_f_good 726
+set nb_sh_good 121
+set nb_sol_good 121
 set nb_compsol_good 0
 set nb_compound_good 1
-set nb_shape_good 3837
+set nb_shape_good 3995
 
 set 3dviewer 1
index a825b460d68991e3e25f90b55fafd85c1425ad0b..f44c178228edc601f514bf1d91c8539264b0c485 100755 (executable)
@@ -45,13 +45,13 @@ baddctools b2
 bapibop result 3
 
 set nb_v_good 2640
-set nb_e_good 5780
-set nb_w_good 2820
-set nb_f_good 2820
-set nb_sh_good 2
-set nb_sol_good 2
+set nb_e_good 5960
+set nb_w_good 3720
+set nb_f_good 3720
+set nb_sh_good 560
+set nb_sol_good 560
 set nb_compsol_good 0
 set nb_compound_good 1
-set nb_shape_good 14065
+set nb_shape_good 17161
 
 set 3dviewer 1
index dcc82e231881fc67196ffb848cf7e3931c378e52..c78ba3699b6a758cec65da76f222a5e60ba1d1ca 100644 (file)
@@ -18,10 +18,10 @@ set nb_v_good 10
 set nb_e_good 11
 set nb_w_good 2
 set nb_f_good 2
-set nb_sh_good 1
+set nb_sh_good 0
 set nb_sol_good 0
 set nb_compsol_good 0
 set nb_compound_good 1
-set nb_shape_good 27
+set nb_shape_good 26
 
 set 2dviewer 1
index 3c525a6258ffda9786c50ea19f5e59662561e4ab..8d52a802c7b1affdf13c59458b310da951dc3d41 100644 (file)
@@ -24,10 +24,10 @@ set nb_v_good 2
 set nb_e_good 3
 set nb_w_good 3
 set nb_f_good 1
-set nb_sh_good 1
+set nb_sh_good 0
 set nb_sol_good 0
 set nb_compsol_good 0
 set nb_compound_good 1
-set nb_shape_good 11
+set nb_shape_good 10
 
 set 2dviewer 1
index 039abf19eaa70667cd6be741f10f35b103608136..dae7aafd960d04dee222e0b6738d60836a2f6163 100755 (executable)
@@ -25,11 +25,11 @@ Number of shapes in shape
  EDGE      : 4
  WIRE      : 1
  FACE      : 1
- SHELL     : 1
+ SHELL     : 0
  SOLID     : 0
  COMPSOLID : 0
  COMPOUND  : 1
- SHAPE     : 12
+ SHAPE     : 11
 "
 checknbshapes result -ref ${nbshapes_expected} -t -m "Result obtained by Cut a wire by halfspace"
 
index 564f6ba17778a56d01b5e24f68e93bd953d9969f..a6d6078f8fd364792c2b36cf0ef4278b4510c499 100755 (executable)
@@ -25,11 +25,11 @@ Number of shapes in shape
  EDGE : 9
  WIRE : 1
  FACE : 1
- SHELL : 1
+ SHELL : 0
  SOLID : 0
  COMPSOLID : 0
  COMPOUND : 1
- SHAPE : 22
+ SHAPE : 21
 
 "
 checknbshapes result -ref ${nbshapes_expected} -t -m "result obtained by Common operator"
diff --git a/tests/bugs/modalg_6/bug26565_1 b/tests/bugs/modalg_6/bug26565_1
new file mode 100755 (executable)
index 0000000..8b0b3c0
--- /dev/null
@@ -0,0 +1,46 @@
+puts "============"
+puts "OCC26565"
+puts "============"
+puts ""
+###############################
+## Compsolid after cut becomes compound of solids
+###############################
+
+box b1 10 10 10
+explode b1 f
+copy b1_1 f
+explode b1 e
+copy b1_8 e
+
+box b2 10 5 5
+
+bclearobjects
+bcleartools
+baddobjects f e
+baddtools b2
+
+bfillds
+bbop r 0
+
+nbshapes r
+
+bbop r 2
+
+nbshapes r
+explode r
+
+# should edge and face
+
+set ShapeType "FACE"
+if { [regexp $ShapeType [whatis r_1]] == 1  } {
+   puts "OK : There is $ShapeType; Compsolid is good"
+} else {
+   puts "Error : There is not $ShapeType; Compsolid is bad"
+}
+
+set ShapeType "EDGE"
+if { [regexp $ShapeType [whatis r_2]] == 1  } {
+   puts "OK : There is $ShapeType; Compsolid is good"
+} else {
+   puts "Error : There is not $ShapeType; Compsolid is bad"
+}
diff --git a/tests/bugs/modalg_6/bug26565_2 b/tests/bugs/modalg_6/bug26565_2
new file mode 100755 (executable)
index 0000000..b8a6223
--- /dev/null
@@ -0,0 +1,51 @@
+puts "============"
+puts "OCC26565"
+puts "============"
+puts ""
+###############################
+## Compsolid after cut becomes compound of solids
+###############################
+
+box b1 10 10 10
+box b2 5 0 0 10 10 10
+explode b2 sh
+copy b2_1 b2
+box b3 5 0 5 10 10 10
+
+bclearobjects
+bcleartools
+baddobjects b1 b2
+baddtools b3
+
+bfillds
+bbop r 0
+
+nbshapes r
+
+bbop r 2
+
+nbshapes r
+explode r
+
+# should shell and two solids
+
+set ShapeType "SHELL"
+if { [regexp $ShapeType [whatis r_1]] == 1  } {
+   puts "OK : There is $ShapeType; Compsolid is good"
+} else {
+   puts "Error : There is not $ShapeType; Compsolid is bad"
+}
+
+set ShapeType "SOLID"
+if { [regexp $ShapeType [whatis r_2]] == 1  } {
+   puts "OK : There is $ShapeType; Compsolid is good"
+} else {
+   puts "Error : There is not $ShapeType; Compsolid is bad"
+}
+
+set ShapeType "SOLID"
+if { [regexp $ShapeType [whatis r_3]] == 1  } {
+   puts "OK : There is $ShapeType; Compsolid is good"
+} else {
+   puts "Error : There is not $ShapeType; Compsolid is bad"
+}
diff --git a/tests/bugs/modalg_6/bug26565_3 b/tests/bugs/modalg_6/bug26565_3
new file mode 100755 (executable)
index 0000000..64ae202
--- /dev/null
@@ -0,0 +1,52 @@
+puts "============"
+puts "OCC26565"
+puts "============"
+puts ""
+###############################
+## Compsolid after cut becomes compound of solids
+###############################
+
+box b1 10 10 10
+explode b1 f
+copy b1_1 f
+explode b1 e
+copy b1_8 e
+
+box b2 10 5 5
+shape sh sh
+add f sh
+copy sh f
+shape w w
+add e w
+copy w e
+
+bclearobjects
+bcleartools
+baddobjects f e
+baddtools b2
+
+bfillds
+bbop r 0
+
+nbshapes r
+
+bbop r 2
+
+nbshapes r
+explode r
+
+# should be shell and wire
+set ShapeType "SHELL"
+if { [regexp $ShapeType [whatis r_1]] == 1  } {
+   puts "OK : There is $ShapeType; Compsolid is good"
+} else {
+   puts "Error : There is not $ShapeType; Compsolid is bad"
+}
+
+set ShapeType "WIRE"
+if { [regexp $ShapeType [whatis r_2]] == 1  } {
+   puts "OK : There is $ShapeType; Compsolid is good"
+} else {
+   puts "Error : There is not $ShapeType; Compsolid is bad"
+}
diff --git a/tests/bugs/modalg_6/bug26565_4 b/tests/bugs/modalg_6/bug26565_4
new file mode 100755 (executable)
index 0000000..c18ab2a
--- /dev/null
@@ -0,0 +1,47 @@
+puts "============"
+puts "OCC26565"
+puts "============"
+puts ""
+###############################
+## Compsolid after cut becomes compound of solids
+###############################
+
+box b1 10 10 10
+box b2 10 0 0 10 5 5
+box b3 10 5 0 10 5 5
+box b4 10 0 5 10 10 5
+
+bclearobjects
+bcleartools
+baddobjects b1 b2 b3 b4
+
+bfillds
+bbuild r
+
+explode r so
+
+shape b1 CS
+add r_1 b1
+add r_2 b1
+add r_3 b1
+add r_4 b1
+
+box b2 5 0 2 10 10 10
+bclearobjects
+bcleartools
+baddobjects b1
+baddtools b2
+
+bfillds
+bbop r 2
+
+explode r
+
+# should be compsolid
+set ShapeType "COMPSOLID"
+if { [regexp $ShapeType [whatis r_1]] == 1  } {
+   puts "OK : There is $ShapeType; Compsolid is good"
+} else {
+   puts "Error : There is not $ShapeType; Compsolid is bad"
+}
diff --git a/tests/bugs/modalg_6/bug26565_5 b/tests/bugs/modalg_6/bug26565_5
new file mode 100755 (executable)
index 0000000..0607643
--- /dev/null
@@ -0,0 +1,68 @@
+puts "============"
+puts "OCC26565"
+puts "============"
+puts ""
+###############################
+## Compsolid after cut becomes compound of solids
+###############################
+
+box b1 10 10 10
+box b2 10 0 0 10 5 5
+box b3 10 5 0 10 5 5
+box b4 10 0 5 10 10 5
+
+bclearobjects
+bcleartools
+baddobjects b1 b2 b3 b4
+bfillds
+
+bbuild r
+
+explode r so
+shape b1 CS
+add r_1 b1
+add r_2 b1
+add r_3 b1
+add r_4 b1
+
+box b2 5 0 2 10 10 5
+box b3 5 0 7 10 10 5
+bclearobjects
+bcleartools
+baddobjects b2 b3
+
+bfillds
+bbuild r
+
+explode r so
+shape b2 CS
+add r_1 b2
+add r_2 b2
+
+box b3 -5 2 3 30 6 4
+
+bclearobjects
+bcleartools
+baddobjects b1 b2
+baddtools b3
+
+bfillds
+bbop r 2
+
+explode r
+
+# should be two compsolids
+set ShapeType "COMPSOLID"
+if { [regexp $ShapeType [whatis r_1]] == 1  } {
+   puts "OK : There is $ShapeType; Compsolid is good"
+} else {
+   puts "Error : There is not $ShapeType; Compsolid is bad"
+}
+
+set ShapeType "COMPSOLID"
+if { [regexp $ShapeType [whatis r_2]] == 1  } {
+   puts "OK : There is $ShapeType; Compsolid is good"
+} else {
+   puts "Error : There is not $ShapeType; Compsolid is bad"
+}
diff --git a/tests/bugs/modalg_6/bug26565_6 b/tests/bugs/modalg_6/bug26565_6
new file mode 100755 (executable)
index 0000000..7624b51
--- /dev/null
@@ -0,0 +1,67 @@
+puts "============"
+puts "OCC26565"
+puts "============"
+puts ""
+###############################
+## Compsolid after cut becomes compound of solids
+###############################
+
+box b1 10 10 10
+box b2 10 0 0 10 5 5
+box b3 10 5 0 10 5 5
+box b4 10 0 5 10 10 5
+
+bclearobjects
+bcleartools
+baddobjects b1 b2 b3 b4
+
+bfillds
+bbuild r
+
+explode r so
+shape b1 CS
+add r_1 b1
+add r_2 b1
+add r_3 b1
+add r_4 b1
+
+box b2 5 0 2 10 10 5
+box b3 5 0 7 10 10 5
+bclearobjects
+bcleartools
+baddobjects b2 b3
+
+bfillds
+bbuild r
+
+explode r so
+shape b2 CS
+add r_1 b2
+add r_2 b2
+
+box b3 5 -2 -2 10 14 20
+bclearobjects
+bcleartools
+baddobjects b1 b2
+baddtools b3
+
+bfillds
+bbop r 2
+
+explode r
+
+# should be two compsolids
+set ShapeType "COMPSOLID"
+if { [regexp $ShapeType [whatis r_1]] == 1  } {
+   puts "OK : There is $ShapeType; Compsolid is good"
+} else {
+   puts "Error : There is not $ShapeType; Compsolid is bad"
+}
+
+set ShapeType "COMPSOLID"
+if { [regexp $ShapeType [whatis r_2]] == 1  } {
+   puts "OK : There is $ShapeType; Compsolid is good"
+} else {
+   puts "Error : There is not $ShapeType; Compsolid is bad"
+}
diff --git a/tests/bugs/modalg_6/bug26565_7 b/tests/bugs/modalg_6/bug26565_7
new file mode 100755 (executable)
index 0000000..0a619f2
--- /dev/null
@@ -0,0 +1,54 @@
+puts "============"
+puts "OCC26565"
+puts "============"
+puts ""
+###############################
+## Compsolid after cut becomes compound of solids
+###############################
+
+box b1 10 10 10
+box b2 10 0 0 10 5 5
+box b3 10 5 0 10 5 5
+box b4 10 0 5 10 10 5
+
+bclearobjects
+bcleartools
+baddobjects b1 b2 b3 b4
+
+bfillds
+bbuild r
+
+explode r so
+shape b1 CS
+add r_1 b1
+add r_2 b1
+add r_3 b1
+add r_4 b1
+
+box b2 5 0 2 10 10 10
+box b3 -5 2 3 30 6 4
+bclearobjects
+bcleartools
+baddobjects b1 b2
+baddtools b3
+
+bfillds
+bbop r 2
+
+explode r
+
+# should be compsolid and solid
+
+set ShapeType "COMPSOLID"
+if { [regexp $ShapeType [whatis r_1]] == 1  } {
+   puts "OK : There is $ShapeType; Compsolid is good"
+} else {
+   puts "Error : There is not $ShapeType; Compsolid is bad"
+}
+
+set ShapeType "SOLID"
+if { [regexp $ShapeType [whatis r_2]] == 1  } {
+   puts "OK : There is $ShapeType; Compsolid is good"
+} else {
+   puts "Error : There is not $ShapeType; Compsolid is bad"
+}
diff --git a/tests/bugs/modalg_6/bug26565_8 b/tests/bugs/modalg_6/bug26565_8
new file mode 100755 (executable)
index 0000000..efe49fd
--- /dev/null
@@ -0,0 +1,33 @@
+puts "============"
+puts "OCC26565"
+puts "============"
+puts ""
+###############################
+## Compsolid after cut becomes compound of solids
+###############################
+
+box b 10 10 10
+explode b f
+mkshe profile b_1 b_3
+
+polyline spine 0 0 0 10 10 0
+
+pipe sh spine profile
+
+whatis sh
+plane pl 10 10 0 -1 -1 0 1 0 0
+mkface f pl
+mksol sl f
+
+bcut res sh sl
+
+explode res
+
+# should be compsolid
+
+set ShapeType "COMPSOLID"
+if { [regexp $ShapeType [whatis res_1]] == 1  } {
+   puts "OK : There is $ShapeType; Compsolid is good"
+} else {
+   puts "Error : There is not $ShapeType; Compsolid is bad"
+}
index 5c29422e5b0fe4632c05a12cf56824ad1bc55161..d06d3c7f17d22834d0741b80e86b3302879393c7 100755 (executable)
@@ -28,11 +28,11 @@ Number of shapes in shape
  EDGE      : 7
  WIRE      : 3
  FACE      : 3
- SHELL     : 1
+ SHELL     : 0
  SOLID     : 0
  COMPSOLID : 0
  COMPOUND  : 1
- SHAPE     : 20
+ SHAPE     : 19
 "
 checknbshapes result -ref ${nbshapes_expected} -t -m "result obtained by Common operator"
 
index 2e8fead91a4458c63ef44999314acdb0e1906b63..b6b8164f5601cd2b66fc4dc707713a6e43d263ba 100644 (file)
@@ -25,10 +25,10 @@ set nb_v_good 6
 set nb_e_good 10
 set nb_w_good 8
 set nb_f_good 6
-set nb_sh_good 1
+set nb_sh_good 0
 set nb_sol_good 0
 set nb_compsol_good 0
 set nb_compound_good 1
-set nb_shape_good 32
+set nb_shape_good 31
 
 set 3dviewer 1
index 08ac9921070c9464a1838b3ff2e345b4c6d0f04e..b082f005ccbdedb894284f8056a052e7c07c8686 100644 (file)
@@ -31,10 +31,10 @@ set nb_v_good 37
 set nb_e_good 39
 set nb_w_good 4
 set nb_f_good 3
-set nb_sh_good 1
+set nb_sh_good 0
 set nb_sol_good 0
 set nb_compsol_good 0
 set nb_compound_good 1
-set nb_shape_good 85
+set nb_shape_good 84
 
 set 3dviewer 1
index edb13d6d38f30b69c4171a7cb66ebbee295b04b9..6692bba19eb6ee7378eb7d982b91584f208d2320 100644 (file)
@@ -36,10 +36,10 @@ set nb_v_good 37
 set nb_e_good 39
 set nb_w_good 4
 set nb_f_good 3
-set nb_sh_good 1
+set nb_sh_good 0
 set nb_sol_good 0
 set nb_compsol_good 0
 set nb_compound_good 1
-set nb_shape_good 85
+set nb_shape_good 84
 
 set 3dviewer 1