]> OCCT Git - occt-copy.git/commitdiff
0028189: Result of Boolean operation is non-manifold wire
authoremv <emv@opencascade.com>
Wed, 28 Dec 2016 12:39:00 +0000 (15:39 +0300)
committeremv <emv@opencascade.com>
Wed, 28 Dec 2016 12:39:00 +0000 (15:39 +0300)
1. The result of Boolean operation on the arguments of collection type, containers WIRE/SHELL/COMPSOLID, is now also a collection.
The result of Boolean operation on arguments of non-collection types is now a compound containing the splits of arguments directly, without its enclosure into containers.
Thus, if there were no containers, such as WIRE/SHELL/COMPSOLID, in the input arguments there will be no such containers in the result of BOP.

2. The containers of type WIRE included into result should now also (as the SHELLs) have coherent orientation of its sub-shapes.
For that the new method has been implemented (BOPTools_AlgoTools::OrientEdgesOnWire(TopoDS_Shape&)) which reorients edges of the given shape for correct ordering.

3. The duplicating containers, i.e. containers with the contents completely included in other containers, are now avoided in the result of BOP.

4. Documentation has been updated.

5. New test cases for the issue.

6. Adjusting test cases to current behavior.

70 files changed:
dox/user_guides/boolean_operations/boolean_operations.md
samples/tcl/snowflake.tcl
src/BOPAlgo/BOPAlgo_BOP.cxx
src/BOPTools/BOPTools_AlgoTools.cdl
src/BOPTools/BOPTools_AlgoTools.cxx
tests/boolean/bfuse_2d/A2
tests/boolean/bfuse_2d/A3
tests/boolean/bfuse_2d/A4
tests/boolean/bfuse_2d/B1
tests/boolean/bfuse_2d/B2
tests/boolean/bfuse_2d/B3
tests/boolean/bfuse_2d/B9
tests/boolean/bopfuse_2d/A2
tests/boolean/bopfuse_2d/A3
tests/boolean/bopfuse_2d/A4
tests/boolean/bopfuse_2d/B1
tests/boolean/bopfuse_2d/B2
tests/boolean/bopfuse_2d/B3
tests/boolean/bopfuse_2d/B9
tests/boolean/bopfuse_complex/N2
tests/boolean/bopfuse_complex/N5
tests/boolean/bopfuse_complex/N6
tests/boolean/bopfuse_complex/O1
tests/boolean/bopfuse_complex/O4
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_4 [new file with mode: 0644]
tests/bugs/modalg_6/bug26565_5 [new file with mode: 0644]
tests/bugs/modalg_6/bug26565_6 [new file with mode: 0644]
tests/bugs/modalg_6/bug26565_7 [new file with mode: 0644]
tests/bugs/modalg_6/bug26565_8 [new file with mode: 0644]
tests/bugs/modalg_6/bug26582
tests/bugs/modalg_6/bug28189_1 [new file with mode: 0644]
tests/bugs/modalg_6/bug28189_2 [new file with mode: 0644]
tests/bugs/modalg_6/bug28189_3 [new file with mode: 0644]
tests/bugs/modalg_6/bug28189_4 [new file with mode: 0644]
tests/bugs/modalg_6/bug28189_5 [new file with mode: 0644]
tests/bugs/modalg_6/bug28189_7 [new file with mode: 0644]
tests/bugs/moddata_3/bug23738
tests/bugs/moddata_3/bug24108
tests/bugs/moddata_3/bug24108_2

index a26fe7595227b912d4e74d58695e87787fef7e60..7676b54bea35153e99d916b6d980e79535634279 100644 (file)
@@ -1078,6 +1078,12 @@ The input data for this step is a *BOPAlgo_Builder* object after building result
 * 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 *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 arguments 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 a compound containing Wire.
