1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-29 14:00:49 +03:00

0033450: Modeling algorithm - HLR algorightm stucks

Selecting the middle point between XInf and XSup leads situation, where X values almost does not change.
To prevent this situation, select shifted point instead of middle.
This commit is contained in:
akaftasev
2023-08-31 12:42:05 +01:00
committed by dpasukhi
parent 8f4cd4793a
commit 9d78134ce9
2 changed files with 10 additions and 2 deletions

View File

@@ -1238,8 +1238,11 @@ void ComputeInternalPoints
// std::cout << "Changement de signe detecte" << std::endl;
solution = Standard_False;
while (!solution) {
X(1) = (XInf(1) + XSup(1)) /2.;
X(2) = (XInf(2) + XSup(2)) /2.;
// Selecting the middle point between XInf and XSup leads situation, where X values almost do not change.
// To prevent this situation, select shifted point instead of middle.
const Standard_Real aCoef = 2. / 3.;
X(1) = XInf(1) + aCoef * (XSup(1) - XInf(1));
X(2) = XInf(2) + aCoef * (XSup(2) - XInf(2));
rsnld.Perform(SFunc,X,infb,supb);
if (!rsnld.IsDone()) {

View File

@@ -0,0 +1,5 @@
set viewname "vfront"
set length 63.8689
restore [locate_data_file bug33450.brep] a
COMPUTE_HLR $viewname $algotype