From 9526aa6a8a2a5b41713211d2f6c2aa58c1344e24 Mon Sep 17 00:00:00 2001 From: emv Date: Thu, 1 Oct 2015 14:48:30 +0300 Subject: [PATCH] 0026565: Compsolid after cut becomes compound of solids 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 --- .gitignore | 2 +- .../boolean_operations/boolean_operations.md | 51 +- .../images/boolean_image136.png | Bin 0 -> 4973 bytes .../images/boolean_image137.png | Bin 0 -> 1198 bytes .../images/boolean_image138.png | Bin 0 -> 1682 bytes samples/tcl/snowflake.tcl | 2 +- src/BOPAlgo/BOPAlgo_BOP.cxx | 512 ++++++++++-------- tests/boolean/gdml_private/F8 | 2 +- tests/bugs/modalg_1/bug11565_1 | 4 +- tests/bugs/modalg_1/bug11565_2 | 4 +- tests/bugs/modalg_1/bug12507 | 4 +- tests/bugs/modalg_2/bug21460 | 4 +- tests/bugs/modalg_2/bug22356 | 4 +- tests/bugs/modalg_2/bug22790 | 4 +- tests/bugs/modalg_2/bug23100 | 4 +- tests/bugs/modalg_2/bug23470 | 5 +- tests/bugs/modalg_2/bug23676 | 4 +- tests/bugs/modalg_4/bug6538 | 4 +- tests/bugs/modalg_5/bug24092 | 4 +- tests/bugs/modalg_5/bug24187 | 4 +- tests/bugs/modalg_5/bug24746 | 4 +- tests/bugs/modalg_5/bug24811 | 11 +- tests/bugs/modalg_5/bug24825_cut | 18 +- tests/bugs/modalg_5/bug24851 | 4 +- tests/bugs/modalg_5/bug25163 | 4 +- tests/bugs/modalg_5/bug25237 | 4 +- tests/bugs/modalg_5/bug25263 | 4 +- tests/bugs/modalg_5/bug25337_1 | 4 +- tests/bugs/modalg_5/bug25337_2 | 4 +- tests/bugs/modalg_5/bug25450_1 | 4 +- tests/bugs/modalg_5/bug25450_2 | 4 +- tests/bugs/modalg_5/bug25614_common | 12 +- tests/bugs/modalg_5/bug25614_cut | 10 +- tests/bugs/modalg_5/bug25614_cut21 | 12 +- tests/bugs/modalg_5/bug25625 | 4 +- tests/bugs/modalg_5/bug25721 | 4 +- tests/bugs/modalg_6/bug25937_2 | 4 +- tests/bugs/modalg_6/bug26224 | 4 +- tests/bugs/modalg_6/bug26565_1 | 46 ++ tests/bugs/modalg_6/bug26565_2 | 51 ++ tests/bugs/modalg_6/bug26565_3 | 52 ++ tests/bugs/modalg_6/bug26565_4 | 47 ++ tests/bugs/modalg_6/bug26565_5 | 68 +++ tests/bugs/modalg_6/bug26565_6 | 67 +++ tests/bugs/modalg_6/bug26565_7 | 54 ++ tests/bugs/modalg_6/bug26565_8 | 33 ++ tests/bugs/modalg_6/bug26582 | 4 +- tests/bugs/moddata_3/bug23738 | 4 +- tests/bugs/moddata_3/bug24108 | 4 +- tests/bugs/moddata_3/bug24108_2 | 4 +- 50 files changed, 834 insertions(+), 333 deletions(-) create mode 100644 dox/user_guides/boolean_operations/images/boolean_image136.png create mode 100644 dox/user_guides/boolean_operations/images/boolean_image137.png create mode 100644 dox/user_guides/boolean_operations/images/boolean_image138.png create mode 100755 tests/bugs/modalg_6/bug26565_1 create mode 100755 tests/bugs/modalg_6/bug26565_2 create mode 100755 tests/bugs/modalg_6/bug26565_3 create mode 100755 tests/bugs/modalg_6/bug26565_4 create mode 100755 tests/bugs/modalg_6/bug26565_5 create mode 100755 tests/bugs/modalg_6/bug26565_6 create mode 100755 tests/bugs/modalg_6/bug26565_7 create mode 100755 tests/bugs/modalg_6/bug26565_8 diff --git a/.gitignore b/.gitignore index c2da7e3b03..53cfb10fc1 100644 --- a/.gitignore +++ b/.gitignore @@ -58,5 +58,5 @@ Release /Makefile /libtool /stamp* -/build +/build* /install diff --git a/dox/user_guides/boolean_operations/boolean_operations.md b/dox/user_guides/boolean_operations/boolean_operations.md index a26fe75952..ccd43d5fcc 100644 --- a/dox/user_guides/boolean_operations/boolean_operations.md +++ b/dox/user_guides/boolean_operations/boolean_operations.md @@ -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 (S1=S11, S12, ...); * Tools (S2=S21, S22, ...). -* 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 (FWi) in *myRC* | *BOPAlgo_BOP::BuildSolid()* | -| 3.2 | Collect all faces of *myRC* except for internal faces (FWi) -> SFS | *BOPAlgo_BOP::BuildSolid ()* | -| 3.3 | Build solids (SDi) from *SFS*. | *BOPAlgo_BuilderSolid* | -| 3.4 | Add the solids (SDi) 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 (FWi) in *myRC* | *BOPAlgo_BOP::BuildSolid()* | +| 2.2 | Collect all faces of *myRC* except for internal faces (FWi) -> SFS | *BOPAlgo_BOP::BuildSolid ()* | +| 2.3 | Build solids (SDi) from *SFS*. | *BOPAlgo_BuilderSolid* | +| 2.4 | Add the solids (SDi) 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 index 0000000000000000000000000000000000000000..6c93bc48e718e20f01b04f6c5be0a343bd202a9a GIT binary patch literal 4973 zcmXw7c{mi__a0@*nr)&%vSv>)$zI49gb~J)tl1`OL^P7+BPC>)oxzNmvBX%jQ`xi3 zkfli!#=eYQe$(%HzV~^~bMHOxd+&43x%ZEAPMnzugq;P%0ssKmp$2;9007->n($vZ zN7F#6k*u_d+0Ve{DFDFH{ZHu9WH|%?03Kne-d&53oVDEPWNZVs-ZIb5SsQMr>NxUl z2F{#0+FDj}uc6wavo2W<$nQ%#@V|lUnwV7w+(qRxy+8p{l1(lG92LyxZpd}N4Bh|) zZknbqGy!&!!KQ*iFu!r8$oJ<4OlFn*Eh3IRDV&80ESL@5tFsK5LbKQW$M1E(78%88 zn^?_XXh6oV6hR$(UUTx{KSHjFQ8$c_0g}rY&+GWCD2Efmz<;lxiIY;4bo7H|S)qM3 z-cMT)cr|_(i}r958NVk&ZOPHAV0HT&ywCB8&4NY2Zya0TLoal7+^F54@M5$Ye>|_~ z9kf`7fyjk7(5^croJ$I$LBd6fKA?uj(P1Q*zUQBPL9hOKh(g>uvt~$Osq&sPW zn#eytU?#xRn(o^a+Rf)w9u7pj?_|0_=<{Ay;AY@#6n&?WIHDqh*`T4SXaTx`p_0;6 zlZ%nRI&6QU^UYKurSGD(XG;0RS-d$Zb>1oW)DXB-hKnUTAfq;BW2wgrI;QQZP>)R^6`xsMxbL+itj9{foNJbe>xO*2WXd@j0#3R8mN6F-% zb_0j*P@U7H-hR2)&X`14zsLqO&V6?3E7$wi!YM%N>?mFU?0V zrTKJ_K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mV?d00001 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 index 0000000000000000000000000000000000000000..a783c0eeefeca8d054057fd580a0634694882adf GIT binary patch literal 1198 zcmeAS@N?(olHy`uVBq!ia0y~yV6+5cSq>(k$d7&PZ9s~%z$3Dlfr0M`2s2LA=96Y% zU`gS0#$b2u?5y&0|ZC1R6p+ z&=6kn`Y&rs#{ak<%+0%Qy!+!}B4XHJXL$SrP}wfal)x^)uE1s;5S zViLZvB|rFz*54bA(^EHocWQZj`BF@4-mU5KeX%^UK6{vNS9cm^ul8NqGIM?C<0(Fq zw^r57@si2={37MWjcSECx);yO6o0)GP?GJ@F2wEwwH>2>Cdd2JJ*|-_`aZbDTYU$qar3L-V=k;#+I#XQF;nqRW zDUnaM0i8MhLfCux<^Qr4Yz8v;Lzk9JyP7rq`#J8ZLQPS%`Omf`z1=G!bTMmsT2FA+ zN{HdN)=Dk^urOzJ>?}d8(yKM^_60nwzxpg|{oe2Y;zi~K=dRng)3Md}>a$mKdx9tV z++J1aHG>lv7M&*1tJ9CKJn%AiRhWLus-UXbORjP!2d=nc;0$z{n?c#?W15d8b^wET zVb3j~FWijdfZ{(g-RGbE^kCQK{_@Oy{6;e6Td#62bgE2#bKqOtF>{C2=c;Eql>l`L zpUk~#(Hb|;BD$!DMOK!}bH#wm0L#Ker5E(<`m1Rd+X(%NpxC< zWS8dKyjJ@~o?nYk;GI{`2FNNo*1vuIdh>fdmb!@F zUly&cdv<%0e2vVbQ0wTZZDIGf?a_S~u&{5Nsf4@@Z$<6Wgp4C^Xzc(`4{yreSVD@*r)>A(&{m=hiz3AnB z!5?kELr)0Yef7NE_-5lmjdX8;1N+w-&3z#&ftD>-oIh->(BP%m5U|jyTAw9AGbDYE z6T?&|hJ{Y0-{LqH1g$t{(aNCJ`l=@w$l*{3S#jA{Jvxk7)wUWD(E`Nq>*c7`ST;CfnEju?t!$^>r0U%+uA+Wt~$(698r?2mk;8 literal 0 HcmV?d00001 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 index 0000000000000000000000000000000000000000..d10a5a59f9cc98e9eaea7b063e002f6b7450a7fe GIT binary patch literal 1682 zcmZ{kX;4#F6vu-V#UO}H;!;Hf5lPS>h$vJ*V%U;^F^d7pswg0P%BCn3Vdpw2UrFkF9ZE2?qA!!R-+2CZ7ad8M`tip)xuq^L(+_T!N{N#Hal+jii&hZaUDjS}W_$J&l!bpzaJl-4@Qiq-pvscrLL zisDVA(1Rz&DMRbfqpvo-mqBo{H^Vs9vcA?asW}x7NX(wZ#}r2}S1%HN9)8*2>q^Os z?YGEq;SS2tv-ZH89rjAF95mt8-NOt|OoZ)hXQCn;+M;uE3^Y_yYZ%_fHd~|wS_nmN zz78gGw`}=1sfF!SgriK*@gdw?jwHfKuXbBjVS|vfkK^QfglSP0ABO&gH~?CgXE2r^ z29WDo0ajBr!d4t5U3%NDTs4%HlU-W_PTN32uQ`)a8iusNfnE)xo_c4;QcQLgHzf2X zOtnQ1f;S0Pr}$tI8(U2xg`rQeR$!fKav5Cl4VQkQJYyGICDrBH$6s$i^eh8N@>ifV_cRQW2r9*)@aBYu(0ra4{179S2 z5J8KcXk`qg)o}O#ta5n?4&^fQz}QM^I=|jpAaWrN*xm2CP$6>Z%m|8VqephhmRz zoMpTQW8K?bwNG^9T0pKN;pt+XnR687RLH_|ob{+8G*7HkEFdehGkiWTvoQUoL~Q9P zQ`>0(Q7?#=f^W*D8oLuoOk;)m$ton!f(@hbk9?fGU5G8+%n9~QP>Wbg3BHMCQ7@V@ zNX3*^%dAC8C0M{?hoSE{Rf0Z2gK*Q|O3dLV(1HtS-P(KkZZN?~nGs}}<$TkgR2+)7 z+Am|;K(07hz++4rFSQ}NYj9z-X=2{-nZvXxlO-aWiO*t zW<4eYc>_@;vvIHM>^m|?LCpmN2u81p+;*nY8GE2Rws>cnU(sTcnx;ZGlbgXlF34;) zq~pB;r4_0ayiGb1*wD1K9C^;z+Zsdy+~<}8B+%!RP9<99WG)<}`_XoK z#u*P2aiF4QDK85>*ciGagq3uhShau9uyx{A+BxxW2=V?+TP;_7J;9d*)vht)6bzq+ zj&k7+M%D- zH}@`Rj$_8%I)A@$$zU 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_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; iShapeInfo(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]= [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 diff --git a/tests/bugs/modalg_5/bug24825_cut b/tests/bugs/modalg_5/bug24825_cut index 4b404481fe..014b7c0be0 100644 --- a/tests/bugs/modalg_5/bug24825_cut +++ b/tests/bugs/modalg_5/bug24825_cut @@ -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 diff --git a/tests/bugs/modalg_5/bug24851 b/tests/bugs/modalg_5/bug24851 index 51ea4efefc..546e95ae15 100644 --- a/tests/bugs/modalg_5/bug24851 +++ b/tests/bugs/modalg_5/bug24851 @@ -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 diff --git a/tests/bugs/modalg_5/bug25163 b/tests/bugs/modalg_5/bug25163 index d45aef0bec..d3a27b8353 100644 --- a/tests/bugs/modalg_5/bug25163 +++ b/tests/bugs/modalg_5/bug25163 @@ -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 diff --git a/tests/bugs/modalg_5/bug25237 b/tests/bugs/modalg_5/bug25237 index a3e324da2b..818f581b19 100644 --- a/tests/bugs/modalg_5/bug25237 +++ b/tests/bugs/modalg_5/bug25237 @@ -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 diff --git a/tests/bugs/modalg_5/bug25263 b/tests/bugs/modalg_5/bug25263 index dada6b1869..de01c71d1b 100644 --- a/tests/bugs/modalg_5/bug25263 +++ b/tests/bugs/modalg_5/bug25263 @@ -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 diff --git a/tests/bugs/modalg_5/bug25337_1 b/tests/bugs/modalg_5/bug25337_1 index 4d15b34ad8..6ff3f9c5e0 100644 --- a/tests/bugs/modalg_5/bug25337_1 +++ b/tests/bugs/modalg_5/bug25337_1 @@ -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 diff --git a/tests/bugs/modalg_5/bug25337_2 b/tests/bugs/modalg_5/bug25337_2 index 6351e020c0..36be0fd872 100644 --- a/tests/bugs/modalg_5/bug25337_2 +++ b/tests/bugs/modalg_5/bug25337_2 @@ -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 diff --git a/tests/bugs/modalg_5/bug25450_1 b/tests/bugs/modalg_5/bug25450_1 index 16a9f4826f..6fada1be7f 100644 --- a/tests/bugs/modalg_5/bug25450_1 +++ b/tests/bugs/modalg_5/bug25450_1 @@ -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 diff --git a/tests/bugs/modalg_5/bug25450_2 b/tests/bugs/modalg_5/bug25450_2 index fbac40d55c..61b22fd50b 100644 --- a/tests/bugs/modalg_5/bug25450_2 +++ b/tests/bugs/modalg_5/bug25450_2 @@ -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 diff --git a/tests/bugs/modalg_5/bug25614_common b/tests/bugs/modalg_5/bug25614_common index c1a2c273f8..42c5b195cc 100755 --- a/tests/bugs/modalg_5/bug25614_common +++ b/tests/bugs/modalg_5/bug25614_common @@ -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 diff --git a/tests/bugs/modalg_5/bug25614_cut b/tests/bugs/modalg_5/bug25614_cut index b8907e1b55..c321a580b2 100755 --- a/tests/bugs/modalg_5/bug25614_cut +++ b/tests/bugs/modalg_5/bug25614_cut @@ -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 diff --git a/tests/bugs/modalg_5/bug25614_cut21 b/tests/bugs/modalg_5/bug25614_cut21 index a825b460d6..f44c178228 100755 --- a/tests/bugs/modalg_5/bug25614_cut21 +++ b/tests/bugs/modalg_5/bug25614_cut21 @@ -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 diff --git a/tests/bugs/modalg_5/bug25625 b/tests/bugs/modalg_5/bug25625 index dcc82e2318..c78ba3699b 100644 --- a/tests/bugs/modalg_5/bug25625 +++ b/tests/bugs/modalg_5/bug25625 @@ -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 diff --git a/tests/bugs/modalg_5/bug25721 b/tests/bugs/modalg_5/bug25721 index 3c525a6258..8d52a802c7 100644 --- a/tests/bugs/modalg_5/bug25721 +++ b/tests/bugs/modalg_5/bug25721 @@ -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 diff --git a/tests/bugs/modalg_6/bug25937_2 b/tests/bugs/modalg_6/bug25937_2 index 039abf19ea..dae7aafd96 100755 --- a/tests/bugs/modalg_6/bug25937_2 +++ b/tests/bugs/modalg_6/bug25937_2 @@ -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" diff --git a/tests/bugs/modalg_6/bug26224 b/tests/bugs/modalg_6/bug26224 index 564f6ba177..a6d6078f8f 100755 --- a/tests/bugs/modalg_6/bug26224 +++ b/tests/bugs/modalg_6/bug26224 @@ -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 index 0000000000..8b0b3c0be0 --- /dev/null +++ b/tests/bugs/modalg_6/bug26565_1 @@ -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 index 0000000000..b8a6223ef0 --- /dev/null +++ b/tests/bugs/modalg_6/bug26565_2 @@ -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 index 0000000000..64ae202c0e --- /dev/null +++ b/tests/bugs/modalg_6/bug26565_3 @@ -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 index 0000000000..c18ab2ad09 --- /dev/null +++ b/tests/bugs/modalg_6/bug26565_4 @@ -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 index 0000000000..0607643e19 --- /dev/null +++ b/tests/bugs/modalg_6/bug26565_5 @@ -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 index 0000000000..7624b5189a --- /dev/null +++ b/tests/bugs/modalg_6/bug26565_6 @@ -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 index 0000000000..0a619f2880 --- /dev/null +++ b/tests/bugs/modalg_6/bug26565_7 @@ -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 index 0000000000..efe49fd9e8 --- /dev/null +++ b/tests/bugs/modalg_6/bug26565_8 @@ -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" +} diff --git a/tests/bugs/modalg_6/bug26582 b/tests/bugs/modalg_6/bug26582 index 5c29422e5b..d06d3c7f17 100755 --- a/tests/bugs/modalg_6/bug26582 +++ b/tests/bugs/modalg_6/bug26582 @@ -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/moddata_3/bug23738 b/tests/bugs/moddata_3/bug23738 index 2e8fead91a..b6b8164f56 100644 --- a/tests/bugs/moddata_3/bug23738 +++ b/tests/bugs/moddata_3/bug23738 @@ -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 diff --git a/tests/bugs/moddata_3/bug24108 b/tests/bugs/moddata_3/bug24108 index 08ac992107..b082f005cc 100644 --- a/tests/bugs/moddata_3/bug24108 +++ b/tests/bugs/moddata_3/bug24108 @@ -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 diff --git a/tests/bugs/moddata_3/bug24108_2 b/tests/bugs/moddata_3/bug24108_2 index edb13d6d38..6692bba19e 100644 --- a/tests/bugs/moddata_3/bug24108_2 +++ b/tests/bugs/moddata_3/bug24108_2 @@ -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 -- 2.20.1