+* For the arguments of collection type (WIRE, SHELL, COMPSOLID) containing overlapping parts the overlapping parts passed into result will be repeated for each container from the input shapes containing such parts. The containers completely included in other containers will be avoided in the result.
+* For the arguments of collection type (WIRE, SHELL, COMPSOLID) the containers included into result will have the same orientation as the original containers from arguments. In case of duplication its orientation will be defined by the orientation of the first container in arguments. Each container included into result will have coherent orientation of its sub-shapes.
+* The result of the operation Fuse for the arguments of collection type (WIRE, SHELL) will consist of the shapes of the same collection type. The overlapping parts (EDGES/FACES) will be shared among containers, but duplicating containers will be avoided in the result. For example, the result of Fuse operation between two fully coinciding wires will be one wire, but the result of Fuse operation between two partially coinciding wires will be two wires sharing coinciding edges.
+* The result of the operation Fuse for the arguments of type COMPSOLID will consist of the compound containing fused solids.
+* The result of the operation Common for the arguments of collection type (WIRE, SHELL, COMPSOLID) will consist of the unique containers containing the overlapping parts. For example, the result of Common operation between two fully overlapping wires will be one wire containing all splits of edges. The number of wires in the result of Common operation between two partially overlapping wires will be equal to the number of connexity blocks of overlapping edges.
 
 @subsection occt_algorithms_9_4 Examples
 
index 3b50252e5861a28f8f6cc795f3ac01a00a2fc2c3..d2702a51914d0ab7ebc4dd13ef60969fa61da031 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
@@ -87,6 +87,9 @@ bfuse w w w2
 bfuse w w w3
 bfuse w w w4
 bfuse w w w5
+shape wsh Sh
+foreach f [explode w f] {add $f wsh}
+renamevar wsh w
 unifysamedom r w
 
 # keep only wires in compound
index e9638c4d6da00192f3c970491d286a0700c38199..a093a5753d58c09bfaf8b8f7e4de61bfcd7f2a2b 100644 (file)
@@ -51,6 +51,21 @@ typedef NCollection_IndexedDataMap
 //
 static
   TopAbs_ShapeEnum TypeToExplore(const Standard_Integer theDim);
+//
+static
+  void CollectContainers(const TopoDS_Shape& theS,
+                         BOPCol_ListOfShape& theLSC);
+//
+static
+  void RemoveDuplicates(BOPCol_ListOfShape& theContainers);
+//
+static
+  void RemoveDuplicates(BOPCol_ListOfShape& theContainers,
+                        const TopAbs_ShapeEnum theType);
+//
+static
+  Standard_Integer NbCommonItemsInMap(const BOPCol_MapOfShape& theM1,
+                                      const BOPCol_MapOfShape& theM2);
 
 
 //=======================================================================
@@ -738,86 +753,135 @@ void BOPAlgo_BOP::BuildRC()
 //=======================================================================
 void BOPAlgo_BOP::BuildShape()
 {
-  Standard_Integer aDmin, aNbLCB;
-  TopAbs_ShapeEnum aT1, aT2, aTR;
-  TopoDS_Shape aR, aRC;
-  TopoDS_Iterator aIt;
-  BRep_Builder aBB;
-  BOPCol_ListOfShape aLCB;
-  BOPCol_ListIteratorOfListOfShape aItLCB;
-  //
-  myErrorStatus=0;
-  //
   BuildRC();
   //
-  aDmin=myDims[1];
-  if (myDims[0]<myDims[1]) {
-    aDmin=myDims[0];
-  }
-  //
-  if (!aDmin) {
-    myShape=myRC;
+  if ((myOperation == BOPAlgo_FUSE) && (myDims[0] == 3)) {
+    BuildSolid();
     return;
   }
   //
-  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;
+  Standard_Integer i;
+  TopAbs_ShapeEnum aType, aT1, aT2;
+  BOPCol_ListOfShape aLSC, aLCB;
+  BOPCol_ListIteratorOfListOfShape aItLS, aItLSIm, aItLCB;
+  TopoDS_Iterator aIt;
+  BRep_Builder aBB;
+  TopoDS_Shape aRC, aRCB;
+  //
+  BOPCol_MapOfShape aMSRC;
+  BOPTools::MapShapes(myRC, aMSRC);
+  //
+  // 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);
     }
+  }
+  // make containers
+  BOPCol_ListOfShape aLCRes;
+  aItLS.Initialize(aLSC);
+  for (; aItLS.More(); aItLS.Next()) {
+    const TopoDS_Shape& aSC = aItLS.Value();
     //
-    BOPTools_AlgoTools::MakeConnexityBlocks
-      (myRC, aT1, aT2, aLCB);
-    aNbLCB=aLCB.Extent();
-    if (!aNbLCB) {
-      myShape=myRC;
-      return;
+    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 BOPCol_ListOfShape& aLSIm = myImages.Find(aS);
+        //
+        aItLSIm.Initialize(aLSIm);
+        for (; aItLSIm.More(); aItLSIm.Next()) {
+          const TopoDS_Shape& aSIm = aItLSIm.Value();
+          if (aMSRC.Contains(aSIm)) {
+            aBB.Add(aRC, aSIm);
+          }
+        }
+      }
+      else if (aMSRC.Contains(aS)) {
+        aBB.Add(aRC, aS);
+      }
     }
     //
