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),
88 STATIC_BLOCAGE_SUR_PAS_TROP_GRAND(0),
89 STATIC_PRECEDENT_INFLEXION(0)
91 Standard_Real KELARG=20.;
93 pasMax=Increment*0.2; //-- le 25 juin 99 suite a des pbs de precision
94 Um1 = ThePSurfaceTool::FirstUParameter(Caro1);
95 Vm1 = ThePSurfaceTool::FirstVParameter(Caro1);
96 UM1 = ThePSurfaceTool::LastUParameter(Caro1);
97 VM1 = ThePSurfaceTool::LastVParameter(Caro1);
99 Um2 = ThePSurfaceTool::FirstUParameter(Caro2);
100 Vm2 = ThePSurfaceTool::FirstVParameter(Caro2);
101 UM2 = ThePSurfaceTool::LastUParameter(Caro2);
102 VM2 = ThePSurfaceTool::LastVParameter(Caro2);
104 ResoU1 = ThePSurfaceTool::UResolution(Caro1,Precision::Confusion());
105 ResoV1 = ThePSurfaceTool::VResolution(Caro1,Precision::Confusion());
107 ResoU2 = ThePSurfaceTool::UResolution(Caro2,Precision::Confusion());
108 ResoV2 = ThePSurfaceTool::VResolution(Caro2,Precision::Confusion());
110 Standard_Real NEWRESO;
111 Standard_Real MAXVAL;
112 Standard_Real MAXVAL2;
114 MAXVAL = Abs(Um1); MAXVAL2 = Abs(UM1);
115 if(MAXVAL2 > MAXVAL) MAXVAL = MAXVAL2;
116 NEWRESO = ResoU1 * MAXVAL ;
117 if(NEWRESO > ResoU1 &&NEWRESO<10) { ResoU1 = NEWRESO; }
120 MAXVAL = Abs(Um2); MAXVAL2 = Abs(UM2);
121 if(MAXVAL2 > MAXVAL) MAXVAL = MAXVAL2;
122 NEWRESO = ResoU2 * MAXVAL ;
123 if(NEWRESO > ResoU2 && NEWRESO<10) { ResoU2 = NEWRESO; }
126 MAXVAL = Abs(Vm1); MAXVAL2 = Abs(VM1);
127 if(MAXVAL2 > MAXVAL) MAXVAL = MAXVAL2;
128 NEWRESO = ResoV1 * MAXVAL ;
129 if(NEWRESO > ResoV1 && NEWRESO<10) { ResoV1 = NEWRESO; }
132 MAXVAL = Abs(Vm2); MAXVAL2 = Abs(VM2);
133 if(MAXVAL2 > MAXVAL) MAXVAL = MAXVAL2;
134 NEWRESO = ResoV2 * MAXVAL ;
135 if(NEWRESO > ResoV2 && NEWRESO<10) { ResoV2 = NEWRESO; }
137 pasuv[0]=pasMax*Abs(UM1-Um1);
138 pasuv[1]=pasMax*Abs(VM1-Vm1);
139 pasuv[2]=pasMax*Abs(UM2-Um2);
140 pasuv[3]=pasMax*Abs(VM2-Vm2);
142 if(ResoU1>0.0001*pasuv[0]) ResoU1=0.00001*pasuv[0];
143 if(ResoV1>0.0001*pasuv[1]) ResoV1=0.00001*pasuv[1];
144 if(ResoU2>0.0001*pasuv[2]) ResoU2=0.00001*pasuv[2];
145 if(ResoV2>0.0001*pasuv[3]) ResoV2=0.00001*pasuv[3];
148 if(ThePSurfaceTool::IsUPeriodic(Caro1)==Standard_False) {
149 //UM1+=KELARG*pasuv[0]; Um1-=KELARG*pasuv[0];
152 Standard_Real t = UM1-Um1;
153 if(t<ThePSurfaceTool::UPeriod(Caro1)) {
154 t=0.5*(ThePSurfaceTool::UPeriod(Caro1)-t);
155 t=(t>KELARG*pasuv[0])? KELARG*pasuv[0] : t;
160 if(ThePSurfaceTool::IsVPeriodic(Caro1)==Standard_False) {
161 //VM1+=KELARG*pasuv[1]; Vm1-=KELARG*pasuv[1];
164 Standard_Real t = VM1-Vm1;
165 if(t<ThePSurfaceTool::VPeriod(Caro1)) {
166 t=0.5*(ThePSurfaceTool::VPeriod(Caro1)-t);
167 t=(t>KELARG*pasuv[1])? KELARG*pasuv[1] : t;
172 if(ThePSurfaceTool::IsUPeriodic(Caro2)==Standard_False) {
173 //UM2+=KELARG*pasuv[2]; Um2-=KELARG*pasuv[2];
176 Standard_Real t = UM2-Um2;
177 if(t<ThePSurfaceTool::UPeriod(Caro2)) {
178 t=0.5*(ThePSurfaceTool::UPeriod(Caro2)-t);
179 t=(t>KELARG*pasuv[2])? KELARG*pasuv[2] : t;
184 if(ThePSurfaceTool::IsVPeriodic(Caro2)==Standard_False) {
185 //VM2+=KELARG*pasuv[3]; Vm2-=KELARG*pasuv[3];
188 Standard_Real t = VM2-Vm2;
189 if(t<ThePSurfaceTool::VPeriod(Caro2)) {
190 t=0.5*(ThePSurfaceTool::VPeriod(Caro2)-t);
191 t=(t>KELARG*pasuv[3])? KELARG*pasuv[3] : t;
196 //-- ComputePasInit(pasuv,Um1,UM1,Vm1,VM1,Um2,UM2,Vm2,VM2,Caro1,Caro2);
198 for (Standard_Integer i = 0; i<=3;i++) {
201 pasInit[i] = pasSav[i] = pasuv[i];
206 //==================================================================================
207 // function : IntWalk_PWalking
209 //==================================================================================
210 IntWalk_PWalking::IntWalk_PWalking(const ThePSurface& Caro1,
211 const ThePSurface& Caro2,
212 const Standard_Real TolTangency,
213 const Standard_Real Epsilon,
214 const Standard_Real Deflection,
215 const Standard_Real Increment,
216 const Standard_Real U1,
217 const Standard_Real V1,
218 const Standard_Real U2,
219 const Standard_Real V2)
223 close(Standard_False),
227 myIntersectionOn2S(Caro1,Caro2,TolTangency),
228 STATIC_BLOCAGE_SUR_PAS_TROP_GRAND(0),
229 STATIC_PRECEDENT_INFLEXION(0)
231 Standard_Real KELARG=20.;
233 pasMax=Increment*0.2; //-- le 25 juin 99 suite a des pbs de precision
235 Um1 = ThePSurfaceTool::FirstUParameter(Caro1);
236 Vm1 = ThePSurfaceTool::FirstVParameter(Caro1);
237 UM1 = ThePSurfaceTool::LastUParameter(Caro1);
238 VM1 = ThePSurfaceTool::LastVParameter(Caro1);
240 Um2 = ThePSurfaceTool::FirstUParameter(Caro2);
241 Vm2 = ThePSurfaceTool::FirstVParameter(Caro2);
242 UM2 = ThePSurfaceTool::LastUParameter(Caro2);
243 VM2 = ThePSurfaceTool::LastVParameter(Caro2);
245 ResoU1 = ThePSurfaceTool::UResolution(Caro1,Precision::Confusion());
246 ResoV1 = ThePSurfaceTool::VResolution(Caro1,Precision::Confusion());
248 ResoU2 = ThePSurfaceTool::UResolution(Caro2,Precision::Confusion());
249 ResoV2 = ThePSurfaceTool::VResolution(Caro2,Precision::Confusion());
251 Standard_Real NEWRESO, MAXVAL, MAXVAL2;
255 if(MAXVAL2 > MAXVAL) {
258 NEWRESO = ResoU1 * MAXVAL ;
259 if(NEWRESO > ResoU1) {
265 if(MAXVAL2 > MAXVAL){
268 NEWRESO = ResoU2 * MAXVAL ;
269 if(NEWRESO > ResoU2) {
275 if(MAXVAL2 > MAXVAL) {
278 NEWRESO = ResoV1 * MAXVAL ;
279 if(NEWRESO > ResoV1) {
285 if(MAXVAL2 > MAXVAL){
288 NEWRESO = ResoV2 * MAXVAL ;
289 if(NEWRESO > ResoV2) {
293 pasuv[0]=pasMax*Abs(UM1-Um1);
294 pasuv[1]=pasMax*Abs(VM1-Vm1);
295 pasuv[2]=pasMax*Abs(UM2-Um2);
296 pasuv[3]=pasMax*Abs(VM2-Vm2);
298 if(ThePSurfaceTool::IsUPeriodic(Caro1)==Standard_False) {
299 UM1+=KELARG*pasuv[0];
300 Um1-=KELARG*pasuv[0];
303 Standard_Real t = UM1-Um1;
304 if(t<ThePSurfaceTool::UPeriod(Caro1)) {
305 t=0.5*(ThePSurfaceTool::UPeriod(Caro1)-t);
306 t=(t>KELARG*pasuv[0])? KELARG*pasuv[0] : t;
312 if(ThePSurfaceTool::IsVPeriodic(Caro1)==Standard_False) {
313 VM1+=KELARG*pasuv[1];
314 Vm1-=KELARG*pasuv[1];
317 Standard_Real t = VM1-Vm1;
318 if(t<ThePSurfaceTool::VPeriod(Caro1)) {
319 t=0.5*(ThePSurfaceTool::VPeriod(Caro1)-t);
320 t=(t>KELARG*pasuv[1])? KELARG*pasuv[1] : t;
325 if(ThePSurfaceTool::IsUPeriodic(Caro2)==Standard_False) {
326 UM2+=KELARG*pasuv[2];
327 Um2-=KELARG*pasuv[2];
330 Standard_Real t = UM2-Um2;
331 if(t<ThePSurfaceTool::UPeriod(Caro2)) {
332 t=0.5*(ThePSurfaceTool::UPeriod(Caro2)-t);
333 t=(t>KELARG*pasuv[2])? KELARG*pasuv[2] : t;
339 if(ThePSurfaceTool::IsVPeriodic(Caro2)==Standard_False) {
340 VM2+=KELARG*pasuv[3];
341 Vm2-=KELARG*pasuv[3];
344 Standard_Real t = VM2-Vm2;
345 if(t<ThePSurfaceTool::UPeriod(Caro2)) {
346 t=0.5*(ThePSurfaceTool::VPeriod(Caro2)-t);
347 t=(t>KELARG*pasuv[3])? KELARG*pasuv[3] : t;
352 //-- ComputePasInit(pasuv,Um1,UM1,Vm1,VM1,Um2,UM2,Vm2,VM2,Caro1,Caro2);
354 for (Standard_Integer i = 0; i<=3;i++) {
355 pasInit[i] = pasSav[i] = pasuv[i];
358 if(ResoU1>0.0001*pasuv[0]) ResoU1=0.00001*pasuv[0];
359 if(ResoV1>0.0001*pasuv[1]) ResoV1=0.00001*pasuv[1];
360 if(ResoU2>0.0001*pasuv[2]) ResoU2=0.00001*pasuv[2];
361 if(ResoV2>0.0001*pasuv[3]) ResoV2=0.00001*pasuv[3];
363 TColStd_Array1OfReal Par(1,4);
371 //==================================================================================
372 // function : PerformFirstPoint
374 //==================================================================================
375 Standard_Boolean IntWalk_PWalking::PerformFirstPoint (const TColStd_Array1OfReal& ParDep,
376 IntSurf_PntOn2S& FirstPoint)
379 close = Standard_False;
383 TColStd_Array1OfReal Param(1,4);
385 for (i=1; i<=4; ++i) {
387 Param(i) = ParDep(i);
389 //-- calcul du premier point solution
390 math_FunctionSetRoot Rsnld(myIntersectionOn2S.Function());
392 myIntersectionOn2S.Perform(Param,Rsnld);
393 if (!myIntersectionOn2S.IsDone()) {
394 return Standard_False;
396 if (myIntersectionOn2S.IsEmpty()) {
397 return Standard_False;
399 FirstPoint = myIntersectionOn2S.Point();
400 return Standard_True;
402 //==================================================================================
403 // function : Perform
405 //==================================================================================
406 void IntWalk_PWalking::Perform(const TColStd_Array1OfReal& ParDep)
408 Perform(ParDep,Um1,Vm1,Um2,Vm2,UM1,VM1,UM2,VM2);
410 //==================================================================================
411 // function : Perform
413 //==================================================================================
414 void IntWalk_PWalking::Perform(const TColStd_Array1OfReal& ParDep,
415 const Standard_Real u1min,
416 const Standard_Real v1min,
417 const Standard_Real u2min,
418 const Standard_Real v2min,
419 const Standard_Real u1max,
420 const Standard_Real v1max,
421 const Standard_Real u2max,
422 const Standard_Real v2max)
425 Standard_Integer i, NbPasOKConseq;
426 Standard_Real UFirst1, VFirst1, ULast1, VLast1, UFirst2, VFirst2, ULast2, VLast2;
427 Standard_Real pasMaxSV[4], aTmp;
428 TColStd_Array1OfReal Param(1,4);
429 IntImp_ConstIsoparametric ChoixIso;
432 done = Standard_False;
436 const ThePSurface& Caro1 =myIntersectionOn2S.Function().AuxillarSurface1();
437 const ThePSurface& Caro2 =myIntersectionOn2S.Function().AuxillarSurface2();
439 UFirst1 = ThePSurfaceTool::FirstUParameter(Caro1);
440 VFirst1 = ThePSurfaceTool::FirstVParameter(Caro1);
441 ULast1 = ThePSurfaceTool::LastUParameter (Caro1);
442 VLast1 = ThePSurfaceTool::LastVParameter (Caro1);
444 UFirst2 = ThePSurfaceTool::FirstUParameter(Caro2);
445 VFirst2 = ThePSurfaceTool::FirstVParameter(Caro2);
446 ULast2 = ThePSurfaceTool::LastUParameter (Caro2);
447 VLast2 = ThePSurfaceTool::LastVParameter (Caro2);
449 ComputePasInit(pasuv,u1min,u1max,v1min,v1max,u2min,u2max,v2min,v2max,
450 Um1,UM1,Vm1,VM1,Um2,UM2,Vm2,VM2,Caro1,Caro2,pasMax+pasMax);
452 if(pasuv[0]<100*ResoU1) {
455 if(pasuv[1]<100*ResoV1) {
458 if(pasuv[2]<100*ResoU2) {
461 if(pasuv[3]<100*ResoV2) {
465 for (i=0; i<4; ++i) {
469 pasInit[i] = pasSav[i] = pasuv[i];
472 line = new IntSurf_LineOn2S ();
474 for (i=1; i<=4; ++i) {
478 //-- reprise des pas uv lies aux surfaces Caro1 et Caro2
479 //-- pasuv[] et pasSav[] sont modifies lors du cheminement
480 for(i = 0; i < 4; ++i) {
481 pasMaxSV[i] = pasSav[i] = pasuv[i] = pasInit[i];
484 //-- calcul du premier point solution
485 math_FunctionSetRoot Rsnld(myIntersectionOn2S.Function());
487 ChoixIso = myIntersectionOn2S.Perform(Param,Rsnld);
488 if (!myIntersectionOn2S.IsDone()) {
492 if (myIntersectionOn2S.IsEmpty()) {
496 if(myIntersectionOn2S.IsTangent()) {
500 Standard_Boolean Arrive, DejaReparti;
501 Standard_Integer IncKey, RejectIndex;
504 DejaReparti = Standard_False;
508 previousPoint = myIntersectionOn2S.Point();
509 previoustg = Standard_False;
510 previousd = myIntersectionOn2S.Direction();
511 previousd1 = myIntersectionOn2S.DirectionOnS1();
512 previousd2 = myIntersectionOn2S.DirectionOnS2();
515 firstd1 = previousd1;
516 firstd2 = previousd2;
517 tgfirst = tglast = Standard_False;
518 choixIsoSav = ChoixIso;
519 //------------------------------------------------------------
520 //-- On Teste si le premier point de cheminement correspond
521 //-- a un point sur frontiere.
522 //-- Dans ce cas, DejaReparti est initialise a True
524 pf = previousPoint.Value();
525 Standard_Boolean bTestFirstPoint = Standard_True;
527 previousPoint.Parameters(Param(1),Param(2),Param(3),Param(4));
528 AddAPoint(line,previousPoint);
530 IntWalk_StatusDeflection Status = IntWalk_OK;
531 Standard_Boolean NoTestDeflection = Standard_False;
532 Standard_Real SvParam[4], f;
533 Standard_Integer LevelOfEmptyInmyIntersectionOn2S=0;
534 Standard_Integer LevelOfPointConfondu = 0;
535 Standard_Integer LevelOfIterWithoutAppend = -1;
537 Arrive = Standard_False;
538 while(!Arrive) {//010
539 LevelOfIterWithoutAppend++;
540 if(LevelOfIterWithoutAppend>20) {
541 Arrive = Standard_True;
545 RepartirOuDiviser(DejaReparti,ChoixIso,Arrive);
546 LevelOfIterWithoutAppend = 0;
552 case IntImp_UIsoparametricOnCaro1: f = Abs(previousd1.X()); break;
553 case IntImp_VIsoparametricOnCaro1: f = Abs(previousd1.Y()); break;
554 case IntImp_UIsoparametricOnCaro2: f = Abs(previousd2.X()); break;
555 case IntImp_VIsoparametricOnCaro2: f = Abs(previousd2.Y()); break;
563 previousPoint.Parameters(Param(1),Param(2),Param(3),Param(4));
566 Standard_Real aIncKey, aEps, dP1, dP2, dP3, dP4;
568 dP1 = sensCheminement * pasuv[0] * previousd1.X() /f;
569 dP2 = sensCheminement * pasuv[1] * previousd1.Y() /f;
570 dP3 = sensCheminement * pasuv[2] * previousd2.X() /f;
571 dP4 = sensCheminement * pasuv[3] * previousd2.Y() /f;
573 aIncKey=5.*(Standard_Real)IncKey;
575 if(ChoixIso == IntImp_UIsoparametricOnCaro1 && Abs(dP1) < aEps) {
578 if(ChoixIso == IntImp_VIsoparametricOnCaro1 && Abs(dP2) < aEps) {
581 if(ChoixIso == IntImp_UIsoparametricOnCaro2 && Abs(dP3) < aEps) {
584 if(ChoixIso == IntImp_VIsoparametricOnCaro2 && Abs(dP4) < aEps) {
593 //==========================
599 ChoixIso= myIntersectionOn2S.Perform(Param, Rsnld, ChoixIso);
601 if (!myIntersectionOn2S.IsDone()) {
602 //arret de la ligne,division
603 Arrive = Standard_False;
608 RepartirOuDiviser(DejaReparti, ChoixIso, Arrive);
611 //== Le calcul du point exact a partir de Param(.) est possible
612 if (myIntersectionOn2S.IsEmpty()) {
613 Standard_Real u1,v1,u2,v2;
614 previousPoint.Parameters(u1,v1,u2,v2);
616 Arrive = Standard_False;
617 if(u1<UFirst1 || u1>ULast1) {
618 Arrive=Standard_True;
620 if(u2<UFirst2 || u2>ULast2) {
621 Arrive=Standard_True;
623 if(v1<VFirst1 || v1>VLast1) {
624 Arrive=Standard_True;
626 if(v2<VFirst2 || v2>VLast2) {
627 Arrive=Standard_True;
629 RepartirOuDiviser(DejaReparti,ChoixIso,Arrive);
630 LevelOfEmptyInmyIntersectionOn2S++;
632 if(LevelOfEmptyInmyIntersectionOn2S>10) {
640 //============================================================
641 //== Un point a ete trouve : T E S T D E F L E C T I O N
642 //============================================================
643 if(NoTestDeflection) {
644 NoTestDeflection = Standard_False;
647 if(--LevelOfEmptyInmyIntersectionOn2S<=0) {
648 LevelOfEmptyInmyIntersectionOn2S=0;
649 if(LevelOfIterWithoutAppend < 10) {
650 Status = TestDeflection();
660 //============================================================
661 //== T r a i t e m e n t s u r S t a t u s ==
662 //============================================================
663 if(LevelOfPointConfondu > 5) {
664 Status = IntWalk_ArretSurPoint;
665 LevelOfPointConfondu = 0;
668 if(Status==IntWalk_OK) {
670 if(NbPasOKConseq >= 5) {
672 Standard_Boolean pastroppetit;
676 pastroppetit=Standard_True;
678 if(pasuv[0]<pasInit[0]) {
679 t = (pasInit[0]-pasuv[0])*0.25;
680 if(t>0.1*pasInit[0]) {
684 pastroppetit=Standard_False;
686 if(pasuv[1]<pasInit[1]) {
687 t = (pasInit[1]-pasuv[1])*0.25;
688 if(t>0.1*pasInit[1]) {
692 pastroppetit=Standard_False;
694 if(pasuv[2]<pasInit[2]){
695 t = (pasInit[2]-pasuv[2])*0.25;
696 if(t>0.1*pasInit[2]) {
700 pastroppetit=Standard_False;
702 if(pasuv[3]<pasInit[3]) {
703 t = (pasInit[3]-pasuv[3])*0.25;
704 if(t>0.1*pasInit[3]) {
708 pastroppetit=Standard_False;
719 pastroppetit=Standard_False;
722 } while(pastroppetit);
724 }//Status==IntWalk_OK
725 else NbPasOKConseq=0;
727 switch(Status) {//007
728 case IntWalk_ArretSurPointPrecedent: {
729 Arrive = Standard_False;
730 RepartirOuDiviser(DejaReparti, ChoixIso, Arrive);
733 case IntWalk_PasTropGrand: {
738 if(LevelOfIterWithoutAppend > 5) {
739 if(pasSav[0]<pasInit[0]) {
740 pasInit[0]-=(pasInit[0]-pasSav[0])*0.25;
741 LevelOfIterWithoutAppend=0;
743 if(pasSav[1]<pasInit[1]) {
744 pasInit[1]-=(pasInit[1]-pasSav[1])*0.25;
745 LevelOfIterWithoutAppend=0;
747 if(pasSav[2]<pasInit[2]) {
748 pasInit[2]-=(pasInit[2]-pasSav[2])*0.25;
749 LevelOfIterWithoutAppend=0;
751 if(pasSav[3]<pasInit[3]) {
752 pasInit[3]-=(pasInit[3]-pasSav[3])*0.25;
753 LevelOfIterWithoutAppend=0;
758 case IntWalk_PointConfondu: {
759 LevelOfPointConfondu++;
760 if(LevelOfPointConfondu>5) {
761 Standard_Boolean pastroppetit;
764 pastroppetit=Standard_True;
765 if(pasuv[0]<pasInit[0]) {
766 pasuv[0]+=(pasInit[0]-pasuv[0])*0.25;
767 pastroppetit=Standard_False;
769 if(pasuv[1]<pasInit[1]) {
770 pasuv[1]+=(pasInit[1]-pasuv[1])*0.25;
771 pastroppetit=Standard_False;
773 if(pasuv[2]<pasInit[2]) {
774 pasuv[2]+=(pasInit[2]-pasuv[2])*0.25;
775 pastroppetit=Standard_False;
777 if(pasuv[3]<pasInit[3]) {
778 pasuv[3]+=(pasInit[3]-pasuv[3])*0.25;
779 pastroppetit=Standard_False;
790 pastroppetit=Standard_False;
793 } while(pastroppetit);
798 case IntWalk_ArretSurPoint: {//006
799 //=======================================================
800 //== T e s t A r r e t : Cadrage sur Param(.) ==
801 //=======================================================
803 Arrive = TestArret(DejaReparti,Param,ChoixIso);
804 // JMB 30th December 1999.
805 // Some statement below should not be put in comment because they are useful.
806 // See grid CTO 909 A1 which infinitely loops
807 if(Arrive==Standard_False && Status==IntWalk_ArretSurPoint) {
808 Arrive=Standard_True;
810 cout << "Compile avec option DEB :Si Pb d intersection : ";
811 cout << "IntWalk_PWalking_1.gxx (lbr le 1erdec98)"<<endl;
818 //=====================================================
819 //== Param(.) est dans les bornes ==
820 //== et ne finit pas une ligne fermee ==
821 //=====================================================
822 //== Verification sur Le Point Courant de myInters
823 Standard_Boolean pointisvalid = Standard_False;
825 Standard_Real u1,v1,u2,v2;
826 myIntersectionOn2S.Point().Parameters(u1,v1,u2,v2);
828 if(u1 <= UM1 && u2 <= UM2 && v1 <= VM1 &&
829 v2 <= VM2 && u1 >= Um1 && u2 >= Um2 &&
830 v1 >= Vm1 && v2 >= Vm2) {
831 pointisvalid=Standard_True;
836 previousPoint = myIntersectionOn2S.Point();
837 previoustg = myIntersectionOn2S.IsTangent();
839 previousd = myIntersectionOn2S.Direction();
840 previousd1 = myIntersectionOn2S.DirectionOnS1();
841 previousd2 = myIntersectionOn2S.DirectionOnS2();
843 //=====================================================
844 //== Verification sur Previous Point
846 Standard_Real u1,v1,u2,v2;
847 previousPoint.Parameters(u1,v1,u2,v2);
848 if( u1 <= UM1 && u2 <= UM2 && v1 <= VM1 &&
849 v2 <= VM2 && u1 >= Um1 && u2 >= Um2 &&
850 v1 >= Vm1 && v2 >= Vm2) {
851 pl = previousPoint.Value();
852 if(bTestFirstPoint) {
853 if(pf.Distance(pl) < 1.e-7){
861 bTestFirstPoint = Standard_False;
865 AddAPoint(line,previousPoint);
867 if(RejectIndex >= 250000) {
871 LevelOfIterWithoutAppend = 0;
875 //====================================================
876 if(Status == IntWalk_ArretSurPoint) {
877 RepartirOuDiviser(DejaReparti,ChoixIso,Arrive);
880 if (line->NbPoints() == 2) {
881 pasSav[0] = pasuv[0];
882 pasSav[1] = pasuv[1];
883 pasSav[2] = pasuv[2];
884 pasSav[3] = pasuv[3];
891 //================= la ligne est fermee ===============
892 AddAPoint(line,line->Value(1)); //ligne fermee
893 LevelOfIterWithoutAppend=0;
896 //====================================================
897 //== Param n etait pas dans les bornes (a ete recadre)
898 //====================================================
899 Standard_Boolean bPrevNotTangent = !previoustg || !myIntersectionOn2S.IsTangent();
901 IntImp_ConstIsoparametric SauvChoixIso = ChoixIso;
902 ChoixIso = myIntersectionOn2S.Perform(Param,Rsnld,ChoixIso);
904 if(!myIntersectionOn2S.IsEmpty()) { //002
905 // debordement sur le carreau reciproque ou intersection en coin
906 if(TestArret(Standard_True,Param,ChoixIso)) {
908 ChoixIso = myIntersectionOn2S.Perform(Param,Rsnld,ChoixIso);
909 if(!myIntersectionOn2S.IsEmpty()) {
910 previousPoint = myIntersectionOn2S.Point();
911 previoustg = myIntersectionOn2S.IsTangent();
913 previousd = myIntersectionOn2S.Direction();
914 previousd1 = myIntersectionOn2S.DirectionOnS1();
915 previousd2 = myIntersectionOn2S.DirectionOnS2();
917 pl = previousPoint.Value();
918 if(bTestFirstPoint) {
919 if(pf.Distance(pl) < 1.e-7){
927 bTestFirstPoint = Standard_False;
931 AddAPoint(line,previousPoint);
933 if(RejectIndex >= 250000) {
937 LevelOfIterWithoutAppend=0;
938 RepartirOuDiviser(DejaReparti,ChoixIso,Arrive);
941 //echec cadrage diviser le pas
942 Arrive = Standard_False;
943 RepartirOuDiviser(DejaReparti,ChoixIso,Arrive);
944 NoTestDeflection = Standard_True;
945 ChoixIso = SauvChoixIso;
949 // save the last point
950 // to revert to it if the current point is out of bounds
951 IntSurf_PntOn2S previousPointSave = previousPoint;
952 Standard_Boolean previoustgSave = previoustg;
953 gp_Dir previousdSave = previousd;
954 gp_Dir2d previousd1Save = previousd1;
955 gp_Dir2d previousd2Save = previousd2;
957 previousPoint = myIntersectionOn2S.Point();
958 previoustg = myIntersectionOn2S.IsTangent();
959 Arrive = Standard_False;
961 previousd = myIntersectionOn2S.Direction();
962 previousd1 = myIntersectionOn2S.DirectionOnS1();
963 previousd2 = myIntersectionOn2S.DirectionOnS2();
965 //========================================
966 //== Verification sur PreviousPoint @@
968 Standard_Real u1,v1,u2,v2;
969 previousPoint.Parameters(u1,v1,u2,v2);
976 Standard_Boolean bFlag1, bFlag2;
977 Standard_Real aTol2D=1.e-11;
979 bFlag1=u1 >= Um1-aTol2D && v1 >= Vm1-aTol2D && u1 <= UM1+aTol2D && v1 <= VM1+aTol2D;
980 bFlag2=u2 >= Um2-aTol2D && v2 >= Vm2-aTol2D && u2 <= UM2+aTol2D && v2 <= VM2+aTol2D;
981 if (bFlag1 && bFlag2) {
983 if(u1 <= UM1 && u2 <= UM2 && v1 <= VM1 &&
984 v2 <= VM2 && u1 >= Um1 && u2 >= Um2 &&
985 v1 >= Vm1 && v2 >= Vm2) {
988 pl = previousPoint.Value();
989 if(bTestFirstPoint) {
990 if(pf.Distance(pl) < 1.e-7) {
998 bTestFirstPoint = Standard_False;
1001 AddAPoint(line,previousPoint);
1003 if(RejectIndex >= 250000) {
1007 LevelOfIterWithoutAppend=0;
1008 Arrive = Standard_True;
1011 // revert to the last correctly calculated point
1012 previousPoint = previousPointSave;
1013 previoustg = previoustgSave;
1014 previousd = previousdSave;
1015 previousd1 = previousd1Save;
1016 previousd2 = previousd2Save;
1020 Standard_Boolean wasExtended = Standard_False;
1022 if(Arrive && myIntersectionOn2S.IsTangent() && bPrevNotTangent) {
1023 if(ExtendLineInCommonZone(SauvChoixIso, DejaReparti)) {
1024 wasExtended = Standard_True;
1025 Arrive = Standard_False;
1026 ChoixIso = SauvChoixIso;
1030 RepartirOuDiviser(DejaReparti,ChoixIso,Arrive);
1032 myIntersectionOn2S.IsDone() && !myIntersectionOn2S.IsEmpty() &&
1033 myIntersectionOn2S.IsTangent() && bPrevNotTangent &&
1036 if(ExtendLineInCommonZone(SauvChoixIso, DejaReparti)) {
1037 wasExtended = Standard_True;
1038 Arrive = Standard_False;
1039 ChoixIso = SauvChoixIso;
1042 }//else !TestArret() $
1043 } //$$ fin succes cadrage sur frontiere (!myIntersectionOn2S.IsEmpty())
1045 //echec cadrage sur frontiere;division du pas
1046 Arrive = Standard_False;
1047 NoTestDeflection = Standard_True;
1048 RepartirOuDiviser(DejaReparti,ChoixIso,Arrive);
1050 }//$$$ fin cadrage sur frontiere (!close)
1051 } //004 fin TestArret retourne Arrive = True
1052 } // 006case IntWalk_ArretSurPoint: fin Traitement Status = OK ou ArretSurPoint
1053 } //007 switch(Status)
1054 } //008 fin traitement point en court (TEST DEFLECTION)
1055 } //009 fin traitement ligne (else if myIntersectionOn2S.IsDone())
1056 } //010 fin si premier point de depart a permis un cheminement while(!Arrive)
1057 done = Standard_True;
1059 // ===========================================================================================================
1060 // function: ExtendLineInCommonZone
1061 // purpose: Extends already computed line inside tangent zone in the direction given by theChoixIso.
1062 // Returns Standard_True if the line was extended through tangent zone and the last computed point
1063 // is outside the tangent zone (but it is not put into the line). Otherwise returns Standard_False.
1064 // ===========================================================================================================
1065 Standard_Boolean IntWalk_PWalking::ExtendLineInCommonZone(const IntImp_ConstIsoparametric theChoixIso,
1066 const Standard_Boolean theDirectionFlag)
1068 Standard_Boolean bOutOfTangentZone = Standard_False;
1069 Standard_Boolean bStop = !myIntersectionOn2S.IsTangent();
1070 Standard_Integer dIncKey = 1;
1071 TColStd_Array1OfReal Param(1,4);
1072 IntWalk_StatusDeflection Status = IntWalk_OK;
1073 Standard_Integer nbIterWithoutAppend = 0;
1074 Standard_Integer nbEqualPoints = 0;
1075 Standard_Integer parit = 0;
1076 Standard_Integer uvit = 0;
1077 IntSurf_SequenceOfPntOn2S aSeqOfNewPoint;
1080 nbIterWithoutAppend++;
1082 if((nbIterWithoutAppend > 20) || (nbEqualPoints > 20)) {
1084 cout<<"Compile with option DEB:";
1085 cout<<"Infinite loop has detected. Stop iterations (IntWalk_PWalking_1.gxx)" << endl;
1087 bStop = Standard_True;
1090 Standard_Real f = 0.;
1092 switch (theChoixIso)
1094 case IntImp_UIsoparametricOnCaro1: f = Abs(previousd1.X()); break;
1095 case IntImp_VIsoparametricOnCaro1: f = Abs(previousd1.Y()); break;
1096 case IntImp_UIsoparametricOnCaro2: f = Abs(previousd2.X()); break;
1097 case IntImp_VIsoparametricOnCaro2: f = Abs(previousd2.Y()); break;
1102 previousPoint.Parameters(Param(1),Param(2),Param(3),Param(4));
1104 Standard_Real dP1 = sensCheminement * pasuv[0] * previousd1.X() /f;
1105 Standard_Real dP2 = sensCheminement * pasuv[1] * previousd1.Y() /f;
1106 Standard_Real dP3 = sensCheminement * pasuv[2] * previousd2.X() /f;
1107 Standard_Real dP4 = sensCheminement * pasuv[3] * previousd2.Y() /f;
1109 if(theChoixIso == IntImp_UIsoparametricOnCaro1 && Abs(dP1) < 1.e-7) dP1 *= (5. * (Standard_Real)dIncKey);
1110 if(theChoixIso == IntImp_VIsoparametricOnCaro1 && Abs(dP2) < 1.e-7) dP2 *= (5. * (Standard_Real)dIncKey);
1111 if(theChoixIso == IntImp_UIsoparametricOnCaro2 && Abs(dP3) < 1.e-7) dP3 *= (5. * (Standard_Real)dIncKey);
1112 if(theChoixIso == IntImp_VIsoparametricOnCaro2 && Abs(dP4) < 1.e-7) dP4 *= (5. * (Standard_Real)dIncKey);
1118 Standard_Real SvParam[4];
1119 IntImp_ConstIsoparametric ChoixIso = theChoixIso;
1121 for(parit = 0; parit < 4; parit++) {
1122 SvParam[parit] = Param(parit+1);
1124 math_FunctionSetRoot Rsnld(myIntersectionOn2S.Function());
1125 ChoixIso = myIntersectionOn2S.Perform(Param,Rsnld, theChoixIso);
1127 if (!myIntersectionOn2S.IsDone()) {
1128 return bOutOfTangentZone;
1131 if (myIntersectionOn2S.IsEmpty()) {
1132 return bOutOfTangentZone;
1135 Status = TestDeflection();
1137 if(Status == IntWalk_OK) {
1139 for(uvit = 0; uvit < 4; uvit++) {
1140 if(pasuv[uvit] < pasInit[uvit]) {
1141 pasuv[uvit] = pasInit[uvit];
1147 case IntWalk_ArretSurPointPrecedent:
1149 bStop = Standard_True;
1150 bOutOfTangentZone = !myIntersectionOn2S.IsTangent();
1153 case IntWalk_PasTropGrand:
1155 for(parit = 0; parit < 4; parit++) {
1156 Param(parit+1) = SvParam[parit];
1158 Standard_Boolean bDecrease = Standard_False;
1160 for(uvit = 0; uvit < 4; uvit++) {
1161 if(pasSav[uvit] < pasInit[uvit]) {
1162 pasInit[uvit] -= (pasInit[uvit] - pasSav[uvit]) * 0.1;
1163 bDecrease = Standard_True;
1167 if(bDecrease) nbIterWithoutAppend--;
1170 case IntWalk_PointConfondu:
1172 for(uvit = 0; uvit < 4; uvit++) {
1173 if(pasuv[uvit] < pasInit[uvit]) {
1174 pasuv[uvit] += (pasInit[uvit] - pasuv[uvit]) * 0.1;
1180 case IntWalk_ArretSurPoint:
1183 bStop = TestArret(theDirectionFlag, Param, ChoixIso);
1188 Standard_Real u11,v11,u12,v12;
1189 myIntersectionOn2S.Point().Parameters(u11,v11,u12,v12);
1190 Standard_Real u21,v21,u22,v22;
1191 previousPoint.Parameters(u21,v21,u22,v22);
1193 if(((fabs(u11-u21) < ResoU1) && (fabs(v11-v21) < ResoV1)) ||
1194 ((fabs(u12-u22) < ResoU2) && (fabs(v12-v22) < ResoV2))) {
1203 bStop = bStop || !myIntersectionOn2S.IsTangent();
1204 bOutOfTangentZone = !myIntersectionOn2S.IsTangent();
1207 Standard_Boolean pointisvalid = Standard_False;
1208 Standard_Real u1,v1,u2,v2;
1209 myIntersectionOn2S.Point().Parameters(u1,v1,u2,v2);
1211 if(u1 <= UM1 && u2 <= UM2 && v1 <= VM1 &&
1212 v2 <= VM2 && u1 >= Um1 && u2 >= Um2 &&
1213 v1 >= Vm1 && v2 >= Vm2)
1214 pointisvalid = Standard_True;
1217 previousPoint = myIntersectionOn2S.Point();
1218 previoustg = myIntersectionOn2S.IsTangent();
1221 previousd = myIntersectionOn2S.Direction();
1222 previousd1 = myIntersectionOn2S.DirectionOnS1();
1223 previousd2 = myIntersectionOn2S.DirectionOnS2();
1225 Standard_Boolean bAddPoint = Standard_True;
1227 if(line->NbPoints() >= 1) {
1228 gp_Pnt pf = line->Value(1).Value();
1229 gp_Pnt pl = previousPoint.Value();
1231 if(pf.Distance(pl) < Precision::Confusion()) {
1233 if(dIncKey == 5000) return bOutOfTangentZone;
1234 else bAddPoint = Standard_False;
1239 aSeqOfNewPoint.Append(previousPoint);
1240 nbIterWithoutAppend = 0;
1244 if (line->NbPoints() == 2) {
1245 for(uvit = 0; uvit < 4; uvit++) {
1246 pasSav[uvit] = pasuv[uvit];
1250 if ( !pointisvalid ) {
1251 // decrease step if out of bounds
1252 // otherwise the same calculations will be
1253 // repeated several times
1254 if ( ( u1 > UM1 ) || ( u1 < Um1 ) )
1257 if ( ( v1 > VM1 ) || ( v1 < Vm1 ) )
1260 if ( ( u2 > UM2 ) || ( u2 < Um2 ) )
1263 if ( ( v2 > VM2 ) || ( v2 < Vm2 ) )
1268 if(close && (line->NbPoints() >= 1)) {
1270 if(!bOutOfTangentZone) {
1271 aSeqOfNewPoint.Append(line->Value(1)); // line end
1273 nbIterWithoutAppend = 0;
1276 ChoixIso = myIntersectionOn2S.Perform(Param, Rsnld, theChoixIso);
1278 if(myIntersectionOn2S.IsEmpty()) {
1279 bStop = !myIntersectionOn2S.IsTangent();
1280 bOutOfTangentZone = !myIntersectionOn2S.IsTangent();
1283 Standard_Boolean bAddPoint = Standard_True;
1284 Standard_Boolean pointisvalid = Standard_False;
1286 previousPoint = myIntersectionOn2S.Point();
1287 Standard_Real u1,v1,u2,v2;
1288 previousPoint.Parameters(u1,v1,u2,v2);
1290 if(u1 <= UM1 && u2 <= UM2 && v1 <= VM1 &&
1291 v2 <= VM2 && u1 >= Um1 && u2 >= Um2 &&
1292 v1 >= Vm1 && v2 >= Vm2)
1293 pointisvalid = Standard_True;
1297 if(line->NbPoints() >= 1) {
1298 gp_Pnt pf = line->Value(1).Value();
1299 gp_Pnt pl = previousPoint.Value();
1301 if(pf.Distance(pl) < Precision::Confusion()) {
1303 if(dIncKey == 5000) return bOutOfTangentZone;
1304 else bAddPoint = Standard_False;
1308 if(bAddPoint && !bOutOfTangentZone) {
1309 aSeqOfNewPoint.Append(previousPoint);
1310 nbIterWithoutAppend = 0;
1325 Standard_Boolean bExtendLine = Standard_False;
1326 Standard_Real u1 = 0., v1 = 0., u2 = 0., v2 = 0.;
1328 Standard_Integer pit = 0;
1330 for(pit = 0; !bExtendLine && (pit < 2); pit++) {
1332 previousPoint.Parameters(u1,v1,u2,v2);
1334 if(aSeqOfNewPoint.Length() > 0)
1335 aSeqOfNewPoint.Value(aSeqOfNewPoint.Length()).Parameters(u1,v1,u2,v2);
1340 if(((u1 - Um1) < ResoU1) ||
1341 ((UM1 - u1) < ResoU1) ||
1342 ((u2 - Um2) < ResoU2) ||
1343 ((UM2 - u2) < ResoU2) ||
1344 ((v1 - Vm1) < ResoV1) ||
1345 ((VM1 - v1) < ResoV1) ||
1346 ((v2 - Vm2) < ResoV2) ||
1347 ((VM2 - v2) < ResoV2))
1348 bExtendLine = Standard_True;
1352 // if(Status == IntWalk_OK || Status == IntWalk_ArretSurPoint) {
1353 if(Status == IntWalk_OK) {
1354 bExtendLine = Standard_True;
1356 if(aSeqOfNewPoint.Length() > 1) {
1357 TColStd_Array1OfReal FirstParams(0, 3), LastParams(0, 3), Resolutions(0, 3);
1358 Resolutions(0) = ResoU1; Resolutions(1) = ResoV1; Resolutions(2) = ResoU2; Resolutions(3) = ResoV2;
1360 aSeqOfNewPoint(1).Parameters(FirstParams.ChangeValue(0), FirstParams.ChangeValue(1),
1361 FirstParams.ChangeValue(2), FirstParams.ChangeValue(3));
1362 aSeqOfNewPoint(aSeqOfNewPoint.Length()).Parameters(LastParams.ChangeValue(0),
1363 LastParams.ChangeValue(1),
1364 LastParams.ChangeValue(2),
1365 LastParams.ChangeValue(3));
1366 Standard_Integer indexofiso = 0;
1368 if(theChoixIso == IntImp_UIsoparametricOnCaro1) indexofiso = 0;
1369 if(theChoixIso == IntImp_VIsoparametricOnCaro1) indexofiso = 1;
1370 if(theChoixIso == IntImp_UIsoparametricOnCaro2) indexofiso = 2;
1371 if(theChoixIso == IntImp_VIsoparametricOnCaro2) indexofiso = 3;
1373 Standard_Integer afirstindex = (indexofiso < 2) ? 0 : 2;
1374 gp_Vec2d aTangentZoneDir(gp_Pnt2d(FirstParams.Value(afirstindex), FirstParams.Value(afirstindex + 1)),
1375 gp_Pnt2d(LastParams.Value(afirstindex), LastParams.Value(afirstindex + 1)));
1377 gp_Dir2d anIsoDir(0, 1);
1379 if((indexofiso == 1) || (indexofiso == 3))
1380 anIsoDir = gp_Dir2d(1, 0);
1382 if(aTangentZoneDir.SquareMagnitude() > gp::Resolution()) {
1383 Standard_Real piquota = M_PI*0.25;
1385 if(fabs(aTangentZoneDir.Angle(anIsoDir)) > piquota) {
1386 Standard_Integer ii = 1, nextii = 2;
1388 Standard_Real asqresol = gp::Resolution();
1389 asqresol *= asqresol;
1392 aSeqOfNewPoint(ii).Parameters(FirstParams.ChangeValue(0), FirstParams.ChangeValue(1),
1393 FirstParams.ChangeValue(2), FirstParams.ChangeValue(3));
1394 aSeqOfNewPoint(ii + 1).Parameters(LastParams.ChangeValue(0), LastParams.ChangeValue(1),
1395 LastParams.ChangeValue(2), LastParams.ChangeValue(3));
1396 d1 = gp_Vec2d(gp_Pnt2d(FirstParams.Value(afirstindex),
1397 FirstParams.Value(afirstindex + 1)),
1398 gp_Pnt2d(LastParams.Value(afirstindex),
1399 LastParams.Value(afirstindex + 1)));
1402 while((d1.SquareMagnitude() < asqresol) &&
1403 (ii < aSeqOfNewPoint.Length()));
1407 while(nextii < aSeqOfNewPoint.Length()) {
1409 gp_Vec2d nextd1(0, 0);
1410 Standard_Integer jj = nextii;
1413 aSeqOfNewPoint(jj).Parameters(FirstParams.ChangeValue(0), FirstParams.ChangeValue(1),
1414 FirstParams.ChangeValue(2), FirstParams.ChangeValue(3));
1415 aSeqOfNewPoint(jj + 1).Parameters(LastParams.ChangeValue(0), LastParams.ChangeValue(1),
1416 LastParams.ChangeValue(2), LastParams.ChangeValue(3));
1417 nextd1 = gp_Vec2d(gp_Pnt2d(FirstParams.Value(afirstindex),
1418 FirstParams.Value(afirstindex + 1)),
1419 gp_Pnt2d(LastParams.Value(afirstindex),
1420 LastParams.Value(afirstindex + 1)));
1424 while((nextd1.SquareMagnitude() < asqresol) &&
1425 (jj < aSeqOfNewPoint.Length()));
1428 if(fabs(d1.Angle(nextd1)) > piquota) {
1429 bExtendLine = Standard_False;
1435 // end if(fabs(aTangentZoneDir.Angle(anIsoDir)
1442 return Standard_False;
1444 Standard_Integer i = 0;
1446 for(i = 1; i <= aSeqOfNewPoint.Length(); i++) {
1447 AddAPoint(line, aSeqOfNewPoint.Value(i));
1450 return bOutOfTangentZone;