diff --git a/src/BOPAlgo/BOPAlgo_MakerVolume.cxx b/src/BOPAlgo/BOPAlgo_MakerVolume.cxx index 3b10f0714e..3e4f1a8189 100644 --- a/src/BOPAlgo/BOPAlgo_MakerVolume.cxx +++ b/src/BOPAlgo/BOPAlgo_MakerVolume.cxx @@ -244,7 +244,7 @@ void BOPAlgo_MakerVolume::MakeBox(BOPCol_MapOfShape& theBoxFaces) // Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax, anExt; // - anExt = myBBox.SquareExtent() * 0.5; + anExt = sqrt(myBBox.SquareExtent()) * 0.5; myBBox.Enlarge(anExt); myBBox.Get(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax); // diff --git a/src/BOPAlgo/BOPAlgo_ShellSplitter.cxx b/src/BOPAlgo/BOPAlgo_ShellSplitter.cxx index 71f6d17867..b188eb1363 100644 --- a/src/BOPAlgo/BOPAlgo_ShellSplitter.cxx +++ b/src/BOPAlgo/BOPAlgo_ShellSplitter.cxx @@ -347,7 +347,6 @@ void BOPAlgo_ShellSplitter::SplitBlock(BOPTools_ConnexityBlock& aCB) TopAbs_EDGE, TopAbs_FACE, aEFMap); - } // aItF.Initialize (myShapes); @@ -501,7 +500,7 @@ void RefineShell(TopoDS_Shell& theShell, TopAbs_EDGE, TopAbs_FACE, aMEF); - + // aNbMEF=aMEF.Extent(); for (i=1; i<=aNbMEF; ++i) { const TopoDS_Shape& aE=aMEF.FindKey(i); @@ -531,7 +530,7 @@ void RefineShell(TopoDS_Shell& theShell, aLFP.Append(aF1); // // Trying to reach the branch point - for (;;) { + for (;;) { aItLFP.Initialize(aLFP); for (; aItLFP.More(); aItLFP.Next()) { const TopoDS_Shape& aFP=aItLFP.Value(); @@ -543,6 +542,10 @@ void RefineShell(TopoDS_Shell& theShell, continue; } // + if (aE.Orientation() == TopAbs_INTERNAL) { + continue; + } + // if (BRep_Tool::Degenerated(aE)) { continue; } @@ -578,7 +581,7 @@ void RefineShell(TopoDS_Shell& theShell, aLFP.Append(aFP1); } aLFP1.Clear(); - }// for (;;) { + }// for (;;) { // aNbMFB=aMFB.Extent(); if (aNbMFB) { @@ -592,7 +595,7 @@ void RefineShell(TopoDS_Shell& theShell, aLShX.Append(aShX); } }//for (; aIt.More(); aIt.Next()) { -} +} //======================================================================= //function : MakeShells //purpose : diff --git a/tests/boolean/volumemaker/C1 b/tests/boolean/volumemaker/C1 index 5ebbb01e94..5527397339 100644 --- a/tests/boolean/volumemaker/C1 +++ b/tests/boolean/volumemaker/C1 @@ -1,9 +1,9 @@ # test script on make volume operation # plane -puts "TODO OCC26020 ALL: Faulty shapes in variables faulty_1 to faulty_" +puts "TODO ?OCC26020 ALL: Faulty shapes in variables faulty_1 to faulty_" puts "TODO ?OCC26020 ALL: Error : The area of the resulting shape is" -puts "TODO OCC26020 ALL: Error: bopcheck failed" +puts "TODO ?OCC26020 ALL: Error: bopcheck failed" # planar face plane pln_f1 -331.49269816258993 -487.15663197846379 -460.05843051255943 -0.29784456643004237 0.75470958022277179 -0.58455287508322795 diff --git a/tests/boolean/volumemaker/C2 b/tests/boolean/volumemaker/C2 index 42e0f76869..c64f03899b 100644 --- a/tests/boolean/volumemaker/C2 +++ b/tests/boolean/volumemaker/C2 @@ -1,7 +1,9 @@ # test script on make volume operation # plane -puts "TODO OCC26020 ALL: Faulty shapes in variables faulty_1 to faulty_" +puts "TODO ?OCC26020 ALL: Faulty shapes in variables faulty_1 to faulty_" +puts "TODO OCC26020 ALL: Error: bopcheck failed" +puts "TODO OCC26020 ALL: Error : The area of the resulting shape is" # planar face plane pln_f1 0 840 1.2212453270876722e-014 0 -1 -1.1102230246251565e-016 diff --git a/tests/bugs/modalg_6/bug26379_1 b/tests/bugs/modalg_6/bug26379_1 new file mode 100644 index 0000000000..ee6f83f781 --- /dev/null +++ b/tests/bugs/modalg_6/bug26379_1 @@ -0,0 +1,24 @@ +puts "========" +puts "OCC26379" +puts "========" +puts "" +####################################################### +# Wrong result produced by the volume maker algorithm +####################################################### + +restore [locate_data_file OCC26379-csf_2.brep] cf +mkvolume result cf -ni + +vinit +vsetdispmode 1 +vdisplay result +vfit + +set bug_info [vreadpixel 350 310 name] +if {$bug_info != "DARKGOLDENROD3 1"} { + puts "ERROR: OCC26379 is reproduced. Volume is incorrect." +} + +set square 6.60933e+006 + +set only_screen 1 diff --git a/tests/bugs/modalg_6/bug26379_2 b/tests/bugs/modalg_6/bug26379_2 new file mode 100644 index 0000000000..d482284379 --- /dev/null +++ b/tests/bugs/modalg_6/bug26379_2 @@ -0,0 +1,24 @@ +puts "========" +puts "OCC26379" +puts "========" +puts "" +####################################################### +# Wrong result produced by the volume maker algorithm +####################################################### + +restore [locate_data_file OCC26379-csf_3.brep] cf +mkvolume result cf -ni + +vinit +vsetdispmode 1 +vdisplay result +vfit + +set bug_info [vreadpixel 350 310 name] +if {$bug_info != "DARKGOLDENROD3 1"} { + puts "ERROR: OCC26379 is reproduced. Volume is incorrect." +} + +set square 7.22211e+006 + +set only_screen 1