-    BOPTools_AlgoTools::MakeContainer(TopAbs_COMPOUND, aRC);  
+    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;
+      }
+    }
+    //
+    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);
-      }
-      //
-      if (aTR==TopAbs_SHELL) {
-        BOPTools_AlgoTools::OrientFacesOnShell(aR);
+        const TopoDS_Shape& aCBS = aIt.Value();
+        aBB.Add(aRCB, aCBS);
       }
       //
-      aBB.Add(aRC, aR);
-    }
-    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();
+      if (aType == TopAbs_WIRE) {
+        // reorient wire
+        BOPTools_AlgoTools::OrientEdgesOnWire(aRCB);
       }
-      else {
-        myShape=myRC;
+      else if (aType == TopAbs_SHELL) {
+        BOPTools_AlgoTools::OrientFacesOnShell(aRCB);
       }
+      //
+      aRCB.Orientation(aSC.Orientation());
+      //
+      aLCRes.Append(aRCB);
     }
-    else {
-      BuildSolid();
+  }
+  //
+  RemoveDuplicates(aLCRes);
+  //
+  // add containers to result
+  TopoDS_Compound aResult;
+  aBB.MakeCompound(aResult);
+  //
+  aItLS.Initialize(aLCRes);
+  for (; aItLS.More(); aItLS.Next()) {
+    aBB.Add(aResult, aItLS.Value());
+  }
+  //
+  // 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.Add(aS)) {
+      aBB.Add(aResult, aS);
     }
   }
+  //
+  myShape = aResult;
 }
 //=======================================================================
 //function : BuildSolid
