1 // Copyright (c) 1995-1999 Matra Datavision
2 // Copyright (c) 1999-2012 OPEN CASCADE SAS
4 // The content of this file is subject to the Open CASCADE Technology Public
5 // License Version 6.5 (the "License"). You may not use the content of this file
6 // except in compliance with the License. Please obtain a copy of the License
7 // at http://www.opencascade.org and read it completely before using this file.
9 // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
10 // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
12 // The Original Code and all software distributed under the License is
13 // distributed on an "AS IS" basis, without warranty of any kind, and the
14 // Initial Developer hereby disclaims all such warranties, including without
15 // limitation, any warranties of merchantability, fitness for a particular
16 // purpose or non-infringement. Please see the License for the specific terms
17 // and conditions governing the rights and limitations under the License.
19 //-----------------------------
20 //-- IntWalk_PWalking_1.gxx
23 #include <Precision.hxx>
24 #include <math_FunctionSetRoot.hxx>
28 //==================================================================================
29 // function : IntWalk_PWalking::IntWalk_PWalking
31 // estimation des max pas : Pour eviter des changenets
32 // trop brusques lors des changements d isos
33 //==================================================================================
34 void ComputePasInit(Standard_Real *pasuv,
35 Standard_Real Um1,Standard_Real UM1,
36 Standard_Real Vm1,Standard_Real VM1,
37 Standard_Real Um2,Standard_Real UM2,
38 Standard_Real Vm2,Standard_Real VM2,
39 Standard_Real _Um1,Standard_Real _UM1,
40 Standard_Real _Vm1,Standard_Real _VM1,
41 Standard_Real _Um2,Standard_Real _UM2,
42 Standard_Real _Vm2,Standard_Real _VM2,
45 const Standard_Real Increment)
47 Standard_Real du1=Abs(UM1-Um1);
48 Standard_Real dv1=Abs(VM1-Vm1);
49 Standard_Real du2=Abs(UM2-Um2);
50 Standard_Real dv2=Abs(VM2-Vm2);
52 Standard_Real _du1=Abs(_UM1-_Um1);
53 Standard_Real _dv1=Abs(_VM1-_Vm1);
54 Standard_Real _du2=Abs(_UM2-_Um2);
55 Standard_Real _dv2=Abs(_VM2-_Vm2);
57 //-- On limite la reduction de l estimation de la boite uv a 0.01 la boite naturelle
58 //-- du1 : Sur boite des Inter
59 //-- _du1 : Sur espace parametrique
60 if(_du1<1e50 && du1<0.01*_du1) du1=0.01*_du1;
61 if(_dv1<1e50 && dv1<0.01*_dv1) dv1=0.01*_dv1;
62 if(_du2<1e50 && du2<0.01*_du2) du2=0.01*_du2;
63 if(_dv2<1e50 && dv2<0.01*_dv2) dv2=0.01*_dv2;
65 pasuv[0]=Increment*du1;
66 pasuv[1]=Increment*dv1;
67 pasuv[2]=Increment*du2;
68 pasuv[3]=Increment*dv2;
70 //==================================================================================
71 // function : IntWalk_PWalking::IntWalk_PWalking
73 //==================================================================================
74 IntWalk_PWalking::IntWalk_PWalking(const ThePSurface& Caro1,
75 const ThePSurface& Caro2,
76 const Standard_Real TolTangency,
77 const Standard_Real Epsilon,
78 const Standard_Real Deflection,
79 const Standard_Real Increment )
83 close(Standard_False),
87 myIntersectionOn2S(Caro1,Caro2,TolTangency)
89 Standard_Real KELARG=20.;
91 pasMax=Increment*0.2; //-- le 25 juin 99 suite a des pbs de precision
92 Um1 = ThePSurfaceTool::FirstUParameter(Caro1);
93 Vm1 = ThePSurfaceTool::FirstVParameter(Caro1);
94 UM1 = ThePSurfaceTool::LastUParameter(Caro1);
95 VM1 = ThePSurfaceTool::LastVParameter(Caro1);
97 Um2 = ThePSurfaceTool::FirstUParameter(Caro2);
98 Vm2 = ThePSurfaceTool::FirstVParameter(Caro2);
99 UM2 = ThePSurfaceTool::LastUParameter(Caro2);
100 VM2 = ThePSurfaceTool::LastVParameter(Caro2);
102 ResoU1 = ThePSurfaceTool::UResolution(Caro1,Precision::Confusion());
103 ResoV1 = ThePSurfaceTool::VResolution(Caro1,Precision::Confusion());
105 ResoU2 = ThePSurfaceTool::UResolution(Caro2,Precision::Confusion());
106 ResoV2 = ThePSurfaceTool::VResolution(Caro2,Precision::Confusion());
108 Standard_Real NEWRESO;
109 Standard_Real MAXVAL;
110 Standard_Real MAXVAL2;
112 MAXVAL = Abs(Um1); MAXVAL2 = Abs(UM1);
113 if(MAXVAL2 > MAXVAL) MAXVAL = MAXVAL2;
114 NEWRESO = ResoU1 * MAXVAL ;
115 if(NEWRESO > ResoU1 &&NEWRESO<10) { ResoU1 = NEWRESO; }
118 MAXVAL = Abs(Um2); MAXVAL2 = Abs(UM2);
119 if(MAXVAL2 > MAXVAL) MAXVAL = MAXVAL2;
120 NEWRESO = ResoU2 * MAXVAL ;
121 if(NEWRESO > ResoU2 && NEWRESO<10) { ResoU2 = NEWRESO; }
124 MAXVAL = Abs(Vm1); MAXVAL2 = Abs(VM1);
125 if(MAXVAL2 > MAXVAL) MAXVAL = MAXVAL2;
126 NEWRESO = ResoV1 * MAXVAL ;
127 if(NEWRESO > ResoV1 && NEWRESO<10) { ResoV1 = NEWRESO; }
130 MAXVAL = Abs(Vm2); MAXVAL2 = Abs(VM2);
131 if(MAXVAL2 > MAXVAL) MAXVAL = MAXVAL2;
132 NEWRESO = ResoV2 * MAXVAL ;
133 if(NEWRESO > ResoV2 && NEWRESO<10) { ResoV2 = NEWRESO; }
135 pasuv[0]=pasMax*Abs(UM1-Um1);
136 pasuv[1]=pasMax*Abs(VM1-Vm1);
137 pasuv[2]=pasMax*Abs(UM2-Um2);
138 pasuv[3]=pasMax*Abs(VM2-Vm2);
140 if(ResoU1>0.0001*pasuv[0]) ResoU1=0.00001*pasuv[0];
141 if(ResoV1>0.0001*pasuv[1]) ResoV1=0.00001*pasuv[1];
142 if(ResoU2>0.0001*pasuv[2]) ResoU2=0.00001*pasuv[2];
143 if(ResoV2>0.0001*pasuv[3]) ResoV2=0.00001*pasuv[3];
146 if(ThePSurfaceTool::IsUPeriodic(Caro1)==Standard_False) {
147 UM1+=KELARG*pasuv[0]; Um1-=KELARG*pasuv[0];
150 Standard_Real t = UM1-Um1;
151 if(t<ThePSurfaceTool::UPeriod(Caro1)) {
152 t=0.5*(ThePSurfaceTool::UPeriod(Caro1)-t);
153 t=(t>KELARG*pasuv[0])? KELARG*pasuv[0] : t;
158 if(ThePSurfaceTool::IsVPeriodic(Caro1)==Standard_False) {
159 VM1+=KELARG*pasuv[1]; Vm1-=KELARG*pasuv[1];
162 Standard_Real t = VM1-Vm1;
163 if(t<ThePSurfaceTool::VPeriod(Caro1)) {
164 t=0.5*(ThePSurfaceTool::VPeriod(Caro1)-t);
165 t=(t>KELARG*pasuv[1])? KELARG*pasuv[1] : t;
170 if(ThePSurfaceTool::IsUPeriodic(Caro2)==Standard_False) {
171 UM2+=KELARG*pasuv[2]; Um2-=KELARG*pasuv[2];
174 Standard_Real t = UM2-Um2;
175 if(t<ThePSurfaceTool::UPeriod(Caro2)) {
176 t=0.5*(ThePSurfaceTool::UPeriod(Caro2)-t);
177 t=(t>KELARG*pasuv[2])? KELARG*pasuv[2] : t;
182 if(ThePSurfaceTool::IsVPeriodic(Caro2)==Standard_False) {
183 VM2+=KELARG*pasuv[3]; Vm2-=KELARG*pasuv[3];
186 Standard_Real t = VM2-Vm2;
187 if(t<ThePSurfaceTool::VPeriod(Caro2)) {
188 t=0.5*(ThePSurfaceTool::VPeriod(Caro2)-t);
189 t=(t>KELARG*pasuv[3])? KELARG*pasuv[3] : t;
194 //-- ComputePasInit(pasuv,Um1,UM1,Vm1,VM1,Um2,UM2,Vm2,VM2,Caro1,Caro2);
196 for (Standard_Integer i = 0; i<=3;i++) {
199 pasInit[i] = pasSav[i] = pasuv[i];
204 //==================================================================================
205 // function : IntWalk_PWalking
207 //==================================================================================
208 IntWalk_PWalking::IntWalk_PWalking(const ThePSurface& Caro1,
209 const ThePSurface& Caro2,
210 const Standard_Real TolTangency,
211 const Standard_Real Epsilon,
212 const Standard_Real Deflection,
213 const Standard_Real Increment,
214 const Standard_Real U1,
215 const Standard_Real V1,
216 const Standard_Real U2,
217 const Standard_Real V2)
221 close(Standard_False),
225 myIntersectionOn2S(Caro1,Caro2,TolTangency)
227 Standard_Real KELARG=20.;
229 pasMax=Increment*0.2; //-- le 25 juin 99 suite a des pbs de precision
231 Um1 = ThePSurfaceTool::FirstUParameter(Caro1);
232 Vm1 = ThePSurfaceTool::FirstVParameter(Caro1);
233 UM1 = ThePSurfaceTool::LastUParameter(Caro1);
234 VM1 = ThePSurfaceTool::LastVParameter(Caro1);
236 Um2 = ThePSurfaceTool::FirstUParameter(Caro2);
237 Vm2 = ThePSurfaceTool::FirstVParameter(Caro2);
238 UM2 = ThePSurfaceTool::LastUParameter(Caro2);
239 VM2 = ThePSurfaceTool::LastVParameter(Caro2);
241 ResoU1 = ThePSurfaceTool::UResolution(Caro1,Precision::Confusion());
242 ResoV1 = ThePSurfaceTool::VResolution(Caro1,Precision::Confusion());
244 ResoU2 = ThePSurfaceTool::UResolution(Caro2,Precision::Confusion());
245 ResoV2 = ThePSurfaceTool::VResolution(Caro2,Precision::Confusion());
247 Standard_Real NEWRESO, MAXVAL, MAXVAL2;
251 if(MAXVAL2 > MAXVAL) {
254 NEWRESO = ResoU1 * MAXVAL ;
255 if(NEWRESO > ResoU1) {
261 if(MAXVAL2 > MAXVAL){
264 NEWRESO = ResoU2 * MAXVAL ;
265 if(NEWRESO > ResoU2) {
271 if(MAXVAL2 > MAXVAL) {
274 NEWRESO = ResoV1 * MAXVAL ;
275 if(NEWRESO > ResoV1) {
281 if(MAXVAL2 > MAXVAL){
284 NEWRESO = ResoV2 * MAXVAL ;
285 if(NEWRESO > ResoV2) {
289 pasuv[0]=pasMax*Abs(UM1-Um1);
290 pasuv[1]=pasMax*Abs(VM1-Vm1);
291 pasuv[2]=pasMax*Abs(UM2-Um2);
292 pasuv[3]=pasMax*Abs(VM2-Vm2);
294 if(ThePSurfaceTool::IsUPeriodic(Caro1)==Standard_False) {
295 UM1+=KELARG*pasuv[0];
296 Um1-=KELARG*pasuv[0];
299 Standard_Real t = UM1-Um1;
300 if(t<ThePSurfaceTool::UPeriod(Caro1)) {
301 t=0.5*(ThePSurfaceTool::UPeriod(Caro1)-t);
302 t=(t>KELARG*pasuv[0])? KELARG*pasuv[0] : t;
308 if(ThePSurfaceTool::IsVPeriodic(Caro1)==Standard_False) {
309 VM1+=KELARG*pasuv[1];
310 Vm1-=KELARG*pasuv[1];
313 Standard_Real t = VM1-Vm1;
314 if(t<ThePSurfaceTool::VPeriod(Caro1)) {
315 t=0.5*(ThePSurfaceTool::VPeriod(Caro1)-t);
316 t=(t>KELARG*pasuv[1])? KELARG*pasuv[1] : t;
321 if(ThePSurfaceTool::IsUPeriodic(Caro2)==Standard_False) {
322 UM2+=KELARG*pasuv[2];
323 Um2-=KELARG*pasuv[2];
326 Standard_Real t = UM2-Um2;
327 if(t<ThePSurfaceTool::UPeriod(Caro2)) {
328 t=0.5*(ThePSurfaceTool::UPeriod(Caro2)-t);
329 t=(t>KELARG*pasuv[2])? KELARG*pasuv[2] : t;
335 if(ThePSurfaceTool::IsVPeriodic(Caro2)==Standard_False) {
336 VM2+=KELARG*pasuv[3];
337 Vm2-=KELARG*pasuv[3];
340 Standard_Real t = VM2-Vm2;
341 if(t<ThePSurfaceTool::UPeriod(Caro2)) {
342 t=0.5*(ThePSurfaceTool::VPeriod(Caro2)-t);
343 t=(t>KELARG*pasuv[3])? KELARG*pasuv[3] : t;
348 //-- ComputePasInit(pasuv,Um1,UM1,Vm1,VM1,Um2,UM2,Vm2,VM2,Caro1,Caro2);
350 for (Standard_Integer i = 0; i<=3;i++) {
351 pasInit[i] = pasSav[i] = pasuv[i];
354 if(ResoU1>0.0001*pasuv[0]) ResoU1=0.00001*pasuv[0];
355 if(ResoV1>0.0001*pasuv[1]) ResoV1=0.00001*pasuv[1];
356 if(ResoU2>0.0001*pasuv[2]) ResoU2=0.00001*pasuv[2];
357 if(ResoV2>0.0001*pasuv[3]) ResoV2=0.00001*pasuv[3];
359 TColStd_Array1OfReal Par(1,4);
367 //==================================================================================
368 // function : PerformFirstPoint
370 //==================================================================================
371 Standard_Boolean IntWalk_PWalking::PerformFirstPoint (const TColStd_Array1OfReal& ParDep,
372 IntSurf_PntOn2S& FirstPoint)
375 close = Standard_False;
379 TColStd_Array1OfReal Param(1,4);
381 for (i=1; i<=4; ++i) {
383 Param(i) = ParDep(i);
385 //-- calcul du premier point solution
386 math_FunctionSetRoot Rsnld(myIntersectionOn2S.Function());
388 myIntersectionOn2S.Perform(Param,Rsnld);
389 if (!myIntersectionOn2S.IsDone()) {
390 return Standard_False;
392 if (myIntersectionOn2S.IsEmpty()) {
393 return Standard_False;
395 FirstPoint = myIntersectionOn2S.Point();
396 return Standard_True;
398 //==================================================================================
399 // function : Perform
401 //==================================================================================
402 void IntWalk_PWalking::Perform(const TColStd_Array1OfReal& ParDep)
404 Perform(ParDep,Um1,Vm1,Um2,Vm2,UM1,VM1,UM2,VM2);
406 //==================================================================================
407 // function : Perform
409 //==================================================================================
410 void IntWalk_PWalking::Perform(const TColStd_Array1OfReal& ParDep,
411 const Standard_Real u1min,
412 const Standard_Real v1min,
413 const Standard_Real u2min,
414 const Standard_Real v2min,
415 const Standard_Real u1max,
416 const Standard_Real v1max,
417 const Standard_Real u2max,
418 const Standard_Real v2max)
421 Standard_Integer i, NbPasOKConseq;
422 Standard_Real UFirst1, VFirst1, ULast1, VLast1, UFirst2, VFirst2, ULast2, VLast2;
423 Standard_Real pasMaxSV[4], aTmp;
424 TColStd_Array1OfReal Param(1,4);
425 IntImp_ConstIsoparametric ChoixIso;
428 done = Standard_False;
432 const ThePSurface& Caro1 =myIntersectionOn2S.Function().AuxillarSurface1();
433 const ThePSurface& Caro2 =myIntersectionOn2S.Function().AuxillarSurface2();
435 UFirst1 = ThePSurfaceTool::FirstUParameter(Caro1);
436 VFirst1 = ThePSurfaceTool::FirstVParameter(Caro1);
437 ULast1 = ThePSurfaceTool::LastUParameter (Caro1);
438 VLast1 = ThePSurfaceTool::LastVParameter (Caro1);
440 UFirst2 = ThePSurfaceTool::FirstUParameter(Caro2);
441 VFirst2 = ThePSurfaceTool::FirstVParameter(Caro2);
442 ULast2 = ThePSurfaceTool::LastUParameter (Caro2);
443 VLast2 = ThePSurfaceTool::LastVParameter (Caro2);
445 ComputePasInit(pasuv,u1min,u1max,v1min,v1max,u2min,u2max,v2min,v2max,
446 Um1,UM1,Vm1,VM1,Um2,UM2,Vm2,VM2,Caro1,Caro2,pasMax+pasMax);
448 if(pasuv[0]<100*ResoU1) {
451 if(pasuv[1]<100*ResoV1) {
454 if(pasuv[2]<100*ResoU2) {
457 if(pasuv[3]<100*ResoV2) {
461 for (i=0; i<4; ++i) {
465 pasInit[i] = pasSav[i] = pasuv[i];
468 line = new IntSurf_LineOn2S ();
470 for (i=1; i<=4; ++i) {
474 //-- reprise des pas uv lies aux surfaces Caro1 et Caro2
475 //-- pasuv[] et pasSav[] sont modifies lors du cheminement
476 for(i = 0; i < 4; ++i) {
477 pasMaxSV[i] = pasSav[i] = pasuv[i] = pasInit[i];
480 //-- calcul du premier point solution
481 math_FunctionSetRoot Rsnld(myIntersectionOn2S.Function());
483 ChoixIso = myIntersectionOn2S.Perform(Param,Rsnld);
484 if (!myIntersectionOn2S.IsDone()) {
488 if (myIntersectionOn2S.IsEmpty()) {
492 if(myIntersectionOn2S.IsTangent()) {
496 Standard_Boolean Arrive, DejaReparti;
497 Standard_Integer IncKey, RejectIndex;
500 DejaReparti = Standard_False;
504 previousPoint = myIntersectionOn2S.Point();
505 previoustg = Standard_False;
506 previousd = myIntersectionOn2S.Direction();
507 previousd1 = myIntersectionOn2S.DirectionOnS1();
508 previousd2 = myIntersectionOn2S.DirectionOnS2();
511 firstd1 = previousd1;
512 firstd2 = previousd2;
513 tgfirst = tglast = Standard_False;
514 choixIsoSav = ChoixIso;
515 //------------------------------------------------------------
516 //-- On Teste si le premier point de cheminement correspond
517 //-- a un point sur frontiere.
518 //-- Dans ce cas, DejaReparti est initialise a True
520 pf = previousPoint.Value();
521 Standard_Boolean bTestFirstPoint = Standard_True;
523 previousPoint.Parameters(Param(1),Param(2),Param(3),Param(4));
524 AddAPoint(line,previousPoint);
526 IntWalk_StatusDeflection Status = IntWalk_OK;
527 Standard_Boolean NoTestDeflection = Standard_False;
528 Standard_Real SvParam[4], f;
529 Standard_Integer LevelOfEmptyInmyIntersectionOn2S=0;
530 Standard_Integer LevelOfPointConfondu = 0;
531 Standard_Integer LevelOfIterWithoutAppend = -1;
533 Arrive = Standard_False;
534 while(!Arrive) {//010
535 LevelOfIterWithoutAppend++;
536 if(LevelOfIterWithoutAppend>20) {
537 Arrive = Standard_True;
541 RepartirOuDiviser(DejaReparti,ChoixIso,Arrive);
542 LevelOfIterWithoutAppend = 0;
548 case IntImp_UIsoparametricOnCaro1: f = Abs(previousd1.X()); break;
549 case IntImp_VIsoparametricOnCaro1: f = Abs(previousd1.Y()); break;
550 case IntImp_UIsoparametricOnCaro2: f = Abs(previousd2.X()); break;
551 case IntImp_VIsoparametricOnCaro2: f = Abs(previousd2.Y()); break;
559 previousPoint.Parameters(Param(1),Param(2),Param(3),Param(4));
562 Standard_Real aIncKey, aEps, dP1, dP2, dP3, dP4;
564 dP1 = sensCheminement * pasuv[0] * previousd1.X() /f;
565 dP2 = sensCheminement * pasuv[1] * previousd1.Y() /f;
566 dP3 = sensCheminement * pasuv[2] * previousd2.X() /f;
567 dP4 = sensCheminement * pasuv[3] * previousd2.Y() /f;
569 aIncKey=5.*(Standard_Real)IncKey;
571 if(ChoixIso == IntImp_UIsoparametricOnCaro1 && Abs(dP1) < aEps) {
574 if(ChoixIso == IntImp_VIsoparametricOnCaro1 && Abs(dP2) < aEps) {
577 if(ChoixIso == IntImp_UIsoparametricOnCaro2 && Abs(dP3) < aEps) {
580 if(ChoixIso == IntImp_VIsoparametricOnCaro2 && Abs(dP4) < aEps) {
589 //==========================
595 ChoixIso= myIntersectionOn2S.Perform(Param, Rsnld, ChoixIso);
597 if (!myIntersectionOn2S.IsDone()) {
598 //arret de la ligne,division
599 Arrive = Standard_False;
604 RepartirOuDiviser(DejaReparti, ChoixIso, Arrive);
607 //== Le calcul du point exact a partir de Param(.) est possible
608 if (myIntersectionOn2S.IsEmpty()) {
609 Standard_Real u1,v1,u2,v2;
610 previousPoint.Parameters(u1,v1,u2,v2);
612 Arrive = Standard_False;
613 if(u1<UFirst1 || u1>ULast1) {
614 Arrive=Standard_True;
616 if(u2<UFirst2 || u2>ULast2) {
617 Arrive=Standard_True;
619 if(v1<VFirst1 || v1>VLast1) {
620 Arrive=Standard_True;
622 if(v2<VFirst2 || v2>VLast2) {
623 Arrive=Standard_True;
625 RepartirOuDiviser(DejaReparti,ChoixIso,Arrive);
626 LevelOfEmptyInmyIntersectionOn2S++;
628 if(LevelOfEmptyInmyIntersectionOn2S>10) {
636 //============================================================
637 //== Un point a ete trouve : T E S T D E F L E C T I O N
638 //============================================================
639 if(NoTestDeflection) {
640 NoTestDeflection = Standard_False;
643 if(--LevelOfEmptyInmyIntersectionOn2S<=0) {
644 LevelOfEmptyInmyIntersectionOn2S=0;
645 if(LevelOfIterWithoutAppend < 10) {
646 Status = TestDeflection();
656 //============================================================
657 //== T r a i t e m e n t s u r S t a t u s ==
658 //============================================================
659 if(LevelOfPointConfondu > 5) {
660 Status = IntWalk_ArretSurPoint;
661 LevelOfPointConfondu = 0;
664 if(Status==IntWalk_OK) {
666 if(NbPasOKConseq >= 5) {
668 Standard_Boolean pastroppetit;
672 pastroppetit=Standard_True;
674 if(pasuv[0]<pasInit[0]) {
675 t = (pasInit[0]-pasuv[0])*0.25;
676 if(t>0.1*pasInit[0]) {
680 pastroppetit=Standard_False;
682 if(pasuv[1]<pasInit[1]) {
683 t = (pasInit[1]-pasuv[1])*0.25;
684 if(t>0.1*pasInit[1]) {
688 pastroppetit=Standard_False;
690 if(pasuv[2]<pasInit[2]){
691 t = (pasInit[2]-pasuv[2])*0.25;
692 if(t>0.1*pasInit[2]) {
696 pastroppetit=Standard_False;
698 if(pasuv[3]<pasInit[3]) {
699 t = (pasInit[3]-pasuv[3])*0.25;
700 if(t>0.1*pasInit[3]) {
704 pastroppetit=Standard_False;
715 pastroppetit=Standard_False;
718 } while(pastroppetit);
720 }//Status==IntWalk_OK
721 else NbPasOKConseq=0;
723 switch(Status) {//007
724 case IntWalk_ArretSurPointPrecedent: {
725 Arrive = Standard_False;
726 RepartirOuDiviser(DejaReparti, ChoixIso, Arrive);
729 case IntWalk_PasTropGrand: {
734 if(LevelOfIterWithoutAppend > 5) {
735 if(pasSav[0]<pasInit[0]) {
736 pasInit[0]-=(pasInit[0]-pasSav[0])*0.25;
737 LevelOfIterWithoutAppend=0;
739 if(pasSav[1]<pasInit[1]) {
740 pasInit[1]-=(pasInit[1]-pasSav[1])*0.25;
741 LevelOfIterWithoutAppend=0;
743 if(pasSav[2]<pasInit[2]) {
744 pasInit[2]-=(pasInit[2]-pasSav[2])*0.25;
745 LevelOfIterWithoutAppend=0;
747 if(pasSav[3]<pasInit[3]) {
748 pasInit[3]-=(pasInit[3]-pasSav[3])*0.25;
749 LevelOfIterWithoutAppend=0;
754 case IntWalk_PointConfondu: {
755 LevelOfPointConfondu++;
756 if(LevelOfPointConfondu>5) {
757 Standard_Boolean pastroppetit;
760 pastroppetit=Standard_True;
761 if(pasuv[0]<pasInit[0]) {
762 pasuv[0]+=(pasInit[0]-pasuv[0])*0.25;
763 pastroppetit=Standard_False;
765 if(pasuv[1]<pasInit[1]) {
766 pasuv[1]+=(pasInit[1]-pasuv[1])*0.25;
767 pastroppetit=Standard_False;
769 if(pasuv[2]<pasInit[2]) {
770 pasuv[2]+=(pasInit[2]-pasuv[2])*0.25;
771 pastroppetit=Standard_False;
773 if(pasuv[3]<pasInit[3]) {
774 pasuv[3]+=(pasInit[3]-pasuv[3])*0.25;
775 pastroppetit=Standard_False;
786 pastroppetit=Standard_False;
789 } while(pastroppetit);
794 case IntWalk_ArretSurPoint: {//006
795 //=======================================================
796 //== T e s t A r r e t : Cadrage sur Param(.) ==
797 //=======================================================
799 Arrive = TestArret(DejaReparti,Param,ChoixIso);
800 // JMB 30th December 1999.
801 // Some statement below should not be put in comment because they are useful.
802 // See grid CTO 909 A1 which infinitely loops
803 if(Arrive==Standard_False && Status==IntWalk_ArretSurPoint) {
804 Arrive=Standard_True;
806 cout << "Compile avec option DEB :Si Pb d intersection : ";
807 cout << "IntWalk_PWalking_1.gxx (lbr le 1erdec98)"<<endl;
814 //=====================================================
815 //== Param(.) est dans les bornes ==
816 //== et ne finit pas une ligne fermee ==
817 //=====================================================
818 //== Verification sur Le Point Courant de myInters
819 Standard_Boolean pointisvalid = Standard_False;
821 Standard_Real u1,v1,u2,v2;
822 myIntersectionOn2S.Point().Parameters(u1,v1,u2,v2);
824 if(u1 <= UM1 && u2 <= UM2 && v1 <= VM1 &&
825 v2 <= VM2 && u1 >= Um1 && u2 >= Um2 &&
826 v1 >= Vm1 && v2 >= Vm2) {
827 pointisvalid=Standard_True;
832 previousPoint = myIntersectionOn2S.Point();
833 previoustg = myIntersectionOn2S.IsTangent();
835 previousd = myIntersectionOn2S.Direction();
836 previousd1 = myIntersectionOn2S.DirectionOnS1();
837 previousd2 = myIntersectionOn2S.DirectionOnS2();
839 //=====================================================
840 //== Verification sur Previous Point
842 Standard_Real u1,v1,u2,v2;
843 previousPoint.Parameters(u1,v1,u2,v2);
844 if( u1 <= UM1 && u2 <= UM2 && v1 <= VM1 &&
845 v2 <= VM2 && u1 >= Um1 && u2 >= Um2 &&
846 v1 >= Vm1 && v2 >= Vm2) {
847 pl = previousPoint.Value();
848 if(bTestFirstPoint) {
849 if(pf.Distance(pl) < 1.e-7){
857 bTestFirstPoint = Standard_False;
861 AddAPoint(line,previousPoint);
863 if(RejectIndex >= 250000) {
867 LevelOfIterWithoutAppend = 0;
871 //====================================================
872 if(Status == IntWalk_ArretSurPoint) {
873 RepartirOuDiviser(DejaReparti,ChoixIso,Arrive);
876 if (line->NbPoints() == 2) {
877 pasSav[0] = pasuv[0];
878 pasSav[1] = pasuv[1];
879 pasSav[2] = pasuv[2];
880 pasSav[3] = pasuv[3];
887 //================= la ligne est fermee ===============
888 AddAPoint(line,line->Value(1)); //ligne fermee
889 LevelOfIterWithoutAppend=0;
892 //====================================================
893 //== Param n etait pas dans les bornes (a ete recadre)
894 //====================================================
895 Standard_Boolean bPrevNotTangent = !previoustg || !myIntersectionOn2S.IsTangent();
897 IntImp_ConstIsoparametric SauvChoixIso = ChoixIso;
898 ChoixIso = myIntersectionOn2S.Perform(Param,Rsnld,ChoixIso);
900 if(!myIntersectionOn2S.IsEmpty()) { //002
901 // debordement sur le carreau reciproque ou intersection en coin
902 if(TestArret(Standard_True,Param,ChoixIso)) {
904 ChoixIso = myIntersectionOn2S.Perform(Param,Rsnld,ChoixIso);
905 if(!myIntersectionOn2S.IsEmpty()) {
906 previousPoint = myIntersectionOn2S.Point();
907 previoustg = myIntersectionOn2S.IsTangent();
909 previousd = myIntersectionOn2S.Direction();
910 previousd1 = myIntersectionOn2S.DirectionOnS1();
911 previousd2 = myIntersectionOn2S.DirectionOnS2();
913 pl = previousPoint.Value();
914 if(bTestFirstPoint) {
915 if(pf.Distance(pl) < 1.e-7){
923 bTestFirstPoint = Standard_False;
927 AddAPoint(line,previousPoint);
929 if(RejectIndex >= 250000) {
933 LevelOfIterWithoutAppend=0;
934 RepartirOuDiviser(DejaReparti,ChoixIso,Arrive);
937 //echec cadrage diviser le pas
938 Arrive = Standard_False;
939 RepartirOuDiviser(DejaReparti,ChoixIso,Arrive);
940 NoTestDeflection = Standard_True;
941 ChoixIso = SauvChoixIso;
945 // save the last point
946 // to revert to it if the current point is out of bounds
947 IntSurf_PntOn2S previousPointSave = previousPoint;
948 Standard_Boolean previoustgSave = previoustg;
949 gp_Dir previousdSave = previousd;
950 gp_Dir2d previousd1Save = previousd1;
951 gp_Dir2d previousd2Save = previousd2;
953 previousPoint = myIntersectionOn2S.Point();
954 previoustg = myIntersectionOn2S.IsTangent();
955 Arrive = Standard_False;
957 previousd = myIntersectionOn2S.Direction();
958 previousd1 = myIntersectionOn2S.DirectionOnS1();
959 previousd2 = myIntersectionOn2S.DirectionOnS2();
961 //========================================
962 //== Verification sur PreviousPoint @@
964 Standard_Real u1,v1,u2,v2;
965 previousPoint.Parameters(u1,v1,u2,v2);
972 Standard_Boolean bFlag1, bFlag2;
973 Standard_Real aTol2D=1.e-11;
975 bFlag1=u1 >= Um1-aTol2D && v1 >= Vm1-aTol2D && u1 <= UM1+aTol2D && v1 <= VM1+aTol2D;
976 bFlag2=u2 >= Um2-aTol2D && v2 >= Vm2-aTol2D && u2 <= UM2+aTol2D && v2 <= VM2+aTol2D;
977 if (bFlag1 && bFlag2) {
979 if(u1 <= UM1 && u2 <= UM2 && v1 <= VM1 &&
980 v2 <= VM2 && u1 >= Um1 && u2 >= Um2 &&
981 v1 >= Vm1 && v2 >= Vm2) {
984 pl = previousPoint.Value();
985 if(bTestFirstPoint) {
986 if(pf.Distance(pl) < 1.e-7) {
994 bTestFirstPoint = Standard_False;
997 AddAPoint(line,previousPoint);
999 if(RejectIndex >= 250000) {
1003 LevelOfIterWithoutAppend=0;
1004 Arrive = Standard_True;
1007 // revert to the last correctly calculated point
1008 previousPoint = previousPointSave;
1009 previoustg = previoustgSave;
1010 previousd = previousdSave;
1011 previousd1 = previousd1Save;
1012 previousd2 = previousd2Save;
1016 Standard_Boolean wasExtended = Standard_False;
1018 if(Arrive && myIntersectionOn2S.IsTangent() && bPrevNotTangent) {
1019 if(ExtendLineInCommonZone(SauvChoixIso, DejaReparti)) {
1020 wasExtended = Standard_True;
1021 Arrive = Standard_False;
1022 ChoixIso = SauvChoixIso;
1026 RepartirOuDiviser(DejaReparti,ChoixIso,Arrive);
1028 myIntersectionOn2S.IsDone() && !myIntersectionOn2S.IsEmpty() &&
1029 myIntersectionOn2S.IsTangent() && bPrevNotTangent &&
1032 if(ExtendLineInCommonZone(SauvChoixIso, DejaReparti)) {
1033 wasExtended = Standard_True;
1034 Arrive = Standard_False;
1035 ChoixIso = SauvChoixIso;
1038 }//else !TestArret() $
1039 } //$$ fin succes cadrage sur frontiere (!myIntersectionOn2S.IsEmpty())
1041 //echec cadrage sur frontiere;division du pas
1042 Arrive = Standard_False;
1043 NoTestDeflection = Standard_True;
1044 RepartirOuDiviser(DejaReparti,ChoixIso,Arrive);
1046 }//$$$ fin cadrage sur frontiere (!close)
1047 } //004 fin TestArret retourne Arrive = True
1048 } // 006case IntWalk_ArretSurPoint: fin Traitement Status = OK ou ArretSurPoint
1049 } //007 switch(Status)
1050 } //008 fin traitement point en court (TEST DEFLECTION)
1051 } //009 fin traitement ligne (else if myIntersectionOn2S.IsDone())
1052 } //010 fin si premier point de depart a permis un cheminement while(!Arrive)
1053 done = Standard_True;
1055 // ===========================================================================================================
1056 // function: ExtendLineInCommonZone
1057 // purpose: Extends already computed line inside tangent zone in the direction given by theChoixIso.
1058 // Returns Standard_True if the line was extended through tangent zone and the last computed point
1059 // is outside the tangent zone (but it is not put into the line). Otherwise returns Standard_False.
1060 // ===========================================================================================================
1061 Standard_Boolean IntWalk_PWalking::ExtendLineInCommonZone(const IntImp_ConstIsoparametric theChoixIso,
1062 const Standard_Boolean theDirectionFlag)
1064 Standard_Boolean bOutOfTangentZone = Standard_False;
1065 Standard_Boolean bStop = !myIntersectionOn2S.IsTangent();
1066 Standard_Integer dIncKey = 1;
1067 TColStd_Array1OfReal Param(1,4);
1068 IntWalk_StatusDeflection Status = IntWalk_OK;
1069 Standard_Integer nbIterWithoutAppend = 0;
1070 Standard_Integer nbEqualPoints = 0;
1071 Standard_Integer parit = 0;
1072 Standard_Integer uvit = 0;
1073 IntSurf_SequenceOfPntOn2S aSeqOfNewPoint;
1076 nbIterWithoutAppend++;
1078 if((nbIterWithoutAppend > 20) || (nbEqualPoints > 20)) {
1080 cout<<"Compile with option DEB:";
1081 cout<<"Infinite loop has detected. Stop iterations (IntWalk_PWalking_1.gxx)" << endl;
1083 bStop = Standard_True;
1086 Standard_Real f = 0.;
1088 switch (theChoixIso)
1090 case IntImp_UIsoparametricOnCaro1: f = Abs(previousd1.X()); break;
1091 case IntImp_VIsoparametricOnCaro1: f = Abs(previousd1.Y()); break;
1092 case IntImp_UIsoparametricOnCaro2: f = Abs(previousd2.X()); break;
1093 case IntImp_VIsoparametricOnCaro2: f = Abs(previousd2.Y()); break;
1098 previousPoint.Parameters(Param(1),Param(2),Param(3),Param(4));
1100 Standard_Real dP1 = sensCheminement * pasuv[0] * previousd1.X() /f;
1101 Standard_Real dP2 = sensCheminement * pasuv[1] * previousd1.Y() /f;
1102 Standard_Real dP3 = sensCheminement * pasuv[2] * previousd2.X() /f;
1103 Standard_Real dP4 = sensCheminement * pasuv[3] * previousd2.Y() /f;
1105 if(theChoixIso == IntImp_UIsoparametricOnCaro1 && Abs(dP1) < 1.e-7) dP1 *= (5. * (Standard_Real)dIncKey);
1106 if(theChoixIso == IntImp_VIsoparametricOnCaro1 && Abs(dP2) < 1.e-7) dP2 *= (5. * (Standard_Real)dIncKey);
1107 if(theChoixIso == IntImp_UIsoparametricOnCaro2 && Abs(dP3) < 1.e-7) dP3 *= (5. * (Standard_Real)dIncKey);
1108 if(theChoixIso == IntImp_VIsoparametricOnCaro2 && Abs(dP4) < 1.e-7) dP4 *= (5. * (Standard_Real)dIncKey);
1114 Standard_Real SvParam[4];
1115 IntImp_ConstIsoparametric ChoixIso = theChoixIso;
1117 for(parit = 0; parit < 4; parit++) {
1118 SvParam[parit] = Param(parit+1);
1120 math_FunctionSetRoot Rsnld(myIntersectionOn2S.Function());
1121 ChoixIso = myIntersectionOn2S.Perform(Param,Rsnld, theChoixIso);
1123 if (!myIntersectionOn2S.IsDone()) {
1124 return bOutOfTangentZone;
1127 if (myIntersectionOn2S.IsEmpty()) {
1128 return bOutOfTangentZone;
1131 Status = TestDeflection();
1133 if(Status == IntWalk_OK) {
1135 for(uvit = 0; uvit < 4; uvit++) {
1136 if(pasuv[uvit] < pasInit[uvit]) {
1137 pasuv[uvit] = pasInit[uvit];
1143 case IntWalk_ArretSurPointPrecedent:
1145 bStop = Standard_True;
1146 bOutOfTangentZone = !myIntersectionOn2S.IsTangent();
1149 case IntWalk_PasTropGrand:
1151 for(parit = 0; parit < 4; parit++) {
1152 Param(parit+1) = SvParam[parit];
1154 Standard_Boolean bDecrease = Standard_False;
1156 for(uvit = 0; uvit < 4; uvit++) {
1157 if(pasSav[uvit] < pasInit[uvit]) {
1158 pasInit[uvit] -= (pasInit[uvit] - pasSav[uvit]) * 0.1;
1159 bDecrease = Standard_True;
1163 if(bDecrease) nbIterWithoutAppend--;
1166 case IntWalk_PointConfondu:
1168 for(uvit = 0; uvit < 4; uvit++) {
1169 if(pasuv[uvit] < pasInit[uvit]) {
1170 pasuv[uvit] += (pasInit[uvit] - pasuv[uvit]) * 0.1;
1176 case IntWalk_ArretSurPoint:
1179 bStop = TestArret(theDirectionFlag, Param, ChoixIso);
1184 Standard_Real u11,v11,u12,v12;
1185 myIntersectionOn2S.Point().Parameters(u11,v11,u12,v12);
1186 Standard_Real u21,v21,u22,v22;
1187 previousPoint.Parameters(u21,v21,u22,v22);
1189 if(((fabs(u11-u21) < ResoU1) && (fabs(v11-v21) < ResoV1)) ||
1190 ((fabs(u12-u22) < ResoU2) && (fabs(v12-v22) < ResoV2))) {
1199 bStop = bStop || !myIntersectionOn2S.IsTangent();
1200 bOutOfTangentZone = !myIntersectionOn2S.IsTangent();
1203 Standard_Boolean pointisvalid = Standard_False;
1204 Standard_Real u1,v1,u2,v2;
1205 myIntersectionOn2S.Point().Parameters(u1,v1,u2,v2);
1207 if(u1 <= UM1 && u2 <= UM2 && v1 <= VM1 &&
1208 v2 <= VM2 && u1 >= Um1 && u2 >= Um2 &&
1209 v1 >= Vm1 && v2 >= Vm2)
1210 pointisvalid = Standard_True;
1213 previousPoint = myIntersectionOn2S.Point();
1214 previoustg = myIntersectionOn2S.IsTangent();
1217 previousd = myIntersectionOn2S.Direction();
1218 previousd1 = myIntersectionOn2S.DirectionOnS1();
1219 previousd2 = myIntersectionOn2S.DirectionOnS2();
1221 Standard_Boolean bAddPoint = Standard_True;
1223 if(line->NbPoints() >= 1) {
1224 gp_Pnt pf = line->Value(1).Value();
1225 gp_Pnt pl = previousPoint.Value();
1227 if(pf.Distance(pl) < Precision::Confusion()) {
1229 if(dIncKey == 5000) return bOutOfTangentZone;
1230 else bAddPoint = Standard_False;
1235 aSeqOfNewPoint.Append(previousPoint);
1236 nbIterWithoutAppend = 0;
1240 if (line->NbPoints() == 2) {
1241 for(uvit = 0; uvit < 4; uvit++) {
1242 pasSav[uvit] = pasuv[uvit];
1246 if ( !pointisvalid ) {
1247 // decrease step if out of bounds
1248 // otherwise the same calculations will be
1249 // repeated several times
1250 if ( ( u1 > UM1 ) || ( u1 < Um1 ) )
1253 if ( ( v1 > VM1 ) || ( v1 < Vm1 ) )
1256 if ( ( u2 > UM2 ) || ( u2 < Um2 ) )
1259 if ( ( v2 > VM2 ) || ( v2 < Vm2 ) )
1264 if(close && (line->NbPoints() >= 1)) {
1266 if(!bOutOfTangentZone) {
1267 aSeqOfNewPoint.Append(line->Value(1)); // line end
1269 nbIterWithoutAppend = 0;
1272 ChoixIso = myIntersectionOn2S.Perform(Param, Rsnld, theChoixIso);
1274 if(myIntersectionOn2S.IsEmpty()) {
1275 bStop = !myIntersectionOn2S.IsTangent();
1276 bOutOfTangentZone = !myIntersectionOn2S.IsTangent();
1279 Standard_Boolean bAddPoint = Standard_True;
1280 Standard_Boolean pointisvalid = Standard_False;
1282 previousPoint = myIntersectionOn2S.Point();
1283 Standard_Real u1,v1,u2,v2;
1284 previousPoint.Parameters(u1,v1,u2,v2);
1286 if(u1 <= UM1 && u2 <= UM2 && v1 <= VM1 &&
1287 v2 <= VM2 && u1 >= Um1 && u2 >= Um2 &&
1288 v1 >= Vm1 && v2 >= Vm2)
1289 pointisvalid = Standard_True;
1293 if(line->NbPoints() >= 1) {
1294 gp_Pnt pf = line->Value(1).Value();
1295 gp_Pnt pl = previousPoint.Value();
1297 if(pf.Distance(pl) < Precision::Confusion()) {
1299 if(dIncKey == 5000) return bOutOfTangentZone;
1300 else bAddPoint = Standard_False;
1304 if(bAddPoint && !bOutOfTangentZone) {
1305 aSeqOfNewPoint.Append(previousPoint);
1306 nbIterWithoutAppend = 0;
1321 Standard_Boolean bExtendLine = Standard_False;
1322 Standard_Real u1 = 0., v1 = 0., u2 = 0., v2 = 0.;
1324 Standard_Integer pit = 0;
1326 for(pit = 0; !bExtendLine && (pit < 2); pit++) {
1328 previousPoint.Parameters(u1,v1,u2,v2);
1330 if(aSeqOfNewPoint.Length() > 0)
1331 aSeqOfNewPoint.Value(aSeqOfNewPoint.Length()).Parameters(u1,v1,u2,v2);
1336 if(((u1 - Um1) < ResoU1) ||
1337 ((UM1 - u1) < ResoU1) ||
1338 ((u2 - Um2) < ResoU2) ||
1339 ((UM2 - u2) < ResoU2) ||
1340 ((v1 - Vm1) < ResoV1) ||
1341 ((VM1 - v1) < ResoV1) ||
1342 ((v2 - Vm2) < ResoV2) ||
1343 ((VM2 - v2) < ResoV2))
1344 bExtendLine = Standard_True;
1348 // if(Status == IntWalk_OK || Status == IntWalk_ArretSurPoint) {
1349 if(Status == IntWalk_OK) {
1350 bExtendLine = Standard_True;
1352 if(aSeqOfNewPoint.Length() > 1) {
1353 TColStd_Array1OfReal FirstParams(0, 3), LastParams(0, 3), Resolutions(0, 3);
1354 Resolutions(0) = ResoU1; Resolutions(1) = ResoV1; Resolutions(2) = ResoU2; Resolutions(3) = ResoV2;
1356 aSeqOfNewPoint(1).Parameters(FirstParams.ChangeValue(0), FirstParams.ChangeValue(1),
1357 FirstParams.ChangeValue(2), FirstParams.ChangeValue(3));
1358 aSeqOfNewPoint(aSeqOfNewPoint.Length()).Parameters(LastParams.ChangeValue(0),
1359 LastParams.ChangeValue(1),
1360 LastParams.ChangeValue(2),
1361 LastParams.ChangeValue(3));
1362 Standard_Integer indexofiso = 0;
1364 if(theChoixIso == IntImp_UIsoparametricOnCaro1) indexofiso = 0;
1365 if(theChoixIso == IntImp_VIsoparametricOnCaro1) indexofiso = 1;
1366 if(theChoixIso == IntImp_UIsoparametricOnCaro2) indexofiso = 2;
1367 if(theChoixIso == IntImp_VIsoparametricOnCaro2) indexofiso = 3;
1369 Standard_Integer afirstindex = (indexofiso < 2) ? 0 : 2;
1370 gp_Vec2d aTangentZoneDir(gp_Pnt2d(FirstParams.Value(afirstindex), FirstParams.Value(afirstindex + 1)),
1371 gp_Pnt2d(LastParams.Value(afirstindex), LastParams.Value(afirstindex + 1)));
1373 gp_Dir2d anIsoDir(0, 1);
1375 if((indexofiso == 1) || (indexofiso == 3))
1376 anIsoDir = gp_Dir2d(1, 0);
1378 if(aTangentZoneDir.SquareMagnitude() > gp::Resolution()) {
1379 Standard_Real piquota = M_PI*0.25;
1381 if(fabs(aTangentZoneDir.Angle(anIsoDir)) > piquota) {
1382 Standard_Integer ii = 1, nextii = 2;
1384 Standard_Real asqresol = gp::Resolution();
1385 asqresol *= asqresol;
1388 aSeqOfNewPoint(ii).Parameters(FirstParams.ChangeValue(0), FirstParams.ChangeValue(1),
1389 FirstParams.ChangeValue(2), FirstParams.ChangeValue(3));
1390 aSeqOfNewPoint(ii + 1).Parameters(LastParams.ChangeValue(0), LastParams.ChangeValue(1),
1391 LastParams.ChangeValue(2), LastParams.ChangeValue(3));
1392 d1 = gp_Vec2d(gp_Pnt2d(FirstParams.Value(afirstindex),
1393 FirstParams.Value(afirstindex + 1)),
1394 gp_Pnt2d(LastParams.Value(afirstindex),
1395 LastParams.Value(afirstindex + 1)));
1398 while((d1.SquareMagnitude() < asqresol) &&
1399 (ii < aSeqOfNewPoint.Length()));
1403 while(nextii < aSeqOfNewPoint.Length()) {
1405 gp_Vec2d nextd1(0, 0);
1406 Standard_Integer jj = nextii;
1409 aSeqOfNewPoint(jj).Parameters(FirstParams.ChangeValue(0), FirstParams.ChangeValue(1),
1410 FirstParams.ChangeValue(2), FirstParams.ChangeValue(3));
1411 aSeqOfNewPoint(jj + 1).Parameters(LastParams.ChangeValue(0), LastParams.ChangeValue(1),
1412 LastParams.ChangeValue(2), LastParams.ChangeValue(3));
1413 nextd1 = gp_Vec2d(gp_Pnt2d(FirstParams.Value(afirstindex),
1414 FirstParams.Value(afirstindex + 1)),
1415 gp_Pnt2d(LastParams.Value(afirstindex),
1416 LastParams.Value(afirstindex + 1)));
1420 while((nextd1.SquareMagnitude() < asqresol) &&
1421 (jj < aSeqOfNewPoint.Length()));
1424 if(fabs(d1.Angle(nextd1)) > piquota) {
1425 bExtendLine = Standard_False;
1431 // end if(fabs(aTangentZoneDir.Angle(anIsoDir)
1438 return Standard_False;
1440 Standard_Integer i = 0;
1442 for(i = 1; i <= aSeqOfNewPoint.Length(); i++) {
1443 AddAPoint(line, aSeqOfNewPoint.Value(i));
1446 return bOutOfTangentZone;