mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-21 10:13:43 +03:00
0026379: Wrong result produced by the volume maker algorithm
1. class BOPAlgo_ShellSplitter static method void RefineShell(TopoDS_Shell& theShell, BOPCol_ListOfShape& aLShX) Added protection from INTERNAL edges. 2. class BOPAlgo_MakerVolume method void BOPAlgo_MakerVolume::MakeBox(BOPCol_MapOfShape& theBoxFaces) Creation of the overlapping box of proper size. Test-cases for issue #26379
This commit is contained in:
parent
067a4a33d8
commit
d0da782fe1
@ -244,7 +244,7 @@ void BOPAlgo_MakerVolume::MakeBox(BOPCol_MapOfShape& theBoxFaces)
|
|||||||
//
|
//
|
||||||
Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax, anExt;
|
Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax, anExt;
|
||||||
//
|
//
|
||||||
anExt = myBBox.SquareExtent() * 0.5;
|
anExt = sqrt(myBBox.SquareExtent()) * 0.5;
|
||||||
myBBox.Enlarge(anExt);
|
myBBox.Enlarge(anExt);
|
||||||
myBBox.Get(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax);
|
myBBox.Get(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax);
|
||||||
//
|
//
|
||||||
|
@ -347,7 +347,6 @@ void BOPAlgo_ShellSplitter::SplitBlock(BOPTools_ConnexityBlock& aCB)
|
|||||||
TopAbs_EDGE,
|
TopAbs_EDGE,
|
||||||
TopAbs_FACE,
|
TopAbs_FACE,
|
||||||
aEFMap);
|
aEFMap);
|
||||||
|
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
aItF.Initialize (myShapes);
|
aItF.Initialize (myShapes);
|
||||||
@ -501,7 +500,7 @@ void RefineShell(TopoDS_Shell& theShell,
|
|||||||
TopAbs_EDGE,
|
TopAbs_EDGE,
|
||||||
TopAbs_FACE,
|
TopAbs_FACE,
|
||||||
aMEF);
|
aMEF);
|
||||||
|
//
|
||||||
aNbMEF=aMEF.Extent();
|
aNbMEF=aMEF.Extent();
|
||||||
for (i=1; i<=aNbMEF; ++i) {
|
for (i=1; i<=aNbMEF; ++i) {
|
||||||
const TopoDS_Shape& aE=aMEF.FindKey(i);
|
const TopoDS_Shape& aE=aMEF.FindKey(i);
|
||||||
@ -531,7 +530,7 @@ void RefineShell(TopoDS_Shell& theShell,
|
|||||||
aLFP.Append(aF1);
|
aLFP.Append(aF1);
|
||||||
//
|
//
|
||||||
// Trying to reach the branch point
|
// Trying to reach the branch point
|
||||||
for (;;) {
|
for (;;) {
|
||||||
aItLFP.Initialize(aLFP);
|
aItLFP.Initialize(aLFP);
|
||||||
for (; aItLFP.More(); aItLFP.Next()) {
|
for (; aItLFP.More(); aItLFP.Next()) {
|
||||||
const TopoDS_Shape& aFP=aItLFP.Value();
|
const TopoDS_Shape& aFP=aItLFP.Value();
|
||||||
@ -543,6 +542,10 @@ void RefineShell(TopoDS_Shell& theShell,
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
|
if (aE.Orientation() == TopAbs_INTERNAL) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
//
|
||||||
if (BRep_Tool::Degenerated(aE)) {
|
if (BRep_Tool::Degenerated(aE)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -578,7 +581,7 @@ void RefineShell(TopoDS_Shell& theShell,
|
|||||||
aLFP.Append(aFP1);
|
aLFP.Append(aFP1);
|
||||||
}
|
}
|
||||||
aLFP1.Clear();
|
aLFP1.Clear();
|
||||||
}// for (;;) {
|
}// for (;;) {
|
||||||
//
|
//
|
||||||
aNbMFB=aMFB.Extent();
|
aNbMFB=aMFB.Extent();
|
||||||
if (aNbMFB) {
|
if (aNbMFB) {
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
# test script on make volume operation
|
# test script on make volume operation
|
||||||
# plane
|
# 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 : The area of the resulting shape is"
|
||||||
puts "TODO OCC26020 ALL: Error: bopcheck failed"
|
puts "TODO ?OCC26020 ALL: Error: bopcheck failed"
|
||||||
|
|
||||||
# planar face
|
# planar face
|
||||||
plane pln_f1 -331.49269816258993 -487.15663197846379 -460.05843051255943 -0.29784456643004237 0.75470958022277179 -0.58455287508322795
|
plane pln_f1 -331.49269816258993 -487.15663197846379 -460.05843051255943 -0.29784456643004237 0.75470958022277179 -0.58455287508322795
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
# test script on make volume operation
|
# test script on make volume operation
|
||||||
# plane
|
# 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
|
# planar face
|
||||||
plane pln_f1 0 840 1.2212453270876722e-014 0 -1 -1.1102230246251565e-016
|
plane pln_f1 0 840 1.2212453270876722e-014 0 -1 -1.1102230246251565e-016
|
||||||
|
24
tests/bugs/modalg_6/bug26379_1
Normal file
24
tests/bugs/modalg_6/bug26379_1
Normal file
@ -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
|
24
tests/bugs/modalg_6/bug26379_2
Normal file
24
tests/bugs/modalg_6/bug26379_2
Normal file
@ -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
|
Loading…
x
Reference in New Issue
Block a user