@@ -1075,3 +1139,149 @@ 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);
+  }
+}
+
+//=======================================================================
+//function : RemoveDuplicates
+//purpose  : Filters the containers with identical contents
+//=======================================================================
+void RemoveDuplicates(BOPCol_ListOfShape& theContainers)
+{
+  RemoveDuplicates(theContainers, TopAbs_WIRE);
+  RemoveDuplicates(theContainers, TopAbs_SHELL);
+  RemoveDuplicates(theContainers, TopAbs_COMPSOLID);
+}
+
+//=======================================================================
+//function : RemoveDuplicates
+//purpose  : Filters the containers of given type with identical contents
+//=======================================================================
+void RemoveDuplicates(BOPCol_ListOfShape& theContainers,
+                      const TopAbs_ShapeEnum theType)
+{
+  // get containers of given type
+  BOPCol_ListOfShape aLC;
+  BOPCol_ListIteratorOfListOfShape aItLC(theContainers);
+  for (; aItLC.More(); aItLC.Next()) {
+    const TopoDS_Shape& aC = aItLC.Value();
+    if (aC.ShapeType() == theType) {
+      aLC.Append(aC);
+    }
+  }
+  //
+  if (aLC.IsEmpty()) {
+    return;
+  }
+  //
+  // map containers to compare its contents
+  NCollection_IndexedDataMap<TopoDS_Shape, BOPCol_MapOfShape> aContents;
+  //
+  aItLC.Initialize(aLC);
+  for (; aItLC.More(); aItLC.Next()) {
+    const TopoDS_Shape& aC = aItLC.Value();
+    //
+    BOPCol_MapOfShape& aMC = aContents(aContents.Add(aC, BOPCol_MapOfShape()));
+    //
+    TopoDS_Iterator aIt(aC);
+    for (; aIt.More(); aIt.Next()) {
+      aMC.Add(aIt.Value());
+    }
+  }
+  //
+  // compare the contents of the containers and find duplicates
+  BOPCol_MapOfShape aDuplicates;
+  //
+  Standard_Integer i, j, aNb = aContents.Extent();
+  for (i = 1; i <= aNb; ++i) {
+    const TopoDS_Shape& aCi = aContents.FindKey(i);
+    if (aDuplicates.Contains(aCi)) {
+      continue;
+    }
+    const BOPCol_MapOfShape& aMi = aContents(i);
+    Standard_Integer aNbi = aMi.Extent();
+    //
+    for (j = i + 1; j <= aNb; ++j) {
+      const TopoDS_Shape& aCj = aContents.FindKey(j);
+      if (aDuplicates.Contains(aCj)) {
+        continue;
+      }
+      const BOPCol_MapOfShape& aMj = aContents(j);
+      Standard_Integer aNbj = aMj.Extent();
+      //
+      Standard_Integer aNbCommon = NbCommonItemsInMap(aMi, aMj);
+      //
+      if (aNbj == aNbCommon) {
+        aDuplicates.Add(aCj);
+        continue;
+      }
+      //
+      if (aNbi == aNbCommon) {
+        aDuplicates.Add(aCi);
+        break;
+      }
+    }
+  }
+  //
+  if (aDuplicates.IsEmpty()) {
+    return;
+  }
+  //
+  // remove duplicating containers
+  aItLC.Initialize(theContainers);
+  for (; aItLC.More(); ) {
+    const TopoDS_Shape& aC = aItLC.Value();
+    if (aDuplicates.Contains(aC)) {
+      theContainers.Remove(aItLC);
+      continue;
+    }
+    aItLC.Next();
+  }
+}
+
+//=======================================================================
+//function : NbCommonItemsInMap
+//purpose  : Counts the items contained in both maps
+//=======================================================================
+Standard_Integer NbCommonItemsInMap(const BOPCol_MapOfShape& theM1,
+                                    const BOPCol_MapOfShape& theM2)
+{
+  const BOPCol_MapOfShape* aMap1 = &theM1;
+  const BOPCol_MapOfShape* aMap2 = &theM2;
+  //
+  if (theM2.Extent() < theM1.Extent()) {
+    aMap1 = &theM2;
+    aMap2 = &theM1;
+  }
+  //
+  Standard_Integer iCommon = 0;
+  for (BOPCol_MapIteratorOfMapOfShape aIt(*aMap1); aIt.More(); aIt.Next()) {
+    if (aMap2->Contains(aIt.Value())) {
+      ++iCommon;
+    }
+  }
+  return iCommon;
+}
index 9c777684fae0808f84e30e87159d931eb0157d43..ee7eb10f9a6f5c051053b3e83a1087920557ae48 100644 (file)
@@ -284,8 +284,15 @@ is
     --          theLCB (as list of compounds) 
     --          in terms of connexity by the shapes of theType  
 
+    OrientEdgesOnWire (myclass; 
+            theW   :out Shape from TopoDS);
+    ---Purpose:
+    -- Correctly orients edges on the wire.
+
     OrientFacesOnShell (myclass; 
-            theS   :out Shape from TopoDS); 
+            theS   :out Shape from TopoDS);
+    ---Purpose:
+    -- Correctly orients faces on the shell.
      
     CorrectTolerances (myclass;  
         theS: Shape  from  TopoDS;  
index 1ed5095b27705cea048921fe201da75186e2af83..df8d6d1516c0149bcc8b6e03ed8f832d86e4793d 100644 (file)
 //
 #include <BOPCol_IndexedMapOfShape.hxx>
 #include <BOPCol_MapOfShape.hxx>
+#include <BOPCol_MapOfOrientedShape.hxx>
 //
 #include <IntTools_ShrunkRange.hxx>
 #include <Precision.hxx>
 //
+#include <TopoDS.hxx>
+//
 
 static
   Standard_Real AngleWithRef(const gp_Dir& theD1,
@@ -196,6 +199,94 @@ void BOPTools_AlgoTools::MakeConnexityBlocks
   }// for (; aIt.More(); aIt.Next()) 
 }
 //=======================================================================
