mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-14 13:30:48 +03:00
0027804: Two breps cause intersections to loop for too long/infinitely
In ProjLib_ComputeApprox algorithm, compute correct parametric tolerance from the input 3D tolerance using surface resolution, in order to pass it to low-level 2D algorithm Approx_FitAndDivide2d (instantiation of the generic class Approx_ComputeCLine). Earlier 3D tolerance was used as parametric tolerance directly, which was a problem for surfaces with too small radius of curvature. Also, eliminate redundant creation of the object of type AppParCurves_MultiCurve on each iteration in the method Approx_ComputeCLine::Compute. The post treatment of the Edge/Edge intersections has been improved. Namely: a. Making the procedure of sharing Edge/Edge intersection vertices consistent with intersection algorithm by enlarging bounding box of each vertex on half of Precision::Confusion(); b. Algorithm of computation of vertex tolerance (in order to cover tangent zone between Edges) has been changed for Line/Circle cases. Test cases for issue CR27804 Adjusting test cases according to their new behavior. Mark the test boolean/volumemaker/A8 as unstable between different versions of MSVS (2010 and 2013).
This commit is contained in:
@@ -412,15 +412,22 @@ void BOPAlgo_PaveFiller::PerformEE()
|
||||
const IntTools_SequenceOfCommonPrts& aCPrts = anEdgeEdge.CommonParts();
|
||||
aNbCPrts = aCPrts.Length();
|
||||
//
|
||||
Standard_Boolean bLineLine = Standard_False;
|
||||
Standard_Boolean bAnalytical = Standard_False;
|
||||
if (aNbCPrts) {
|
||||
const TopoDS_Edge& aOE1 = *(TopoDS_Edge*)&myDS->Shape(nE1);
|
||||
const TopoDS_Edge& aOE2 = *(TopoDS_Edge*)&myDS->Shape(nE2);
|
||||
//
|
||||
BRepAdaptor_Curve aBAC1(aOE1), aBAC2(aOE2);
|
||||
//
|
||||
bLineLine = (aBAC1.GetType() == GeomAbs_Line &&
|
||||
aBAC2.GetType() == GeomAbs_Line);
|
||||
GeomAbs_CurveType aType1 = aBAC1.GetType();
|
||||
GeomAbs_CurveType aType2 = aBAC2.GetType();
|
||||
//
|
||||
bAnalytical = (((aType1 == GeomAbs_Line) &&
|
||||
(aType2 == GeomAbs_Line ||
|
||||
aType2 == GeomAbs_Circle)) ||
|
||||
((aType2 == GeomAbs_Line) &&
|
||||
(aType1 == GeomAbs_Line ||
|
||||
aType1 == GeomAbs_Circle)));
|
||||
}
|
||||
//
|
||||
for (i=1; i<=aNbCPrts; ++i) {
|
||||
@@ -483,10 +490,11 @@ void BOPAlgo_PaveFiller::PerformEE()
|
||||
//
|
||||
BOPTools_AlgoTools::MakeNewVertex(aE1, aT1, aE2, aT2, aVnew);
|
||||
Standard_Real aTolVnew = BRep_Tool::Tolerance(aVnew);
|
||||
if (bLineLine) {
|
||||
if (bAnalytical) {
|
||||
// increase tolerance for Line/Line intersection, but do not update
|
||||
// the vertex till its intersection with some other shape
|
||||
Standard_Real aTolMin = (aCR1.Last() - aCR1.First()) / 2.;
|
||||
Standard_Real aTolMin = (BRepAdaptor_Curve(aE1).GetType() == GeomAbs_Line) ?
|
||||
(aCR1.Last() - aCR1.First()) / 2. : (aCR2.Last() - aCR2.First()) / 2.;
|
||||
if (aTolMin > aTolVnew) {
|
||||
aTolVnew = aTolMin;
|
||||
}
|
||||
@@ -780,6 +788,7 @@ void BOPAlgo_PaveFiller::TreatNewVertices
|
||||
Bnd_Box> aTreeFiller(aBBTree);
|
||||
BOPAlgo_VectorOfTNV aVTNV;
|
||||
//
|
||||
Standard_Real aTolAdd = Precision::Confusion() / 2.;
|
||||
aNbV = theMVCPB.Extent();
|
||||
for (i=1; i<=aNbV; ++i) {
|
||||
const TopoDS_Vertex& aV = *((TopoDS_Vertex*)&theMVCPB.FindKey(i));
|
||||
@@ -787,7 +796,7 @@ void BOPAlgo_PaveFiller::TreatNewVertices
|
||||
//
|
||||
aTol = theMVCPB.FindFromIndex(i).Tolerance();
|
||||
aBox.Add(BRep_Tool::Pnt(aV));
|
||||
aBox.SetGap(aTol);
|
||||
aBox.SetGap(aTol + aTolAdd);
|
||||
//
|
||||
aTreeFiller.Add(i, aBox);
|
||||
//
|
||||
|
Reference in New Issue
Block a user