mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-09-13 14:27:08 +03:00
0024789: BOPAlgo_Builder produces invalid result on planar, conical and spherical surfaces
BOPAlgo_PaveFiller::MakeBlocks() - Improve Face/Face post treatment procedure by: * Adding more existing edge for intersection with section edges to resolve all possible intersections. * Using tree for edges selection. * Avoiding intersection of the existing edges among themselves. IntPatch_ImpImpIntersection::CyCyNoGeometric - add more points to wline to make it more smooth.
This commit is contained in:
@@ -825,7 +825,8 @@ Standard_Boolean BOPTools_AlgoTools::IsInternalFace
|
||||
const TopoDS_Face& aF2=(*(TopoDS_Face*)(&aLF.Last()));
|
||||
iRet=BOPTools_AlgoTools::IsInternalFace(theFace, aE, aF1, aF2,
|
||||
theContext);
|
||||
break;
|
||||
if (iRet != 2)
|
||||
break;
|
||||
}
|
||||
}//for(; aExp.More(); aExp.Next()) {
|
||||
//
|
||||
@@ -901,8 +902,6 @@ Standard_Integer BOPTools_AlgoTools::IsInternalFace
|
||||
const TopoDS_Face& theFace2,
|
||||
const Handle(IntTools_Context)& theContext)
|
||||
{
|
||||
Standard_Boolean bRet;
|
||||
Standard_Integer iRet;
|
||||
TopoDS_Edge aE1, aE2;
|
||||
TopoDS_Face aFOff;
|
||||
BOPTools_ListOfCoupleOfShape theLCSOff;
|
||||
@@ -931,17 +930,15 @@ Standard_Integer BOPTools_AlgoTools::IsInternalFace
|
||||
aCS2.SetShape2(theFace2);
|
||||
theLCSOff.Append(aCS2);
|
||||
//
|
||||
bRet=GetFaceOff(aE1, theFace1, theLCSOff, aFOff, theContext);
|
||||
//
|
||||
iRet=0; // theFace is not internal
|
||||
if (theFace.IsEqual(aFOff)) {
|
||||
Standard_Integer iRet = 0; // theFace is not internal
|
||||
Standard_Boolean isDone = GetFaceOff (aE1, theFace1, theLCSOff, aFOff, theContext);
|
||||
if (!isDone)
|
||||
// error, unable to classify face by this edge
|
||||
iRet = 2;
|
||||
else if (theFace.IsEqual (aFOff))
|
||||
// theFace is internal
|
||||
iRet=1;
|
||||
if (!bRet) {
|
||||
// theFace seems to be internal
|
||||
iRet=2;
|
||||
}
|
||||
}
|
||||
iRet = 1;
|
||||
|
||||
return iRet;
|
||||
}
|
||||
//=======================================================================
|
||||
@@ -957,7 +954,7 @@ Standard_Boolean BOPTools_AlgoTools::GetFaceOff
|
||||
{
|
||||
Standard_Boolean bRet, bIsComputed;
|
||||
Standard_Real aT, aT1, aT2, aAngle, aTwoPI, aAngleMin, aDt3D;
|
||||
Standard_Real aUmin, aUsup, aVmin, aVsup, aPA;
|
||||
Standard_Real aUmin, aUsup, aVmin, aVsup;
|
||||
gp_Pnt aPn1, aPn2, aPx;
|
||||
gp_Dir aDN1, aDN2, aDBF, aDBF2, aDTF;
|
||||
gp_Vec aVTgt;
|
||||
@@ -967,7 +964,6 @@ Standard_Boolean BOPTools_AlgoTools::GetFaceOff
|
||||
BOPTools_ListIteratorOfListOfCoupleOfShape aIt;
|
||||
GeomAPI_ProjectPointOnSurf aProjPL;
|
||||
//
|
||||
aPA=Precision::Angular();
|
||||
aAngleMin=100.;
|
||||
aTwoPI=M_PI+M_PI;
|
||||
aC3D =BRep_Tool::Curve(theE1, aT1, aT2);
|
||||
@@ -994,6 +990,10 @@ Standard_Boolean BOPTools_AlgoTools::GetFaceOff
|
||||
//
|
||||
aDTF=aDN1^aDBF;
|
||||
//
|
||||
// The difference between faces should be obvious enough
|
||||
// to guarantee the correctness of the classification
|
||||
Standard_Real anAngleCriteria = Precision::Confusion();
|
||||
|
||||
bRet=Standard_True;
|
||||
aIt.Initialize(theLCSOff);
|
||||
for (; aIt.More(); aIt.Next()) {
|
||||
@@ -1012,11 +1012,7 @@ Standard_Boolean BOPTools_AlgoTools::GetFaceOff
|
||||
//Angle
|
||||
aAngle=AngleWithRef(aDBF, aDBF2, aDTF);
|
||||
//
|
||||
if(aAngle<0.) {
|
||||
aAngle=aTwoPI+aAngle;
|
||||
}
|
||||
//
|
||||
if (aAngle<aPA) {
|
||||
if (Abs(aAngle) < Precision::Angular()) {
|
||||
if (aF2==theF1) {
|
||||
aAngle=M_PI;
|
||||
}
|
||||
@@ -1025,19 +1021,21 @@ Standard_Boolean BOPTools_AlgoTools::GetFaceOff
|
||||
}
|
||||
}
|
||||
//
|
||||
if (fabs(aAngle-aAngleMin)<aPA) {
|
||||
if (Abs(aAngle) < anAngleCriteria ||
|
||||
Abs (aAngle-aAngleMin) < anAngleCriteria) {
|
||||
// the minimal angle can not be found
|
||||
bRet=Standard_False;
|
||||
}
|
||||
//
|
||||
if (aAngle < 0.)
|
||||
{
|
||||
aAngle = aTwoPI + aAngle;
|
||||
}
|
||||
//
|
||||
if (aAngle<aAngleMin){
|
||||
aAngleMin=aAngle;
|
||||
theFOff=aF2;
|
||||
}
|
||||
else if (aAngle==aAngleMin) {
|
||||
// the minimal angle can not be found
|
||||
bRet=Standard_False;
|
||||
}
|
||||
}
|
||||
return bRet;
|
||||
}
|
||||
|
Reference in New Issue
Block a user