1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-04 13:13:25 +03:00

0028491: Incomplete section curve

The main idea of the fix is to forbid check if intersection curve lies in the some face (with input tolerance) if we have 2D-intersection curve on this face (we consider that necessary tolerance has been computed in intersection algorithm honestly). If we do not have 2D-curve on this face then we need check as before.

New algorithm is implemented in IntTools_Context::IsValidBlockForFaces(...) method.

------
src\Extrema\Extrema_GenExtPS.cxx
No principled changes have been made.
This commit is contained in:
nbv
2017-02-28 10:45:51 +03:00
committed by bugmaster
parent 9ed6494b47
commit 370101f340
4 changed files with 106 additions and 39 deletions

View File

@@ -803,41 +803,44 @@ Standard_Boolean IntTools_Context::IsValidBlockForFace
//function : IsValidBlockForFaces
//purpose :
//=======================================================================
Standard_Boolean IntTools_Context::IsValidBlockForFaces
(const Standard_Real aT1,
const Standard_Real aT2,
const IntTools_Curve& aC,
const TopoDS_Face& aF1,
const TopoDS_Face& aF2,
const Standard_Real aTol)
Standard_Boolean IntTools_Context::IsValidBlockForFaces(const Standard_Real theT1,
const Standard_Real theT2,
const IntTools_Curve& theC,
const TopoDS_Face& theF1,
const TopoDS_Face& theF2,
const Standard_Real theTol)
{
Standard_Boolean bFlag1, bFlag2;
//
Handle(Geom2d_Curve) aPC1 = aC.FirstCurve2d();
Handle(Geom2d_Curve) aPC2 = aC.SecondCurve2d();
if( !aPC1.IsNull() && !aPC2.IsNull() ) {
Standard_Real aMidPar = IntTools_Tools::IntermediatePoint(aT1, aT2);
gp_Pnt2d aPnt2D;
const Standard_Integer aNbElem = 2;
const Handle(Geom2d_Curve) &aPC1 = theC.FirstCurve2d();
const Handle(Geom2d_Curve) &aPC2 = theC.SecondCurve2d();
const Handle(Geom_Curve) &aC3D = theC.Curve();
const Handle(Geom2d_Curve)* anArrPC[aNbElem] = { &aPC1, &aPC2 };
const TopoDS_Face* anArrF[aNbElem] = { &theF1, &theF2 };
const Standard_Real aMidPar = IntTools_Tools::IntermediatePoint(theT1, theT2);
const gp_Pnt aP(aC3D->Value(aMidPar));
aPC1->D0(aMidPar, aPnt2D);
bFlag1 = IsPointInOnFace(aF1, aPnt2D);
Standard_Boolean bFlag = Standard_True;
gp_Pnt2d aPnt2D;
if( !bFlag1 )
return bFlag1;
for (Standard_Integer i = 0; (i < 2) && bFlag; ++i)
{
const Handle(Geom2d_Curve) &aPC = *anArrPC[i];
const TopoDS_Face &aF = *anArrF[i];
aPC2->D0(aMidPar, aPnt2D);
bFlag2 = IsPointInOnFace(aF2, aPnt2D);
return bFlag2;
if (!aPC.IsNull())
{
aPC->D0(aMidPar, aPnt2D);
bFlag = IsPointInOnFace(aF, aPnt2D);
}
else
{
bFlag = IsValidPointForFace(aP, aF, theTol);
}
}
//
bFlag1=IsValidBlockForFace (aT1, aT2, aC, aF1, aTol);
if (!bFlag1) {
return bFlag1;
}
bFlag2=IsValidBlockForFace (aT1, aT2, aC, aF2, aTol);
return bFlag2;
return bFlag;
}
//=======================================================================
//function : IsVertexOnLine