diff --git a/src/IntPatch/IntPatch_ImpImpIntersection_2.gxx b/src/IntPatch/IntPatch_ImpImpIntersection_2.gxx index f94f8096d2..b1d3dfcbfd 100644 --- a/src/IntPatch/IntPatch_ImpImpIntersection_2.gxx +++ b/src/IntPatch/IntPatch_ImpImpIntersection_2.gxx @@ -177,8 +177,11 @@ void IntPatch_ImpImpIntersection::Perform(const Handle(Adaptor3d_HSurface)& S1, aBox2.Add(gp_Pnt2d(aU2f, S2->FirstVParameter())); aBox2.Add(gp_Pnt2d(aU2l, S2->LastVParameter())); - const Standard_Real a2DTol = Min( S1->UResolution(TolTang), - S2->UResolution(TolTang)); + // Resolution is too big if the cylinder radius is + // too small. Therefore, we shall bounde its value above. + // Here, we use simple constant. + const Standard_Real a2DTol = Min(1.0e-4, Min( S1->UResolution(TolTang), + S2->UResolution(TolTang))); Standard_Boolean isReversed = ((aU2l - aU2f) < (aU1l - aU1f)); diff --git a/tests/bugs/modalg_6/bug27310_2 b/tests/bugs/modalg_6/bug27310_2 index 30e5754f8d..fe5faee133 100644 --- a/tests/bugs/modalg_6/bug27310_2 +++ b/tests/bugs/modalg_6/bug27310_2 @@ -6,7 +6,7 @@ puts "" # Huge tolerance obtained in the result of intersection of two cylindrical faces ################################################# -set ExpTol 7.7015195151142059e-006 +set ExpTol 0.00027580830315682321 set GoodNbCurv 2 restore [locate_data_file OCC496a.brep] a diff --git a/tests/bugs/modalg_6/bug27761 b/tests/bugs/modalg_6/bug27761 index 68222063ea..4b5c54f866 100644 --- a/tests/bugs/modalg_6/bug27761 +++ b/tests/bugs/modalg_6/bug27761 @@ -1,6 +1,3 @@ -puts "TODO OCC27766 ALL: Error : The command is not valid. The length is 0." -puts "TODO OCC27766 ALL: Error : The length of result shape is" - puts "========" puts "OCC27761" puts "========" @@ -16,4 +13,16 @@ bsection result c1 c2 checkshape result # approximate theoretical length of the result -checkprops result -l 0.00201518 \ No newline at end of file +checkprops result -l 0.00192624 + +regexp {nb alone Vertices : ([-0-9.+eE]+)} [checksection result] full nbv +if { $nbv != 0 } { puts "Error : Section is incorrect" } + +smallview +don result +fit +clear +disp c1 c2 +disp result + +checkview -screenshot -2d -path ${imagedir}/${test_image}.png diff --git a/tests/bugs/modalg_6/bug27766 b/tests/bugs/modalg_6/bug27766 new file mode 100644 index 0000000000..d992b88ed2 --- /dev/null +++ b/tests/bugs/modalg_6/bug27766 @@ -0,0 +1,30 @@ +puts "========" +puts "OCC27766" +puts "========" +puts "" +################################################# +# Incorrect section curves between attached cylinders +################################################# + +set ExpTol 1.0e-7 +set GoodNbCurv 5 + +restore [locate_data_file bug27761_c1.brep] c1 +restore [locate_data_file bug27761_c2.brep] c2 + +set log [bopcurves c1 c2 -2d] + +regexp {Tolerance Reached=+([-0-9.+eE]+)\n+([-0-9.+eE]+)} ${log} full Toler NbCurv + +if {${NbCurv} != ${GoodNbCurv}} { + puts "Error: Number of curves is bad!" +} + +checkreal TolReached $Toler $ExpTol 0.0 0.1 + +smallview +don c_* +fit +disp c1 c2 + +checkview -screenshot -2d -path ${imagedir}/${test_image}.png