0024612: Wrong pcurve of the section curve
[occt.git] / src / IntWalk / IntWalk_IWalking_3.gxx
index bb790e6..6bc7b7a 100644 (file)
@@ -118,27 +118,27 @@ void IntWalk_IWalking::ComputeOpenLine(const TColStd_SequenceOfReal& Umult,
       CurrentLine->AddPoint(previousPoint);
       // modified by NIZHNY-MKK  Fri Oct 27 12:34:32 2000.BEGIN
       if(movementdirectioninfo[I] !=0) {
-       if(movementdirectioninfo[I] < 0) {
-         StepSign = -1;
-         CurrentLine->SetTangentVector(previousd3d.Reversed(),1);
-       } else {
-         StepSign = 1; 
-         CurrentLine->SetTangentVector(previousd3d,1);
-       }
+        if(movementdirectioninfo[I] < 0) {
+          StepSign = -1;
+          CurrentLine->SetTangentVector(previousd3d.Reversed(),1);
+        } else {
+          StepSign = 1; 
+          CurrentLine->SetTangentVector(previousd3d,1);
+        }
       } else {
-       Standard_Real tyutuyt=ThePointOfPathTool::Direction3d(PathPnt) * previousd3d;
-       if( tyutuyt < 0) {
-         StepSign = -1;
-         CurrentLine->SetTangentVector(previousd3d.Reversed(),1);
-       }
-       else {
-         StepSign = 1; 
-         CurrentLine->SetTangentVector(previousd3d,1);
-       }
+        Standard_Real tyutuyt=ThePointOfPathTool::Direction3d(PathPnt) * previousd3d;
+        if( tyutuyt < 0) {
+          StepSign = -1;
+          CurrentLine->SetTangentVector(previousd3d.Reversed(),1);
+        }
+        else {
+          StepSign = 1; 
+          CurrentLine->SetTangentVector(previousd3d,1);
+        }
       }
       // modified by NIZHNY-MKK  Fri Oct 27 12:34:37 2000.END
 
-//  Modified by Sergey KHROMOV - Tue Nov 20 10:41:45 2001 Begin
+      //  Modified by Sergey KHROMOV - Tue Nov 20 10:41:45 2001 Begin
       wd1[I].etat = - abs(wd1[I].etat);
       movementdirectioninfo[I] = (movementdirectioninfo[I]==0) ? StepSign : 0;
 //  Modified by Sergey KHROMOV - Tue Nov 20 10:41:56 2001 End
@@ -146,13 +146,13 @@ void IntWalk_IWalking::ComputeOpenLine(const TColStd_SequenceOfReal& Umult,
       Standard_Real d2dx = Abs(previousd2d.X()); 
       Standard_Real d2dy = Abs(previousd2d.Y()); 
       if (d2dx < tolerance(1)) {
-       PasC = pas * (VM-Vm)/d2dy;
+        PasC = pas * (VM-Vm)/d2dy;
       }
       else if (d2dy < tolerance(2)) {
-       PasC = pas * (UM-Um)/d2dx;
+        PasC = pas * (UM-Um)/d2dx;
       }
       else {
-       PasC = pas * Min((UM-Um)/d2dx,(VM-Vm)/d2dy);
+        PasC = pas * Min((UM-Um)/d2dx,(VM-Vm)/d2dy);
       }
 
       Arrive = Standard_False;
@@ -161,274 +161,280 @@ void IntWalk_IWalking::ComputeOpenLine(const TColStd_SequenceOfReal& Umult,
       StatusPrecedent = IntWalk_OK;
       // modified by NIZHNY-MKK  Fri Oct 27 12:39:37 2000
       Standard_Integer IndexOfPathPointDoNotCheck=0;
-
+      Standard_Integer aNbIter = 10;
       while (!Arrive) { //    as one of stop tests is not checked
-
-       Cadre = Cadrage(BornInf,BornSup,UVap,PasC,StepSign);
-       //  Border?
+        Cadre = Cadrage(BornInf,BornSup,UVap,PasC,StepSign);
+        //  Border?
 
 #ifdef CHRONO
-       Chronrsnld.Start();
+        Chronrsnld.Start();
 #endif
 
-       Rsnld.Perform(Func,UVap,BornInf,BornSup);
+        Rsnld.Perform(Func,UVap,BornInf,BornSup);
 
 #ifdef CHRONO
-       Chronrsnld.Stop();
+        Chronrsnld.Stop();
 #endif
 
-       if (Cadre) {
-         BornInf(1) = Um; BornSup(1) = UM; BornInf(2) = Vm; BornSup(2) = VM;
-       }
-       if (Rsnld.IsDone()) {
-         if (Abs(Func.Root()) > Func.Tolerance()) {
-           PasC = PasC / 2.0;
-           PasCu = Abs(PasC*previousd2d.X());
-           PasCv = Abs(PasC*previousd2d.Y());
-           if (PasCu <= tolerance(1) && PasCv <= tolerance(2)) {
-             if (CurrentLine->NbPoints() == 1) break;
-             Arrive = Standard_True;
-             CurrentLine->AddStatusLast(Standard_False);
-             Tgtend = Standard_True; // check
+        if (Cadre) {
+          BornInf(1) = Um; BornSup(1) = UM; BornInf(2) = Vm; BornSup(2) = VM;
+        }
+        if (Rsnld.IsDone()) {
+          if (Abs(Func.Root()) > Func.Tolerance()) {
+            PasC = PasC / 2.0;
+            PasCu = Abs(PasC*previousd2d.X());
+            PasCv = Abs(PasC*previousd2d.Y());
+            if (PasCu <= tolerance(1) && PasCv <= tolerance(2)) {
+              if (CurrentLine->NbPoints() == 1) break;
+              Arrive = Standard_True;
+              CurrentLine->AddStatusLast(Standard_False);
+              Tgtend = Standard_True; // check
               Rajout = Standard_True;
-             seqAjout.Append(lines.Length() + 1);
-           }  
-         }
-         else { // test stop
-           Rsnld.Root(UVap);
-           Arrive = TestArretPassage(Umult, Vmult, Func, UVap, N);
-           if (Arrive) {
-             Cadre = Standard_False;
-             //in case if there is a frame and arrive at the same time
-           }
-           else {
-             if (Rajout) {
-               ArretAjout =TestArretAjout(Func, UVap, N, Psol);
-               if (ArretAjout) {
-                 // jag 940615
-                 Tgtend = lines.Value(N)->IsTangentAtEnd();
-                 N = -N;
-               }
-             }
-             // modified by NIZHNY-MKK  Thu Nov  2 15:09:08 2000.BEGIN
-             if(!(Rajout && ArretAjout)) {
-               Standard_Real prevUp, prevVp;
-               if (!reversed) {
-                 previousPoint.ParametersOnS2(prevUp, prevVp);
-               }
-               else {
-                 previousPoint.ParametersOnS1(prevUp, prevVp);
-               }
-               Arrive = TestPassedSolutionWithNegativeState(wd1, Umult, Vmult, prevUp, prevVp,
-                                                            nbMultiplicities, tolerance, Func, UVap, N);               
-               if(Arrive) {
-                 Cadre = Standard_False;
-               }
-             }
-             // modified by NIZHNY-MKK  Thu Nov  2 15:09:13 2000.END
-             if (!ArretAjout && Cadre) {
-               if (CurrentLine->NbPoints() == 1) break; // cancel the line
-               TestArretCadre(Umult, Vmult, CurrentLine, Func, UVap, N);
-//             if (N == 0) {
-               if (N <= 0) { // jag 941017
-                 MakeWalkingPoint(2, UVap(1), UVap(2), Func, Psol);
-                 Tgtend = Func.IsTangent();
+              seqAjout.Append(lines.Length() + 1);
+            }  
+          }
+          else { // test stop
+            Rsnld.Root(UVap);
+            Arrive = TestArretPassage(Umult, Vmult, Func, UVap, N);
+            if (Arrive) {
+              Cadre = Standard_False;
+              //in case if there is a frame and arrive at the same time
+            }
+            else {
+              if (Rajout) {
+                ArretAjout =TestArretAjout(Func, UVap, N, Psol);
+                if (ArretAjout) {
+                  // jag 940615
+                  Tgtend = lines.Value(N)->IsTangentAtEnd();
                   N = -N;
-               }
-             }
-           }
-           Status = TestDeflection(Func, Arrive, UVap, StatusPrecedent,
-                                   NbDivision,PasC,StepSign);
-           StatusPrecedent = Status;
-           if (Status == IntWalk_PasTropGrand) {
-             Arrive = Standard_False;
-             ArretAjout = Standard_False;
-             Tgtend = Standard_False; // jag 940615
-             if (!reversed) {
-               previousPoint.ParametersOnS2(UVap(1), UVap(2));
-             }
-             else {
-               previousPoint.ParametersOnS1(UVap(1), UVap(2));
-             }
-           }
-           else if (ArretAjout || Cadre) {
-             Arrive = Standard_True;
-             CurrentLine->AddStatusLast(Standard_False);
-             if (Status != IntWalk_ArretSurPointPrecedent) {
-               CurrentLine->AddPoint(Psol);                      
-             }
-             if (Cadre && N==0) {
-               Rajout = Standard_True;
-               seqAjout.Append(lines.Length()+1);
-             }
-           }
-           else if (Status == IntWalk_ArretSurPointPrecedent) {
-             if (CurrentLine->NbPoints() == 1) { //cancel the line
-               Arrive = Standard_False;
-               break;
-             }
-             Arrive = Standard_True;
-             Rajout = Standard_True;
+                }
+              }
+              // modified by NIZHNY-MKK  Thu Nov  2 15:09:08 2000.BEGIN
+              if(!(Rajout && ArretAjout)) {
+                Standard_Real prevUp, prevVp;
+                if (!reversed) {
+                  previousPoint.ParametersOnS2(prevUp, prevVp);
+                }
+                else {
+                  previousPoint.ParametersOnS1(prevUp, prevVp);
+                }
+                Arrive = TestPassedSolutionWithNegativeState(wd1, Umult, Vmult, prevUp, prevVp,
+                  nbMultiplicities, tolerance, Func, UVap, N);         
+                if(Arrive) {
+                  Cadre = Standard_False;
+                }
+              }
+              // modified by NIZHNY-MKK  Thu Nov  2 15:09:13 2000.END
+              if (!ArretAjout && Cadre) {
+                if (CurrentLine->NbPoints() == 1) break; // cancel the line
+                TestArretCadre(Umult, Vmult, CurrentLine, Func, UVap, N);
+                //             if (N == 0) {
+                if (N <= 0) { // jag 941017
+                  MakeWalkingPoint(2, UVap(1), UVap(2), Func, Psol);
+                  Tgtend = Func.IsTangent();
+                  N = -N;
+                }
+              }
+            }
+            Status = TestDeflection(Func, Arrive, UVap, StatusPrecedent,
+              NbDivision,PasC,StepSign);
+            StatusPrecedent = Status;
+            if (Status == IntWalk_PasTropGrand) {
+              Arrive = Standard_False;
+              ArretAjout = Standard_False;
+              Tgtend = Standard_False; // jag 940615
+              if (!reversed) {
+                previousPoint.ParametersOnS2(UVap(1), UVap(2));
+              }
+              else {
+                previousPoint.ParametersOnS1(UVap(1), UVap(2));
+              }
+            }
+            else if (ArretAjout || Cadre) {
+              Arrive = Standard_True;
+              CurrentLine->AddStatusLast(Standard_False);
+              if (Status != IntWalk_ArretSurPointPrecedent) {
+                CurrentLine->AddPoint(Psol);                      
+              }
+              if (Cadre && N==0) {
+                Rajout = Standard_True;
+                seqAjout.Append(lines.Length()+1);
+              }
+            }
+            else if (Status == IntWalk_ArretSurPointPrecedent) {
+              if (CurrentLine->NbPoints() == 1) { //cancel the line
+                Arrive = Standard_False;
+                break;
+              }
+              Arrive = Standard_True;
+              Rajout = Standard_True;
               seqAjout.Append(lines.Length() + 1);
-             CurrentLine->AddStatusLast(Standard_False);
-             Tgtend = Standard_True; // check
-           }
-           else if (Arrive)  {
-             if (CurrentLine->NbPoints() == 1 &&    // cancel the line
-                 (N == I || Status == IntWalk_PointConfondu) ) {
-               // if N == I the main uv is probably lost
-               // or the point is a point of accumulation
-               // if point is confused the start data is bad
-               Arrive =  Standard_False;
-               break;
-             }
-             // necessairily N > 0 jag 940617
+              CurrentLine->AddStatusLast(Standard_False);
+              Tgtend = Standard_True; // check
+            }
+            else if (Arrive)  {
+              if (CurrentLine->NbPoints() == 1 &&    // cancel the line
+                (N == I || Status == IntWalk_PointConfondu) ) {
+                  // if N == I the main uv is probably lost
+                  // or the point is a point of accumulation
+                  // if point is confused the start data is bad
+                  Arrive =  Standard_False;
+                  break;
+              }
+              // necessairily N > 0 jag 940617
               // point of stop given at input 
-             PathPnt = Pnts1.Value(N);
-             
-             Standard_Integer etat1N=wd1[N].etat;
-             // modified by NIZHNY-MKK  Thu Nov  2 15:09:51 2000.BEGIN
-             //              if (etat1N < 11) { // passing point that is a stop  
-             if (Abs(etat1N) < 11) { // passing point that is a stop    
-               // modified by NIZHNY-MKK  Thu Nov  2 15:12:11 2000.END
-               if (Status == IntWalk_ArretSurPoint) { 
-                 CurrentLine->AddStatusLast(Standard_False);
-                 Tgtend = Standard_True; // need check
-               }
-               else { 
-                 Arrive = Standard_False;
-               }
-               CurrentLine->AddIndexPassing(N);
-             }
-             else { // point of stop given at input
-               if (etat1N == 11) {
-                 Tgtend = Standard_True;
-               }
-               CurrentLine->AddStatusLast(Standard_True, N, PathPnt);
-             }
-             AddPointInCurrentLine(N,PathPnt,CurrentLine);
-             if ((etat1N != 1 && etat1N != 11)) {
-               // modified by NIZHNY-MKK  Fri Oct 27 12:43:05 2000.BEGIN
-               //              wd1[N].etat= - wd1[N].etat;
-               wd1[N].etat = - Abs(etat1N);            
-               movementdirectioninfo[N] = (movementdirectioninfo[N]==0) ? StepSign : 0;
-               if(Arrive && movementdirectioninfo[N]!=0) {
-                 IndexOfPathPointDoNotCheck = N;
-               }
+              PathPnt = Pnts1.Value(N);
 
-               if(Arrive) {
-                 Rajout = Standard_True;
-                 seqAjout.Append(lines.Length() + 1);
-               }
-               // modified by NIZHNY-MKK  Fri Oct 27 12:45:33 2000.END
-             }
-           }
-           else if (Status == IntWalk_ArretSurPoint) {
-             Arrive = Standard_True;                   
-             CurrentLine->AddStatusLast(Standard_False);
-             Tgtend = Standard_True;
+              Standard_Integer etat1N=wd1[N].etat;
+              // modified by NIZHNY-MKK  Thu Nov  2 15:09:51 2000.BEGIN
+              //             if (etat1N < 11) { // passing point that is a stop  
+              if (Abs(etat1N) < 11) { // passing point that is a stop    
+                // modified by NIZHNY-MKK  Thu Nov  2 15:12:11 2000.END
+                if (Status == IntWalk_ArretSurPoint) { 
+                  CurrentLine->AddStatusLast(Standard_False);
+                  Tgtend = Standard_True; // need check
+                }
+                else { 
+                  Arrive = Standard_False;
+                }
+                CurrentLine->AddIndexPassing(N);
+              }
+              else { // point of stop given at input
+                if (etat1N == 11) {
+                  Tgtend = Standard_True;
+                }
+                CurrentLine->AddStatusLast(Standard_True, N, PathPnt);
+              }
+              AddPointInCurrentLine(N,PathPnt,CurrentLine);
+              if ((etat1N != 1 && etat1N != 11)) {
+                // modified by NIZHNY-MKK  Fri Oct 27 12:43:05 2000.BEGIN
+                //             wd1[N].etat= - wd1[N].etat;
+                wd1[N].etat = - Abs(etat1N);           
+                movementdirectioninfo[N] = (movementdirectioninfo[N]==0) ? StepSign : 0;
+                if(Arrive && movementdirectioninfo[N]!=0) {
+                  IndexOfPathPointDoNotCheck = N;
+                }
+
+                if(Arrive) {
+                  Rajout = Standard_True;
+                  seqAjout.Append(lines.Length() + 1);
+                }
+                // modified by NIZHNY-MKK  Fri Oct 27 12:45:33 2000.END
+              }
+            }
+            else if (Status == IntWalk_ArretSurPoint) {
+              Arrive = Standard_True;                   
+              CurrentLine->AddStatusLast(Standard_False);
+              Tgtend = Standard_True;
               MakeWalkingPoint(1, UVap(1), UVap(2), Func, Psol);
-             CurrentLine->AddPoint(Psol);
-             Rajout = Standard_True;
+              CurrentLine->AddPoint(Psol);
+              Rajout = Standard_True;
               seqAjout.Append(lines.Length() + 1);
-           }
-           else if (Status == IntWalk_OK) { 
+            }
+            else if (Status == IntWalk_OK) { 
               MakeWalkingPoint(2, UVap(1), UVap(2), Func, previousPoint);
-             previousd3d = Func.Direction3d();
-             previousd2d = Func.Direction2d();
-             CurrentLine->AddPoint(previousPoint);
-           }                           
-         }
-       }
-       else { // no numerical solution
-         PasC = PasC / 2.;
-         PasCu = Abs(PasC*previousd2d.X());
-         PasCv = Abs(PasC*previousd2d.Y());
-         if (PasCu <= tolerance(1) && PasCv <= tolerance(2)) {
-           if (CurrentLine->NbPoints()==1) break;
-           Arrive = Standard_True;
-           CurrentLine->AddStatusLast(Standard_False);
-           Tgtend = Standard_True; // need check
-           Rajout = Standard_True;
+              previousd3d = Func.Direction3d();
+              previousd2d = Func.Direction2d();
+              CurrentLine->AddPoint(previousPoint);
+            }     
+            else if (Status == IntWalk_PointConfondu)
+            {
+              aNbIter --;
+            }
+          }
+        }
+        else { // no numerical solution
+          PasC = PasC / 2.;
+          PasCu = Abs(PasC*previousd2d.X());
+          PasCv = Abs(PasC*previousd2d.Y());
+          if (PasCu <= tolerance(1) && PasCv <= tolerance(2)) {
+            if (CurrentLine->NbPoints()==1) break;
+            Arrive = Standard_True;
+            CurrentLine->AddStatusLast(Standard_False);
+            Tgtend = Standard_True; // need check
+            Rajout = Standard_True;
             seqAjout.Append(lines.Length() + 1);
-         }  
-       }
+          }  
+        }
+
+        if(aNbIter < 0)
+          break;
       } // end of started line
       
       if (Arrive) {
-       CurrentLine->SetTangencyAtEnd(Tgtend);
-       lines.Append(CurrentLine);
-       // modified by NIZHNY-MKK  Fri Oct 27 12:59:29 2000.BEGIN
-       movementdirectioninfo[I]=0;
-       if(wd1[I].etat > 0)
-       // modified by NIZHNY-MKK  Fri Oct 27 12:59:42 2000.END
-         wd1[I].etat=-wd1[I].etat;
+        CurrentLine->SetTangencyAtEnd(Tgtend);
+        lines.Append(CurrentLine);
+        // modified by NIZHNY-MKK  Fri Oct 27 12:59:29 2000.BEGIN
+        movementdirectioninfo[I]=0;
+        if(wd1[I].etat > 0)
+          // modified by NIZHNY-MKK  Fri Oct 27 12:59:42 2000.END
+          wd1[I].etat=-wd1[I].etat;
 
-       //-- lbr le 5 juin 97 (Pb ds Contap)
-       for(Standard_Integer av=1; av<=nbPath; av++) { 
-         // modified by NIZHNY-MKK  Fri Oct 27 13:00:22 2000.BEGIN
-         //      if (wd1[av].etat > 11) {
-         if ((wd1[av].etat > 11) || 
-             ((av!=I) && 
-              (av!=IndexOfPathPointDoNotCheck) && 
-              (wd1[av].etat < -11)  && 
-              (movementdirectioninfo[av]!=0))) {
-         // modified by NIZHNY-MKK  Fri Oct 27 13:00:26 2000.END
-           Standard_Real Uav=wd1[av].ustart;
-           Standard_Real Vav=wd1[av].vstart;
-           Standard_Real Uavp,Vavp;
-           const IntSurf_PntOn2S &avP=CurrentLine->Value(CurrentLine->NbPoints());
-           if (!reversed) {
-             avP.ParametersOnS2(Uavp,Vavp);
-           }
-           else {
-             avP.ParametersOnS1(Uavp,Vavp);
-           }
-           Uav-=Uavp;
-           Vav-=Vavp;
-           Uav*=0.001; Vav*=0.001;
-           if(Abs(Uav)<tolerance(1) && Abs(Vav)<tolerance(2)) { 
-             // modified by NIZHNY-MKK  Fri Oct 27 13:01:38 2000.BEGIN
-             //              wd1[av].etat=-wd1[av].etat;
-             if(wd1[av].etat < 0) {
-               movementdirectioninfo[av] = 0;
-             } else {
-               wd1[av].etat=-wd1[av].etat;
-               movementdirectioninfo[av] = StepSign;
-             }
-             // modified by NIZHNY-MKK  Fri Oct 27 13:01:42 2000.END
-             CurrentLine->AddStatusLast(Standard_True, av, Pnts1.Value(av));
-             //-- cout<<"\n Debug ? lbr ds IntWalk_IWalking_3.gxx"<<endl;
-           }
-           
-           const IntSurf_PntOn2S &avPP=CurrentLine->Value(1);
-           if (!reversed) {
-             avPP.ParametersOnS2(Uavp,Vavp);
-           }
-           else {
-             avPP.ParametersOnS1(Uavp,Vavp);
-           }
-           Uav=wd1[av].ustart;
-           Vav=wd1[av].vstart;
-           Uav-=Uavp;
-           Vav-=Vavp;
-           Uav*=0.001; Vav*=0.001;
-           if(Abs(Uav)<tolerance(1) && Abs(Vav)<tolerance(2)) { 
-             // modified by NIZHNY-MKK  Fri Oct 27 13:02:49 2000.BEGIN
-             //              wd1[av].etat=-wd1[av].etat;
-             if(wd1[av].etat < 0) {
-               movementdirectioninfo[av] = 0;
-             } else {
-               wd1[av].etat=-wd1[av].etat;
-               movementdirectioninfo[av] = -StepSign;
-             }
-             // modified by NIZHNY-MKK  Fri Oct 27 13:02:52 2000.END
-             //-- cout<<"\n Debug ? lbr ds IntWalk_IWalking_3.gxx"<<endl;
-             CurrentLine->AddStatusFirst(Standard_False, Standard_True, av, Pnts1.Value(av));
-           }
-         }
-       }
-         
+        //-- lbr le 5 juin 97 (Pb ds Contap)
+        for(Standard_Integer av=1; av<=nbPath; av++) { 
+          // modified by NIZHNY-MKK  Fri Oct 27 13:00:22 2000.BEGIN
+          //     if (wd1[av].etat > 11) {
+          if ((wd1[av].etat > 11) || 
+            ((av!=I) && 
+            (av!=IndexOfPathPointDoNotCheck) && 
+            (wd1[av].etat < -11)  && 
+            (movementdirectioninfo[av]!=0)))
+          {
+            // modified by NIZHNY-MKK  Fri Oct 27 13:00:26 2000.END
+            Standard_Real Uav=wd1[av].ustart;
+            Standard_Real Vav=wd1[av].vstart;
+            Standard_Real Uavp,Vavp;
+            const IntSurf_PntOn2S &avP=CurrentLine->Value(CurrentLine->NbPoints());
+            if (!reversed) {
+              avP.ParametersOnS2(Uavp,Vavp);
+            }
+            else {
+              avP.ParametersOnS1(Uavp,Vavp);
+            }
+            Uav-=Uavp;
+            Vav-=Vavp;
+            Uav*=0.001; Vav*=0.001;
+            if(Abs(Uav)<tolerance(1) && Abs(Vav)<tolerance(2)) { 
+              // modified by NIZHNY-MKK  Fri Oct 27 13:01:38 2000.BEGIN
+              //             wd1[av].etat=-wd1[av].etat;
+              if(wd1[av].etat < 0) {
+                movementdirectioninfo[av] = 0;
+              } else {
+                wd1[av].etat=-wd1[av].etat;
+                movementdirectioninfo[av] = StepSign;
+              }
+              // modified by NIZHNY-MKK  Fri Oct 27 13:01:42 2000.END
+              CurrentLine->AddStatusLast(Standard_True, av, Pnts1.Value(av));
+              //-- cout<<"\n Debug ? lbr ds IntWalk_IWalking_3.gxx"<<endl;
+            }
+
+            const IntSurf_PntOn2S &avPP=CurrentLine->Value(1);
+            if (!reversed) {
+              avPP.ParametersOnS2(Uavp,Vavp);
+            }
+            else {
+              avPP.ParametersOnS1(Uavp,Vavp);
+            }
+            Uav=wd1[av].ustart;
+            Vav=wd1[av].vstart;
+            Uav-=Uavp;
+            Vav-=Vavp;
+            Uav*=0.001; Vav*=0.001;
+            if(Abs(Uav)<tolerance(1) && Abs(Vav)<tolerance(2)) { 
+              // modified by NIZHNY-MKK  Fri Oct 27 13:02:49 2000.BEGIN
+              //             wd1[av].etat=-wd1[av].etat;
+              if(wd1[av].etat < 0) {
+                movementdirectioninfo[av] = 0;
+              } else {
+                wd1[av].etat=-wd1[av].etat;
+                movementdirectioninfo[av] = -StepSign;
+              }
+              // modified by NIZHNY-MKK  Fri Oct 27 13:02:52 2000.END
+              //-- cout<<"\n Debug ? lbr ds IntWalk_IWalking_3.gxx"<<endl;
+              CurrentLine->AddStatusFirst(Standard_False, Standard_True, av, Pnts1.Value(av));
+            }
+          }
+        }
       }
     } //end of point processing
   } //end of all points