1 // Created on: 1996-03-07
2 // Created by: Jean Yves LEBEY
3 // Copyright (c) 1996-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and / or modify it
9 // under the terms of the GNU Lesser General Public 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.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #include <TopOpeBRepBuild_Builder.ixx>
19 #include <BRep_Builder.hxx>
20 #include <TopTools_IndexedDataMapOfShapeShape.hxx>
21 #include <TopTools_IndexedMapOfOrientedShape.hxx>
24 #include <TopoDS_Wire.hxx>
25 #include <TopoDS_Compound.hxx>
26 #include <BRep_Tool.hxx>
27 #include <BRepTools.hxx>
28 #include <GeomAdaptor_Surface.hxx>
29 #include <GeomAbs_SurfaceType.hxx>
30 #include <Geom_Surface.hxx>
31 #include <Geom_RectangularTrimmedSurface.hxx>
32 #include <Geom2d_Curve.hxx>
33 #include <Standard_ProgramError.hxx>
34 #include <TopOpeBRepDS.hxx>
35 #include <TopOpeBRepDS_EXPORT.hxx>
36 #include <TopOpeBRepTool.hxx>
37 #include <TopOpeBRepTool_EXPORT.hxx>
38 #include <TopOpeBRepBuild_define.hxx>
39 #include <TopOpeBRepTool_2d.hxx>
43 extern Standard_Boolean TopOpeBRepBuild_GetcontextNOPURGE();
44 extern Standard_Boolean TopOpeBRepBuild_GetcontextNOCORRISO();
45 extern Standard_Boolean TopOpeBRepBuild_GettraceCHK();
46 extern Standard_Boolean TopOpeBRepDS_GettraceSTRANGE();
47 #define DEBSHASET(sarg,meth,shaset,str) \
48 TCollection_AsciiString sarg((meth));(sarg)=(sarg)+(shaset).DEBNumber()+(str);
49 Standard_EXPORT void debgfabu(const Standard_Integer i) {cout<<"++ debgfabu "<<i<<endl;}
50 Standard_EXPORT void debwesmf(const Standard_Integer i) {cout<<"++ debwesmf "<<i<<endl;}
51 Standard_EXPORT Standard_Boolean DEBpurclo = Standard_False;
53 void debpurclomess(Standard_Integer i){cout<<"++ debpurclo "<<i<<endl;debpurclo();}
54 Standard_EXPORT void debcorriso(const Standard_Integer i) {cout<<"++ debcorriso "<<i<<endl;}
55 extern void* GFABUMAKEFACEPWES_DEB;
60 #include <TopOpeBRepTool_DRAW.hxx>
63 Standard_EXPORT Standard_Boolean FUN_tool_ClosedW(const TopoDS_Wire& W);
66 static void FUN_Raise(){cout<<"--------- ERROR in GWESMakeFaces ---------"<<endl;}
69 //=======================================================================
70 //function : GWESMakeFaces
72 //=======================================================================
73 void TopOpeBRepBuild_Builder::GWESMakeFaces
74 (const TopoDS_Shape& FF,TopOpeBRepBuild_WireEdgeSet& WES,TopTools_ListOfShape& LOF)
77 Standard_Integer iF; Standard_Boolean tSPS = GtraceSPS(FF,iF);
78 DEBSHASET(s,"#--- GWESMakeFaces ",WES," ");
79 if(tSPS){ GdumpSHA(FF,(Standard_Address)s.ToCString());cout<<endl; WES.DumpSS();}
80 if(tSPS){debwesmf(iF);}
81 GFABUMAKEFACEPWES_DEB = (void*)&WES;
84 const Standard_Boolean ForceClass = Standard_True;
85 TopOpeBRepBuild_FaceBuilder FABU;
86 FABU.InitFaceBuilder(WES,FF,ForceClass);
88 // Wire checking,the aim is to rebuild faces having
89 // edges unconnected to the others (in the face UV representation)
90 // This can occur when the face has a closing edge. To avoid this,
91 // we delete the lonesome closing edge from the wire.
92 Standard_Boolean topurge = Standard_True;
94 if (TopOpeBRepBuild_GetcontextNOPURGE()) topurge = Standard_False;
98 Standard_Boolean traceF = Standard_False;
100 TopTools_IndexedMapOfShape mapW;
101 for (FABU.InitFace(); FABU.MoreFace(); FABU.NextFace()) {
102 for (FABU.InitWire(); FABU.MoreWire(); FABU.NextWire()) {
104 Standard_Boolean isold = FABU.IsOldWire();
105 if (isold) W = FABU.OldWire();
108 TopoDS_Compound cmp; BB.MakeCompound(cmp);
110 for (; FABU.MoreEdge(); FABU.NextEdge()) FABU.AddEdgeWire(FABU.Edge(),cmp);
113 if (W.IsNull()) continue;
114 Standard_Integer iiwi = mapW.Add(W); TCollection_AsciiString aa("wii_");FUN_tool_draw(aa,W,iiwi);
121 TopOpeBRepDS_DataStructure& BDS = myDataStructure->ChangeDS();
123 TopTools_IndexedMapOfShape mapPIE; // pseudo internal edges
124 FABU.DetectPseudoInternalEdge(mapPIE);
126 TopTools_IndexedDataMapOfShapeShape mapVVsameG,mapVon1Edge,mapVVref;
127 FABU.DetectUnclosedWire(mapVVsameG,mapVon1Edge);
129 Standard_Integer nVV = mapVVsameG.Extent();
131 // Updating the DS with same domain vertices,
132 // filling up map <mapVVref>
133 for (Standard_Integer i = 1; i <= nVV; i++) {
134 const TopoDS_Shape& V = mapVVsameG.FindKey(i);
135 Standard_Boolean hsdm = myDataStructure->HasSameDomain(V);
137 Standard_Integer rankV = BDS.AncestorRank(V);
139 const TopoDS_Shape& VsameG = mapVVsameG.FindFromIndex(i);
141 // MSV Oct 4, 2001: prefer old vertex as SameDomainReference
142 Standard_Integer rankVsameG = BDS.AncestorRank(VsameG);
143 Standard_Boolean otherRef = (rankVsameG != 0 && rankV != 1);
146 BDS.FillShapesSameDomain(VsameG,V);
148 BDS.FillShapesSameDomain(V,VsameG);
150 hsdm = myDataStructure->HasSameDomain(V);
153 Standard_Integer Iref = myDataStructure->SameDomainReference(V);
154 const TopoDS_Shape& Vref = myDataStructure->Shape(Iref);
155 mapVVref.Add(V,Vref);
158 FABU.CorrectGclosedWire(mapVVref,mapVon1Edge);
159 FABU.DetectUnclosedWire(mapVVsameG,mapVon1Edge);
163 TopTools_DataMapOfShapeInteger MWisOld;
164 TopTools_IndexedMapOfOrientedShape MshNOK;
165 GFABUMakeFaces(FF,FABU,LOF,MWisOld);
167 // 2. on periodic face F :
168 // finds up faulty shapes MshNOK to avoid when building up shapes
169 // (edge no longer closing that appears twice in the new face)
175 cout<<endl<<"#<< AVANT PurgeClosingEdges "<<endl;
177 TopTools_ListOfShape dLOF;TopTools_DataMapOfShapeInteger dMWisOld;
178 GFABUMakeFaces(FF,FABU,dLOF,dMWisOld);
179 TopTools_ListIteratorOfListOfShape X(dLOF); for (Standard_Integer i=1;X.More();X.Next(),i++) {
180 TCollection_AsciiString ss("purclo");ss=ss+i;DBRep::Set(ss.ToCString(),X.Value());
181 cout<<"... face "<<ss<<endl;
184 DEBpurclo = Standard_True;
188 const TopoDS_Face& FA = TopoDS::Face(FF);
189 Standard_Boolean puok = TopOpeBRepTool::PurgeClosingEdges(FA,LOF,MWisOld,MshNOK);
190 if (!puok) Standard_Failure::Raise("TopOpeBRepBuild::GWESMakeFaces");
191 topurge = !MshNOK.IsEmpty();
194 if (tSPS) DEBpurclo = Standard_False;
199 TopTools_ListOfShape LOFF;
200 Standard_Boolean puok = TopOpeBRepTool::MakeFaces(TopoDS::Face(FF),LOF,MshNOK,LOFF);
201 if (!puok) Standard_Failure::Raise("TopOpeBRepBuild::GWESMakeFaces");
202 LOF.Clear(); LOF.Assign(LOFF);
205 //1. on periodic face F :
206 // translates edge's pcurve to have it in F's UVbounds
207 // translates edge's pcurve to have it connexed to others in UV space
208 Standard_Boolean corronISO = Standard_True;
210 if (TopOpeBRepBuild_GetcontextNOCORRISO()) corronISO = Standard_False;
211 if (tSPS) debcorriso(iF);
213 Standard_Boolean ffcloseds = FUN_tool_closedS(FF);
214 corronISO = corronISO && ffcloseds;
216 TopTools_ListIteratorOfListOfShape itFF(LOF);
217 TopTools_ListOfShape newLOF;
218 const TopoDS_Face& FFa = TopoDS::Face(FF);
219 for (; itFF.More(); itFF.Next()){
220 TopoDS_Face Fa = TopoDS::Face(itFF.Value());
221 TopOpeBRepTool::CorrectONUVISO(FFa,Fa);
224 LOF.Clear(); LOF.Assign(newLOF);
227 // xpu280898 : regularisation after GFABUMakeFaces,purge processings
228 TopTools_ListOfShape newLOF; RegularizeFaces(FF,LOF,newLOF);
229 LOF.Clear(); LOF.Assign(newLOF);
233 //------------------------------------------------------
234 // retourne vrai si newFace contient une seule arete non orientee
235 //------------------------------------------------------
236 static Standard_Boolean FUN_purgeFon1nonoriE(const TopoDS_Shape& newFace)
238 TopExp_Explorer ex(newFace,TopAbs_EDGE);
239 Standard_Integer nE = 0;
240 for (; ex.More(); ex.Next()) nE++;
242 ex.Init(newFace,TopAbs_EDGE);
243 const TopoDS_Shape& ed = ex.Current();
244 TopAbs_Orientation ori = ed.Orientation();
245 Standard_Boolean hasori = (ori == TopAbs_FORWARD) || (ori == TopAbs_REVERSED);
246 if (!hasori) return Standard_True;
247 //// modified by jgv, 6.06.02 for OCC424 ////
248 TopoDS_Edge theEdge = TopoDS::Edge( ed );
249 if (BRep_Tool::Degenerated( theEdge ))
250 return Standard_True;
251 /////////////////////////////////////////////
253 return Standard_False;
256 //-- ofv --------------------------------------------------------------------
257 // function : FUN_ReOrientIntExtEdge
258 // purpose : change orientation of INTERNAL (EXTERNAL) edge, if necessary
259 // FRE - tool (edge with FORWARD or REVERSED orientation),
260 // OFRE - orientation of tool (FORWARD or REVERSED),
261 // INE - object (edge with INTERNAL (EXTERNAL) orientation)
262 //---------------------------------------------------------------------------
263 static TopAbs_Orientation FUN_ReOrientIntExtEdge(const TopoDS_Edge& FRE,
264 TopAbs_Orientation OFRE,
265 const TopoDS_Edge& INE)
267 TopAbs_Orientation result = INE.Orientation();
268 TopoDS_Vertex Vf1,Vl1,Vf2,Vl2;
270 TopExp::Vertices(FRE, Vf1, Vl1, Standard_False);
271 TopExp::Vertices(INE, Vf2, Vl2, Standard_False);
273 if(OFRE == TopAbs_FORWARD)
275 if(Vl1.IsSame(Vf2)) result = TopAbs_FORWARD;
276 if(Vl1.IsSame(Vl2)) result = TopAbs_REVERSED;
277 if(Vf1.IsSame(Vf2)) result = TopAbs_REVERSED;
278 if(Vf1.IsSame(Vl2)) result = TopAbs_FORWARD;
280 if(OFRE == TopAbs_REVERSED)
282 if(Vl1.IsSame(Vf2)) result = TopAbs_REVERSED;
283 if(Vl1.IsSame(Vl2)) result = TopAbs_FORWARD;
284 if(Vf1.IsSame(Vf2)) result = TopAbs_FORWARD;
285 if(Vf1.IsSame(Vl2)) result = TopAbs_REVERSED;
289 //----------------------------------------------------------------------------
291 //-- ofv --------------------------------------------------------------------
292 // function : FUN_CheckORI
294 //----------------------------------------------------------------------------
295 static Standard_Integer FUN_CheckORI(TopAbs_Orientation O1,
296 TopAbs_Orientation O2)
298 Standard_Integer result;
299 if((O1 == TopAbs_INTERNAL || O1 == TopAbs_EXTERNAL) && (O2 == TopAbs_INTERNAL || O2 == TopAbs_EXTERNAL)) result = 0;
300 else if((O1 == TopAbs_INTERNAL || O1 == TopAbs_EXTERNAL) && (O2 == TopAbs_FORWARD || O2 == TopAbs_REVERSED)) result = 1;
301 else if((O1 == TopAbs_FORWARD || O1 == TopAbs_REVERSED) && (O2 == TopAbs_INTERNAL || O2 == TopAbs_EXTERNAL)) result = 2;
305 //----------------------------------------------------------------------------
306 //=======================================================================
307 //function : GFABUMakeFaces
309 //=======================================================================
311 void TopOpeBRepBuild_Builder::GFABUMakeFaces(const TopoDS_Shape& FF,TopOpeBRepBuild_FaceBuilder& FABU,
312 TopTools_ListOfShape& LOF,TopTools_DataMapOfShapeInteger& MWisOld)
315 Standard_Integer iF;Standard_Boolean tSPS=GtraceSPS(FF,iF);
317 cout<<endl;GdumpSHA(FF,(char *) "#--- GFABUMakeFaces ");cout<<endl;
318 GdumpFABU(FABU);debgfabu(iF);
320 Standard_Boolean strange = TopOpeBRepDS_GettraceSTRANGE();
323 TopTools_ListOfShape lnewFace;
328 Handle(Geom_Surface) Surf = BRep_Tool::Surface(TopoDS::Face(FF),Loc);
329 // JYL : mise en // des 5 lignes suivantes pour reprendre la correction de DPF
331 // GeomAdaptor_Surface GAS1(Surf);
332 // GeomAbs_SurfaceType tt1 = GAS1.GetType();
333 // Handle(Standard_Type) T = Surf->DynamicType();
334 // Standard_Boolean istrim = ( T == STANDARD_TYPE(Geom_RectangularTrimmedSurface) );
335 // if ( istrim && tt1 == GeomAbs_Plane) Surf = Handle(Geom_RectangularTrimmedSurface)::DownCast(Surf)->BasisSurface();
336 Standard_Real tolFF = BRep_Tool::Tolerance(TopoDS::Face(FF));
341 // Unfortunately, the function GFillONPartsWES2() from file TopOpeBRepBuild_BuilderON.cxx sets orientation of
342 // some section edges as INTERNAL or EXTERNAL, but they should be FORWARD or REVERSED. It probably makes faces
343 // without closed boundary, for example. So, we must check carefuly edges with orientation INTERNAL(EXTERNAL).
344 // Bugs: 60936, 60937, 60938 (cut, fuse, common shapes)
345 TopoDS_Compound CmpOfEdges;
346 BRep_Builder BldCmpOfEdges;
347 TopTools_IndexedDataMapOfShapeListOfShape mapVOE;
348 TopoDS_Face tdF = TopoDS::Face(FF);
352 for (; FABU.MoreFace(); FABU.NextFace())
354 Standard_Integer nbnewWwithe = 0;
355 Standard_Integer nboldW = 0;
357 BB.MakeFace(newFace,Surf,Loc,tolFF);
358 // myBuildTool.CopyFace(FF,newFace);
360 Standard_Integer nbw = FABU.InitWire();
361 for (; FABU.MoreWire(); FABU.NextWire())
363 Standard_Integer ne = 0;
364 Standard_Integer neFORWARD = 0;
365 Standard_Integer neREVERSED = 0;
366 Standard_Integer neINTERNAL = 0;
367 Standard_Integer neEXTERNAL = 0;
369 Standard_Boolean isold = FABU.IsOldWire();
373 newWire = TopoDS::Wire(FABU.OldWire());
377 BldCmpOfEdges.MakeCompound(CmpOfEdges);//new compound
378 myBuildTool.MakeWire(newWire);
380 for(; FABU.MoreEdge(); FABU.NextEdge())
382 TopoDS_Edge newEdge = TopoDS::Edge(FABU.Edge());
383 // if (mEtouched.Contains(newEdge)) continue;// xpu290498
384 // mEtouched.Add(newEdge);// xpu290498
387 Standard_Integer nadde = FABU.AddEdgeWire(newEdge,CmpOfEdges);
389 //Standard_Integer nadde = FABU.AddEdgeWire(newEdge,newWire);
393 TopAbs_Orientation oE = newEdge.Orientation();
394 if (oE == TopAbs_INTERNAL) neINTERNAL++;
395 else if (oE == TopAbs_EXTERNAL) neEXTERNAL++;
396 else if (oE == TopAbs_FORWARD) neFORWARD++;
397 else if (oE == TopAbs_REVERSED) neREVERSED++;
399 Standard_Boolean hasPC = FC2D_HasCurveOnSurface(newEdge,newFace); // jyl980402+
400 if (!hasPC) // jyl980402+
402 Standard_Real tolE = BRep_Tool::Tolerance(newEdge); // jyl980402+
403 Standard_Real f2,l2,tolpc; Handle(Geom2d_Curve) C2D; // jyl980402+
404 //C2D = FC2D_CurveOnSurface(newEdge,newFace,f2,l2,tolpc); // jyl980402+
405 C2D = FC2D_CurveOnSurface(newEdge,newFace,f2,l2,tolpc, Standard_True); // xpu051198 (CTS21701)
406 if(C2D.IsNull()) Standard_ProgramError::Raise("TopOpeBRepBuild_Builder::GFABUMakeFaces null PC"); // jyl980402+
407 Standard_Real tol = Max(tolE,tolpc); // jyl980402+
408 BRep_Builder BB_PC; BB_PC.UpdateEdge(newEdge,C2D,newFace,tol); // jyl980402+
413 if((neINTERNAL == 0 && neEXTERNAL == 0) || (ne == neINTERNAL || ne == neEXTERNAL))
415 TopExp_Explorer EdgeEx;
416 if(nbw == 1 && ne == 2)
418 EdgeEx.Init(CmpOfEdges,TopAbs_EDGE);
419 TopoDS_Edge nEdge1 = TopoDS::Edge(EdgeEx.Current());
421 TopoDS_Edge nEdge2 = TopoDS::Edge(EdgeEx.Current());
422 if( nEdge1.IsSame(nEdge2) )
425 for(EdgeEx.Init(CmpOfEdges,TopAbs_EDGE); EdgeEx.More(); EdgeEx.Next())
427 TopoDS_Edge newEdge = TopoDS::Edge(EdgeEx.Current());
428 FABU.AddEdgeWire(newEdge,newWire);
433 //TopTools_IndexedDataMapOfShapeListOfShape mapVOE;
435 TopExp::MapShapesAndAncestors(CmpOfEdges,TopAbs_VERTEX,TopAbs_EDGE,mapVOE);
436 // checking: wire is closed and regular. If wire is not close or not regular: vertex has only the one edge
437 // or vetrex has more then two shared edges, we don't modify it.
438 Standard_Boolean WisClsd = Standard_True;
439 for(Standard_Integer MapStep = 1; MapStep <= mapVOE.Extent(); MapStep++)
441 const TopTools_ListOfShape& LofE = mapVOE.FindFromIndex(MapStep);
442 if(LofE.Extent() != 2) { WisClsd = Standard_False; break; }
446 //wire is not regular:
447 TopExp_Explorer EdgeEx;
448 for(EdgeEx.Init(CmpOfEdges,TopAbs_EDGE); EdgeEx.More(); EdgeEx.Next())
450 TopoDS_Edge newEdge = TopoDS::Edge(EdgeEx.Current());
451 FABU.AddEdgeWire(newEdge,newWire);
456 //wire seems to be regular:
457 TopTools_ListOfShape LofAddE; // list of edges has already been added in wire
458 Standard_Integer naddsame = 0;
459 while( ne > (LofAddE.Extent() + naddsame) )
461 for(Standard_Integer StepMap = 1; StepMap <= mapVOE.Extent(); StepMap++)
463 const TopTools_ListOfShape& LofE = mapVOE.FindFromIndex(StepMap);
464 TopTools_ListIteratorOfListOfShape itLofE(LofE);
465 TopoDS_Edge E1 = TopoDS::Edge(itLofE.Value());
467 TopoDS_Edge E2 = TopoDS::Edge(itLofE.Value());
468 TopAbs_Orientation O1 = E1.Orientation();
469 TopAbs_Orientation O2 = E2.Orientation();
470 Standard_Boolean IsSameE1 = BRep_Tool::IsClosed(E1,tdF);
471 Standard_Boolean IsSameE2 = BRep_Tool::IsClosed(E2,tdF);
472 Standard_Boolean AddE1 = Standard_True;
473 Standard_Boolean AddE2 = Standard_True;
475 //checking current edges in the list of added edges
476 TopTools_ListIteratorOfListOfShape itLofAddE(LofAddE);
477 for(; itLofAddE.More(); itLofAddE.Next() )
479 const TopoDS_Shape& LE = itLofAddE.Value();
480 TopAbs_Orientation OLE = LE.Orientation();
481 if(E1.IsSame(LE) && !IsSameE1) { AddE1 = Standard_False; E1.Orientation(OLE); O1 = OLE; }
482 if(E2.IsSame(LE) && !IsSameE2) { AddE2 = Standard_False; E2.Orientation(OLE); O2 = OLE; }
484 Standard_Integer chkORI = FUN_CheckORI(O1,O2);
485 if(chkORI == 0){ AddE1 = Standard_False; AddE2 = Standard_False; }
488 TopAbs_Orientation ori = FUN_ReOrientIntExtEdge(E2,O2,E1);
489 if(ori == TopAbs_FORWARD) { E1.Orientation(TopAbs_FORWARD); neFORWARD++; }
490 if(ori == TopAbs_REVERSED){ E1.Orientation(TopAbs_REVERSED); neREVERSED++; }
491 if(ori == TopAbs_REVERSED || ori == TopAbs_FORWARD)
493 if(O1 == TopAbs_INTERNAL) neINTERNAL--;
499 TopAbs_Orientation ori = FUN_ReOrientIntExtEdge(E1,O1,E2);
500 if(ori == TopAbs_FORWARD) { E2.Orientation(TopAbs_FORWARD); neFORWARD++; }
501 if(ori == TopAbs_REVERSED){ E2.Orientation(TopAbs_REVERSED); neREVERSED++; }
502 if(ori == TopAbs_REVERSED || ori == TopAbs_FORWARD)
504 if(O2 == TopAbs_INTERNAL) neINTERNAL--;
513 FABU.AddEdgeWire(E1,newWire);
514 if(!IsSameE1) LofAddE.Append(E1);
519 FABU.AddEdgeWire(E2,newWire);
520 if(!IsSameE2) LofAddE.Append(E2);
526 } // neINTERNAL(neEXTERNAL) != 0
531 if ( tSPS ) cout<<"#--- GFABUMakeFaces "<<iF<<" : "<<ne<<" edges"<<endl;
536 Standard_Integer iow = isold? 1: 0;
537 MWisOld.Bind(newWire,iow);
540 // <newWire> is empty :
542 if (ne == 0) continue;
543 else if (nbw == 1 && (ne == neINTERNAL+neEXTERNAL)) continue;
547 // caractere Closed() du nouveau wire newWire
549 Standard_Boolean closed = FUN_tool_ClosedW(newWire);
550 myBuildTool.Closed(newWire,closed);
553 myBuildTool.AddFaceWire(newFace,newWire);
557 if ( nbnewWwithe == 0 && nboldW == 0 ) {
561 Standard_Boolean topurge = FUN_purgeFon1nonoriE(newFace);
564 if (strange) cout<<"Builder::GFABUMakeFaces -> purgeFon1nonoriE\n";
569 // Le changement de surface de trim a basis causait la perte des regularites de l'edge
570 // j'ai change par un recadrage du trim en attendant mieux. DPF le 29/07/1998.
571 // Le danger est de modifier une donnee d'entree.
572 Handle(Standard_Type) T = Surf->DynamicType();
573 Standard_Boolean istrim = ( T == STANDARD_TYPE(Geom_RectangularTrimmedSurface) );
575 Handle(Geom_RectangularTrimmedSurface)
576 hrts=*((Handle(Geom_RectangularTrimmedSurface)*)&Surf);
577 Standard_Real oumin,oumax,ovmin,ovmax;
578 hrts->Bounds(oumin,oumax,ovmin,ovmax);
579 Standard_Real umin,umax,vmin,vmax;
580 BRepTools::UVBounds(newFace, umin, umax, vmin, vmax);
581 if (umin < oumin) oumin=umin;
582 if (umax > oumax) oumax=umax;
583 if (vmin < ovmin) ovmin=vmin;
584 if (vmax > ovmax) ovmax=vmax;
585 hrts->SetTrim(oumin, oumax, ovmin, ovmax, Standard_True, Standard_True);
587 lnewFace.Append(newFace);
593 cout<<endl;GdumpSHA(FF, (char *) "#--- GFABUMakeFaces avant regularize");cout<<endl;
594 GdumpFABU(FABU);debgfabu(iF);
598 // xpu281098 : regularisation after purge processings (cto009L2,f4ou)
599 // RegularizeFaces(FF,lnewFace,LOF);
600 // Standard_Integer nLOF = LOF.Extent(); // DEB
601 LOF.Append(lnewFace);