+// function: OrientEdgesOnWire
+// purpose: Reorient edges on wire for correct ordering
+//=======================================================================
+void BOPTools_AlgoTools::OrientEdgesOnWire(TopoDS_Shape& theWire)
+{
+  // make vertex-edges connexity map
+  BOPCol_IndexedDataMapOfShapeListOfShape aVEMap;
+  BOPTools::MapShapesAndAncestors(theWire, TopAbs_VERTEX, TopAbs_EDGE, aVEMap);
+  //
+  if (aVEMap.IsEmpty()) {
+    return;
+  }
+  //
+  BRep_Builder aBB;
+  // new wire
+  TopoDS_Wire aWire;
+  aBB.MakeWire(aWire);
+  // fence map
+  BOPCol_MapOfOrientedShape aMFence;
+  //
+  TopoDS_Iterator aIt(theWire);
+  for (; aIt.More(); aIt.Next()) {
+    const TopoDS_Edge& aEC = TopoDS::Edge(aIt.Value());
+    if (!aMFence.Add(aEC)) {
+      continue;
+    }
+    //
+    // add edge to a wire as it is
+    aBB.Add(aWire, aEC);
+    //
+    TopoDS_Vertex aV1, aV2;
+    TopExp::Vertices(aEC, aV1, aV2, Standard_True);
+    //
+    if (aV1.IsSame(aV2)) {
+      // closed edge, go to the next edge
+      continue;
+    }
+    //
+    // orient the adjacent edges
+    for (Standard_Integer i = 0; i < 2; ++i) {
+      TopoDS_Shape aVC = !i ? aV1 : aV2;
+      //
+      for (;;) {
+        const BOPCol_ListOfShape& aLE = aVEMap.FindFromKey(aVC);
+        if (aLE.Extent() != 2) {
+          // free vertex or multi-connexity, go to the next edge
+          break;
+        }
+        //
+        Standard_Boolean bStop = Standard_True;
+        //
+        BOPCol_ListIteratorOfListOfShape aItLE(aLE);
+        for (; aItLE.More(); aItLE.Next()) {
+          const TopoDS_Edge& aEN = TopoDS::Edge(aItLE.Value());
+          if (aMFence.Contains(aEN)) {
+            continue;
+          }
+          //
+          TopoDS_Vertex aVN1, aVN2;
+          TopExp::Vertices(aEN, aVN1, aVN2, Standard_True);
+          if (aVN1.IsSame(aVN2)) {
+            // closed edge, go to the next edge
+            break;
+          }
+          //
+          // change orientation if necessary and go to the next edges
+          if ((!i && aVC.IsSame(aVN2)) || (i && aVC.IsSame(aVN1))) {
+            aBB.Add(aWire, aEN);
+          }
+          else {
+            aBB.Add(aWire, aEN.Reversed());
+          }
+          aMFence.Add(aEN);
+          aVC = aVC.IsSame(aVN1) ? aVN2 : aVN1;
+          bStop = Standard_False;
+          break;
+        }
+        //
+        if (bStop) {
+          break;
+        }
+      }
+    }
+  }
+  //
+  theWire = aWire;
+}
+//=======================================================================
 // function: OrientFacesOnShell
 // purpose: 
 //=======================================================================
index 45535ccd345a85e983a6845400f0104436dace44..1467d5070ebdf8ceabf6278bf110f1bc2b680a42 100644 (file)
@@ -1,6 +1,6 @@
 restore [locate_data_file case_3_wire.brep] a
 restore [locate_data_file offset_wire_034.brep] b
 bfuse result a b
-set length 739.311
+set length 1085.29
 set nbsh_v 14
 set nbsh_e 14
index 3582ee1806c433e87143135f5e171a783628ee21..d47e7d8eaa09ce070a5d6e34e4cf3010d32d4fed 100644 (file)
@@ -1,6 +1,6 @@
 restore [locate_data_file case_3_wire.brep] a
 restore [locate_data_file case_3_wire2.brep] b
 bfuse result a b
