mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-21 10:13:43 +03:00
0024187: Wrong result of COMMON operation.
In the function void BOPAlgo_Builder::FillInternalShapes() added treatment for the arguments of type COMPOUND. Adding test case for issue CR24187
This commit is contained in:
parent
8b381bc3a3
commit
c884a2681d
@ -76,6 +76,11 @@ static
|
|||||||
void OwnInternalShapes(const TopoDS_Shape& ,
|
void OwnInternalShapes(const TopoDS_Shape& ,
|
||||||
BOPCol_IndexedMapOfShape& );
|
BOPCol_IndexedMapOfShape& );
|
||||||
|
|
||||||
|
static
|
||||||
|
void TreatCompound(const TopoDS_Shape& theS,
|
||||||
|
BOPCol_MapOfShape& aMFence,
|
||||||
|
BOPCol_ListOfShape& theLS);
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//class : BOPAlgo_ShapeBox
|
//class : BOPAlgo_ShapeBox
|
||||||
//purpose : Auxiliary class
|
//purpose : Auxiliary class
|
||||||
@ -618,6 +623,7 @@ void BOPAlgo_Builder::FillInternalShapes()
|
|||||||
BOPCol_MapOfShape aMSOr(100, aAllocator);
|
BOPCol_MapOfShape aMSOr(100, aAllocator);
|
||||||
BOPCol_ListOfShape aLSd(aAllocator);
|
BOPCol_ListOfShape aLSd(aAllocator);
|
||||||
BOPCol_ListOfShape aLArgs(aAllocator);
|
BOPCol_ListOfShape aLArgs(aAllocator);
|
||||||
|
BOPCol_ListOfShape aLSC(aAllocator);
|
||||||
//
|
//
|
||||||
// 1. Shapes to process
|
// 1. Shapes to process
|
||||||
//
|
//
|
||||||
@ -627,10 +633,11 @@ void BOPAlgo_Builder::FillInternalShapes()
|
|||||||
aIt.Initialize(myArguments);
|
aIt.Initialize(myArguments);
|
||||||
for (; aIt.More(); aIt.Next()) {
|
for (; aIt.More(); aIt.Next()) {
|
||||||
const TopoDS_Shape& aS=aIt.Value();
|
const TopoDS_Shape& aS=aIt.Value();
|
||||||
if (!aMFence.Add(aS)) {
|
TreatCompound(aS, aMFence, aLSC);
|
||||||
continue;
|
}
|
||||||
}
|
aIt.Initialize(aLSC);
|
||||||
//
|
for (; aIt.More(); aIt.Next()) {
|
||||||
|
const TopoDS_Shape& aS=aIt.Value();
|
||||||
aType=aS.ShapeType();
|
aType=aS.ShapeType();
|
||||||
if (aType==TopAbs_WIRE) {
|
if (aType==TopAbs_WIRE) {
|
||||||
aItS.Initialize(aS);
|
aItS.Initialize(aS);
|
||||||
@ -947,7 +954,32 @@ Standard_Boolean IsClosedShell(const TopoDS_Shell& aSh)
|
|||||||
//
|
//
|
||||||
return bRet;
|
return bRet;
|
||||||
}
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : TreatCompound
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void TreatCompound(const TopoDS_Shape& theS,
|
||||||
|
BOPCol_MapOfShape& aMFence,
|
||||||
|
BOPCol_ListOfShape& theLS)
|
||||||
|
{
|
||||||
|
TopAbs_ShapeEnum aType;
|
||||||
|
//
|
||||||
|
aType = theS.ShapeType();
|
||||||
|
if (aType != TopAbs_COMPOUND) {
|
||||||
|
if (aMFence.Add(theS)) {
|
||||||
|
theLS.Append(theS);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
TopoDS_Iterator aIt;
|
||||||
|
//
|
||||||
|
aIt.Initialize(theS);
|
||||||
|
for (; aIt.More(); aIt.Next()) {
|
||||||
|
const TopoDS_Shape& aS = aIt.Value();
|
||||||
|
TreatCompound(aS, aMFence, theLS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// ErrorStatus
|
// ErrorStatus
|
||||||
|
33
tests/bugs/modalg_5/bug24187
Normal file
33
tests/bugs/modalg_5/bug24187
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
puts "============"
|
||||||
|
puts "OCC24187"
|
||||||
|
puts "============"
|
||||||
|
puts ""
|
||||||
|
###############################################################################################
|
||||||
|
# Wrong result of COMMON operation
|
||||||
|
###############################################################################################
|
||||||
|
|
||||||
|
box b1 10 10 10
|
||||||
|
|
||||||
|
circle c1 -3 5 2 5
|
||||||
|
circle c2 -3 5 8 5
|
||||||
|
mkedge e1 c1
|
||||||
|
mkedge e2 c2
|
||||||
|
compound e1 e2 b2
|
||||||
|
|
||||||
|
bop b1 b2
|
||||||
|
bopcommon result
|
||||||
|
|
||||||
|
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_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 2dviewer 1
|
Loading…
x
Reference in New Issue
Block a user