mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-14 13:30:48 +03:00
0029711: General Fuse operation produces invalid result
The following improvements have been introduced in Boolean Operations algorithm s: 1. UBTree is replaced with EBTree in Boolean operations to be able to add/remove elements into the tree of bounding boxes. 2. Repeated (nested) intersection of sub-shapes is performed with argument vertices whose tolerances increased during the operation. 3. The algorithms of Edge/Edge and Edge/Face intersection have been improved for the cases when the intersection point is located close to the edge boundaries . 4. New procedure has been implemented to ensure forced creation of Edge/Face common blocks in cases when the edge is really close to the face. 5. Post-processing of Face/Face intersection results has been improved. 6. Extension of the planar faces for Plane/Plane intersection is avoided. 7. Builder Face now better classifies potentially internal edges relatively to new faces with filtering by bounding boxes. Side effect changes: 1. IntTools_ShrunkRange now keeps the length of the valid range of the edge. 2. The method BOPDS_DS::UpdateEdgeTolerance() has been removed as unused (replaced by the BOPAlgo_PaveFiller::UpdateEdgeTolerance()). Test case for the issue 0029900. Test case for the issue 0029711. Adjustments of the existing test cases. Avoid using uninitialized variables.
This commit is contained in:
@@ -760,7 +760,6 @@ Standard_Boolean BOPTools_AlgoTools::IsInternalFace
|
||||
const Handle(IntTools_Context)& theContext)
|
||||
{
|
||||
Standard_Boolean bDegenerated;
|
||||
Standard_Integer aNbF, iRet, iFound;
|
||||
TopAbs_Orientation aOr;
|
||||
TopoDS_Edge aE1;
|
||||
TopExp_Explorer aExp;
|
||||
@@ -771,14 +770,8 @@ Standard_Boolean BOPTools_AlgoTools::IsInternalFace
|
||||
// iRet=0; - state is not IN
|
||||
// iRet=1; - state is IN
|
||||
// iRet=2; - state can not be found by the method of angles
|
||||
//
|
||||
// For this function the returned value iRet means:
|
||||
// iRet=0; - state is not IN
|
||||
// iRet=1; - state is IN
|
||||
//
|
||||
iRet=0;
|
||||
Standard_Integer iRet = 0;
|
||||
// 1 Try to find an edge from theFace in theMEF
|
||||
iFound=0;
|
||||
aExp.Init(theFace, TopAbs_EDGE);
|
||||
for(; aExp.More(); aExp.Next()) {
|
||||
const TopoDS_Edge& aE=(*(TopoDS_Edge*)(&aExp.Current()));
|
||||
@@ -786,8 +779,6 @@ Standard_Boolean BOPTools_AlgoTools::IsInternalFace
|
||||
continue;
|
||||
}
|
||||
//
|
||||
++iFound;
|
||||
//
|
||||
aOr=aE.Orientation();
|
||||
if (aOr==TopAbs_INTERNAL) {
|
||||
continue;
|
||||
@@ -798,18 +789,13 @@ Standard_Boolean BOPTools_AlgoTools::IsInternalFace
|
||||
}
|
||||
// aE
|
||||
TopTools_ListOfShape& aLF=theMEF.ChangeFromKey(aE);
|
||||
aNbF=aLF.Extent();
|
||||
if (!aNbF) {
|
||||
return iRet != 0; // it can not be so
|
||||
}
|
||||
//
|
||||
else if (aNbF==1) {
|
||||
Standard_Integer aNbF = aLF.Extent();
|
||||
if (aNbF==1) {
|
||||
// aE is internal edge on aLF.First()
|
||||
const TopoDS_Face& aF1=(*(TopoDS_Face*)(&aLF.First()));
|
||||
BOPTools_AlgoTools::GetEdgeOnFace(aE, aF1, aE1);
|
||||
if (aE1.Orientation()!=TopAbs_INTERNAL) {
|
||||
iRet=2;
|
||||
break;
|
||||
if (aE1.Orientation() != TopAbs_INTERNAL) {
|
||||
continue;
|
||||
}
|
||||
//
|
||||
iRet=BOPTools_AlgoTools::IsInternalFace(theFace, aE, aF1, aF1,
|
||||
@@ -820,31 +806,14 @@ Standard_Boolean BOPTools_AlgoTools::IsInternalFace
|
||||
else if (aNbF==2) {
|
||||
const TopoDS_Face& aF1=(*(TopoDS_Face*)(&aLF.First()));
|
||||
const TopoDS_Face& aF2=(*(TopoDS_Face*)(&aLF.Last()));
|
||||
//
|
||||
if (aF2.IsSame(aF1) && BRep_Tool::IsClosed(aE, aF1)) {
|
||||
// treat as it was for 1 face
|
||||
iRet=BOPTools_AlgoTools::IsInternalFace(theFace, aE, aF1, aF2,
|
||||
theContext);
|
||||
break;
|
||||
}
|
||||
}
|
||||
//
|
||||
if (aNbF%2) {
|
||||
return Standard_False; // it can not be so
|
||||
}
|
||||
else { // aNbF=2,4,6,8,...
|
||||
iRet=BOPTools_AlgoTools::IsInternalFace(theFace, aE, aLF,
|
||||
iRet=BOPTools_AlgoTools::IsInternalFace(theFace, aE, aF1, aF2,
|
||||
theContext);
|
||||
break;
|
||||
}
|
||||
}//for(; aExp.More(); aExp.Next()) {
|
||||
//
|
||||
if (!iFound) {
|
||||
// the face has no shared edges with the solid
|
||||
iRet=2;
|
||||
}
|
||||
//
|
||||
if (iRet!=2) {
|
||||
if (aExp.More() && iRet != 2)
|
||||
{
|
||||
return iRet == 1;
|
||||
}
|
||||
//
|
||||
|
@@ -17,10 +17,10 @@
|
||||
|
||||
#include <Bnd_Box.hxx>
|
||||
#include <BOPTools_BoxSelector.hxx>
|
||||
#include <NCollection_UBTree.hxx>
|
||||
#include <NCollection_EBTree.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
|
||||
typedef NCollection_UBTree<Standard_Integer, Bnd_Box> BOPTools_BoxBndTree;
|
||||
typedef NCollection_EBTree<Standard_Integer, Bnd_Box> BOPTools_BoxBndTree;
|
||||
typedef BOPTools_BoxSelector<Bnd_Box> BOPTools_BoxBndTreeSelector;
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user