-set length 739.311
+set length 1085.29
 set nbsh_v 20
 set nbsh_e 20
index 2367bed74fe0654abcb8ca94acd4f9cd322525c5..ffdf0d8ddea5b180043b38b80268dc8c08fcd0f7 100644 (file)
@@ -1,6 +1,6 @@
 restore [locate_data_file case_3_wire.brep] a
 restore [locate_data_file case_3_wire5.brep] b
 bfuse result a b
-set length 862.192
+set length 928.558
 set nbsh_v 12
 set nbsh_e 13
index 33fdf540b548548b8f0cd44510906b72e96c66d7..e22a337ec8af7d007dfbbeae36d95b3291c39b4a 100644 (file)
@@ -1,6 +1,6 @@
 restore [locate_data_file case_9_wire.brep] a
 restore [locate_data_file case_9_wire1.brep] b
 bfuse result a b
-set length 1809.78
+set length 1953.57
 set nbsh_v 8
 set nbsh_e 9
index 5d4adf82d508368f2110fecdce7f80342b78015a..342062a8c04b9f8c3df6be918117ffeee907c288 100644 (file)
@@ -1,6 +1,6 @@
 restore [locate_data_file case_9_wire.brep] a
 restore [locate_data_file case_9_wire2.brep] b
 bfuse result a b
-set length 1982.81
+set length 2126.59
 set nbsh_v 10
 set nbsh_e 11
index 8899e20a92fc8e3d5a7f4c5c867a1639c5a6a58a..3fc28a47e7c1943e83bfa0c17b382d0298dfd24d 100644 (file)
@@ -1,6 +1,6 @@
 restore [locate_data_file case_9_wire.brep] a
 restore [locate_data_file case_9_wire3.brep] b
 bfuse result a b
-set length 2046.69
+set length 2126.59
 set nbsh_v 10
 set nbsh_e 11
index 62250b64dcc4aed6e4e051a0ccea0308d929fa3e..6d726293de41f72fa95a12e1a6b9eb6b93b60278 100644 (file)
@@ -1,6 +1,6 @@
 restore [locate_data_file case_9_wire_a.brep] a
 restore [locate_data_file case_9_wire1.brep] b
 bfuse result a b
-set length 1377.51
+set length 1521.3
 set nbsh_v 7
 set nbsh_e 7
index a8954e4bc2b5b19a891d91b70bdc8318f5b5d4c2..22b102f8ec8daa11c756f7f738016d0b50ae81ce 100644 (file)
@@ -2,6 +2,6 @@ restore [locate_data_file case_3_wire.brep] a
 restore [locate_data_file offset_wire_034.brep] b
 bop a b
 bopfuse result
-set length 739.311
+set length 1085.29
 set nbsh_v 14
 set nbsh_e 14
index e87725cb01c0e00ff08895c98e64747b8378f024..905b61169f80e469ff1d41d36c26e40cd067af6e 100644 (file)
@@ -2,6 +2,6 @@ restore [locate_data_file case_3_wire.brep] a
 restore [locate_data_file case_3_wire2.brep] b
 bop a b
 bopfuse result
-set length 739.311
+set length 1085.29
 set nbsh_v 20
 set nbsh_e 20
index 0e314f0bf89c975036ac6dd058fa63b7fe76e9b0..4a516bb93aa2963a709fde6b8753a5c7bb7b4b43 100644 (file)
@@ -2,6 +2,6 @@ restore [locate_data_file case_3_wire.brep] a
 restore [locate_data_file case_3_wire5.brep] b
 bop a b
 bopfuse result
-set length 862.192
+set length 928.558
 set nbsh_v 12
 set nbsh_e 13
index 71bf6121c79817c7d80ce04d2a166ab642d0d3b5..2a6c4d94fb1c5e2c235bcec1b2e76455e35d56a8 100644 (file)
@@ -2,6 +2,6 @@ restore [locate_data_file case_9_wire.brep] a
 restore [locate_data_file case_9_wire1.brep] b
 bop a b
 bopfuse result
