diff --git a/src/ModelingData/TKGeomBase/BndLib/BndLib_Add3dCurve.cxx b/src/ModelingData/TKGeomBase/BndLib/BndLib_Add3dCurve.cxx index 7af8bc9e22..5508a13268 100644 --- a/src/ModelingData/TKGeomBase/BndLib/BndLib_Add3dCurve.cxx +++ b/src/ModelingData/TKGeomBase/BndLib/BndLib_Add3dCurve.cxx @@ -215,9 +215,13 @@ void BndLib_Add3dCurve::Add(const Adaptor3d_Curve& C, u2 = Bsaux->LastParameter(); // modified by NIZHNY-EAP Fri Dec 3 14:29:18 1999 ___END___ } + const Standard_Real anU2Periodic = + Bsaux->IsPeriodic() ? (u2 - (Bsaux->LastParameter() - Bsaux->FirstParameter())) : u2; Standard_Real aSegmentTol = 2. * Precision::PConfusion(); - if (Abs(u2 - u1) < aSegmentTol) - aSegmentTol = Abs(u2 - u1) * 0.01; + if (Abs((anU2Periodic - u1) < aSegmentTol)) + { + aSegmentTol = Abs(anU2Periodic - u1) * 0.01; + } Bsaux->Segment(u1, u2, aSegmentTol); Bs = Bsaux; } diff --git a/tests/bugs/modalg_6/bug27079_3 b/tests/bugs/modalg_6/bug27079_3 index db7200a31d..8162441ce4 100644 --- a/tests/bugs/modalg_6/bug27079_3 +++ b/tests/bugs/modalg_6/bug27079_3 @@ -20,6 +20,6 @@ bop f1 f2 bopsection result checkprops result -l 13.7747 -checknbshapes result -vertex 4 -edge 3 +checknbshapes result -vertex 3 -edge 2 checkview -screenshot -2d -path ${imagedir}/${test_image}.png diff --git a/tests/bugs/modalg_8/bug_gh466 b/tests/bugs/modalg_8/bug_gh466 new file mode 100644 index 0000000000..492a206ea2 --- /dev/null +++ b/tests/bugs/modalg_8/bug_gh466 @@ -0,0 +1,10 @@ +puts "=========================================================================" +puts "GH466: BRepBndLib::AddClose crashes" +puts "=========================================================================" +puts "" + +pload QAcommands + +restore [locate_data_file bug_gh466.brep] result + +OCC566 result