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