-set length 1809.78
+set length 1953.57
 set nbsh_v 8
 set nbsh_e 9
index b9e8aaed0360d5c93d0f2aad3f209c72218f264a..ee7e0d6cbdf737c9e3d9138019c07b6cfcdcfb5b 100644 (file)
@@ -2,6 +2,6 @@ restore [locate_data_file case_9_wire.brep] a
 restore [locate_data_file case_9_wire2.brep] b
 bop a b
 bopfuse result
-set length 1982.81
+set length 2126.59
 set nbsh_v 10
 set nbsh_e 11
index f4e0b3383a5fbccf4c269edfefec5c2499525cc5..41721cf2c638cb380c026c4a04346a6902f778bf 100644 (file)
@@ -2,6 +2,6 @@ restore [locate_data_file case_9_wire.brep] a
 restore [locate_data_file case_9_wire3.brep] b
 bop a b
 bopfuse result
-set length 2046.69
+set length 2126.59
 set nbsh_v 10
 set nbsh_e 11
index 9902578f82ba4ecda7acb2819bde646b89a1ad5b..61821f4d51138dc9acfbd14bef690c583a087ee0 100644 (file)
@@ -2,6 +2,6 @@ restore [locate_data_file case_9_wire_a.brep] a
 restore [locate_data_file case_9_wire1.brep] b
 bop a b
 bopfuse result
-set length 1377.51
+set length 1521.3
 set nbsh_v 7
 set nbsh_e 7
index 3ed1a0c92437d4ee74a49ea39ac800af89acd07b..7522f0e66880f76106a4ac1970f8bffd8f9e0523 100644 (file)
@@ -5,4 +5,4 @@ bop b1 b2
 bopfuse result
 
 
-set square 850
+set square 1200
index 10fbb77471e4067a73dde6b4e46dc4803b821f7f..b06919087bcbfe8c026b8d913d9edf24b4252b3c 100644 (file)
@@ -5,4 +5,4 @@ bop b1 b2
 bopfuse result
 
 
-set square 800
+set square 1200
index 644c8691621dd7f0f469e76cb56793668df6e643..9cc82404dbd64f93d94b43c2cacb49182206647f 100644 (file)
@@ -5,4 +5,4 @@ bop b1 b2
 bopfuse result
 
 
-set square 468.629
+set square 800
index de370311c9112a92e6963a66b3fcbbcf1626e691..e85a104e7456d2cf2b862afc061c1e998a287e67 100644 (file)
@@ -5,4 +5,4 @@ bop b1 b2
 bopfuse result
 
 
-set square 11868.2
+set square 13962.6
index f8e4ad24da2f9c2d2f0a9650f8cf1ad0d012fcd6..7c282353da7af0fbadaf6dabf6c9b1831c4235c3 100644 (file)
@@ -5,4 +5,4 @@ bop b1 b2
 bopfuse result
 
 
-set square 87964.6
+set square 125664
index 97f1249ddeaa63a68f7d1489aa34eac6084ce26b..03dff5fa13959b48f99000dbfae22f4596cffe33 100644 (file)
@@ -1,4 +1,6 @@
+puts "TODO OCC26619 ALL: Error : The area of the resulting shape is"
+
 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.50445e+007
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_4 b/tests/bugs/modalg_6/bug26565_4
new file mode 100644 (file)
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 100644 (file)
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 100644 (file)
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 100644 (file)
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 100644 (file)
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"
 
