From b493028765b080def002a7410e17710bf7db0404 Mon Sep 17 00:00:00 2001 From: ifv Date: Thu, 18 May 2017 16:10:45 +0300 Subject: [PATCH] 0028637: [regression] Extrema curve - curve can not find correct solution between edge based on the line and BSpline edge Adding condition for preventing decreasing Lipschitz constant if derivative are too small Test case is created --- src/Extrema/Extrema_GenExtCC.gxx | 6 ++++++ tests/bugs/modalg_6/bug28637 | 12 ++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 tests/bugs/modalg_6/bug28637 diff --git a/src/Extrema/Extrema_GenExtCC.gxx b/src/Extrema/Extrema_GenExtCC.gxx index 63294ae1bd..a03e33d116 100644 --- a/src/Extrema/Extrema_GenExtCC.gxx +++ b/src/Extrema/Extrema_GenExtCC.gxx @@ -220,6 +220,12 @@ void Extrema_GenExtCC::Perform() // Change constant value according to the concrete curve types. Standard_Boolean isConstLockedFlag = Standard_False; + //To prevent LipConst to became too small + const Standard_Real aCR = 0.001; + if (aMaxDer1 / aMaxDer < aCR || aMaxDer2 / aMaxDer < aCR) + { + isConstLockedFlag = Standard_True; + } if (C1.GetType() == GeomAbs_Line) { aMaxDer = 1.0 / C2.Resolution(1.0); diff --git a/tests/bugs/modalg_6/bug28637 b/tests/bugs/modalg_6/bug28637 new file mode 100644 index 0000000000..5caeda323a --- /dev/null +++ b/tests/bugs/modalg_6/bug28637 @@ -0,0 +1,12 @@ +puts "========" +puts "OCC28637" +puts "========" +puts "" +#################################################################################### +## [regression] Extrema curve - curve can not find correct solution between edge based on the line and BSpline edge +#################################################################################### + +restore [locate_data_file bug28637_shapes.brep] b +explode b +distmini d b_1 b_2 +checkprops d -l 4.46857e-005 -deps 1.e-2