diff --git a/src/IntTools/IntTools_BeanFaceIntersector.cxx b/src/IntTools/IntTools_BeanFaceIntersector.cxx index 513e3e5c2a..5bc0d5a946 100644 --- a/src/IntTools/IntTools_BeanFaceIntersector.cxx +++ b/src/IntTools/IntTools_BeanFaceIntersector.cxx @@ -1140,7 +1140,7 @@ void IntTools_BeanFaceIntersector::ComputeRangeFromStartPoint(const Standard_Boo Standard_Integer aValidIndex = theIndex; Standard_Real aMinDelta = myCurveResolution * 0.5; - Standard_Real aDeltaRestrictor = myLastParameter - myFirstParameter; + Standard_Real aDeltaRestrictor = 0.1 * (myLastParameter - myFirstParameter); if(aMinDelta > aDeltaRestrictor) aMinDelta = aDeltaRestrictor * 0.5; @@ -1202,7 +1202,7 @@ void IntTools_BeanFaceIntersector::ComputeRangeFromStartPoint(const Standard_Boo aDelta = (pointfound) ? (aDelta * 2.) : (aDelta * 0.5); aDelta = (aDelta < aDeltaRestrictor) ? aDelta : aDeltaRestrictor; - + aCurPar = (ToIncreaseParameter) ? (aPrevPar + aDelta) : (aPrevPar - aDelta); diff --git a/src/IntTools/IntTools_EdgeFace.cxx b/src/IntTools/IntTools_EdgeFace.cxx index dffdb25c2c..37bfcec4a8 100644 --- a/src/IntTools/IntTools_EdgeFace.cxx +++ b/src/IntTools/IntTools_EdgeFace.cxx @@ -93,13 +93,18 @@ Standard_Boolean IntTools_EdgeFace::IsCoincident() myS.GetType() == GeomAbs_Plane) aNbSeg = 2; // Check only three points for Line/Plane intersection - const Standard_Real aTresh=0.5; + const Standard_Real aTresh = 0.5; const Standard_Integer aTreshIdxF = RealToInt((aNbSeg+1)*0.25), aTreshIdxL = RealToInt((aNbSeg+1)*0.75); const Handle(Geom_Surface) aSurf = BRep_Tool::Surface(myFace); aT1=myRange.First(); aT2=myRange.Last(); + Standard_Real aBndShift = 0.01 * (aT2 - aT1); + //Shifting first and last curve points in order to avoid projection + //on surface boundary and rejection projection point with minimal distance + aT1 += aBndShift; + aT2 -= aBndShift; dT=(aT2-aT1)/aNbSeg; // Standard_Boolean isClassified = Standard_False; @@ -115,8 +120,11 @@ Standard_Boolean IntTools_EdgeFace::IsCoincident() // aD=aProjector.LowerDistance(); - if (aD>myCriteria) { - continue; + if (aD > myCriteria) { + if (aD > 100. * myCriteria) + return Standard_False; + else + continue; } // diff --git a/tests/bugs/modalg_7/bug27469_1 b/tests/bugs/modalg_7/bug27469_1 index 9fc5079ac3..db45442785 100644 --- a/tests/bugs/modalg_7/bug27469_1 +++ b/tests/bugs/modalg_7/bug27469_1 @@ -1,12 +1,7 @@ -puts "TODO OCC27469 ALL: Error : is WRONG because number of" - -puts "========" -puts "OCC27469" -puts "========" +puts "====================================================================" +puts "OCC27469 Regression vs 6.9.1: Wrong result of Edge/Face intersection" +puts "====================================================================" puts "" -############################################################### -# Regression vs 6.9.1: Wrong result of Edge/Face intersection -############################################################### restore [locate_data_file bug27469_shapes.brep] b @@ -21,4 +16,9 @@ baddtools b_2_10 b_2_9 bfillds bbuild result -checknbshapes result -edge 35 +checkshape result +checknbshapes result -face 1 -wire 3 -edge 35 -vertex 30 +checkmaxtol result -min_tol 2.42e-7 +checkprops result -l 38486.5 + +checkview -display result -2d -path ${imagedir}/${test_image}.png \ No newline at end of file diff --git a/tests/bugs/modalg_7/bug27469_2 b/tests/bugs/modalg_7/bug27469_2 index 1ddb9ff9a8..3b4accea80 100644 --- a/tests/bugs/modalg_7/bug27469_2 +++ b/tests/bugs/modalg_7/bug27469_2 @@ -1,12 +1,7 @@ -puts "TODO OCC27469 ALL: Faulty shapes in variables faulty_1 to faulty_" - -puts "========" -puts "OCC27469" -puts "========" +puts "====================================================================" +puts "OCC27469 Regression vs 6.9.1: Wrong result of Edge/Face intersection" +puts "====================================================================" puts "" -############################################################### -# Regression vs 6.9.1: Wrong result of Edge/Face intersection -############################################################### restore [locate_data_file bug27469_shapes.brep] b @@ -20,3 +15,7 @@ bfillds bbuild result checkshape result +checknbshapes result -solid 7 -shell 7 -face 39 -wire 46 -edge 67 -vertex 34 +checkmaxtol result -min_tol 2.17e-2 +checkprops result -l 352002 +checkview -display result -2d -path ${imagedir}/${test_image}.png