The map to protect the result of Boolean operation from duplicating parts in containers has been removed (method void BOPAlgo_BOP::BuildShape()).
The results of Boolean operations on containers will be the following:
1. 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.
2. The result of the operation Fuse for the arguments of collection type (WIRE, SHELL, COMPSOLID) will contain
the same number of containers as the arguments. The overlapping parts (EDGES/FACES/SOLIDS) will be shared among them.
For example, the result of Fuse operation between two wires will be two wires sharing coinciding edges if any.
3. The result of the operation Common for the arguments of collection type (WIRE, SHELL, COMPSOLID) will consist
of the containers containing the same overlapping parts. For example, the result of Common operation between two
fully/partially overlapping wires will be two wires containing the same edges.
Style correction.
Added test case bugs/modalg_1/bug13538
Modified boolean test cases according to new begavior
* 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 result of the operation Fuse for the arguments of collection type (WIRE, SHELL, COMPSOLID) will contain the same number of containers as the arguments. The overlapping parts (EDGES/FACES/SOLIDS) will be shared among them. For example, the result of Fuse operation between two wires will be two wires sharing coinciding edges if any.
+* The result of the operation Common for the arguments of collection type (WIRE, SHELL, COMPSOLID) will consist of the containers containing the same overlapping parts. For example, the result of Common operation between two fully/partially overlapping wires will be two wires containing the same edges.
@subsection occt_algorithms_9_4 Examples
@figure{/user_guides/boolean_operations/images/boolean_image065.png}
-* The result of *Cut21* operation is a compound containing split part of the argument *S2*. In this case
+* The result of *Cut21* operation is a compound containing split part of the argument *S2*. In this case
argument *S2* has a common part with solid *S1* so the corresponding part is not included into the result.
@figure{/user_guides/boolean_operations/images/boolean_image066.png}
@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.
+* The result of *Cut12* operation is a compound containing new Shell and Wire split from the arguments *Sh* and *W*. In this case they have a common part with solid *S* so the corresponding part is not included into the result.
@figure{/user_guides/boolean_operations/images/boolean_image138.png}
* The result of *Cut21* operation is not defined as the objects have a lower dimension than the tool.
+@subsubsection occt_algorithms_9_4_24 Case 24: Two Wires that have overlapping edges.
+
+Let us consider two Wires that have overlapping edges, *W1* is the object and *W2* is the tool:
+
+@figure{/user_guides/boolean_operations/images/boolean_image139.png}
+
+* The result of *Fuse* operation is a compound containing two Wires, which share an overlapping edge. The new Wires are created from the objects:
+
+@figure{/user_guides/boolean_operations/images/boolean_image140.png}
+
+* The result of *Common* operation is a compound containing two Wires both consisting of an overlapping edge. The new Wires are created from the objects:
+
+@figure{/user_guides/boolean_operations/images/boolean_image141.png}
+
+* The result of *Cut12* operation is a compound containing a wire split from object *W1*. Its common part with *W2* is not included into the result.
+
+@figure{/user_guides/boolean_operations/images/boolean_image142.png}
+
+* The result of *Cut21* operation is a compound containing a wire split from *W2*. Its common part with *W1* is not included into the result.
+
+@figure{/user_guides/boolean_operations/images/boolean_image143.png}
+
@subsection occt_algorithms_9_5 Class BOPAlgo_BOP
@figure{/user_guides/boolean_operations/images/operations_image065.svg, "Diagram of BRepAlgoAPI package"}
-The detailed description of the classes can be found in corresponding header files.
-The examples are below in this chapter.
+The detailed description of the classes can be found in the corresponding .hxx files. The examples are below in this chapter.
@subsection occt_algorithms_11b_2 Package BOPTest
The package *BOPTest* provides the usage of the Boolean Component on Tcl level. The method *BOPTest::APICommands* contains corresponding Tcl commands:
TopoDS_Compound aResult;
aBB.MakeCompound(aResult);
//
- BOPCol_MapOfShape aMSRC, aMFence;
+ BOPCol_MapOfShape aMSRC;
BOPTools::MapShapes(myRC, aMSRC);
//
// collect images of containers
aItLSIm.Initialize(aLSIm);
for (; aItLSIm.More(); aItLSIm.Next()) {
const TopoDS_Shape& aSIm = aItLSIm.Value();
- if (aMSRC.Contains(aSIm) && aMFence.Add(aSIm)) {
+ if (aMSRC.Contains(aSIm)) {
aBB.Add(aRC, aSIm);
}
}
}
- else if (aMSRC.Contains(aS) && aMFence.Add(aS)) {
+ else if (aMSRC.Contains(aS)) {
aBB.Add(aRC, aS);
}
}
bcommon result b a
-checkprops result -l 345.975
+checkprops result -l 691.95
checksection result
checknbshapes result -vertex 8 -edge 7 -t
bcommon result b a
-checkprops result -l 345.975
+checkprops result -l 691.95
checksection result
checknbshapes result -vertex 14 -edge 13 -t
bcommon result b a
-checkprops result -l 66.3661
+checkprops result -l 132.732
checksection result
checknbshapes result -vertex 2 -edge 1 -t
bcommon result b a
-checkprops result -l 143.787
+checkprops result -l 287.575
checksection result
checknbshapes result -vertex 2 -edge 1 -t
bcommon result b a
-checkprops result -l 143.787
+checkprops result -l 287.575
checksection result
checknbshapes result -vertex 2 -edge 1 -t
bcommon result b a
-checkprops result -l 79.9002
+checkprops result -l 159.8
checksection result
checknbshapes result -vertex 2 -edge 1 -t
bcommon result b a
-checkprops result -l 143.787
+checkprops result -l 287.575
checksection result
checknbshapes result -vertex 2 -edge 1 -t
bfuse result a b
-checkprops result -l 739.311
+checkprops result -l 1085.29
checksection result
checknbshapes result -vertex 14 -edge 14 -t
bfuse result a b
-checkprops result -l 739.311
+checkprops result -l 1085.29
checksection result
checknbshapes result -vertex 20 -edge 20 -t
bfuse result a b
-checkprops result -l 862.192
+checkprops result -l 928.558
checksection result
checknbshapes result -vertex 12 -edge 13 -t
bfuse result a b
-checkprops result -l 1809.78
+checkprops result -l 1953.57
checksection result
checknbshapes result -vertex 8 -edge 9 -t
bfuse result a b
-checkprops result -l 1982.81
+checkprops result -l 2126.59
checksection result
checknbshapes result -vertex 10 -edge 11 -t
bfuse result a b
-checkprops result -l 2046.69
+checkprops result -l 2126.59
checksection result
checknbshapes result -vertex 10 -edge 11 -t
bfuse result a b
-checkprops result -l 1377.51
+checkprops result -l 1521.3
checksection result
checknbshapes result -vertex 7 -edge 7 -t
bop a b
bopcommon result
-checkprops result -l 345.975
+checkprops result -l 691.95
checksection result
checknbshapes result -vertex 8 -edge 7 -t
bop a b
bopcommon result
-checkprops result -l 345.975
+checkprops result -l 691.95
checksection result
checknbshapes result -vertex 14 -edge 13 -t
bop a b
bopcommon result
-checkprops result -l 66.3661
+checkprops result -l 132.732
checksection result
checknbshapes result -vertex 2 -edge 1 -t
bop a b
bopcommon result
-checkprops result -l 143.787
+checkprops result -l 287.575
checksection result
checknbshapes result -vertex 2 -edge 1 -t
bop a b
bopcommon result
-checkprops result -l 143.787
+checkprops result -l 287.575
checksection result
checknbshapes result -vertex 2 -edge 1 -t
bop a b
bopcommon result
-checkprops result -l 79.9002
+checkprops result -l 159.8
checksection result
checknbshapes result -vertex 2 -edge 1 -t
bop a b
bopcommon result
-checkprops result -l 143.787
+checkprops result -l 287.575
checksection result
checknbshapes result -vertex 2 -edge 1 -t
bop b1 b2
bopcommon result
-checkprops result -s 350
+checkprops result -s 700
checkview -display result -2d -otherwise { b1 b2 } -s -path ${imagedir}/${test_image}.png
bop b1 b2
bopcommon result
-checkprops result -s 100
+checkprops result -s 200
checkview -display result -2d -otherwise { b1 b2 } -s -path ${imagedir}/${test_image}.png
bop b1 b2
bopcommon result
-checkprops result -s 95.7107
+checkprops result -s 191.421
checkview -display result -2d -otherwise { b1 b2 } -s -path ${imagedir}/${test_image}.png
bop b1 b2
bopcommon result
-checkprops result -s 400
+checkprops result -s 800
checkview -display result -2d -otherwise { b1 b2 } -s -path ${imagedir}/${test_image}.png
bop b1 b2
bopcommon result
-checkprops result -s 331.371
+checkprops result -s 662.742
checkview -display result -2d -otherwise { b1 b2 } -s -path ${imagedir}/${test_image}.png
bop b1 b2
bopcommon result
-checkprops result -s 2094.4
+checkprops result -s 4188.79
checkview -display result -2d -otherwise { b1 b2 } -s -path ${imagedir}/${test_image}.png
bop b1 b2
bopcommon result
-checkprops result -s 1610.86
+checkprops result -s 3221.73
checkview -display result -2d -otherwise { b1 b2 } -s -path ${imagedir}/${test_image}.png
bop b1 b2
bopcommon result
-checkprops result -s 1610.86
+checkprops result -s 3221.73
checkview -display result -2d -otherwise { b1 b2 } -s -path ${imagedir}/${test_image}.png
bop b1 b2
bopcommon result
-checkprops result -s 37699.1
+checkprops result -s 75398.2
checkview -display result -2d -otherwise { b1 b2 } -s -path ${imagedir}/${test_image}.png
bop a b
bopfuse result
-checkprops result -l 739.311
+checkprops result -l 1085.29
checksection result
checknbshapes result -vertex 14 -edge 14 -t
bop a b
bopfuse result
-checkprops result -l 739.311
+checkprops result -l 1085.29
checksection result
checknbshapes result -vertex 20 -edge 20 -t
bop a b
bopfuse result
-checkprops result -l 862.192
+checkprops result -l 928.558
checksection result
checknbshapes result -vertex 12 -edge 13 -t
bop a b
bopfuse result
-checkprops result -l 1809.78
+checkprops result -l 1953.57
checksection result
checknbshapes result -vertex 8 -edge 9 -t
bop a b
bopfuse result
-checkprops result -l 1982.81
+checkprops result -l 2126.59
checksection result
checknbshapes result -vertex 10 -edge 11 -t
bop a b
bopfuse result
-checkprops result -l 2046.69
+checkprops result -l 2126.59
checksection result
checknbshapes result -vertex 10 -edge 11 -t
bop a b
bopfuse result
-checkprops result -l 1377.51
+checkprops result -l 1521.3
checksection result
checknbshapes result -vertex 7 -edge 7 -t
bop b1 b2
bopfuse result
-checkprops result -s 850
+checkprops result -s 1200
checkview -display result -2d -otherwise { b1 b2 } -s -path ${imagedir}/${test_image}.png
bop b1 b2
bopfuse result
-checkprops result -s 800
+checkprops result -s 1200
checkview -display result -2d -otherwise { b1 b2 } -s -path ${imagedir}/${test_image}.png
bop b1 b2
bopfuse result
-checkprops result -s 468.629
+checkprops result -s 800
checkview -display result -2d -otherwise { b1 b2 } -s -path ${imagedir}/${test_image}.png
bop b1 b2
bopfuse result
-checkprops result -s 11868.2
+checkprops result -s 13962.6
checkview -display result -2d -otherwise { b1 b2 } -s -path ${imagedir}/${test_image}.png
bop b1 b2
bopfuse result
-checkprops result -s 62831.9
+checkprops result -s 64442.7
checkview -display result -2d -otherwise { b1 b2 } -s -path ${imagedir}/${test_image}.png
bop b1 b2
bopfuse result
-checkprops result -s 62831.9
+checkprops result -s 64442.7
checkview -display result -2d -otherwise { b1 b2 } -s -path ${imagedir}/${test_image}.png
bop b1 b2
bopfuse result
-checkprops result -s 87964.6
+checkprops result -s 125664
checkview -display result -2d -otherwise { b1 b2 } -s -path ${imagedir}/${test_image}.png
bop a_1 b_1
bopcommon result
-checkprops result -s 10000
+checkprops result -s 20000
checkshape result
-checknbshapes result -vertex 4 -edge 4 -wire 1 -face 1 -shell 1 -solid 0 -compsolid 0 -compound 1 -shape 12
+checknbshapes result -vertex 4 -edge 4 -wire 1 -face 1 -shell 2 -solid 0 -compsolid 0 -compound 1 -shape 13
set 2viewer 0
--- /dev/null
+puts "============"
+puts "OCC27270"
+puts "============"
+puts ""
+###########################################################################################################
+# Boolean operations: incorrect assembling of sub-shapes in container shapes (wires, shells, compsolids)
+###########################################################################################################
+
+box b1 200 200 200
+explode b1 w
+compound b1_1 b1_2 b1_3 b1_4 b1_5 b1_6 c1
+tcopy c1 c2
+ttranslate c2 100 0 300
+bfuse result c1 c2
+set info [explode result]
+if { [llength $info] > 2 } {
+ puts "OK: result is correct"
+} else {
+ puts "Error: incorrect assembling of sub-shapes in container shapes"
+}
+
+checkprops result -l 9600
+checkshape result
+checkview -display result -3d -path ${imagedir}/${test_image}.png