80f181b114224c63bb8dbc23297730b19381d61f
[occt.git] / src / ChFi3d / ChFi3d_FilBuilder_C2.cxx
1 // Created on: 1994-03-29
2 // Created by: Isabelle GRIGNON
3 // Copyright (c) 1994-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16
17 #include <ChFi3d_FilBuilder.jxx>
18
19 #include <ChFi3d.hxx>
20 #include <ChFi3d_Builder_0.hxx>
21
22 #include <StdFail_NotDone.hxx>
23 #include <Standard_NotImplemented.hxx>
24 #include <Standard_ErrorHandler.hxx>
25
26 #include <math_Vector.hxx>
27 #include <TColgp_Array1OfPnt.hxx>
28 #include <TColgp_Array1OfPnt2d.hxx>
29 #include <TColStd_Array1OfReal.hxx>
30 #include <TColStd_Array1OfInteger.hxx>
31 #include <TColStd_ListOfInteger.hxx>
32 #include <gp_Pnt.hxx>
33 #include <gp_Pnt2d.hxx>
34 #include <gp_Dir.hxx>
35 #include <gp_Lin.hxx>
36 #include <gp_Pln.hxx>
37 #include <gp_Ax3.hxx>
38 #include <Geom_BSplineCurve.hxx>
39 #include <Geom2d_TrimmedCurve.hxx>
40 #include <Geom2d_BSplineCurve.hxx>
41 #include <Law_Linear.hxx>
42 #include <BRepBlend_CSCircular.hxx>
43 #include <BRepBlend_Line.hxx>
44 #include <Geom2dConvert.hxx>
45 #include <BSplCLib.hxx>
46
47 #include <Adaptor3d_CurveOnSurface.hxx>
48 #include <Adaptor3d_HCurveOnSurface.hxx>
49 #include <BRepLProp_CLProps.hxx>
50 #include <GeomAdaptor_Curve.hxx>
51 #include <GeomAdaptor_HCurve.hxx>
52 #include <Geom2dAdaptor_Curve.hxx>
53 #include <Geom2dAdaptor_HCurve.hxx>
54 #include <GeomAdaptor_Surface.hxx>
55 #include <GeomAdaptor_HSurface.hxx>
56 #include <BRep_Tool.hxx>
57 #include <BRepAdaptor_Curve2d.hxx>
58 #include <BRepAdaptor_Curve.hxx>
59 #include <BRepAdaptor_HCurve.hxx>
60 #include <BRepAdaptor_Surface.hxx>
61 #include <BRepAdaptor_HSurface.hxx>
62 #include <BRepTopAdaptor_TopolTool.hxx> 
63 #include <GeomFill_ConstrainedFilling.hxx>
64 #include <GeomFill_SimpleBound.hxx>
65
66 #include <IntSurf_LineOn2S.hxx>
67 #include <IntSurf_Transition.hxx>
68 #include <IntSurf_TypeTrans.hxx>
69 #include <IntCurveSurface_HInter.hxx>
70 #include <IntCurveSurface_IntersectionPoint.hxx>
71
72 #include <TopoDS.hxx>
73 #include <TopoDS_Vertex.hxx>
74 #include <TopoDS_Face.hxx>
75 #include <TopOpeBRepDS_DataStructure.hxx>
76 #include <TopOpeBRepDS_ListOfInterference.hxx>
77 #include <TopAbs.hxx>
78 #include <TopAbs_Orientation.hxx>
79 #include <TopExp.hxx>
80 #include <TopTools_ListIteratorOfListOfShape.hxx>
81 #include <TopOpeBRepDS_HDataStructure.hxx>
82 #include <ChFiDS_Regul.hxx>
83 #include <ChFiDS_State.hxx>
84 #include <ChFiDS_SequenceOfSurfData.hxx>
85 #include <ChFiDS_SurfData.hxx>
86 #include <ChFiDS_FaceInterference.hxx>
87 #include <ChFiDS_ListIteratorOfListOfStripe.hxx>
88 #include <ChFiDS_Stripe.hxx>
89 #include <ChFiDS_Spine.hxx>
90 #include <ChFiDS_FilSpine.hxx>
91 #include <ChFiDS_HData.hxx>
92 #include <ChFiDS_CommonPoint.hxx>
93
94 #include <ChFiKPart_ComputeData.hxx>
95
96 #ifdef DRAW
97 #include <DrawTrSurf.hxx>
98 #endif
99 #ifdef OCCT_DEBUG
100 #include <Geom_TrimmedCurve.hxx>
101 extern Standard_Boolean ChFi3d_GettraceDRAWSPINE();
102 extern Standard_Boolean ChFi3d_GetcontextFORCEFILLING();
103 #include <OSD_Chronometer.hxx>
104
105 extern Standard_Real  t_t2cornerinit ,t_perf2cornerbyinter,t_chfikpartcompdata,
106                      t_cheminement,t_remplissage,t_t2cornerDS;
107 extern void ChFi3d_InitChron(OSD_Chronometer& ch);
108 extern void ChFi3d_ResultChron(OSD_Chronometer & ch,Standard_Real& time);
109 #endif
110
111 //=======================================================================
112 //function : ToricRotule
113 //purpose  : Test if it is a particular case of torus routine.
114 //           Three planes with two constant incident fillets
115 //           of the same radius and the third face perpendicular to  
116 //           two others are required.
117 //=======================================================================
118
119 static Standard_Boolean ToricRotule(const BRepAdaptor_Surface& fac,
120                                     const BRepAdaptor_Surface& s1,
121                                     const BRepAdaptor_Surface& s2,
122                                     const Handle(ChFiDS_Stripe)& c1,
123                                     const Handle(ChFiDS_Stripe)& c2)
124
125 {
126   Standard_Real tolesp = 1.e-7;
127
128   Handle(ChFiDS_FilSpine) sp1=Handle(ChFiDS_FilSpine)::DownCast(c1->Spine()); 
129   Handle(ChFiDS_FilSpine) sp2=Handle(ChFiDS_FilSpine)::DownCast(c2->Spine()); 
130   if(sp1.IsNull() || sp2.IsNull()) return Standard_False;
131   if (!sp1->IsConstant() || !sp2->IsConstant()) 
132     return Standard_False;
133   if ((fac.GetType() != GeomAbs_Plane) ||
134       (s1.GetType() != GeomAbs_Plane) ||
135       (s2.GetType() != GeomAbs_Plane)) return Standard_False;
136   gp_Dir df = fac.Plane().Position().Direction();
137   gp_Dir ds1 = s1.Plane().Position().Direction();
138   gp_Dir ds2 = s2.Plane().Position().Direction();
139   if ( Abs(df.Dot(ds1)) >= tolesp || Abs(df.Dot(ds2)) >= tolesp ) 
140     return Standard_False;
141   Standard_Real r1 = sp1->Radius();
142   Standard_Real r2 = sp2->Radius();
143   if(Abs(r1 - r2) >= tolesp) return Standard_False;
144   return Standard_True;
145 }
146
147 static void RemoveSD(Handle(ChFiDS_Stripe)& Stripe,
148                       const Standard_Integer num1,
149                       const Standard_Integer num2 )
150 {
151   ChFiDS_SequenceOfSurfData& Seq = 
152     Stripe->ChangeSetOfSurfData()->ChangeSequence();
153   if(Seq.IsEmpty()) return;
154   if (num1==num2) 
155     Seq.Remove(num1);
156   else
157     Seq.Remove(num1,num2);
158 }
159
160
161 //=======================================================================
162 //function : PerformTwoCorner
163 //purpose  : 
164 //=======================================================================
165
166 void ChFi3d_FilBuilder::PerformTwoCorner(const Standard_Integer Index)
167 {
168 #ifdef OCCT_DEBUG
169   OSD_Chronometer ch;
170   ChFi3d_InitChron(ch); // init perf initialisation 
171 #endif 
172   
173   done = 0;
174   const TopoDS_Vertex& Vtx = myVDataMap.FindKey(Index);
175   TopOpeBRepDS_DataStructure& DStr = myDS->ChangeDS();
176   ChFiDS_ListIteratorOfListOfStripe It;
177   It.Initialize(myVDataMap(Index));
178   Handle(ChFiDS_Stripe)  st1,st2;
179   Standard_Integer Sens1,Sens2;
180   Standard_Integer Isd1,Isd2,i1,i2;
181   Handle(ChFiDS_SurfData) sd1,sd2;
182   ChFiDS_SequenceOfSurfData SeqFil1,SeqFil2;
183   Handle(Geom_Surface) surf1,surf2;
184   Standard_Boolean  OkinterCC,Okvisavis,SameSide;
185   Standard_Integer IFaCo1,IFaCo2;
186   Standard_Real UIntPC1,UIntPC2;
187   TopoDS_Face FaCo;
188   TopoDS_Edge E1,E2,E;
189   TopoDS_Vertex V1,V2;
190 //  gp_Pnt P1,P2;
191   Standard_Integer nbsurf1,nbsurf2,deb1,fin1,deb2,fin2;
192   Standard_Real parE1,parE2;
193   //Necessary information on fillets is extracted 
194   //------------------------------------------------------
195   
196   //the first
197   //----------
198  
199   st1 = It.Value(); 
200   Isd1 = ChFi3d_IndexOfSurfData(Vtx,st1,Sens1);
201   
202   
203   //the second
204   //----------
205   It.Next();
206   st2 = It.Value();
207   if(st2 == st1) {
208     Sens2 = -1;
209     Isd2 = st2->SetOfSurfData()->Length();
210   }
211   else{ Isd2 = ChFi3d_IndexOfSurfData(Vtx,st2,Sens2); }
212   
213   // If two edges to rounded are tangent GeomPlate is called
214
215   if (Sens1==1)  E1= st1->Spine()->Edges(1);
216   else E1= st1->Spine()->Edges( st1->Spine()->NbEdges());
217   
218   if (Sens2==1)  E2= st2->Spine()->Edges(1);
219   else E2= st2->Spine()->Edges( st2->Spine()->NbEdges());
220   
221   BRepAdaptor_Curve BCurv1(E1);
222   BRepAdaptor_Curve BCurv2(E2);
223   parE1=BRep_Tool::Parameter(Vtx,E1);
224   parE2=BRep_Tool::Parameter(Vtx,E2);
225   BRepLProp_CLProps CL1(BCurv1,parE1 , 1, 1.e-4);
226   BRepLProp_CLProps CL2(BCurv2,parE2 , 1, 1.e-4);
227   gp_Dir dir1,dir2 ;
228   CL1.Tangent(dir1);
229   CL2.Tangent(dir2);
230   if (Sens1==-1)  dir1.Reverse();
231   if (Sens2==-1)  dir2.Reverse();
232   Standard_Real ang1;
233   ang1=Abs(dir1.Angle(dir2));
234   if (ang1<M_PI/180.) {
235     PerformMoreThreeCorner(Index,2);
236     done=1;
237     return;
238   }
239
240   OkinterCC = ChFi3d_IsInFront(DStr,st1,st2,Isd1,Isd2,Sens1,Sens2,
241                                UIntPC1,UIntPC2,FaCo,SameSide,
242                                IFaCo1,IFaCo2,Okvisavis,Vtx,Standard_True);
243
244   Standard_Boolean trouve=Standard_False;  
245   if (!Okvisavis) {
246
247   
248 // one is not limited to the first or the last surfdata 
249 // to find the opposing data
250     nbsurf1=st1->SetOfSurfData()->Length();
251     nbsurf2=st2->SetOfSurfData()->Length();
252     deb1=1; 
253     deb2=1;
254     fin1=1;
255     fin2=1;
256     if (nbsurf1!=1) {
257       if (Sens1==1) {
258         deb1=1;
259         fin1=2;
260       }
261       else  {
262         deb1=nbsurf1-1;
263         fin1=nbsurf1;
264       }
265     }
266     if (nbsurf2!=1) {
267       if (Sens2==1 ) {
268         deb2=1;
269         fin2=2;
270       }
271       else {
272         deb2=nbsurf2-1;
273         fin2=nbsurf2;
274       }
275     }
276   
277     for (i1=deb1;i1<=fin1 &&!trouve;i1++) {
278       Isd1=i1;
279       for (i2=deb2;i2<=fin2 &&!trouve;i2++) {
280         Isd2=i2;
281  
282         OkinterCC = ChFi3d_IsInFront(DStr,st1,st2,Isd1,Isd2,Sens1,Sens2,
283                                UIntPC1,UIntPC2,FaCo,SameSide,
284                                IFaCo1,IFaCo2,Okvisavis,Vtx,Standard_True);
285         trouve=Okvisavis;
286       }
287     } 
288     if (!trouve){
289       PerformMoreThreeCorner(Index,2);
290       done=1;
291       return;
292     }
293     else {
294       if (Sens1==1 && Isd1!=1) RemoveSD(st1,1,1);
295       if (Sens1!=1 && Isd1!=nbsurf1) RemoveSD(st1,fin1,fin1);
296       if (Sens2==1 && Isd2!=1) RemoveSD(st2,1,1);
297       if (Sens2!=1 && Isd2!=nbsurf2) RemoveSD(st2,fin2,fin2);
298
299     }
300     Isd1=ChFi3d_IndexOfSurfData(Vtx,st1,Sens1);
301     Isd2=ChFi3d_IndexOfSurfData(Vtx,st2,Sens2);
302   }
303    // StdFail_NotDone::Raise("TwoCorner : no common face");
304   Standard_Integer IFaArc1 = 3-IFaCo1, IFaArc2 = 3-IFaCo2;
305   SeqFil1 = st1->ChangeSetOfSurfData()->ChangeSequence();
306   SeqFil2 = st2->ChangeSetOfSurfData()->ChangeSequence();
307   sd1 = SeqFil1.ChangeValue(Isd1);
308   surf1 = DStr.Surface(sd1->Surf()).Surface();
309   sd2 = SeqFil2.ChangeValue(Isd2);
310   surf2 = DStr.Surface(sd2->Surf()).Surface();
311   TopAbs_Orientation OFaCo = FaCo.Orientation(); 
312   // The concavities are analyzed and the opposite face and the
313   // eventual intersection of 2 pcurves on this face are found.
314   
315   ChFiDS_State Stat1,Stat2;
316   Standard_Boolean isfirst1 = (Sens1 == 1);
317   Standard_Boolean isfirst2 = (Sens2 == 1);
318   Stat1 = st1->Spine()->Status(isfirst1);
319   Stat2 = st2->Spine()->Status(isfirst2);
320   Standard_Boolean c1biseau = (Stat1 == ChFiDS_AllSame); 
321   Standard_Boolean c1rotule = (Stat1 == ChFiDS_OnSame && Stat2 == ChFiDS_OnSame);
322   
323   // It is checked if the fillets have a commonpoint on a common arc. 
324   // This edge is the pivot of the bevel or the knee.
325   
326   ChFiDS_CommonPoint& CP1 = sd1->ChangeVertex(isfirst1,IFaArc1);
327   ChFiDS_CommonPoint& CP2 = sd2->ChangeVertex(isfirst2,IFaArc2);
328   
329   Standard_Boolean resetcp1 = 0;
330   Standard_Boolean resetcp2 = 0;
331   
332   TopoDS_Edge pivot;
333   Standard_Boolean yapiv = Standard_False;
334   if(CP1.IsOnArc()) pivot = CP1.Arc();
335   else {
336     PerformMoreThreeCorner(Index,2);
337     done=1;
338     return;
339   }
340   if(CP1.IsOnArc()&& CP2.IsOnArc()){
341     yapiv = (pivot.IsSame(CP2.Arc()));
342   }
343   Handle(BRepAdaptor_HCurve) Hpivot;
344   Standard_Boolean sameparam = Standard_False;
345   Standard_Real parCP1 = 0., parCP2 = 0.;
346   if(yapiv) {
347     Hpivot = new BRepAdaptor_HCurve(pivot);
348     parCP1 = CP1.ParameterOnArc();
349     parCP2 = CP2.ParameterOnArc();
350     gp_Pnt tst1 = Hpivot->Value(parCP1);
351     gp_Pnt tst2 = Hpivot->Value(parCP2);
352     sameparam = tst1.Distance(tst2) <= tolesp;
353   }
354   Handle(BRepAdaptor_HSurface) HFaCo = new BRepAdaptor_HSurface();
355   Handle(BRepAdaptor_HSurface) HFaPiv;
356   Handle(BRepAdaptor_HSurface) HBRS1 = new BRepAdaptor_HSurface();
357   Handle(BRepAdaptor_HSurface) HBRS2 = new BRepAdaptor_HSurface();
358   
359   BRepAdaptor_Surface& BRS1 = HBRS1->ChangeSurface();
360   BRepAdaptor_Surface& BRS2 = HBRS2->ChangeSurface();
361   BRepAdaptor_Surface& BRFaCo = HFaCo->ChangeSurface();
362   BRFaCo.Initialize(FaCo);
363   
364   TopoDS_Face FF1,FF2,F,FaPiv;
365   TopAbs_Orientation pctrans = TopAbs_FORWARD ;
366   Handle(Geom2d_BSplineCurve) PCurveOnPiv;
367   FF1 = TopoDS::Face(DStr.Shape(sd1->Index(IFaArc1)));
368   FF2 = TopoDS::Face(DStr.Shape(sd2->Index(IFaArc2)));
369   if (FF1.IsNull()||FF2.IsNull()) 
370   {PerformMoreThreeCorner(Index,2);
371    done=1;
372    return;
373   }
374   BRS1.Initialize(FF1);
375   BRS2.Initialize(FF2);
376   
377   if(yapiv ) {
378     TopTools_ListIteratorOfListOfShape Kt;
379     Standard_Boolean ok1 = Standard_False, ok2 = Standard_False;
380     for (Kt.Initialize(myEFMap(pivot)); Kt.More(); Kt.Next()){
381       F = TopoDS::Face(Kt.Value());
382       if(!ok1 && FF1.IsSame(F)){
383         ok1 = Standard_True;
384       }
385       if(!ok2 && FF2.IsSame(F)){
386         ok2 = Standard_True;
387       }
388     }
389     if(!ok1 || !ok2){
390       PerformMoreThreeCorner(Index,2);
391       done=1;
392       return;
393     }
394   }
395   
396 #ifdef OCCT_DEBUG
397   ChFi3d_ResultChron(ch ,t_t2cornerinit);//result perf initialisation 
398 #endif 
399   
400   //bevel
401   //------
402   ChFiDS_CommonPoint cp11,cp12,cp21,cp22;
403   ChFiDS_FaceInterference intf11,intf12,intf21,intf22;
404
405   if(c1biseau){
406 #ifdef OCCT_DEBUG
407     ChFi3d_InitChron(ch); // init perf PerformTwoCornerbyInter
408 #endif 
409     
410     done = PerformTwoCornerbyInter(Index);
411     
412 #ifdef OCCT_DEBUG
413     ChFi3d_ResultChron(ch , t_perf2cornerbyinter); // result perf  PerformTwoCornerbyInter
414 #endif 
415    
416     if (!done){
417       PerformMoreThreeCorner(Index,2);
418       done=1;
419       return;
420     }
421   } 
422   else if(c1rotule){//save.
423     cp11 = sd1->Vertex(isfirst1,1);
424     cp12 = sd1->Vertex(isfirst1,2);
425     cp21 = sd2->Vertex(isfirst2,1);
426     cp22 = sd2->Vertex(isfirst2,2);
427     intf11 = sd1->InterferenceOnS1();
428     intf12 = sd1->InterferenceOnS2();
429     intf21 = sd2->InterferenceOnS1();
430     intf22 = sd2->InterferenceOnS2();
431 #ifdef OCCT_DEBUG
432     ChFi3d_InitChron(ch); // init perf PerformTwoCornerbyInter
433 #endif 
434       
435     done = PerformTwoCornerbyInter(Index);
436       
437 #ifdef OCCT_DEBUG
438       ChFi3d_ResultChron(ch , t_perf2cornerbyinter); // result perf  PerformTwoCornerbyInter
439 #endif 
440     if (!done) {
441       // restore
442       sd1->ChangeVertex(isfirst1,1) = cp11;
443       sd1->ChangeVertex(isfirst1,2) = cp12;
444       sd2->ChangeVertex(isfirst2,1) = cp21;
445       sd2->ChangeVertex(isfirst2,2) = cp22;
446       sd1->ChangeInterferenceOnS1() = intf11;
447       sd1->ChangeInterferenceOnS2() = intf12;
448       sd2->ChangeInterferenceOnS1() = intf21;
449       sd2->ChangeInterferenceOnS2() = intf22;
450       done = 0;
451     }
452   }
453   
454   if(!c1biseau && !done){
455     //new cornerdata is created
456     //-------------------------------
457     Handle(ChFiDS_Stripe) corner = new ChFiDS_Stripe();
458     Handle(ChFiDS_HData)& cornerset = corner->ChangeSetOfSurfData();
459     cornerset = new ChFiDS_HData();
460     Handle(ChFiDS_SurfData) coin = new ChFiDS_SurfData();
461     cornerset->Append(coin);
462     
463     if (SameSide) {
464       if(ToricRotule(BRFaCo,BRS1,BRS2,st1,st2)){
465         // Direct construction.
466         // ---------------------
467         
468         Standard_Integer bid;
469         TopAbs_Orientation ori = OFaCo;
470         TopAbs_Orientation oriS = st1->Orientation(IFaCo1);
471         TopAbs_Orientation OFF1 = FF1.Orientation(); 
472         TopAbs_Orientation oriSFF1 = st1->Orientation(IFaArc1);
473         bid = 1;
474         bid = ChFi3d::NextSide(ori,OFF1,oriS,oriSFF1,bid);
475         TopAbs_Orientation op1 = TopAbs_FORWARD,op2 = TopAbs_FORWARD;
476         if(yapiv) bid = ChFi3d::ConcaveSide(BRS1,BRS2,pivot,op1,op2);
477         op1 = TopAbs::Reverse(op1);
478         op2 = TopAbs::Reverse(op2);
479 #ifdef OCCT_DEBUG
480         ChFi3d_InitChron(ch);// init perf ChFiKPart_ComputeData 
481 #endif 
482         Standard_Real radius = 
483           Handle(ChFiDS_FilSpine)::DownCast(st1->Spine())->Radius();
484         done = ChFiKPart_ComputeData::ComputeCorner(DStr,coin,HFaCo,HBRS1,HBRS2,
485                                                     OFaCo,ori,op1,op2,radius);
486 #ifdef OCCT_DEBUG
487         ChFi3d_ResultChron(ch , t_chfikpartcompdata);//result perf ChFiKPart_ComputeData 
488 #endif 
489       }
490       else {
491         // Construction by filling remplissage
492         // ----------------------------
493         Standard_Real  uPCArc1,  uPCArc2;
494         gp_Pnt2d p2da1,p2df1,p2da2,p2df2,p2dfac1,p2dfac2;
495         gp_Vec2d v2dfac1,v2dfac2;
496         Handle(GeomFill_Boundary) B1,B2,Bpiv,Bfac;
497         uPCArc1 = sd1->Interference(IFaArc1).Parameter(isfirst1);
498         p2da1 = sd1->Interference(IFaArc1).PCurveOnSurf()->Value(uPCArc1);
499         p2df1 = sd1->Interference(IFaCo1).PCurveOnSurf()->Value(uPCArc1);
500         sd1->Interference(IFaCo1).PCurveOnFace()->D1(uPCArc1,p2dfac1,v2dfac1);
501         uPCArc2 = sd2->Interference(IFaArc2).Parameter(isfirst2);
502         p2da2 = sd2->Interference(IFaArc2).PCurveOnSurf()->Value(uPCArc2);
503         p2df2 = sd2->Interference(IFaCo2).PCurveOnSurf()->Value(uPCArc2);
504         sd2->Interference(IFaCo2).PCurveOnFace()->D1(uPCArc2,p2dfac2,v2dfac2);
505 #ifdef OCCT_DEBUG
506         ChFi3d_InitChron(ch ); // init perf filling
507 #endif 
508         B1 = ChFi3d_mkbound(surf1,p2df1,p2da1,tolesp,2.e-4);
509         B2 = ChFi3d_mkbound(surf2,p2df2,p2da2,tolesp,2.e-4);
510         Handle(Geom2d_Curve) PCurveOnFace;
511         Bfac = ChFi3d_mkbound(HFaCo,PCurveOnFace,Sens1,p2dfac1,v2dfac1,
512                               Sens2,p2dfac2,v2dfac2,tolesp,2.e-4);
513         GeomFill_ConstrainedFilling fil(8,20);
514         if(sameparam) {
515           fil.Init(Bfac,B2,B1,1);
516         }
517         else {
518           Handle(Adaptor3d_HCurve) HPivTrim = Hpivot->ChangeCurve().
519             Trim(Min(parCP1,parCP2),Max(parCP1,parCP2),tolesp);
520           Bpiv = new GeomFill_SimpleBound(HPivTrim,tolesp,2.e-4);
521           fil.Init(Bfac,B2,Bpiv,B1,1);
522           BRepAdaptor_Curve2d pcpivot;
523           gp_Vec dArc,dcf;
524           gp_Pnt bidon;
525           Hpivot->D1(parCP1,bidon,dArc);
526           Standard_Real fb1,lb1;
527           B1->Bounds(fb1,lb1);
528           B1->D1(lb1,bidon,dcf);
529           Standard_Boolean pivotverslebas = dArc.Dot(dcf) <= 0.; 
530           Standard_Boolean pcfalenvers = (parCP1 > parCP2);
531           if((pivotverslebas && !pcfalenvers)||
532              (!pivotverslebas && pcfalenvers)) {
533             FaPiv = FF2;
534             HFaPiv = HBRS2;
535             resetcp2 = 1;
536           }
537           else {
538             FaPiv = FF1;
539             HFaPiv = HBRS1;
540             resetcp1 = 1;
541           }
542           FaPiv.Orientation(TopAbs_FORWARD);
543           pcpivot.Initialize(pivot,FaPiv);
544           TopExp_Explorer Expl;
545           for(Expl.Init(FaPiv,TopAbs_EDGE); Expl.More(); Expl.Next()){
546             if(Expl.Current().IsSame(pivot)) {
547               pctrans = Expl.Current().Orientation();
548               break;
549             }
550           }
551           if(pcpivot.GetType() != GeomAbs_BSplineCurve){
552             Handle(Geom2d_TrimmedCurve) 
553               trc = new Geom2d_TrimmedCurve(pcpivot.Curve(),
554                                             Min(parCP1,parCP2),
555                                             Max(parCP1,parCP2));
556             PCurveOnPiv = Geom2dConvert::CurveToBSplineCurve(trc);
557           }
558           else {
559             PCurveOnPiv = Geom2dConvert::SplitBSplineCurve
560               (Handle(Geom2d_BSplineCurve)::DownCast(pcpivot.Curve()),
561                Min(parCP1,parCP2),Max(parCP1,parCP2),tol2d);
562           }
563           TColStd_Array1OfReal kk(1,PCurveOnPiv->NbKnots());
564           PCurveOnPiv->Knots(kk);
565           BSplCLib::Reparametrize(0.,1.,kk);
566           PCurveOnPiv->SetKnots(kk);
567           if(pcfalenvers) {
568             PCurveOnPiv->Reverse();
569             pctrans = TopAbs::Reverse(pctrans);
570           }
571         }
572         Handle(Geom_Surface) Surfcoin = fil.Surface();
573         done = CompleteData(coin,Surfcoin,
574                             HFaCo,PCurveOnFace,
575                             HFaPiv,PCurveOnPiv,OFaCo,1,
576                             0,0,0,0);
577 #ifdef OCCT_DEBUG
578         ChFi3d_ResultChron(ch , t_remplissage);// result perf filling 
579 #endif 
580       }
581 #ifdef OCCT_DEBUG
582       ChFi3d_InitChron(ch); // init perf update DS
583 #endif 
584       if (done){
585         // Update 3 CornerData and the DS
586         // ----------------------------------------
587         if(resetcp1){
588           gp_Pnt pjyl = CP1.Point();
589           Standard_Real tolsav = CP1.Tolerance();
590           CP1.Reset();
591           CP1.SetPoint(pjyl);
592           CP1.SetTolerance(tolsav);
593         }
594         else if(resetcp2){
595           gp_Pnt pjyl = CP2.Point();
596           Standard_Real tolsav = CP2.Tolerance();
597           CP2.Reset();
598           CP2.SetPoint(pjyl);
599           CP2.SetTolerance(tolsav);
600         }
601         Standard_Real P1deb,P2deb,P1fin,P2fin;
602         Standard_Integer If1,If2,Il1,Il2,Icf,Icl;
603         const ChFiDS_CommonPoint& Pf1 = coin->VertexFirstOnS1();
604         ChFiDS_CommonPoint& Pf2 = coin->ChangeVertexFirstOnS2();
605         const ChFiDS_CommonPoint& Pl1 = coin->VertexLastOnS1();
606         ChFiDS_CommonPoint& Pl2 = coin->ChangeVertexLastOnS2();
607         Pf2 = CP1;
608         Pl2 = CP2;
609         
610         // the corner to start,
611         // -----------------------
612         ChFiDS_Regul regdeb, regfin;
613         If1 = ChFi3d_IndexPointInDS(Pf1,DStr);
614         If2 = ChFi3d_IndexPointInDS(Pf2,DStr);
615         Il1 = ChFi3d_IndexPointInDS(Pl1,DStr);
616         if(sameparam) Il2 = If2;
617         else Il2 = ChFi3d_IndexPointInDS(Pl2,DStr);
618         
619         gp_Pnt2d pp1,pp2;
620         pp1 = coin->InterferenceOnS1().PCurveOnSurf()->
621           Value(coin->InterferenceOnS1().FirstParameter());
622         pp2 = coin->InterferenceOnS2().PCurveOnSurf()->
623           Value(coin->InterferenceOnS2().FirstParameter());
624         Handle(Geom_Curve) C3d;
625         Standard_Real tolreached;
626         ChFi3d_ComputeArete(Pf1,pp1,Pf2,pp2,
627                             DStr.Surface(coin->Surf()).Surface(),C3d,
628                             corner->ChangeFirstPCurve(),P1deb,P2deb,
629                             tolesp,tol2d,tolreached,0);
630         Standard_Real par1 = sd1->Interference(IFaArc1).Parameter(isfirst1);
631         pp1 = sd1->Interference(IFaCo1).PCurveOnSurf()->Value(par1);
632         pp2 = sd1->Interference(IFaArc1).PCurveOnSurf()->Value(par1);
633         Standard_Real tolr1;
634         ChFi3d_ComputePCurv(C3d,pp1,pp2,st1->ChangePCurve(isfirst1),
635                             DStr.Surface(sd1->Surf()).Surface(),
636                             P1deb,P2deb,tolesp,tolr1);
637         tolreached = Max(tolreached,tolr1);
638         TopOpeBRepDS_Curve Tcurv1(C3d,tolreached);
639         Icf = DStr.AddCurve(Tcurv1);
640         regdeb.SetCurve(Icf);
641         regdeb.SetS1(coin->Surf(),0);
642         regdeb.SetS2(sd1->Surf(),0);
643         myRegul.Append(regdeb);
644         corner->ChangeFirstCurve(Icf);
645         corner->ChangeFirstParameters(P1deb,P2deb);
646         corner->ChangeIndexFirstPointOnS1(If1);
647         corner->ChangeIndexFirstPointOnS2(If2);
648       
649         pp1 = coin->InterferenceOnS1().PCurveOnSurf()->
650           Value(coin->InterferenceOnS1().LastParameter());
651         pp2 = coin->InterferenceOnS2().PCurveOnSurf()->
652           Value(coin->InterferenceOnS2().LastParameter());
653         ChFi3d_ComputeArete(Pl1,pp1,Pl2,pp2,
654                             DStr.Surface(coin->Surf()).Surface(),C3d,
655                             corner->ChangeLastPCurve(),P1fin,P2fin,
656                             tolesp,tol2d,tolreached,0);
657         Standard_Real par2 = sd2->Interference(IFaArc2).Parameter(isfirst2);
658         pp1 = sd2->Interference(IFaCo2).PCurveOnSurf()->Value(par2);
659         pp2 = sd2->Interference(IFaArc2).PCurveOnSurf()->Value(par2);
660         Standard_Real tolr2;
661         ChFi3d_ComputePCurv(C3d,pp1,pp2,st2->ChangePCurve(isfirst2),
662                             DStr.Surface(sd2->Surf()).Surface(),
663                             P1deb,P2deb,tolesp,tolr2);
664         tolreached = Max(tolreached,tolr2);
665         TopOpeBRepDS_Curve Tcurv2(C3d,tolreached);
666         Icl = DStr.AddCurve(Tcurv2);
667         regfin.SetCurve(Icl);
668         regfin.SetS1(coin->Surf(),0);
669         regfin.SetS2(sd2->Surf(),0);
670         myRegul.Append(regfin);
671         corner->ChangeLastCurve(Icl);
672         corner->ChangeLastParameters(P1fin,P2fin);
673         corner->ChangeIndexLastPointOnS1(Il1);
674         corner->ChangeIndexLastPointOnS2(Il2);
675         
676         coin->ChangeIndexOfS1(DStr.AddShape(FaCo));
677         if(sameparam) coin->ChangeIndexOfS2(0);
678         else {
679           coin->ChangeIndexOfS2(DStr.AddShape(FaPiv));
680           coin->ChangeInterferenceOnS2().SetTransition(pctrans);
681         }
682         corner->SetSolidIndex(st1->SolidIndex());
683         
684         // then the starting Stripe,
685         // ------------------------
686         st1->SetCurve(Icf,isfirst1);
687         st1->SetIndexPoint(If1,isfirst1,IFaCo1);
688         st1->SetIndexPoint(If2,isfirst1,IFaArc1);
689         st1->SetParameters(isfirst1,P1deb,P2deb);
690         sd1->ChangeVertex(isfirst1,IFaCo1) = Pf1;
691         sd1->ChangeVertex(isfirst1,IFaArc1) = Pf2;
692         sd1->ChangeInterference(IFaCo1).SetParameter(par1,isfirst1);
693         if (IFaCo1 == 2) st1->SetOrientation(TopAbs_REVERSED,isfirst1);
694         
695         // then the end Stripe,
696         // -------------------------
697         st2->SetCurve(Icl,isfirst2);
698         st2->SetIndexPoint(Il1,isfirst2,IFaCo2);
699         st2->SetIndexPoint(Il2,isfirst2,IFaArc2);
700         st2->SetParameters(isfirst2,P1fin,P2fin);
701         sd2->ChangeVertex(isfirst2,IFaCo2) = Pl1;
702         sd2->ChangeVertex(isfirst2,IFaArc2) = Pl2;
703         sd2->ChangeInterference(IFaCo2).SetParameter(par2,isfirst2);
704         if (IFaCo2 == 2) st2->SetOrientation(TopAbs_REVERSED,isfirst2);
705       }
706 #ifdef OCCT_DEBUG
707       ChFi3d_ResultChron(ch , t_t2cornerDS);// result perf update DS 
708 #endif 
709     }
710     else {
711       //it is necessary to make difference with
712       if(!OkinterCC) {
713         Standard_Failure::Raise("TwoCorner : No intersection pc pc");
714       }
715       Handle(ChFiDS_Stripe) stsam, stdif;
716       Handle(ChFiDS_SurfData) sdsam, sddif;
717       Standard_Real uintpcsam = 0., uintpcdif = 0.;
718       Standard_Integer ifacosam = 0, ifacodif = 0, ifaopsam = 0, ifaopdif = 0;
719       Standard_Boolean isfirstsam = Standard_False, isfirstdif = Standard_False;
720       if(Stat1 == ChFiDS_OnSame && Stat2 == ChFiDS_OnDiff){
721         stsam = st1; sdsam = sd1; uintpcsam = UIntPC1; 
722         ifacosam = IFaCo1; ifaopsam = IFaArc1; isfirstsam = isfirst1;
723         stdif = st2; sddif = sd2; uintpcdif = UIntPC2; 
724         ifacodif = IFaCo2; ifaopdif = IFaArc2; isfirstdif = isfirst2;
725       }
726       else if(Stat1 == ChFiDS_OnDiff && Stat2 == ChFiDS_OnSame){
727         stsam = st2; sdsam = sd2; uintpcsam = UIntPC2; 
728         ifacosam = IFaCo2; ifaopsam = IFaArc2; isfirstsam = isfirst2;
729         stdif = st1; sddif = sd1; uintpcdif = UIntPC1; 
730         ifacodif = IFaCo1; ifaopdif = IFaArc1; isfirstdif = isfirst1;
731       }
732       else {
733         Standard_Failure::Raise("TwoCorner : Config unknown");
734       }
735       //It is checked if surface ondiff has a point on arc from the side opposed
736       //to the common face and if this arc is connected to the base face  
737       //opposed to common face of the surface onsame.
738       ChFiDS_CommonPoint& cpopdif = sddif->ChangeVertex(isfirstdif,ifaopdif);
739       if(!cpopdif.IsOnArc()) {
740         Standard_Failure::Raise
741           ("TwoCorner : No point on restriction on surface OnDiff");
742       }
743       const TopoDS_Edge& Arcopdif = cpopdif.Arc();
744       const TopoDS_Face& Fopsam = TopoDS::Face(DStr.Shape(sdsam->Index(ifaopsam)));
745       TopExp_Explorer ex;
746       for(ex.Init(Fopsam,TopAbs_EDGE); ex.More(); ex.Next()){
747         if(ex.Current().IsSame(Arcopdif)) {
748           break;
749         }
750         else if(!ex.More()) {
751           Standard_Failure::Raise
752             ("TwoCorner : No common face to loop the contour");
753         }
754       }
755 #ifdef OCCT_DEBUG
756       ChFi3d_InitChron(ch ); // init perf filling 
757 #endif 
758       Handle(GeomFill_Boundary) Bsam,Bdif,Bfac;
759       gp_Pnt2d ppopsam = 
760         sdsam->Interference(ifaopsam).PCurveOnSurf()->Value(uintpcsam);
761       gp_Pnt2d ppcosam = 
762         sdsam->Interference(ifacosam).PCurveOnSurf()->Value(uintpcsam);
763       Handle(Geom_Surface) surfsam = DStr.Surface(sdsam->Surf()).Surface();
764       Handle(GeomAdaptor_HSurface) Hsurfsam = new GeomAdaptor_HSurface(surfsam);
765       Handle(Geom2d_Curve) pcsurfsam;
766       Bsam = ChFi3d_mkbound(Hsurfsam,pcsurfsam,ppopsam,ppcosam,tolesp,2.e-4);
767       Standard_Real upcopdif = sddif->Interference(ifaopdif).Parameter(isfirstdif);
768       gp_Pnt2d ppopdif = 
769         sddif->Interference(ifaopdif).PCurveOnSurf()->Value(upcopdif);
770       gp_Pnt2d ppcodif = 
771         sddif->Interference(ifacodif).PCurveOnSurf()->Value(uintpcdif);
772       Handle(Geom_Surface) surfdif = DStr.Surface(sddif->Surf()).Surface();
773       Handle(GeomAdaptor_HSurface) Hsurfdif = new GeomAdaptor_HSurface(surfdif);
774       Handle(Geom2d_Curve) pcsurfdif;
775       Bdif = ChFi3d_mkbound(Hsurfdif,pcsurfdif,ppcodif,ppopdif,tolesp,2.e-4);
776       gp_Pnt2d ppfacsam,ppfacdif;
777       gp_Pnt PPfacsam,PPfacdif;
778       gp_Vec VVfacsam,VVfacdif;
779       sdsam->Interference(ifaopsam).PCurveOnFace()->D0(uintpcsam,ppfacsam);
780       const Handle(Geom_Curve)& curvopsam = 
781         DStr.Curve(sdsam->Interference(ifaopsam).LineIndex()).Curve();
782       curvopsam->D1(uintpcsam,PPfacsam,VVfacsam);
783       BRepAdaptor_Curve2d PCArcFac(Arcopdif,Fopsam);
784       PCArcFac.D0(cpopdif.ParameterOnArc(),ppfacdif);
785       BRepAdaptor_Curve CArcFac(Arcopdif);
786       CArcFac.D1(cpopdif.ParameterOnArc(),PPfacdif,VVfacdif);
787       Handle(BRepAdaptor_HSurface) HBRFopsam = new BRepAdaptor_HSurface();
788       BRepAdaptor_Surface& BRFopsam = HBRFopsam->ChangeSurface();
789       BRFopsam.Initialize(Fopsam,Standard_False);
790       Handle(Geom2d_Curve) pcFopsam = ChFi3d_BuildPCurve(HBRFopsam,
791                                                          ppfacsam,VVfacsam,
792                                                          ppfacdif,VVfacdif,1);
793       Bfac = ChFi3d_mkbound(HBRFopsam,pcFopsam,tolesp,2.e-4);
794       GeomFill_ConstrainedFilling fil(8,20);
795       fil.Init(Bsam,Bdif,Bfac,1);
796 #if 0
797       for(Standard_Integer ib = 0; ib < 4; ib++){
798         if(ib == 2) continue;
799         fil.CheckCoonsAlgPatch(ib);
800         fil.CheckTgteField(ib);
801         fil.CheckApprox(ib);
802         fil.CheckResult(ib);
803       }
804 #endif
805       Handle(Geom_Surface) Surfcoin = fil.Surface();
806       TopAbs_Orientation Osurfsam = sdsam->Orientation();
807       Handle(Geom2d_Curve) pcnul;
808       done = CompleteData(coin,Surfcoin,
809                           Hsurfsam,pcsurfsam,
810                           HBRFopsam,pcnul,Osurfsam,1,
811                           0,0,0,0);
812 #ifdef OCCT_DEBUG
813       ChFi3d_ResultChron(ch , t_remplissage);// result perf filling 
814 #endif 
815       if(!done) Standard_Failure::Raise("concavites inverted : fail");
816 #ifdef OCCT_DEBUG
817       ChFi3d_InitChron(ch); // init perf update DS
818 #endif 
819       // Update 3 CornerData and the DS
820       // ----------------------------------------
821       // the corner to start,
822       // -----------------------
823       Standard_Real P1deb,P2deb,P1fin,P2fin;
824       Standard_Integer If1,If2,Il1,Il2,Icf,Icl;
825       const ChFiDS_CommonPoint& Pf1 = coin->VertexFirstOnS1();
826       ChFiDS_CommonPoint& Pf2 = coin->ChangeVertexFirstOnS2();
827       const ChFiDS_CommonPoint& Pl1 = coin->VertexLastOnS1();
828       ChFiDS_CommonPoint& Pl2 = coin->ChangeVertexLastOnS2();
829       Pf2 = Pl2 = cpopdif;
830         
831       ChFiDS_Regul regdeb, regfin;
832       If1 = ChFi3d_IndexPointInDS(Pf1,DStr);
833       If2 = ChFi3d_IndexPointInDS(Pf2,DStr);
834       Il1 = ChFi3d_IndexPointInDS(Pl1,DStr);
835       Il2 = If2;
836         
837       gp_Pnt2d pp1,pp2;
838       pp1 = coin->InterferenceOnS1().PCurveOnSurf()->
839         Value(coin->InterferenceOnS1().FirstParameter());
840       pp2 = coin->InterferenceOnS2().PCurveOnSurf()->
841         Value(coin->InterferenceOnS2().FirstParameter());
842       Handle(Geom_Curve) C3d;
843       Standard_Real tolreached;
844       ChFi3d_ComputeArete(Pf1,pp1,Pf2,pp2,
845                           DStr.Surface(coin->Surf()).Surface(),C3d,
846                           corner->ChangeFirstPCurve(),P1deb,P2deb,
847                           tolesp,tol2d,tolreached,0);
848       Standard_Real tolr1;
849       Handle(GeomAdaptor_HCurve) HC3d = new GeomAdaptor_HCurve(C3d);
850       ChFi3d_SameParameter(HC3d,pcFopsam,HBRFopsam,tolesp,tolr1);
851       tolreached = Max(tolreached,tolr1);
852       TopOpeBRepDS_Curve Tcurv1(C3d,tolreached);
853       Icf = DStr.AddCurve(Tcurv1);
854       // place the pcurve on face in the DS
855       TopAbs_Orientation OpcFopsam = sdsam->Interference(ifaopsam).Transition();
856       Standard_Integer IFopsam = sdsam->Index(ifaopsam);
857       if(isfirstsam) OpcFopsam = TopAbs::Reverse(OpcFopsam);
858       Handle(TopOpeBRepDS_SurfaceCurveInterference) 
859         interf = ChFi3d_FilCurveInDS(Icf,IFopsam,pcFopsam,OpcFopsam);
860       DStr.ChangeShapeInterferences(IFopsam).Append(interf);
861
862       regdeb.SetCurve(Icf);
863       regdeb.SetS1(coin->Surf(),0);
864       regdeb.SetS2(IFopsam,1);
865       myRegul.Append(regdeb);
866       corner->ChangeFirstCurve(Icf);
867       corner->ChangeFirstParameters(P1deb,P2deb);
868       corner->ChangeIndexFirstPointOnS1(If1);
869       corner->ChangeIndexFirstPointOnS2(If2);
870       
871       pp1 = coin->InterferenceOnS1().PCurveOnSurf()->
872         Value(coin->InterferenceOnS1().LastParameter());
873       pp2 = coin->InterferenceOnS2().PCurveOnSurf()->
874         Value(coin->InterferenceOnS2().LastParameter());
875       ChFi3d_ComputeArete(Pl1,pp1,Pl2,pp2,
876                           DStr.Surface(coin->Surf()).Surface(),C3d,
877                           corner->ChangeLastPCurve(),P1fin,P2fin,
878                           tolesp,tol2d,tolreached,0);
879       Standard_Real tolr2;
880       HC3d->ChangeCurve().Load(C3d);
881       ChFi3d_SameParameter(HC3d,pcsurfdif,Hsurfdif,tolesp,tolr2);
882       tolreached = Max(tolreached,tolr2);
883       TopOpeBRepDS_Curve Tcurv2(C3d,tolreached);
884       Icl = DStr.AddCurve(Tcurv2);
885       regfin.SetCurve(Icl);
886       regfin.SetS1(coin->Surf(),0);
887       regfin.SetS2(sddif->Surf(),0);
888       myRegul.Append(regfin);
889       corner->ChangeLastCurve(Icl);
890       corner->ChangeLastParameters(P1fin,P2fin);
891       corner->ChangeIndexLastPointOnS1(Il1);
892       corner->ChangeIndexLastPointOnS2(Il2);
893         
894       coin->ChangeIndexOfS1(-sdsam->Surf());
895       coin->ChangeIndexOfS2(0);
896
897       corner->SetSolidIndex(stsam->SolidIndex());
898         
899       // then Stripe OnSame
900       // ---------------------
901       const ChFiDS_FaceInterference& intcoin1 = coin->InterferenceOnS1();
902       stsam->SetCurve(intcoin1.LineIndex(),isfirstsam);
903       stsam->InDS(isfirstsam); // filDS already works from the corner.
904       stsam->ChangePCurve(isfirstsam) = coin->InterferenceOnS1().PCurveOnFace();
905       stsam->SetIndexPoint(If1,isfirstsam,ifaopsam);
906       stsam->SetIndexPoint(Il1,isfirstsam,ifacosam);
907       stsam->SetParameters(isfirstsam,
908                            intcoin1.FirstParameter(),
909                            intcoin1.LastParameter());
910       sdsam->ChangeVertex(isfirstsam,ifaopsam) = Pf1;
911       sdsam->ChangeVertex(isfirstsam,ifacosam) = Pl1;
912       sdsam->ChangeInterferenceOnS1().SetParameter(uintpcsam,isfirstsam);
913       sdsam->ChangeInterferenceOnS2().SetParameter(uintpcsam,isfirstsam);
914       if (ifaopsam == 2) stsam->SetOrientation(TopAbs_REVERSED,isfirstsam);
915         
916       // then Stripe OnDiff
917       // ---------------------
918       stdif->SetCurve(Icl,isfirstdif);
919       stdif->ChangePCurve(isfirstdif) = pcsurfdif;
920       stdif->SetIndexPoint(Il2,isfirstdif,ifaopdif);
921       stdif->SetIndexPoint(Il1,isfirstdif,ifacodif);
922       stdif->SetParameters(isfirstdif,P1fin,P2fin);
923       sddif->ChangeVertex(isfirstdif,ifaopdif) = Pl2;
924       sddif->ChangeVertex(isfirstdif,ifacodif) = Pl1;
925       sddif->ChangeInterference(ifacodif).SetParameter(uintpcdif,isfirstdif);
926       if (ifaopdif == 1) stdif->SetOrientation(TopAbs_REVERSED,isfirstdif);
927 #ifdef OCCT_DEBUG
928       ChFi3d_ResultChron(ch , t_t2cornerDS);// result perf update DS 
929 #endif 
930     }
931     if(!myEVIMap.IsBound(Vtx)){
932       TColStd_ListOfInteger li;
933       myEVIMap.Bind(Vtx,li);
934     }
935     myEVIMap.ChangeFind(Vtx).Append(coin->Surf());
936     myListStripe.Append(corner);
937   }
938 }  
939