From 1a060fcf2182deca7060e1e5de7177c9986da06c Mon Sep 17 00:00:00 2001 From: nbv Date: Tue, 22 Sep 2015 13:35:13 +0300 Subject: [PATCH] 0026632: HLR sample doesn't work with Algo mode The main reason of the problem is Walking-line contains two equal Walking-points (the segment has null-length both in 3D and 2D). --- src/IntWalk/IntWalk_IWalking_5.gxx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/IntWalk/IntWalk_IWalking_5.gxx b/src/IntWalk/IntWalk_IWalking_5.gxx index ca67056f06..b3454916a1 100644 --- a/src/IntWalk/IntWalk_IWalking_5.gxx +++ b/src/IntWalk/IntWalk_IWalking_5.gxx @@ -109,8 +109,14 @@ IntWalk_StatusDeflection IntWalk_IWalking::TestDeflection const Standard_Real aMinTolU = 0.1*Abs(Step*previousd2d.X()), aMinTolV = 0.1*Abs(Step*previousd2d.Y()); + const Standard_Real aTolU = (aMinTolU > 0.0) ? Min(tolerance(1), aMinTolU) : tolerance(1), + aTolV = (aMinTolV > 0.0) ? Min(tolerance(2), aMinTolV) : tolerance(2); - if ((Abs(Du) < Min(tolerance(1), aMinTolU)) && (Abs(Dv) < Min(tolerance(2), aMinTolV))) + //If aMinTolU==0.0 then (Abs(Du) < aMinTolU) is equivalent of (Abs(Du) < 0.0). + //It is impossible. Therefore, this case should be processed separately. + //Analogicaly for aMinTolV. + + if ((Abs(Du) < aTolU) && (Abs(Dv) < aTolV)) { //Thin shapes (for which Ulast-Ufirst or/and Vlast-Vfirst is quite small) //exists (see bug #25820). In this case, step is quite small too.