From: emv Date: Wed, 28 Dec 2016 12:39:00 +0000 (+0300) Subject: 0028189: Result of Boolean operation is non-manifold wire X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=042532570d56ccda2d74d389bd0a4cc12844f7dd;p=occt-copy.git 0028189: Result of Boolean operation is non-manifold wire 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. --- diff --git a/dox/user_guides/boolean_operations/boolean_operations.md b/dox/user_guides/boolean_operations/boolean_operations.md index a26fe75952..7676b54bea 100644 --- a/dox/user_guides/boolean_operations/boolean_operations.md +++ b/dox/user_guides/boolean_operations/boolean_operations.md @@ -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 diff --git a/samples/tcl/snowflake.tcl b/samples/tcl/snowflake.tcl index 3b50252e58..d2702a5191 100644 --- a/samples/tcl/snowflake.tcl +++ b/samples/tcl/snowflake.tcl @@ -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 diff --git a/src/BOPAlgo/BOPAlgo_BOP.cxx b/src/BOPAlgo/BOPAlgo_BOP.cxx index e9638c4d6d..a093a5753d 100644 --- a/src/BOPAlgo/BOPAlgo_BOP.cxx +++ b/src/BOPAlgo/BOPAlgo_BOP.cxx @@ -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] 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; +} diff --git a/src/BOPTools/BOPTools_AlgoTools.cdl b/src/BOPTools/BOPTools_AlgoTools.cdl index 9c777684fa..ee7eb10f9a 100644 --- a/src/BOPTools/BOPTools_AlgoTools.cdl +++ b/src/BOPTools/BOPTools_AlgoTools.cdl @@ -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; diff --git a/src/BOPTools/BOPTools_AlgoTools.cxx b/src/BOPTools/BOPTools_AlgoTools.cxx index 1ed5095b27..df8d6d1516 100644 --- a/src/BOPTools/BOPTools_AlgoTools.cxx +++ b/src/BOPTools/BOPTools_AlgoTools.cxx @@ -63,10 +63,13 @@ // #include #include +#include // #include #include // +#include +// 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: //======================================================================= diff --git a/tests/boolean/bfuse_2d/A2 b/tests/boolean/bfuse_2d/A2 index 45535ccd34..1467d5070e 100644 --- a/tests/boolean/bfuse_2d/A2 +++ b/tests/boolean/bfuse_2d/A2 @@ -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 diff --git a/tests/boolean/bfuse_2d/A3 b/tests/boolean/bfuse_2d/A3 index 3582ee1806..d47e7d8eaa 100644 --- a/tests/boolean/bfuse_2d/A3 +++ b/tests/boolean/bfuse_2d/A3 @@ -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 diff --git a/tests/boolean/bfuse_2d/A4 b/tests/boolean/bfuse_2d/A4 index 2367bed74f..ffdf0d8dde 100644 --- a/tests/boolean/bfuse_2d/A4 +++ b/tests/boolean/bfuse_2d/A4 @@ -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 diff --git a/tests/boolean/bfuse_2d/B1 b/tests/boolean/bfuse_2d/B1 index 33fdf540b5..e22a337ec8 100644 --- a/tests/boolean/bfuse_2d/B1 +++ b/tests/boolean/bfuse_2d/B1 @@ -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 diff --git a/tests/boolean/bfuse_2d/B2 b/tests/boolean/bfuse_2d/B2 index 5d4adf82d5..342062a8c0 100644 --- a/tests/boolean/bfuse_2d/B2 +++ b/tests/boolean/bfuse_2d/B2 @@ -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 diff --git a/tests/boolean/bfuse_2d/B3 b/tests/boolean/bfuse_2d/B3 index 8899e20a92..3fc28a47e7 100644 --- a/tests/boolean/bfuse_2d/B3 +++ b/tests/boolean/bfuse_2d/B3 @@ -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 diff --git a/tests/boolean/bfuse_2d/B9 b/tests/boolean/bfuse_2d/B9 index 62250b64dc..6d726293de 100644 --- a/tests/boolean/bfuse_2d/B9 +++ b/tests/boolean/bfuse_2d/B9 @@ -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 diff --git a/tests/boolean/bopfuse_2d/A2 b/tests/boolean/bopfuse_2d/A2 index a8954e4bc2..22b102f8ec 100644 --- a/tests/boolean/bopfuse_2d/A2 +++ b/tests/boolean/bopfuse_2d/A2 @@ -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 diff --git a/tests/boolean/bopfuse_2d/A3 b/tests/boolean/bopfuse_2d/A3 index e87725cb01..905b61169f 100644 --- a/tests/boolean/bopfuse_2d/A3 +++ b/tests/boolean/bopfuse_2d/A3 @@ -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 diff --git a/tests/boolean/bopfuse_2d/A4 b/tests/boolean/bopfuse_2d/A4 index 0e314f0bf8..4a516bb93a 100644 --- a/tests/boolean/bopfuse_2d/A4 +++ b/tests/boolean/bopfuse_2d/A4 @@ -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 diff --git a/tests/boolean/bopfuse_2d/B1 b/tests/boolean/bopfuse_2d/B1 index 71bf6121c7..2a6c4d94fb 100644 --- a/tests/boolean/bopfuse_2d/B1 +++ b/tests/boolean/bopfuse_2d/B1 @@ -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 diff --git a/tests/boolean/bopfuse_2d/B2 b/tests/boolean/bopfuse_2d/B2 index b9e8aaed03..ee7e0d6cbd 100644 --- a/tests/boolean/bopfuse_2d/B2 +++ b/tests/boolean/bopfuse_2d/B2 @@ -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 diff --git a/tests/boolean/bopfuse_2d/B3 b/tests/boolean/bopfuse_2d/B3 index f4e0b3383a..41721cf2c6 100644 --- a/tests/boolean/bopfuse_2d/B3 +++ b/tests/boolean/bopfuse_2d/B3 @@ -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 diff --git a/tests/boolean/bopfuse_2d/B9 b/tests/boolean/bopfuse_2d/B9 index 9902578f82..61821f4d51 100644 --- a/tests/boolean/bopfuse_2d/B9 +++ b/tests/boolean/bopfuse_2d/B9 @@ -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 diff --git a/tests/boolean/bopfuse_complex/N2 b/tests/boolean/bopfuse_complex/N2 index 3ed1a0c924..7522f0e668 100644 --- a/tests/boolean/bopfuse_complex/N2 +++ b/tests/boolean/bopfuse_complex/N2 @@ -5,4 +5,4 @@ bop b1 b2 bopfuse result -set square 850 +set square 1200 diff --git a/tests/boolean/bopfuse_complex/N5 b/tests/boolean/bopfuse_complex/N5 index 10fbb77471..b06919087b 100644 --- a/tests/boolean/bopfuse_complex/N5 +++ b/tests/boolean/bopfuse_complex/N5 @@ -5,4 +5,4 @@ bop b1 b2 bopfuse result -set square 800 +set square 1200 diff --git a/tests/boolean/bopfuse_complex/N6 b/tests/boolean/bopfuse_complex/N6 index 644c869162..9cc82404db 100644 --- a/tests/boolean/bopfuse_complex/N6 +++ b/tests/boolean/bopfuse_complex/N6 @@ -5,4 +5,4 @@ bop b1 b2 bopfuse result -set square 468.629 +set square 800 diff --git a/tests/boolean/bopfuse_complex/O1 b/tests/boolean/bopfuse_complex/O1 index de370311c9..e85a104e74 100644 --- a/tests/boolean/bopfuse_complex/O1 +++ b/tests/boolean/bopfuse_complex/O1 @@ -5,4 +5,4 @@ bop b1 b2 bopfuse result -set square 11868.2 +set square 13962.6 diff --git a/tests/boolean/bopfuse_complex/O4 b/tests/boolean/bopfuse_complex/O4 index f8e4ad24da..7c282353da 100644 --- a/tests/boolean/bopfuse_complex/O4 +++ b/tests/boolean/bopfuse_complex/O4 @@ -5,4 +5,4 @@ bop b1 b2 bopfuse result -set square 87964.6 +set square 125664 diff --git a/tests/boolean/gdml_private/F8 b/tests/boolean/gdml_private/F8 index 97f1249dde..03dff5fa13 100644 --- a/tests/boolean/gdml_private/F8 +++ b/tests/boolean/gdml_private/F8 @@ -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 diff --git a/tests/bugs/modalg_1/bug11565_1 b/tests/bugs/modalg_1/bug11565_1 index 29a46b572b..6ca06f77c6 100755 --- a/tests/bugs/modalg_1/bug11565_1 +++ b/tests/bugs/modalg_1/bug11565_1 @@ -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 diff --git a/tests/bugs/modalg_1/bug11565_2 b/tests/bugs/modalg_1/bug11565_2 index 3a2358bcc2..01bb884cb4 100755 --- a/tests/bugs/modalg_1/bug11565_2 +++ b/tests/bugs/modalg_1/bug11565_2 @@ -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 diff --git a/tests/bugs/modalg_1/bug12507 b/tests/bugs/modalg_1/bug12507 index dbef9be48f..bd1213fa47 100755 --- a/tests/bugs/modalg_1/bug12507 +++ b/tests/bugs/modalg_1/bug12507 @@ -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 diff --git a/tests/bugs/modalg_2/bug21460 b/tests/bugs/modalg_2/bug21460 index aeb40c38c2..3195699117 100755 --- a/tests/bugs/modalg_2/bug21460 +++ b/tests/bugs/modalg_2/bug21460 @@ -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 diff --git a/tests/bugs/modalg_2/bug22356 b/tests/bugs/modalg_2/bug22356 index 748acac8a5..f8dfc8ff58 100755 --- a/tests/bugs/modalg_2/bug22356 +++ b/tests/bugs/modalg_2/bug22356 @@ -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 diff --git a/tests/bugs/modalg_2/bug22790 b/tests/bugs/modalg_2/bug22790 index 15712fa378..bf6ed2951d 100755 --- a/tests/bugs/modalg_2/bug22790 +++ b/tests/bugs/modalg_2/bug22790 @@ -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 diff --git a/tests/bugs/modalg_2/bug23100 b/tests/bugs/modalg_2/bug23100 index c2a149fb1c..a9210fef8c 100755 --- a/tests/bugs/modalg_2/bug23100 +++ b/tests/bugs/modalg_2/bug23100 @@ -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 diff --git a/tests/bugs/modalg_2/bug23470 b/tests/bugs/modalg_2/bug23470 index 1b5405bf91..8111768a1f 100755 --- a/tests/bugs/modalg_2/bug23470 +++ b/tests/bugs/modalg_2/bug23470 @@ -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 diff --git a/tests/bugs/modalg_2/bug23676 b/tests/bugs/modalg_2/bug23676 index 0edbcb8f42..d581a5b7c9 100755 --- a/tests/bugs/modalg_2/bug23676 +++ b/tests/bugs/modalg_2/bug23676 @@ -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 diff --git a/tests/bugs/modalg_4/bug6538 b/tests/bugs/modalg_4/bug6538 index dec5dfa13e..72f74ceedc 100755 --- a/tests/bugs/modalg_4/bug6538 +++ b/tests/bugs/modalg_4/bug6538 @@ -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 diff --git a/tests/bugs/modalg_5/bug24092 b/tests/bugs/modalg_5/bug24092 index 9e7bbd1b76..9b73779413 100644 --- a/tests/bugs/modalg_5/bug24092 +++ b/tests/bugs/modalg_5/bug24092 @@ -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 diff --git a/tests/bugs/modalg_5/bug24187 b/tests/bugs/modalg_5/bug24187 index 54c9077834..5d7781b9a6 100644 --- a/tests/bugs/modalg_5/bug24187 +++ b/tests/bugs/modalg_5/bug24187 @@ -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 diff --git a/tests/bugs/modalg_5/bug24746 b/tests/bugs/modalg_5/bug24746 index 57ffe130a3..2db9f01292 100644 --- a/tests/bugs/modalg_5/bug24746 +++ b/tests/bugs/modalg_5/bug24746 @@ -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 diff --git a/tests/bugs/modalg_5/bug24811 b/tests/bugs/modalg_5/bug24811 index 1ebb8d2fc7..59db6c9b4e 100644 --- a/tests/bugs/modalg_5/bug24811 +++ b/tests/bugs/modalg_5/bug24811 @@ -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 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_4 b/tests/bugs/modalg_6/bug26565_4 new file mode 100644 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 100644 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 100644 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 100644 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 100644 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/modalg_6/bug28189_1 b/tests/bugs/modalg_6/bug28189_1 new file mode 100644 index 0000000000..3fc3ee001e --- /dev/null +++ b/tests/bugs/modalg_6/bug28189_1 @@ -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 index 0000000000..6d878c4d3a --- /dev/null +++ b/tests/bugs/modalg_6/bug28189_2 @@ -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 index 0000000000..b2c2fd3cc6 --- /dev/null +++ b/tests/bugs/modalg_6/bug28189_3 @@ -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 index 0000000000..76f51bfc3e --- /dev/null +++ b/tests/bugs/modalg_6/bug28189_4 @@ -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 index 0000000000..ba17389cd8 --- /dev/null +++ b/tests/bugs/modalg_6/bug28189_5 @@ -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 index 0000000000..5fad480f58 --- /dev/null +++ b/tests/bugs/modalg_6/bug28189_7 @@ -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" +} 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