0023419: EDF 14260 - Problem of fusion

This commit is contained in:
jfa 2017-03-10 13:54:30 +03:00
parent 31792db89f
commit 0c782492c0

View File

@ -373,6 +373,7 @@ TopoDS_Shape GEOMImpl_BooleanDriver::makeCompoundShellFromFaces
return aResult; return aResult;
} }
//======================================================================= //=======================================================================
//function : performOperation //function : performOperation
//purpose : //purpose :
@ -415,11 +416,12 @@ TopoDS_Shape GEOMImpl_BooleanDriver::performOperation
// This allows to avoid adding empty compounds, // This allows to avoid adding empty compounds,
// resulting from COMMON on two non-intersecting shapes. // resulting from COMMON on two non-intersecting shapes.
if (aStepResult.ShapeType() == TopAbs_COMPOUND) { if (aStepResult.ShapeType() == TopAbs_COMPOUND) {
#if OCC_VERSION_MAJOR >= 7 #if OCC_VERSION_MAJOR >= 7
if (aValue1.ShapeType() == TopAbs_FACE && aValue2.ShapeType() == TopAbs_FACE) { if ((aValue1.ShapeType() == TopAbs_FACE || aValue1.ShapeType() == TopAbs_SHELL) &&
(aValue2.ShapeType() == TopAbs_FACE || aValue2.ShapeType() == TopAbs_SHELL)) {
aStepResult = makeCompoundShellFromFaces(aStepResult); aStepResult = makeCompoundShellFromFaces(aStepResult);
} }
#endif #endif
TopoDS_Iterator aCompIter (aStepResult); TopoDS_Iterator aCompIter (aStepResult);
for (; aCompIter.More(); aCompIter.Next()) { for (; aCompIter.More(); aCompIter.Next()) {
// add shape in a result // add shape in a result
@ -477,11 +479,12 @@ TopoDS_Shape GEOMImpl_BooleanDriver::performOperation
// This allows to avoid adding empty compounds, // This allows to avoid adding empty compounds,
// resulting from CUT of parts // resulting from CUT of parts
if (aCut.ShapeType() == TopAbs_COMPOUND) { if (aCut.ShapeType() == TopAbs_COMPOUND) {
#if OCC_VERSION_MAJOR >= 7 #if OCC_VERSION_MAJOR >= 7
if (itSub1.Value().ShapeType() == TopAbs_FACE) { if (itSub1.Value().ShapeType() == TopAbs_FACE ||
itSub1.Value().ShapeType() == TopAbs_SHELL) {
aCut = makeCompoundShellFromFaces(aCut); aCut = makeCompoundShellFromFaces(aCut);
} }
#endif #endif
TopoDS_Iterator aCompIter (aCut); TopoDS_Iterator aCompIter (aCut);
for (; aCompIter.More(); aCompIter.Next()) { for (; aCompIter.More(); aCompIter.Next()) {
// add shape in a result // add shape in a result
@ -509,7 +512,7 @@ TopoDS_Shape GEOMImpl_BooleanDriver::performOperation
// perform FUSE operation // perform FUSE operation
else if (theType == BOOLEAN_FUSE) { else if (theType == BOOLEAN_FUSE) {
#if OCC_VERSION_MAJOR >= 7 #if OCC_VERSION_MAJOR >= 7
Standard_Boolean isFaces = Standard_False; Standard_Boolean isFaces = Standard_False;
TopTools_ListOfShape listShape1, listShape2; TopTools_ListOfShape listShape1, listShape2;
GEOMUtils::AddSimpleShapes(theShape1, listShape1); GEOMUtils::AddSimpleShapes(theShape1, listShape1);
@ -521,7 +524,8 @@ TopoDS_Shape GEOMImpl_BooleanDriver::performOperation
TopTools_ListIteratorOfListOfShape itSub2 (listShape2); TopTools_ListIteratorOfListOfShape itSub2 (listShape2);
for (; itSub2.More(); itSub2.Next()) { for (; itSub2.More(); itSub2.Next()) {
TopoDS_Shape aValue2 = itSub2.Value(); TopoDS_Shape aValue2 = itSub2.Value();
if (aValue1.ShapeType() == TopAbs_FACE && aValue2.ShapeType() == TopAbs_FACE) { if ((aValue1.ShapeType() == TopAbs_FACE || aValue1.ShapeType() == TopAbs_SHELL) &&
(aValue2.ShapeType() == TopAbs_FACE || aValue2.ShapeType() == TopAbs_SHELL)) {
isFaces = Standard_True; isFaces = Standard_True;
} }
} }
@ -534,10 +538,10 @@ TopoDS_Shape GEOMImpl_BooleanDriver::performOperation
StdFail_NotDone::Raise("Fuse operation can not be performed on the given shapes"); StdFail_NotDone::Raise("Fuse operation can not be performed on the given shapes");
} }
aShape = BO.Shape(); aShape = BO.Shape();
#if OCC_VERSION_MAJOR >= 7 #if OCC_VERSION_MAJOR >= 7
if (isFaces) if (isFaces)
aShape = makeCompoundShellFromFaces(aShape); aShape = makeCompoundShellFromFaces(aShape);
#endif #endif
} }
// perform SECTION operation // perform SECTION operation