0030153: Visualization, TKOpenGl - AIS_ColoredShape::SynchronizeAspects() doesn't...
[occt.git] / src / ChFi3d / ChFi3d_FilBuilder_C3.cxx
CommitLineData
b311480e 1// Created on: 1995-04-26
2// Created by: Modelistation
3// Copyright (c) 1995-1999 Matra Datavision
973c2be1 4// Copyright (c) 1999-2014 OPEN CASCADE SAS
b311480e 5//
973c2be1 6// This file is part of Open CASCADE Technology software library.
b311480e 7//
d5f74e42 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
973c2be1 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.
b311480e 13//
973c2be1 14// Alternatively, this file may be used under the terms of Open CASCADE
15// commercial license or contractual agreement.
7fd59977 16
7fd59977 17
42cf5bc1 18#include <Adaptor3d_CurveOnSurface.hxx>
19#include <Adaptor3d_HSurface.hxx>
20#include <Adaptor3d_TopolTool.hxx>
21#include <BRepAdaptor_Curve.hxx>
22#include <BRepAdaptor_HCurve.hxx>
23#include <BRepAdaptor_HCurve2d.hxx>
24#include <BRepAdaptor_HSurface.hxx>
25#include <BRepAdaptor_Surface.hxx>
26#include <BRepBlend_ConstRad.hxx>
27#include <BRepBlend_ConstRadInv.hxx>
28#include <BRepBlend_EvolRad.hxx>
29#include <BRepBlend_EvolRadInv.hxx>
30#include <BRepBlend_Line.hxx>
31#include <BRepTopAdaptor_TopolTool.hxx>
32#include <ChFi3d.hxx>
33#include <ChFi3d_Builder_0.hxx>
34#include <ChFi3d_FilBuilder.hxx>
35#include <ChFiDS_CommonPoint.hxx>
36#include <ChFiDS_FaceInterference.hxx>
37#include <ChFiDS_HData.hxx>
38#include <ChFiDS_HElSpine.hxx>
39#include <ChFiDS_ListIteratorOfListOfStripe.hxx>
40#include <ChFiDS_Regul.hxx>
41#include <ChFiDS_SequenceOfSurfData.hxx>
42#include <ChFiDS_Spine.hxx>
43#include <ChFiDS_Stripe.hxx>
44#include <ChFiDS_SurfData.hxx>
45#include <ChFiKPart_ComputeData.hxx>
7fd59977 46#include <ElCLib.hxx>
47#include <ElSLib.hxx>
7fd59977 48#include <Geom2d_BezierCurve.hxx>
49#include <Geom2d_Curve.hxx>
7fd59977 50#include <Geom2d_Line.hxx>
42cf5bc1 51#include <Geom2d_TrimmedCurve.hxx>
7fd59977 52#include <Geom2dAdaptor_Curve.hxx>
53#include <Geom2dAdaptor_HCurve.hxx>
42cf5bc1 54#include <Geom_BezierCurve.hxx>
55#include <Geom_BSplineSurface.hxx>
56#include <Geom_Circle.hxx>
57#include <Geom_Plane.hxx>
7fd59977 58#include <GeomAdaptor_Curve.hxx>
59#include <GeomAdaptor_HCurve.hxx>
7fd59977 60#include <GeomAdaptor_HSurface.hxx>
42cf5bc1 61#include <GeomAdaptor_Surface.hxx>
62#include <gp_Ax2.hxx>
63#include <gp_Ax3.hxx>
64#include <gp_Dir.hxx>
65#include <gp_Lin.hxx>
66#include <gp_Pnt.hxx>
67#include <gp_Pnt2d.hxx>
68#include <gp_Vec.hxx>
69#include <gp_XY.hxx>
70#include <IntAna_QuadQuadGeo.hxx>
71#include <IntCurveSurface_IntersectionPoint.hxx>
72#include <Law_Function.hxx>
73#include <Law_S.hxx>
74#include <math_Vector.hxx>
75#include <Precision.hxx>
76#include <Standard_Failure.hxx>
77#include <Standard_NotImplemented.hxx>
78#include <TColgp_Array1OfPnt2d.hxx>
79#include <TColStd_ListOfInteger.hxx>
7fd59977 80#include <TopAbs.hxx>
81#include <TopAbs_Orientation.hxx>
42cf5bc1 82#include <TopoDS.hxx>
83#include <TopoDS_Edge.hxx>
84#include <TopoDS_Face.hxx>
85#include <TopoDS_Shape.hxx>
86#include <TopoDS_Vertex.hxx>
7fd59977 87#include <TopOpeBRepDS_Curve.hxx>
42cf5bc1 88#include <TopOpeBRepDS_DataStructure.hxx>
89#include <TopOpeBRepDS_HDataStructure.hxx>
7fd59977 90#include <TopOpeBRepDS_Surface.hxx>
91
7fd59977 92#ifdef DRAW
93#include <DrawTrSurf.hxx>
94#endif
0797d9d3 95#ifdef OCCT_DEBUG
7fd59977 96#include <Geom_TrimmedCurve.hxx>
97extern Standard_Boolean ChFi3d_GettraceDRAWSPINE();
98extern Standard_Boolean ChFi3d_GetcontextSPINEBEZIER();
99extern Standard_Boolean ChFi3d_GetcontextSPINECIRCLE();
100extern Standard_Boolean ChFi3d_GetcontextSPINECE();
101extern Standard_Boolean ChFi3d_GetcontextFORCEFILLING();
102#include <OSD_Chronometer.hxx>
103
104extern Standard_Real t_t3cornerinit ,t_spherique,t_torique,
105t_notfilling,t_filling,t_t3cornerDS;
106extern void ChFi3d_InitChron(OSD_Chronometer& ch);
107extern void ChFi3d_ResultChron(OSD_Chronometer & ch,Standard_Real& time);
108#endif
109
110//=======================================================================
111//function : SearchPivot
112//purpose :
113//=======================================================================
114static Standard_Integer SearchPivot(Standard_Integer* s,
115 Standard_Real u[3][3],
116 const Standard_Real t)
117{
118 Standard_Boolean bondeb,bonfin;
119 for(Standard_Integer i = 0; i <= 2; i++){
120 if(s[(i+1)%3] == 1){bondeb = (u[(i+1)%3][i]-u[(i+1)%3][(i+2)%3] >= -t);}
121 else {bondeb = (u[(i+1)%3][i]-u[(i+1)%3][(i+2)%3] <= t);}
122 if(s[(i+2)%3] == 1){bonfin = (u[(i+2)%3][i]-u[(i+2)%3][(i+1)%3] >= -t);}
123 else {bonfin = (u[(i+2)%3][i]-u[(i+2)%3][(i+1)%3] <= t);}
124 if (bondeb && bonfin){ return i; }
125 }
126 return -1;
127}
128
129
130//=======================================================================
131//function : SearchFD
132//purpose :
133//=======================================================================
134static Standard_Boolean SearchFD(TopOpeBRepDS_DataStructure& DStr,
135 const Handle(ChFiDS_Stripe)& cd1,
136 const Handle(ChFiDS_Stripe)& cd2,
137 const Standard_Integer sens1,
138 const Standard_Integer sens2,
139 Standard_Integer& i1,
140 Standard_Integer& i2,
141 Standard_Real& p1,
142 Standard_Real& p2,
143 const Standard_Integer ind1,
144 const Standard_Integer ind2,
145 TopoDS_Face& face,
146 Standard_Boolean& sameside,
147 Standard_Integer& jf1,
148 Standard_Integer& jf2)
149{
150 Standard_Boolean found = Standard_False;
151 Standard_Integer id1 = ind1, id2 = ind2;
152 Standard_Integer if1 = ind1, if2 = ind2;
153 Standard_Integer l1 = cd1->SetOfSurfData()->Length();
154 Standard_Integer l2 = cd2->SetOfSurfData()->Length();
155 Standard_Integer i;
156 Standard_Boolean fini1 = Standard_False, fini2 = Standard_False;
157 Standard_Boolean visavis;
158 TopoDS_Vertex Vtx;
159 while( !found ){
160 for(i = id1; (i*sens1) <= (if1*sens1) && !found && !fini2; i = i+sens1 ){
161 if(ChFi3d_IsInFront(DStr,cd1,cd2,i,if2,sens1,sens2,p1,p2,face,sameside,jf1,jf2,visavis,Vtx,Standard_False,0)){
162 i1 = i;
163 i2 = if2;
164 found = Standard_True;
165 }
166 }
167 if(!fini1){
168 if1 = if1 + sens1;
169 if(if1 < 1 || if1 > l1){ if1 = if1 - sens1; fini1 = Standard_True; }
170 }
171
172 for(i = id2; (i*sens2) <= (if2*sens2) && !found && !fini1; i = i+sens2 ){
173 if(ChFi3d_IsInFront(DStr,cd1,cd2,if1,i,sens1,sens2,p1,p2,face,sameside,jf1,jf2,visavis,Vtx,Standard_False,0)){
174 i1 = if1;
175 i2 = i;
176 found = Standard_True;
177 }
178 }
179 if(!fini2){
180 if2 = if2 + sens2;
181 if(if2 < 1 || if2 > l2){ if2 = if2 - sens2; fini2 = Standard_True; }
182 }
183 if(fini1 && fini2) break;
184 }
185 return found;
186}
187
188
189//=======================================================================
190//function : ToricCorner
81bba717 191//purpose : Test if this is a paricular cas of a torus corner
192// (or spherical limited by isos).
7fd59977 193//=======================================================================
194
195static Standard_Boolean ToricCorner(const TopoDS_Face& F,
196 const Standard_Real rd,
197 const Standard_Real rf,
198 const gp_Vec& v)
199{
200 if(Abs(rd-rf) > Precision::Confusion()){ return Standard_False; }
201 BRepAdaptor_Surface bs(F);
202 if(bs.GetType() != GeomAbs_Plane){ return Standard_False; }
203 Standard_Real scal1 = Abs(bs.Plane().Position().XDirection().Dot(v));
204 Standard_Real scal2 = Abs(bs.Plane().Position().YDirection().Dot(v));
205 return (scal1 <= Precision::Confusion() &&
206 scal2 <= Precision::Confusion());
207}
208
209//=======================================================================
210//function : PerformThreeCorner
81bba717 211//purpose : Calculate fillet on a top with three edges
212// incident carrying each edge.
7fd59977 213//=======================================================================
214
215void ChFi3d_FilBuilder::PerformThreeCorner(const Standard_Integer Jndex)
216{
217
0797d9d3 218#ifdef OCCT_DEBUG
7fd59977 219 OSD_Chronometer ch;
220 ChFi3d_InitChron(ch); // init perf initialisation
221#endif
222
223 TopOpeBRepDS_DataStructure& DStr = myDS->ChangeDS();
224 const TopoDS_Vertex& Vtx = myVDataMap.FindKey(Jndex);
225 ChFiDS_ListIteratorOfListOfStripe It;
226 Standard_Integer Index[3],pivot,deb,fin,ii,jj,kk;
227 //Standard_Real R = 0.;
228 Standard_Boolean pivdif = Standard_True;
229 Standard_Boolean c1pointu = Standard_False;
230 Standard_Boolean c1toric = Standard_False;
231 Standard_Boolean c1spheric = Standard_False;
232 Handle(ChFiDS_Stripe) CD[3];
233 TopoDS_Face face[3];
234 Standard_Integer jf[3][3];
235 Standard_Boolean sameside[3], oksea[3];
236 for(Standard_Integer g = 0; g <= 2; g++){oksea[g] = Standard_False;}
237 Standard_Integer i[3][3];
238 Standard_Integer sens[3];
239 Standard_Real p[3][3];
240
241 Standard_Boolean filling = 0;
242
243 for (It.Initialize(myVDataMap(Jndex)),ii=0;It.More() && ii<3;It.Next(),ii++){
244 Index[ii] = ChFi3d_IndexOfSurfData(Vtx,It.Value(),sens[ii]);
245 CD[ii] = It.Value();
246 }
81bba717 247 // It is checked if one of CD is not present twice in which
248 // case it is necessary to modify the return of IndexOfSurfData
249 // that takes the first solution.
7fd59977 250 if(CD[0] == CD[1]){
251 Index[1] = CD[1]->SetOfSurfData()->Length();
252 sens[1] = -1;
253 }
254 else if(CD[1] == CD[2]){
255 Index[2] = CD[2]->SetOfSurfData()->Length();
256 sens[2] = -1;
257 }
258 else if(CD[0] == CD[2]){
259 Index[2] = CD[2]->SetOfSurfData()->Length();
260 sens[2] = -1;
261 }
262 oksea[2] = SearchFD(DStr,CD[0],CD[1],sens[0],sens[1],i[0][1],i[1][0],
263 p[0][1],p[1][0],Index[0],Index[1],face[2],sameside[2],
264 jf[0][1],jf[1][0]);
265 oksea[1] = SearchFD(DStr,CD[0],CD[2],sens[0],sens[2],i[0][2],i[2][0],
266 p[0][2],p[2][0],Index[0],Index[2],face[1],sameside[1],
267 jf[0][2],jf[2][0]);
268 oksea[0] = SearchFD(DStr,CD[1],CD[2],sens[1],sens[2],i[1][2],i[2][1],
269 p[1][2],p[2][1],Index[1],Index[2],face[0],sameside[0],
270 jf[1][2],jf[2][1]);
271 //
81bba717 272 // Analyze concavities of 3 fillets :
273 // - 2 concavities identic and 1 inverted.
274 // - 3 concavities identic
7fd59977 275 //
276 if(oksea[2] && oksea[1] && !sameside[2] && !sameside[1])
277 { pivot = 0; deb = 1; fin = 2;}
278 else if(oksea[2] && oksea[0] && !sameside[2] && !sameside[0])
279 { pivot = 1; deb = 2; fin = 0;}
280 else if(oksea[1] && oksea[0] && !sameside[1] && !sameside[0])
281 { pivot = 2; deb = 0; fin = 1;}
282 else if(oksea[0] && oksea[1] && oksea[2]){
81bba717 283 // 3 concavities identic.
7fd59977 284 pivot = SearchPivot(sens,p,tol2d);
285 if(pivot < 0){
0797d9d3 286#ifdef OCCT_DEBUG
81bba717 287 cout<<"pivot not found, plate is called"<<endl;
7fd59977 288#endif
289 PerformMoreThreeCorner(Jndex, 3);
290 return;
291 }
292 else{deb = (pivot+1)%3 ; fin = (pivot+2)%3;}
293 pivdif = Standard_False;
294 if(Abs(p[0][1]-p[0][2]) <= tol2d &&
295 Abs(p[1][0]-p[1][2]) <= tol2d &&
296 Abs(p[2][0]-p[2][1]) <= tol2d){
297 c1pointu = Standard_True;
298 }
299 }
300 else {
301 PerformMoreThreeCorner(Jndex, 3);
302 return;
303 }
304 Standard_Integer ifacdeb, ifacfin;
305 ifacdeb = CD[deb]->ChangeSetOfSurfData()->Value(i[deb][pivot])->Index(3-jf[deb][pivot]);
306 ifacfin = CD[fin]->ChangeSetOfSurfData()->Value(i[fin][pivot])->Index(3-jf[fin][pivot]);
307 if(ifacfin != ifacdeb){
0797d9d3 308#ifdef OCCT_DEBUG
81bba717 309 cout<<"several base faces, plate is called"<<endl;
7fd59977 310#endif
311 PerformMoreThreeCorner(Jndex, 3);
312 return;
313 }
314 if(i[pivot][deb] != i[pivot][fin]){
0797d9d3 315#ifdef OCCT_DEBUG
81bba717 316 cout<<"load surfdata on the pivot, plate is called"<<endl;
7fd59977 317#endif
318 PerformMoreThreeCorner(Jndex, 3);
319 return;
320 }
321
322 Standard_Real Rdeb,Rfin,Rdp,Rfp;
323 gp_Pnt Pdeb,Pfin,Pdp,Pfp;
324 gp_Vec Vdeb,Vfin,Vdp,Vfp;
325 if(c1pointu){
326 gp_Pnt pbid;
327 gp_Vec qv[3];
328 Standard_Real qr[3];
329 for(ii = 0; ii<=2; ii++){
330 jj = (ii+1)%3 ; kk = (ii+2)%3;
331 ChFi3d_ExtrSpineCarac(DStr,CD[jj],i[jj][ii],p[jj][ii],1,
332 sens[jj],pbid,qv[jj],qr[jj]);
333 }
334 for(ii = 0; ii<=2 && !c1toric; ii++){
335 jj = (ii+1)%3 ; kk = (ii+2)%3;
336 if(ToricCorner(face[ii],qr[jj],qr[kk],qv[ii])){
337 c1toric = Standard_True;
338 pivot = ii; deb = jj; fin = kk;
339 }
340 }
341 if(!c1toric)c1spheric=(Abs(qr[0]-qr[1])<tolesp && Abs(qr[0]-qr[2])<tolesp);
342 }
343
81bba717 344 // Previously to avoid loops the points were always located
345 // inside, which could impede the construction of the
346 // guideline of the corner which now is a circle.
7fd59977 347 // Standard_Integer jjjd = jf[deb][fin], jjjf = jf[fin][deb];
348 // if (pivdif) jjjd = jf[deb][pivot], jjjf = jf[fin][pivot];
349 Standard_Integer jjjd = jf[deb][pivot], jjjf = jf[fin][pivot];
350 ChFi3d_ExtrSpineCarac(DStr,CD[deb],i[deb][pivot],p[deb][pivot],
351 jjjd,sens[deb],Pdeb,Vdeb,Rdeb);
352 ChFi3d_ExtrSpineCarac(DStr,CD[fin],i[fin][pivot],p[fin][pivot],
353 jjjf,sens[fin],Pfin,Vfin,Rfin);
354 ChFi3d_ExtrSpineCarac(DStr,CD[pivot],i[pivot][deb],p[pivot][deb],
355 0,sens[pivot],Pdp,Vdp,Rdp);
356 ChFi3d_ExtrSpineCarac(DStr,CD[pivot],i[pivot][fin],p[pivot][fin],
357 0,sens[pivot],Pfp,Vfp,Rfp);
81bba717 358 //in cas of allsame it is checked that points on the face are not
359 //too close, which can stop the work.
7fd59977 360 if(!pivdif) {
361 gp_Pnt ptestdeb,ptestfin; gp_Vec bidvec; Standard_Real bidr;
362 ChFi3d_ExtrSpineCarac(DStr,CD[deb],i[deb][pivot],p[deb][pivot],
363 jf[deb][fin],sens[deb],ptestdeb,bidvec,bidr);
364 ChFi3d_ExtrSpineCarac(DStr,CD[fin],i[fin][pivot],p[fin][pivot],
365 jf[fin][deb],sens[fin],ptestfin,bidvec,bidr);
366 Standard_Real distest = ptestdeb.Distance(ptestfin);
367 if(distest < (Rdp+Rfp)*0.05) filling = 1;
368 if(distest < (Rdp+Rfp)*0.005) c1pointu = 1;
369 }
370
371 if(!c1pointu){
372 if (!pivdif) c1pointu = (Abs(p[deb][pivot]-p[deb][fin]) <=tol2d &&
373 Abs(p[fin][pivot]-p[fin][deb]) <=tol2d);
374 if(Abs(p[pivot][deb] - p[pivot][fin]) <= tol2d)
375 c1toric = ToricCorner(face[pivot],Rdeb,Rfin,Vdp);
376 }
81bba717 377 // there is a pivot, the start and the end CD (finally !?!) :
7fd59977 378 // -------------------------------------------------------------
81bba717 379 // the criterions determining if the corner is a torus or a sphere
380 // are based only on the configuration of sections at end and the
381 // nature of faces, it is necessary to make tests to
382 // determine if a more detailed analysis of incident fillets
383 // is necessare to provide tangency between them and
384 // the corner (in particular in the case with variable radius).
7fd59977 385
386
387
388 Handle(ChFiDS_SurfData)&
389 fddeb = CD[deb]->ChangeSetOfSurfData()->ChangeValue(i[deb][pivot]);
390 Handle(ChFiDS_SurfData)&
391 fdfin = CD[fin]->ChangeSetOfSurfData()->ChangeValue(i[fin][pivot]);
392 Handle(ChFiDS_SurfData)&
393 fdpiv = CD[pivot]->ChangeSetOfSurfData()->ChangeValue(i[pivot][deb]);
394
395
81bba717 396 // HSurfaces and other suitable tools are constructed.
7fd59977 397 // ----------------------------------------------------------
398
399 TopAbs_Orientation OFac = face[pivot].Orientation();
400 Handle(BRepAdaptor_HSurface) Fac = new BRepAdaptor_HSurface(face[pivot]);
401 gp_Pnt2d ppp1,ppp2;
402 const ChFiDS_FaceInterference& bid1 = CD[pivot]->SetOfSurfData()->
403 Value(i[pivot][deb])->InterferenceOnS1();
404 ppp1 = bid1.PCurveOnSurf()->Value(bid1.FirstParameter());
405 const ChFiDS_FaceInterference& bid2 = CD[pivot]->SetOfSurfData()->
406 Value(i[pivot][deb])->InterferenceOnS2();
407 ppp2 = bid2.PCurveOnSurf()->Value(bid2.LastParameter());
408 Standard_Real uu1 = ppp1.X(), uu2 = ppp2.X(), vv1 = ppp1.Y(), vv2 = ppp2.Y();
409 GeomAdaptor_Surface
410 gasurf((DStr.Surface(CD[pivot]->SetOfSurfData()->
411 Value(i[pivot][deb])->Surf())).Surface(),
412 uu1, uu2, vv1, vv2);
413 GeomAbs_SurfaceType styp = gasurf.GetType();
414 if(styp == GeomAbs_Cylinder){
415 Standard_Real h = vv2 - vv1;
416 vv1 -= 0.5*h;
417 vv2 += 0.5*h;
418 gasurf.Load((DStr.Surface(CD[pivot]->SetOfSurfData()->
419 Value(i[pivot][deb])->Surf())).Surface(),
420 uu1, uu2, vv1, vv2);
421 }
422 else if(styp == GeomAbs_Torus){
423 Standard_Real h = uu2 - uu1;
424 uu1 -= 0.1*h;
425 uu2 += 0.1*h;
426 gasurf.Load((DStr.Surface(CD[pivot]->SetOfSurfData()->
427 Value(i[pivot][deb])->Surf())).Surface(),
428 uu1, uu2, vv1, vv2);
429 }
430 else if(styp == GeomAbs_BezierSurface || styp == GeomAbs_BSplineSurface){
431 gasurf.Load((DStr.Surface(CD[pivot]->SetOfSurfData()->
432 Value(i[pivot][deb])->Surf())).Surface());
433 }
434
435 Handle(GeomAdaptor_HSurface) Surf = new GeomAdaptor_HSurface(gasurf);
436 // Handle(BRepTopAdaptor_TopolTool) IFac = new BRepTopAdaptor_TopolTool(Fac);
81bba717 437 // Try to not classify on the face for cases of reentering fillets which naturally depass
438 // the border.
7fd59977 439 Handle(GeomAdaptor_HSurface)
440 bidsurf = new GeomAdaptor_HSurface(Fac->ChangeSurface().Surface());
441 Handle(Adaptor3d_TopolTool)
442 IFac = new Adaptor3d_TopolTool(bidsurf);
81bba717 443 // end of the attempt.
7fd59977 444 Handle(Adaptor3d_TopolTool) ISurf = new Adaptor3d_TopolTool(Surf);
445 Handle(ChFiDS_Stripe) corner = new ChFiDS_Stripe();
446 Handle(ChFiDS_HData)& cornerset = corner->ChangeSetOfSurfData();
447 cornerset = new ChFiDS_HData();
448 Handle(ChFiDS_SurfData) coin = new ChFiDS_SurfData();
449 cornerset->Append(coin);
450 TopAbs_Orientation o1,o2,os1,os2,oo1,oo2;
451 Standard_Integer choix = CD[deb]->Choix();
452 o1 = face[pivot].Orientation();
453 o2 = fdpiv->Orientation();
454 oo1 = o1; oo2 = o2;
455 os1 = CD[deb]->OrientationOnFace1();
456 os2 = CD[deb]->OrientationOnFace2();
457 if(jf[deb][fin] == 1){
458 choix = ChFi3d::NextSide(o1,o2,os1,os2,choix);
459 if(sens[deb] == 1){
460 if(choix%2 == 1) choix++;
461 else choix--;
462 }
463 }
464 else {
465 choix = ChFi3d::NextSide(o2,o1,os1,os2,-choix);
466 if(sens[deb] == -1){
467 if(choix%2 == 1) choix++;
468 else choix--;
469 }
470 }
471
472 gp_Pnt2d pfac1,pfac2,psurf1,psurf2;
473 gp_Vec2d vfac1,vfac2;
474 CD[deb]->SetOfSurfData()->Value(i[deb][pivot])->
475 Interference(jf[deb][fin]).PCurveOnFace()->D1(p[deb][pivot],pfac1,vfac1);
476 CD[fin]->SetOfSurfData()->Value(i[fin][pivot])->
477 Interference(jf[fin][deb]).PCurveOnFace()->D1(p[fin][pivot],pfac2,vfac2);
478 psurf1 = CD[pivot]->SetOfSurfData()->Value(i[pivot][deb])->
479 Interference(jf[pivot][deb]).PCurveOnSurf()->Value(p[pivot][deb]);
480 psurf2 = CD[pivot]->SetOfSurfData()->Value(i[pivot][fin])->
481 Interference(jf[pivot][fin]).PCurveOnSurf()->Value(p[pivot][fin]);
482
483 done = Standard_False;
0797d9d3 484#ifdef OCCT_DEBUG
7fd59977 485 if(ChFi3d_GetcontextFORCEFILLING()) c1spheric = c1toric = 0;
486#endif
487
0797d9d3 488#ifdef OCCT_DEBUG
7fd59977 489 ChFi3d_ResultChron(ch , t_t3cornerinit); // result perf initialisations
490#endif
491
492 if (c1toric){
493
0797d9d3 494#ifdef OCCT_DEBUG
81bba717 495 ChFi3d_InitChron(ch); // init perf case torus
7fd59977 496#endif
497
81bba717 498 // Direct Construction.
7fd59977 499 // ---------------------
500 done = ChFiKPart_ComputeData::ComputeCorner
501 (DStr,coin,Fac,Surf,oo1,oo2,o1,o2,Rdeb,Rdp,pfac1,pfac2,psurf1,psurf2);
502
0797d9d3 503#ifdef OCCT_DEBUG
81bba717 504 ChFi3d_ResultChron(ch , t_torique); // result perf case torus
7fd59977 505#endif
506
507 }
508 else if(c1spheric){
509
0797d9d3 510#ifdef OCCT_DEBUG
81bba717 511 ChFi3d_InitChron(ch); //init perf case sphere
7fd59977 512#endif
513
514 done = ChFiKPart_ComputeData::ComputeCorner
515 (DStr,coin,Fac,Surf,oo1,oo2,o1,o2,Rdp,pfac1,psurf1,psurf2);
516
0797d9d3 517#ifdef OCCT_DEBUG
81bba717 518 ChFi3d_ResultChron(ch , t_spherique);// result perf cas sphere
7fd59977 519#endif
520
521 }
522 else if(c1pointu){
523 filling = 1;
524 }
525 if(!done){
526 if(!filling) {
527
0797d9d3 528#ifdef OCCT_DEBUG
7fd59977 529 ChFi3d_InitChron(ch);// init perf not filling
530#endif
531
81bba717 532 //Calculate a guideline,
7fd59977 533 //------------------------------
81bba717 534 //Numerous problems with loops and half-turns connected to
535 //the curvature of the guideline !!!!!!
536 //FOR CIRCLE.
537 //If the nature of guideline is changed it is necessary to
538 //reset points Pdeb and Pfin at the inside (see the
539 //comments about it in the calculation of Pdeb and Pfin).
7fd59977 540
541 Standard_Real radpondere = (Rdp+Rfp)/2.;
542 Standard_Real locfleche = fleche;
543
544 Standard_Real WFirst,WLast;
545 Handle(Geom_Curve) spinecoin = ChFi3d_CircularSpine(WFirst,WLast,
546 Pdeb,Vdeb,
547 Pfin,Vfin,radpondere);
548 if(spinecoin.IsNull()){
81bba717 549 // This is a bad case when the intersection of
550 // section planes is done out of the sector.
7fd59977 551 spinecoin = ChFi3d_Spine(Pdeb,Vdeb,
552 Pfin,Vfin,radpondere);
553 WFirst = 0.; WLast = 1.;
554 }
555 else locfleche = radpondere * (WLast - WFirst) * fleche;
556 Standard_Real pasmax = (WLast-WFirst)*0.05;
557 Handle(ChFiDS_HElSpine) cornerspine = new ChFiDS_HElSpine();
558 cornerspine->ChangeCurve().SetCurve(spinecoin);
559 cornerspine->ChangeCurve().FirstParameter(WFirst - pasmax);
560 cornerspine->ChangeCurve().LastParameter(WLast + pasmax);
81bba717 561 // Just to confuse Compute that should not require this
562 // in this exact case ...
7fd59977 563 Handle(ChFiDS_Spine) NullSpine;
81bba717 564 // The fillet is calculated - from beginning to end
565 // - from the face to the surface
7fd59977 566 //
567 math_Vector Soldep(1,4);
568 Soldep(1) = pfac1.X();
569 Soldep(2) = pfac1.Y();
570 Soldep(3) = psurf1.X();
571 Soldep(4) = psurf1.Y();
572
573 Standard_Boolean Gd1,Gd2,Gf1,Gf2;
574 Handle(BRepBlend_Line) lin;
575 Standard_Real ffi = WFirst, lla = WLast + pasmax;
576
577 if (Abs(Rdeb-Rfin)<=tolesp){
578
579 BRepBlend_ConstRad func(Fac,Surf,cornerspine);
580 BRepBlend_ConstRadInv finv(Fac,Surf,cornerspine);
581 func.Set(Rdeb,choix);
582 func.Set(myShape);
583 finv.Set(Rdeb,choix);
584 Standard_Real TolGuide = cornerspine->Resolution(tolesp);
585
dde68833 586 Standard_Integer intf = 3, intl = 3;
7fd59977 587 done = ComputeData(coin,cornerspine,NullSpine,lin,Fac,IFac,Surf,ISurf,
588 func,finv,ffi,pasmax,locfleche,TolGuide,ffi,lla,
589 0,0,1,Soldep,intf,intl,Gd1,Gd2,Gf1,Gf2,0,1);
0797d9d3 590#ifdef OCCT_DEBUG
7fd59977 591 if(ChFi3d_GetcontextFORCEFILLING()) done = 0;
592#endif
593 if(done && Gf2){
594 done = CompleteData(coin,func,lin,Fac,Surf,OFac,Gd1,0,Gf1,0);
595 filling = !done;
596 }
597 else filling = 1;
598 }
599 else{
600 Handle(Law_S) law = new Law_S();
601 law->Set(WFirst,Rdeb,WLast,Rfin);
602 BRepBlend_EvolRad func(Fac,Surf,cornerspine,law);
603 BRepBlend_EvolRadInv finv(Fac,Surf,cornerspine,law);
604 func.Set(choix);
605 func.Set(myShape);
606 finv.Set(choix);
607 Standard_Real TolGuide = cornerspine->Resolution(tolesp);
dde68833 608 Standard_Integer intf = 3, intl = 3;
7fd59977 609 done = ComputeData(coin,cornerspine,NullSpine,lin,Fac,IFac,Surf,ISurf,
610 func,finv,ffi,pasmax,locfleche,TolGuide,ffi,lla,
611 0,0,1,Soldep,intf,intl,Gd1,Gd2,Gf1,Gf2,0,1);
0797d9d3 612#ifdef OCCT_DEBUG
7fd59977 613 if(ChFi3d_GetcontextFORCEFILLING()) done = 0;
614#endif
615 if(done && Gf2){
616 done = CompleteData(coin,func,lin,Fac,Surf,OFac,Gd1,0,Gf1,0);
617 filling = !done;
618 }
619 else filling = 1;
620 }
621
0797d9d3 622#ifdef OCCT_DEBUG
7fd59977 623 ChFi3d_ResultChron(ch , t_notfilling);// result perf not filling
624#endif
625
626 }
627
628 if(filling) {
629
0797d9d3 630#ifdef OCCT_DEBUG
7fd59977 631 ChFi3d_InitChron(ch); // init perf filling
632#endif
633
81bba717 634 // the contour to be fillet consists of straight lines uv in beginning and end
635 // of two pcurves (only one if c1pointu) calculted as possible
636 // on piv and the opposite face.
7fd59977 637 Handle(GeomFill_Boundary) Bdeb,Bfin,Bpiv,Bfac;
638 Handle(Geom2d_Curve) PCurveOnFace;
639 if(!c1pointu)
640 Bfac = ChFi3d_mkbound(Fac,PCurveOnFace,sens[deb],pfac1,vfac1,
641 sens[fin],pfac2,vfac2,tolesp,2.e-4);
642 Standard_Integer kkk;
643 gp_Pnt ppbid;
644 gp_Vec vp1,vp2;
645 kkk = CD[deb]->SetOfSurfData()->Value(i[deb][pivot])->
646 Interference(jf[deb][pivot]).LineIndex();
647 DStr.Curve(kkk).Curve()->D1(p[deb][pivot],ppbid,vp1);
648 kkk = CD[fin]->SetOfSurfData()->Value(i[fin][pivot])->
649 Interference(jf[fin][pivot]).LineIndex();
650 DStr.Curve(kkk).Curve()->D1(p[fin][pivot],ppbid,vp2);
651 Handle(Geom2d_Curve) PCurveOnPiv;
652// Bpiv = ChFi3d_mkbound(Surf,PCurveOnPiv,sens[deb],psurf1,vp1,
653// sens[fin],psurf2,vp2,tolesp,2.e-4);
654 Bpiv = ChFi3d_mkbound(Surf,PCurveOnPiv,psurf1,psurf2,tolesp,2.e-4,0);
655 Standard_Real pardeb2 = p[deb][pivot];
656 Standard_Real parfin2 = p[fin][pivot];
657 if(c1pointu){
658 pardeb2 = p[deb][fin];
659 parfin2 = p[fin][deb];
660 }
661 gp_Pnt2d pdeb1 = CD[deb]->SetOfSurfData()->Value(i[deb][pivot])->
662 Interference(jf[deb][pivot]).PCurveOnSurf()->Value(p[deb][pivot]);
663 gp_Pnt2d pdeb2 = CD[deb]->SetOfSurfData()->Value(i[deb][pivot])->
664 Interference(jf[deb][fin]).PCurveOnSurf()->Value(pardeb2);
665 gp_Pnt2d pfin1 = CD[fin]->SetOfSurfData()->Value(i[fin][pivot])->
666 Interference(jf[fin][pivot]).PCurveOnSurf()->Value(p[fin][pivot]);
667 gp_Pnt2d pfin2 = CD[fin]->SetOfSurfData()->Value(i[fin][pivot])->
668 Interference(jf[fin][deb]).PCurveOnSurf()->Value(parfin2);
669 Handle(Geom_Surface) sdeb =
670 DStr.Surface(CD[deb]->SetOfSurfData()->
671 Value(i[deb][pivot])->Surf()).Surface();
672 Handle(Geom_Surface) sfin =
673 DStr.Surface(CD[fin]->SetOfSurfData()->
674 Value(i[fin][pivot])->Surf()).Surface();
675
676 Bdeb = ChFi3d_mkbound(sdeb,pdeb1,pdeb2,tolesp,2.e-4);
677 Bfin = ChFi3d_mkbound(sfin,pfin1,pfin2,tolesp,2.e-4);
678
679 GeomFill_ConstrainedFilling fil(11,20);
680 if(c1pointu) fil.Init(Bpiv,Bfin,Bdeb,1);
681 else fil.Init(Bpiv,Bfin,Bfac,Bdeb,1);
682
683 Handle(Geom_Surface) Surfcoin = fil.Surface();
81bba717 684 Surfcoin->VReverse(); // revert to direction face surface;
7fd59977 685 done = CompleteData(coin,Surfcoin,
686 Fac,PCurveOnFace,
687 Surf,PCurveOnPiv,fdpiv->Orientation(),0,
688 0,0,0,0);
689
0797d9d3 690#ifdef OCCT_DEBUG
7fd59977 691 ChFi3d_ResultChron(ch , t_filling);// result perf filling
692#endif
693
694 }
695 }
696 Standard_Real P1deb,P2deb,P1fin,P2fin;
697 if(!c1pointu){
698 p[deb][fin] = p[deb][pivot];
699 p[fin][deb] = p[fin][pivot];
700 }
701
702 if (done){
81bba717 703 // Update of 4 Stripes and the DS
7fd59977 704 // -------------------------------------
705
0797d9d3 706#ifdef OCCT_DEBUG
81bba717 707 ChFi3d_InitChron(ch);// init perf update DS
7fd59977 708#endif
709
710 gp_Pnt2d pp1,pp2;
711 Standard_Real parpp1,parpp2;
712 Standard_Integer If1,If2,Il1,Il2,Icf,Icl;
713 const ChFiDS_CommonPoint& Pf1 = coin->VertexFirstOnS1();
714 const ChFiDS_CommonPoint& Pf2 = coin->VertexFirstOnS2();
715 ChFiDS_CommonPoint& Pl1 = coin->ChangeVertexLastOnS1();
716 if(c1pointu) Pl1 = coin->ChangeVertexFirstOnS1();
717 const ChFiDS_CommonPoint& Pl2 = coin->VertexLastOnS2();
718
719 Bnd_Box bf1,bl1,bf2,bl2;
720 Bnd_Box *pbf1 = &bf1,*pbl1 = &bl1,*pbf2 = &bf2,*pbl2 = &bl2;
721 if(c1pointu) pbl1 = pbf1;
722 pbf1->Add(Pf1.Point());pbf2->Add(Pf2.Point());
723 pbl1->Add(Pl1.Point());pbl2->Add(Pl2.Point());
724
81bba717 725 // the start corner,
7fd59977 726 // -----------------------
727 ChFiDS_Regul regdeb, regfin;
728 If1 = ChFi3d_IndexPointInDS(Pf1,DStr);
729 If2 = ChFi3d_IndexPointInDS(Pf2,DStr);
730 if(c1pointu) Il1 = If1;
731 else Il1 = ChFi3d_IndexPointInDS(Pl1,DStr);
732 Il2 = ChFi3d_IndexPointInDS(Pl2,DStr);
733 pp1 = coin->InterferenceOnS1().PCurveOnSurf()->
734 Value(coin->InterferenceOnS1().FirstParameter());
735 pp2 = coin->InterferenceOnS2().PCurveOnSurf()->
736 Value(coin->InterferenceOnS2().FirstParameter());
737 if(c1pointu) coin->ChangeIndexOfS1(0);
738 else coin->ChangeIndexOfS1(DStr.AddShape(face[pivot]));
739 coin->ChangeIndexOfS2(-fdpiv->Surf());
740
741 Handle(Geom_Curve) C3d;
742 Standard_Real tolreached;
743 ChFi3d_ComputeArete(Pf1,pp1,Pf2,pp2,
744 DStr.Surface(coin->Surf()).Surface(),C3d,
745 corner->ChangeFirstPCurve(),P1deb,P2deb,
746 tolesp,tol2d,tolreached,0);
747 TopOpeBRepDS_Curve Tcurv1(C3d,tolreached);
748 Icf = DStr.AddCurve(Tcurv1);
749 regdeb.SetCurve(Icf);
750 regdeb.SetS1(coin->Surf(),0);
751 regdeb.SetS2(fddeb->Surf(),0);
752 myRegul.Append(regdeb);
753 corner->ChangeFirstCurve(Icf);
754 corner->ChangeFirstParameters(P1deb,P2deb);
755 corner->ChangeIndexFirstPointOnS1(If1);
756 corner->ChangeIndexFirstPointOnS2(If2);
757 ChFi3d_EnlargeBox(DStr,corner,coin,*pbf1,*pbf2,1);
758
759 pp1 = coin->InterferenceOnS1().PCurveOnSurf()->
760 Value(coin->InterferenceOnS1().LastParameter());
761 pp2 = coin->InterferenceOnS2().PCurveOnSurf()->
762 Value(coin->InterferenceOnS2().LastParameter());
763 ChFi3d_ComputeArete(Pl1,pp1,Pl2,pp2,
764 DStr.Surface(coin->Surf()).Surface(),C3d,
765 corner->ChangeLastPCurve(),P1fin,P2fin,
766 tolesp,tol2d,tolreached,0);
767 TopOpeBRepDS_Curve Tcurv2(C3d,tolreached);
768 Icl = DStr.AddCurve(Tcurv2);
769 regfin.SetCurve(Icl);
770 regfin.SetS1(coin->Surf(),0);
771 regfin.SetS2(fdfin->Surf(),0);
772 myRegul.Append(regfin);
773 corner->ChangeLastCurve(Icl);
774 corner->ChangeLastParameters(P1fin,P2fin);
775 corner->ChangeIndexLastPointOnS1(Il1);
776 corner->ChangeIndexLastPointOnS2(Il2);
777 ChFi3d_EnlargeBox(DStr,corner,coin,*pbl1,*pbl2,0);
778
81bba717 779 // then CornerData of the beginning,
780 // --------------------------------
7fd59977 781 Standard_Boolean isfirst = (sens[deb] == 1), rev = (jf[deb][fin] == 2);
782 Standard_Integer isurf1 = 1, isurf2 = 2;
783 parpp1 = p[deb][fin]; parpp2 = p[deb][pivot];
784 if (rev) {
785 isurf1 = 2; isurf2 = 1;
786 parpp1 = p[deb][pivot]; parpp2 = p[deb][fin];
787 CD[deb]->SetOrientation(TopAbs_REVERSED,isfirst);
788 }
789 pp1 = fddeb->InterferenceOnS1().PCurveOnSurf()->Value(parpp1);
790 pp2 = fddeb->InterferenceOnS2().PCurveOnSurf()->Value(parpp2);
791 CD[deb]->SetCurve(Icf,isfirst);
792 CD[deb]->SetIndexPoint(If1,isfirst,isurf1);
793 CD[deb]->SetIndexPoint(If2,isfirst,isurf2);
794 CD[deb]->SetParameters(isfirst,P1deb,P2deb);
795 fddeb->ChangeVertex(isfirst,isurf1) = Pf1;
796 fddeb->ChangeVertex(isfirst,isurf2) = Pf2;
797 fddeb->ChangeInterferenceOnS1().SetParameter(parpp1,isfirst);
798 fddeb->ChangeInterferenceOnS2().SetParameter(parpp2,isfirst);
799 TopOpeBRepDS_Curve& tcdeb = DStr.ChangeCurve(Icf);
800 Handle(Geom_Curve) crefdeb = tcdeb.Curve();
801 Standard_Real tolrdeb;
802 ChFi3d_ComputePCurv(crefdeb,pp1,pp2,CD[deb]->ChangePCurve(isfirst),
803 DStr.Surface(fddeb->Surf()).Surface(),
804 P1deb,P2deb,tolesp,tolrdeb,rev);
805 tcdeb.Tolerance(Max(tolrdeb,tcdeb.Tolerance()));
806 if(rev) ChFi3d_EnlargeBox(DStr,CD[deb],fddeb,*pbf2,*pbf1,isfirst);
807 else ChFi3d_EnlargeBox(DStr,CD[deb],fddeb,*pbf1,*pbf2,isfirst);
808
81bba717 809 // then the end CornerData,
810 // ------------------------
7fd59977 811 isfirst = (sens[fin] == 1); rev = (jf[fin][deb] == 2);
812 isurf1 = 1; isurf2 = 2;
813 parpp1 = p[fin][deb]; parpp2 = p[fin][pivot];
814 if (rev) {
815 isurf1 = 2; isurf2 = 1;
816 parpp1 = p[fin][pivot]; parpp2 = p[fin][deb];
817 CD[fin]->SetOrientation(TopAbs_REVERSED,isfirst);
818 }
819 pp1 = fdfin->InterferenceOnS1().PCurveOnSurf()->Value(parpp1);
820 pp2 = fdfin->InterferenceOnS2().PCurveOnSurf()->Value(parpp2);
821 CD[fin]->SetCurve(Icl,isfirst);
822 CD[fin]->SetIndexPoint(Il1,isfirst,isurf1);
823 CD[fin]->SetIndexPoint(Il2,isfirst,isurf2);
824 CD[fin]->SetParameters(isfirst,P1fin,P2fin);
825 fdfin->ChangeVertex(isfirst,isurf1) = Pl1;
826 fdfin->ChangeVertex(isfirst,isurf2) = Pl2;
827 fdfin->ChangeInterferenceOnS1().SetParameter(parpp1,isfirst);
828 fdfin->ChangeInterferenceOnS2().SetParameter(parpp2,isfirst);
829 TopOpeBRepDS_Curve& tcfin = DStr.ChangeCurve(Icl);
830 Handle(Geom_Curve) creffin = tcfin.Curve();
831 Standard_Real tolrfin;
832 ChFi3d_ComputePCurv(creffin,pp1,pp2,CD[fin]->ChangePCurve(isfirst),
833 DStr.Surface(fdfin->Surf()).Surface(),
834 P1fin,P2fin,tolesp,tolrfin,rev);
835 tcfin.Tolerance(Max(tolrfin,tcfin.Tolerance()));
836 if(rev) ChFi3d_EnlargeBox(DStr,CD[fin],fdfin,*pbl2,*pbl1,isfirst);
837 else ChFi3d_EnlargeBox(DStr,CD[fin],fdfin,*pbl1,*pbl2,isfirst);
838
81bba717 839 // anf finally the pivot.
7fd59977 840 // ------------------
841 ChFiDS_FaceInterference& fi = coin->ChangeInterferenceOnS2();
842 isfirst = (sens[pivot] == 1); rev = (jf[pivot][deb] == 2);
843 isurf1 = 1; isurf2 = 2;
844 if (rev) {
845 isurf1 = 2; isurf2 = 1;
846 CD[pivot]->SetOrientation(TopAbs_REVERSED,isfirst);
847 }
848 Standard_Integer ICcoinpiv = fi.LineIndex();
849 TopOpeBRepDS_Curve& TCcoinpiv = DStr.ChangeCurve(ICcoinpiv);
850 CD[pivot]->SetCurve(ICcoinpiv,isfirst);
851 Handle(Geom_Curve) Ccoinpiv = DStr.Curve(ICcoinpiv).Curve();
852 Handle(Geom2d_Curve)& C2dOnPiv = fi.ChangePCurveOnFace();
853 Handle(Geom_Surface) Spiv = DStr.Surface(fdpiv->Surf()).Surface();
854 Standard_Real tolr;
855 ChFi3d_SameParameter(Ccoinpiv,C2dOnPiv,Spiv,
856 fi.FirstParameter(),fi.LastParameter(),
857 tolesp,tolr);
858 TCcoinpiv.Tolerance(Max(TCcoinpiv.Tolerance(),tolr));
859 CD[pivot]->ChangePCurve(isfirst) = C2dOnPiv;
860 CD[pivot]->SetIndexPoint(If2,isfirst,isurf1);
861 CD[pivot]->SetIndexPoint(Il2,isfirst,isurf2);
862 CD[pivot]->SetParameters(isfirst,fi.FirstParameter(),fi.LastParameter());
863 fdpiv->ChangeVertex(isfirst,isurf1) = Pf2;
864 fdpiv->ChangeVertex(isfirst,isurf2) = Pl2;
865 fdpiv->ChangeInterference(isurf1).SetParameter(p[pivot][deb],isfirst);
866 fdpiv->ChangeInterference(isurf2).SetParameter(p[pivot][fin],isfirst);
81bba717 867 CD[pivot]->InDS(isfirst); // filDS already does it from the corner.
7fd59977 868 if(rev) ChFi3d_EnlargeBox(DStr,CD[pivot],fdpiv,*pbl2,*pbf2,isfirst);
869 else ChFi3d_EnlargeBox(DStr,CD[pivot],fdpiv,*pbf2,*pbl2,isfirst);
870
81bba717 871 //To end the tolerances of points are rescaled.
7fd59977 872 ChFi3d_SetPointTolerance(DStr,*pbf1,If1);
873 ChFi3d_SetPointTolerance(DStr,*pbf2,If2);
874 ChFi3d_SetPointTolerance(DStr,*pbl1,Il1);
875 ChFi3d_SetPointTolerance(DStr,*pbl2,Il2);
876 }
877
81bba717 878 //The data corners are truncated and index is updated.
7fd59977 879 //----------------------------------------------------
880
881 if(i[deb][pivot] < Index[deb]){
882 CD[deb]->ChangeSetOfSurfData()->Remove(i[deb][pivot]+1,Index[deb]);
883 Index[deb] = i[deb][pivot];
884 }
885 else if(i[deb][pivot] > Index[deb]) {
886 CD[deb]->ChangeSetOfSurfData()->Remove(Index[deb],i[deb][pivot]-1);
887 i[deb][pivot] = Index[deb];
888 }
889 if(i[fin][pivot] < Index[fin]) {
890 CD[fin]->ChangeSetOfSurfData()->Remove(i[fin][pivot]+1,Index[fin]);
891 Index[fin] = i[fin][pivot];
892 }
893 else if(i[fin][pivot] > Index[fin]) {
894 CD[fin]->ChangeSetOfSurfData()->Remove(Index[fin],i[fin][pivot]-1);
895 i[fin][pivot] = Index[fin];
896 }
81bba717 897 // it is necessary to take into account mutant corners.
7fd59977 898 if(i[pivot][deb] < Index[pivot]) {
899 CD[pivot]->ChangeSetOfSurfData()->Remove(i[pivot][deb]+1,Index[pivot]);
900 Index[pivot] = i[pivot][deb];
901 }
902 else if(i[pivot][deb] > Index[pivot]) {
903 CD[pivot]->ChangeSetOfSurfData()->Remove(Index[pivot],i[pivot][deb]-1);
904 i[pivot][deb] = Index[pivot];
905 }
906 if(!myEVIMap.IsBound(Vtx)){
907 TColStd_ListOfInteger li;
908 myEVIMap.Bind(Vtx,li);
909 }
910 myEVIMap.ChangeFind(Vtx).Append(coin->Surf());
911 corner->SetSolidIndex(CD[pivot]->SolidIndex());
912 myListStripe.Append(corner);
913
0797d9d3 914#ifdef OCCT_DEBUG
81bba717 915 ChFi3d_ResultChron(ch , t_t3cornerDS);// result perf update DS
7fd59977 916#endif
917}