mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-09-18 14:27:39 +03:00
0026718: Big tolerance value of the edge in the result of General Fuse operation
class BOPTools_AlgoTools2D method Standard_Integer BOPTools_AlgoTools2D::AttachExistingPCurve (const TopoDS_Edge& aE2, // old const TopoDS_Edge& aE1, // new const TopoDS_Face& aF, const Handle(IntTools_Context)& aCtx) To prevent huge tolerance increasing check the distances between 2d and 3d curves (through surface) before attaching 2d curve to the edge. Test case for issue CR26718 Correction of test cases for issue CR26718
This commit is contained in:
@@ -37,6 +37,7 @@
|
||||
#include <TopExp_Explorer.hxx>
|
||||
|
||||
#include <IntTools_Context.hxx>
|
||||
#include <IntTools_Tools.hxx>
|
||||
|
||||
#include <BOPTools_AlgoTools2D.hxx>
|
||||
|
||||
@@ -55,7 +56,6 @@ static
|
||||
Standard_Boolean IsClosed(const TopoDS_Edge& ,
|
||||
const TopoDS_Face& );
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : AttachExistingPCurve
|
||||
//purpose :
|
||||
@@ -66,9 +66,10 @@ Standard_Integer BOPTools_AlgoTools2D::AttachExistingPCurve
|
||||
const TopoDS_Face& aF,
|
||||
const Handle(IntTools_Context)& aCtx)
|
||||
{
|
||||
Standard_Boolean bIsToReverse, bIsClosed;
|
||||
Standard_Boolean bIsToReverse, bIsClosed, bComp;
|
||||
Standard_Integer iRet;
|
||||
Standard_Real aTol, aT11, aT12, aT21, aT22, aTolPPC;
|
||||
Standard_Real aTolSP, aTMax;
|
||||
Handle(Geom2d_Curve) aC2Dold, aC2DoldC;
|
||||
Handle(Geom2d_Curve) aC2DT;
|
||||
BRep_Builder aBB;
|
||||
@@ -97,13 +98,10 @@ Standard_Integer BOPTools_AlgoTools2D::AttachExistingPCurve
|
||||
//
|
||||
aC2DT=new Geom2d_TrimmedCurve(aC2DoldC, aT21, aT22);
|
||||
//
|
||||
aTol=BRep_Tool::Tolerance(aE1);
|
||||
BRep_Tool::Range (aE1, aT11, aT12);
|
||||
aBB.SameRange(aE1, Standard_False);
|
||||
aBB.SameParameter(aE1, Standard_False);
|
||||
|
||||
aTolPPC=Precision::PConfusion();
|
||||
//
|
||||
Handle(Geom_Curve) aCE1 = BRep_Tool::Curve(aE1, aT11, aT12);
|
||||
//
|
||||
GeomLib::SameRange(aTolPPC, aC2DT, aT21, aT22, aT11, aT12, aC2DT);
|
||||
//
|
||||
if (aC2DT.IsNull()){
|
||||
@@ -111,15 +109,36 @@ Standard_Integer BOPTools_AlgoTools2D::AttachExistingPCurve
|
||||
return iRet;
|
||||
}
|
||||
//
|
||||
// check the curves on same parameter to prevent
|
||||
// big tolerance increasing
|
||||
Handle(Geom_Surface) aSF = BRep_Tool::Surface(aF);
|
||||
//
|
||||
bComp = IntTools_Tools::ComputeTolerance
|
||||
(aCE1, aC2DT, aSF, aT11, aT12, aTolSP, aTMax);
|
||||
if (!bComp) {
|
||||
iRet = 3;
|
||||
return iRet;
|
||||
}
|
||||
//
|
||||
aTol = BRep_Tool::Tolerance(aE1);
|
||||
//
|
||||
if ((aTolSP > 10.*aTol) && aTolSP > 0.1) {
|
||||
iRet = 4;
|
||||
return iRet;
|
||||
}
|
||||
//
|
||||
aBB.SameRange(aE1, Standard_False);
|
||||
aBB.SameParameter(aE1, Standard_False);
|
||||
//
|
||||
aBB.UpdateEdge(aE1, aC2DT, aF, aTol);
|
||||
BRepLib::SameParameter(aE1);
|
||||
BRepLib::SameRange(aE1);
|
||||
//
|
||||
bIsClosed=IsClosed(aE2, aF);
|
||||
bIsClosed = IsClosed(aE2, aF);
|
||||
if (bIsClosed) {
|
||||
iRet=UpdateClosedPCurve(aE2, aE1, aF, aCtx);
|
||||
iRet = UpdateClosedPCurve(aE2, aE1, aF, aCtx);
|
||||
if(iRet) {
|
||||
iRet=3;
|
||||
iRet = 5;
|
||||
}
|
||||
}
|
||||
//
|
||||
@@ -309,4 +328,3 @@ Standard_Boolean IsClosed(const TopoDS_Edge& aE,
|
||||
}
|
||||
return bRet;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user