diff --git a/tests/bugs/modalg_6/bug28189_1 b/tests/bugs/modalg_6/bug28189_1
new file mode 100644 (file)
index 0000000..3fc3ee0
--- /dev/null
@@ -0,0 +1,36 @@
+puts "========"
+puts "OCC28189"
+puts "========"
+puts ""
+#################################################
+# Result of Boolean operation is non-manifold wire
+#################################################
+
+restore [locate_data_file bug28189_contour.brep] s
+restore [locate_data_file bug28189_solid.brep] c
+
+bcommon result s c
+
+checknbshapes result -vertex 3 -edge 2 -wire 1
+set length 173.267
+
+# check orientation of edges in the resulting wire
+
+explode result e
+explode result_1 v
+explode result_2 v
+
+set cmp1 [compare result_1_1 result_2_1]
+set cmp2 [compare result_1_1 result_2_2]
+
+if {[regexp "same shapes" $cmp1]} {
+  if {[regexp "equal shapes" $cmp1]} {
+    puts "Error: Incorrect orientation of edges in wire"
+  }
+} elseif {[regexp "same shapes" $cmp2]} {
+  if {[regexp "equal shapes" $cmp2]} {
+    puts "Error: Incorrect orientation of edges in wire"
+  }
+} else {
+  puts "Error: No shared vertex"
+}
diff --git a/tests/bugs/modalg_6/bug28189_2 b/tests/bugs/modalg_6/bug28189_2
new file mode 100644 (file)
index 0000000..6d878c4
--- /dev/null
@@ -0,0 +1,15 @@
+puts "========"
+puts "OCC28189"
+puts "========"
+puts ""
+#################################################
+# Result of Boolean operation is non-manifold wire
+#################################################
+
+box b1 10 10 10
+box b2 10 10 10
+eval compound [explode b1 w] b1
+eval compound [explode b1 w] b2
+bcommon result b1 b2
+
+checknbshapes result -wire 6
diff --git a/tests/bugs/modalg_6/bug28189_3 b/tests/bugs/modalg_6/bug28189_3
new file mode 100644 (file)
index 0000000..b2c2fd3
--- /dev/null
@@ -0,0 +1,15 @@
+puts "========"
+puts "OCC28189"
+puts "========"
+puts ""
+#################################################
+# Result of Boolean operation is non-manifold wire
+#################################################
+
+box b1 10 10 10
+box b2 10 10 10
+eval compound [explode b1 w] b1
+eval compound [explode b1 w] b2
+bfuse result b1 b2
+
+checknbshapes result -wire 6
diff --git a/tests/bugs/modalg_6/bug28189_4 b/tests/bugs/modalg_6/bug28189_4
new file mode 100644 (file)
index 0000000..76f51bf
--- /dev/null
@@ -0,0 +1,16 @@
+puts "========"
+puts "OCC28189"
+puts "========"
+puts ""
+#################################################
+# Result of Boolean operation is non-manifold wire
+#################################################
+
+box b1 10 10 10
+box b2 10 10 10
+eval compound [explode b1 w] b1
+eval compound [explode b1 w] b2
+ttranslate b2 5 0 0
+bcommon result b1 b2
+
+checknbshapes result -wire 4
diff --git a/tests/bugs/modalg_6/bug28189_5 b/tests/bugs/modalg_6/bug28189_5
new file mode 100644 (file)
index 0000000..ba17389
--- /dev/null
@@ -0,0 +1,16 @@
+puts "========"
+puts "OCC28189"
+puts "========"
+puts ""
+#################################################
+# Result of Boolean operation is non-manifold wire
+#################################################
+
+box b1 10 10 10
+box b2 10 10 10
+eval compound [explode b1 w] b1
+eval compound [explode b1 w] b2
+ttranslate b2 5 0 0
+bfuse result b1 b2
+
+checknbshapes result -wire 12
diff --git a/tests/bugs/modalg_6/bug28189_7 b/tests/bugs/modalg_6/bug28189_7
new file mode 100644 (file)
index 0000000..5fad480
--- /dev/null
@@ -0,0 +1,27 @@
+puts "========"
+puts "OCC28189"
+puts "========"
+puts ""
+#################################################
+# Result of Boolean operation is non-manifold wire
+#################################################
+
+polyline p1 0 0 0 1 0 0
+polyline p2 0 0 0 1 0 0
+
+orientation p1 R
+orientation p2 F
+
+bfuse result1 p1 p2
+explode result1
+
+if {![regexp "REVERSED" [whatis result1_1]]} {
+  puts "Error: Incorrect orientation of wire"
+}
+
+bcommon result2 p2 p1
+explode result2
+
+if {![regexp "FORWARD" [whatis result2_1]]} {
+  puts "Error: Incorrect orientation of wire"
+}
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