Integration of OCCT 6.5.0 from SVN
[occt.git] / src / TopOpeBRepTool / TopOpeBRepTool_faulty.cxx
1 // File:        TopOpeBRepTool_faulty.cxx
2 // Created:     Tue Nov 24 11:15:13 1998
3 // Author:      Xuan PHAM PHU
4 //              <xpu@poulopox.paris1.matra-dtv.fr>
5
6 #include <TopOpeBRepTool_define.hxx>
7 #include <TopOpeBRepTool_EXPORT.hxx>
8 #include <TopOpeBRepTool_2d.hxx>
9 #include <TopExp_Explorer.hxx>
10 #include <BRep_Tool.hxx>
11 #include <GeomAdaptor_Surface.hxx>
12 #include <TopTools_Array1OfShape.hxx>
13 #include <TopoDS.hxx>
14 #include <TopExp.hxx>
15
16 #define M_FORWARD(sta)  (sta == TopAbs_FORWARD)
17 #define M_REVERSED(sta) (sta == TopAbs_REVERSED)
18 #define M_INTERNAL(sta) (sta == TopAbs_INTERNAL)
19 #define M_EXTERNAL(sta) (sta == TopAbs_EXTERNAL)
20
21 #ifdef DRAW
22 #include <TopOpeBRepTool_DRAW.hxx>
23 #endif
24
25 #ifdef DEB
26 //Standard_IMPORT extern TopTools_IndexedMapOfShape STATIC_PURGE_mapv;
27 Standard_IMPORT TopTools_IndexedMapOfShape STATIC_PURGE_mapv;
28 //Standard_IMPORT extern TopTools_IndexedMapOfOrientedShape STATIC_PURGE_mapeds;
29 Standard_IMPORT TopTools_IndexedMapOfOrientedShape STATIC_PURGE_mapeds;
30 Standard_IMPORT Standard_Boolean TopOpeBRepTool_GettracePURGE();
31 Standard_EXPORT void FUN_REINIT()
32 {STATIC_PURGE_mapv.Clear(); STATIC_PURGE_mapeds.Clear();}
33 static void FUN_RaiseError()
34 {
35 #ifdef DEB
36   Standard_Boolean trc = TopOpeBRepTool_GettracePURGE();
37   //  Standard_Failure::Raise("TopOpeBRepTool::PurgeClosingEdges");
38   FUN_REINIT(); 
39   if (trc) cout <<"*********failure in TopOpeBRepTool::PurgeClosingEdges***********\n";
40 #endif
41 }
42 Standard_EXPORT Standard_Integer FUN_addepc(const TopoDS_Shape& ed,const TopoDS_Shape& f){
43   Standard_Integer ie = STATIC_PURGE_mapeds.Add(ed);
44 #ifdef DRAW
45 //  TCollection_AsciiString aa = TCollection_AsciiString("pc_"); FUN_tool_draw(aa,TopoDS::Edge(ed),TopoDS::Face(f),ie);
46 //  TCollection_AsciiString bb = TCollection_AsciiString("ed_"); FUN_tool_draw(bb,ed,ie);
47 #endif  
48   return ie;
49 }
50 Standard_EXPORT Standard_Integer FUN_addcheckepc(const TopoDS_Shape& ed,const TopoDS_Shape& f) {
51   Standard_Integer ie = 0;
52   ie = STATIC_PURGE_mapeds.FindIndex(ed);
53   if (ie == 0) ie = FUN_addepc(ed,f);
54   return ie;
55 }
56 /*Standard_EXPORT Standard_Integer FUN_adds(const TopoDS_Shape& s) {
57   TopAbs_ShapeEnum typ = s.ShapeType();
58   TCollection_AsciiString aa; Standard_Integer is;
59   if (typ == TopAbs_VERTEX) {aa = TCollection_AsciiString("v_"); is = STATIC_PURGE_mapv.Add(s);}
60 #ifdef DRAW
61   Standard_Boolean trc = TopOpeBRepTool_GettracePURGE();
62   if (trc) FUN_tool_draw(aa,s,is);
63 #endif
64   return is;
65 }*/
66 Standard_IMPORT Standard_Integer FUN_adds(const TopoDS_Shape& s);
67 Standard_EXPORT void FUN_tool_tori(const TopAbs_Orientation Or)
68 {
69   switch (Or) {
70   case TopAbs_FORWARD:
71     cout<<"FOR";break;
72   case TopAbs_REVERSED:
73     cout<<"REV";break;
74   case TopAbs_INTERNAL:
75     cout<<"INT";break;
76   case TopAbs_EXTERNAL:
77     cout<<"EXT";break;
78   }    
79 }
80 #endif
81
82 Standard_EXPORT void FUN_tool_trace(const Standard_Integer Index)
83 {if (Index == 1) cout <<"FORWARD ";
84  if (Index == 2) cout <<"REVERSED ";}
85 Standard_EXPORT  void FUN_tool_trace(const gp_Pnt2d p2d)
86 {cout<<" = ("<<p2d.X()<<" "<<p2d.Y()<<")"<<endl;}
87
88 /*Standard_IMPORT Standard_Real FUN_tool_parOnE(const Standard_Integer Index,const TopoDS_Edge& E,const TopoDS_Face& F);
89 Standard_IMPORT void FUN_tool_addTomap
90 (const TopoDS_Shape& key,const TopoDS_Shape& elementOfitem,TopTools_DataMapOfShapeListOfShape& map,const Standard_Integer check);
91 Standard_IMPORT void FUN_tool_addTomap(const TopoDS_Shape& key,const TopoDS_Shape& elementOfitem,
92                                        TopTools_IndexedDataMapOfShapeListOfShape& map,const Standard_Integer check);
93
94 // ----------------------------------------------------------------------
95 Standard_EXPORT gp_Pnt2d FUN_GetVParonF(const TopoDS_Edge& E, const TopoDS_Face& F, const Standard_Integer Index)
96 // ----------------------------------------------------------------------
97 {
98   Standard_Real par = FUN_tool_parOnE(Index, E, F);
99   Standard_Real pf,pl,tol; Handle(Geom2d_Curve) PC = FUNTOOLC2D_CurveOnSurface(E,F,pf,pl,tol); 
100   if (PC.IsNull()) Standard_Failure::Raise(" FUN_GetVParonF : no 2d curve");
101   gp_Pnt2d  p2d; PC->D0(par,p2d);
102   return p2d;
103 }
104
105 // ----------------------------------------------------------------------
106 Standard_EXPORT Standard_Real FUN_toluv(const GeomAdaptor_Surface& GAS, const Standard_Real& tol3d)
107 // ----------------------------------------------------------------------
108 {
109   Standard_Real tolu = GAS.UResolution(tol3d);
110   Standard_Real tolv = GAS.VResolution(tol3d); 
111   Standard_Real toluv = Max(tolu,tolv);
112   return toluv;
113 }
114
115 // ----------------------------------------------------------------------
116 Standard_EXPORT void FUN_tool_Vertices(const TopoDS_Edge& E, TopTools_Array1OfShape& vertices)
117 // ----------------------------------------------------------------------
118 {  
119   // Returns vertices (F,R) if E is FORWARD
120   //                  (R,V) if E is REVERSED
121   TopAbs_Orientation oriE = E.Orientation();
122   TopoDS_Vertex vF, vR; TopExp::Vertices(E,vF,vR);
123   Standard_Integer iF, iR;
124   if (oriE == TopAbs_FORWARD) {iF = 1; iR = 2;}
125   else                        {iF = 2; iR = 1;}
126   vertices.ChangeValue(iF) = vF; 
127   vertices.ChangeValue(iR) = vR;
128
129 // ----------------------------------------------------------------------
130 Standard_EXPORT void FUN_mapVloe(const TopoDS_Shape& F, TopTools_IndexedDataMapOfShapeListOfShape& mapVloe)
131 // ----------------------------------------------------------------------
132 {
133   mapVloe.Clear();
134 //  TopExp::MapShapesAndAncestors(F,TopAbs_VERTEX,TopAbs_EDGE,mapVloe);
135   TopExp_Explorer exe(F, TopAbs_EDGE);
136   for (; exe.More(); exe.Next()){
137     const TopoDS_Shape e = exe.Current();
138     TopExp_Explorer exv(e, TopAbs_VERTEX);
139     for (; exv.More(); exv.Next()){
140       const TopoDS_Shape& v = exv.Current();
141       FUN_tool_addTomap(v, e, mapVloe, 0);      
142     }
143   } 
144 }*/
145
146 //======================================================================
147
148 /*Standard_EXPORT Standard_Boolean FUN_DetectEdgeswithfaultyUV
149 (const TopoDS_Face& Fin, const TopoDS_Shape& fF, const TopTools_ListOfShape& ISOEds,
150  const Standard_Boolean has2fybounds, TopTools_ListOfShape& lfyE, Standard_Integer& Ivfaulty,
151  const Standard_Boolean& stopatfirst=Standard_False)
152 // purpose : finding out edges <lfyE> / its UV rep. on <Fin>
153 //           is unconnected to the other pcurves.
154 //           if (has2fybounds), the 2 bounds of the pcurve are faulty.
155 //           else : Ivfaulty is index of faulty vertex.
156 // return True if at least one edge is faulty
157 {
158   // <ISOEds> : list of pcurves to check among <fF>'s 2d rep. edges.
159   // <ISOEds> are edges of <fF>
160
161   lfyE.Clear();
162   Ivfaulty = 0; // dummy if has2faultybounds
163   TopTools_ListOfShape Eds;
164   TopExp_Explorer exe(fF, TopAbs_EDGE);
165   for (; exe.More(); exe.Next()) Eds.Append(exe.Current());
166
167   // <mapVloe> :
168   // ----------
169   //    key  = a vertex boundary of a closing edge,
170   //    item = the list of edges connexed to the vertex.
171   TopTools_IndexedDataMapOfShapeListOfShape mapVloe; ::FUN_mapVloe(fF,mapVloe);
172
173   const Handle(Geom_Surface)& SU = BRep_Tool::Surface(Fin);
174   GeomAdaptor_Surface GAS(SU);
175   Standard_Real tttol = 1.e-8;
176   Standard_Real tttolF = BRep_Tool::Tolerance(Fin);
177   Standard_Real tttuvF = FUN_toluv(GAS,tttolF);
178   
179   // fF's checking :
180   // -----------------
181   // An edge is valid if the first and last vertices are valid:
182   // vertex <vISOe> is valid if there is an edge with bound <ve> such that :
183   //   <vISOe> and <ve> share same UV geometry
184   //   <vISOe> and <ve> are of opposite orientation.   
185   TopTools_ListIteratorOfListOfShape itISOEd(ISOEds);
186   for (; itISOEd.More(); itISOEd.Next()) {
187     const TopoDS_Edge& ISOe = TopoDS::Edge(itISOEd.Value());
188     TopAbs_Orientation oriISO = ISOe.Orientation();
189     if (M_INTERNAL(oriISO) || M_EXTERNAL(oriISO)) continue;
190     
191     Standard_Real tttolISOe = BRep_Tool::Tolerance(ISOe);
192     Standard_Real tttuvISOe = FUN_toluv(GAS,tttolISOe);
193     
194     TopTools_Array1OfShape vISOE(1,2); FUN_tool_Vertices(ISOe, vISOE);
195
196     Standard_Boolean closed = vISOE(1).IsSame(vISOE(2));
197     if (closed) continue; // closed edge is ass
198     
199     Standard_Integer nfyv = 0;
200     for (Standard_Integer ivISOe = 1; ivISOe <=2; ivISOe++) {
201
202       // <vISOe> (boundary of <ISOe>):      
203       const TopoDS_Vertex& vISOe = TopoDS::Vertex(vISOE(ivISOe));
204       gp_Pnt2d UVvISOe = FUN_GetVParonF(ISOe, Fin, ivISOe);
205       
206       Standard_Real tttolvISOe = BRep_Tool::Tolerance(vISOe);
207       Standard_Real tttuvvISOe = FUN_toluv(GAS,tttolvISOe);
208
209       Standard_Boolean isbound = mapVloe.Contains(vISOe);
210       if (!isbound) {FUN_RaiseError(); return Standard_False;}
211       
212       // <vISOeok> :
213       Standard_Boolean vISOeok = Standard_False;
214       const TopTools_ListOfShape& loe = mapVloe.FindFromKey(vISOe);
215       Standard_Integer nloe = loe.Extent();
216       for (TopTools_ListIteratorOfListOfShape ite(loe); ite.More(); ite.Next()) {
217         const TopoDS_Edge& E = TopoDS::Edge(ite.Value());
218         if (E.IsSame(ISOe)) continue;
219         Standard_Real tttolE = BRep_Tool::Tolerance(E);
220         Standard_Real tttuvE = FUN_toluv(GAS,tttolE);
221
222         TopTools_Array1OfShape vE(1,2); FUN_tool_Vertices(E,vE);        
223         for (Standard_Integer ive = 1; ive <=2; ive++) {          
224           const TopoDS_Vertex& ve = TopoDS::Vertex(vE(ive));      
225           Standard_Boolean samev = ve.IsSame(vISOe);
226           if (!samev) continue;
227           
228           if (ive == ivISOe) continue;
229           gp_Pnt2d UVve = FUN_GetVParonF(E, Fin, ive);  
230           
231           Standard_Real tttolve = BRep_Tool::Tolerance(ve);
232           Standard_Real tttuvve = FUN_toluv(GAS,tttolve);
233  
234           tttol = Max(tttol,Max(tttuvF,Max(tttuvE,Max(tttuvISOe,Max(tttuvve,tttuvvISOe)))));
235           Standard_Boolean isequal = UVvISOe.IsEqual(UVve,tttol);
236           if (isequal) {vISOeok = Standard_True; break;}
237         } // ive        
238         if (vISOeok) break;
239       } // ite(loe)
240       
241       if (!vISOeok) nfyv++;
242       
243       Standard_Boolean stop = (!has2fybounds && (nfyv > 0));
244       if (stop) {
245         if (Ivfaulty == 0) Ivfaulty = ivISOe;//xpu121098 (cto900J4,f4ou) : first faulty edge
246         break;
247       }
248     } // ivISOe = 1..2
249     
250     Standard_Boolean found = has2fybounds && (nfyv == 2);
251     found = found || (!has2fybounds && (nfyv == 1));
252     if (found) {
253       lfyE.Append(ISOe);
254     }
255   }
256
257   Standard_Integer n = lfyE.Extent();
258   Standard_Boolean det = (n != 0);
259   return det;
260 } // FUN_DetectEdgeswithfaultyUV
261
262 Standard_EXPORT Standard_Boolean FUN_DetectEdgewithfaultyUV
263 (const TopoDS_Face& Fin, const TopoDS_Shape& fF, const TopTools_ListOfShape& ISOEds,
264  const Standard_Boolean has2fybounds, TopoDS_Shape& fyE, Standard_Integer& Ivfaulty)
265 // purpose : finding out first edge <fyE> / its UV rep. on <Fin>
266 //           is unconnected to the other pcurves.
267 //           if (has2fybounds), the 2 bounds of the pcurve are faulty.
268 //           else : Ivfaulty is index of faulty vertex.
269 // return True if at least one edge is faulty
270 {
271   // <ISOEds> : list of pcurves to check among <fF>'s 2d rep. edges.
272   // <ISOEds> are edges of <fF>
273   TopTools_ListOfShape lfyE;
274   Standard_Boolean det = FUN_DetectEdgeswithfaultyUV(Fin,fF,ISOEds,has2fybounds,lfyE,Ivfaulty);
275   if (det) fyE = lfyE.First();
276   return det;
277 }
278
279 // ----------------------------------------------------------------------
280 Standard_EXPORT Standard_Boolean FUN_DetectFaultyClosingEdge
281 (const TopoDS_Face& Fin,const TopTools_ListOfShape& Eds,const TopTools_ListOfShape& cEds,TopTools_ListOfShape& fyE)
282 // ----------------------------------------------------------------------
283 {
284 #ifdef DEB
285   Standard_Boolean trc = TopOpeBRepTool_GettracePURGE();
286   for (TopTools_ListIteratorOfListOfShape it(Eds); it.More(); it.Next()){
287     const TopoDS_Shape& ed = it.Value();
288     TopExp_Explorer ex;
289     for (ex.Init(ed, TopAbs_VERTEX); ex.More(); ex.Next())
290 //    for (TopExp_Explorer ex(ed, TopAbs_VERTEX); ex.More(); ex.Next())
291       FUN_adds(ex.Current());}
292 #endif
293
294   // <cEds> and <Eds> are the lists of closed and non-"closing" edges 
295   // describing a wire boundary on face <Fin>. 
296   // ("closing" edge = edge built on the geometry of a closing edge of <Fin> )  
297   
298   // If <W> has UV non-connexed edges, returns <True> if <fyE> is the list of faulty cEds
299   // fyE = {e / e has its 2 bounds non-UVconnexed}
300   // Returns <False> elsewhere.
301   // prequesitory : wire <W> is 3d-connexed, so a faulty edge must be a 
302   //                closing edge.
303
304   // <mapVloe> :
305   // ----------
306   //    key  = a vertex boundary of a closing edge,
307   //    item = the list of edges connexed to the vertex.
308   TopTools_DataMapOfShapeListOfShape mapVloe;
309   for (TopTools_ListIteratorOfListOfShape itEd(Eds); itEd.More(); itEd.Next()) { 
310     const TopoDS_Edge& E = TopoDS::Edge(itEd.Value());
311     TopExp_Explorer ex;
312     for (ex.Init(E, TopAbs_VERTEX); ex.More(); ex.Next()) { 
313 //    for (TopExp_Explorer ex(E, TopAbs_VERTEX); ex.More(); ex.Next()) { 
314       const TopoDS_Shape& v = ex.Current();
315       FUN_tool_addTomap(v, E, mapVloe, 0);
316     }
317   }    
318   const Handle(Geom_Surface)& SU = BRep_Tool::Surface(TopoDS::Face(Fin));
319   GeomAdaptor_Surface GAS(SU);
320   Standard_Real tttol = 1.e-8;
321   Standard_Real tttolF = BRep_Tool::Tolerance(TopoDS::Face(Fin));
322   Standard_Real tttuvF = FUN_toluv(GAS,tttolF);  
323
324   Standard_Boolean uclosed,vclosed; Standard_Real uperiod,vperiod; 
325   Standard_Boolean uvclosed = FUN_tool_closedS(Fin,uclosed,uperiod,vclosed,vperiod);
326   
327   // wire's checking :
328   // -----------------
329   // An edge is valid if the first and last vertices are valid:
330   // vertex <vce> is valid if there is an edge with bound <ve> verifying :
331   //   <vce> and <ve> share same UV geometry
332   //   <vce> and <ve> are of opposite orientation.   
333   TopTools_ListIteratorOfListOfShape itCEd(cEds);
334   for (; itCEd.More(); itCEd.Next()) {
335     const TopoDS_Edge& cE = TopoDS::Edge(itCEd.Value());   
336     Standard_Boolean isou,isov; gp_Pnt2d o2d; gp_Dir2d d2d; 
337     Standard_Real f,l,tol; Handle(Geom2d_Curve) PC = FUNTOOLC2D_CurveOnSurface(cE,Fin,f,l,tol);
338     Standard_Boolean isouv = FUN_tool_IsUViso(PC,isou,isov,d2d,o2d);
339     
340 #ifdef DEB 
341     Standard_Integer icE = FUN_addcheckepc(cE,Fin);
342     if (trc)  {cout<<"closing edge "<<icE<<" "; TopAbs::Print(cE.Orientation(),cout);
343                cout<<" : \n";}
344 #endif
345     
346     Standard_Real tttolcE = BRep_Tool::Tolerance(cE);
347     Standard_Real tttuvcE = FUN_toluv(GAS,tttolcE);
348     
349     Standard_Boolean cEKO = Standard_True;
350     TopTools_Array1OfShape vcE(1,2); FUN_tool_Vertices(cE, vcE);    
351     for (Standard_Integer ivce = 1; ivce <=2; ivce++) {
352       // <vce> (boundary of <cE>):      
353       const TopoDS_Vertex& vce = TopoDS::Vertex(vcE(ivce));
354       gp_Pnt2d UVvce = FUN_GetVParonF(cE, Fin, ivce);
355 #ifdef DEB
356       // recall in one wire, there are 2 vertices for one non-degenerated closing edge
357       Standard_Integer ivmapv = STATIC_PURGE_mapv.Add(vce);
358       if (trc) {
359         cout<<"v"<<ivmapv<<" ";FUN_tool_trace(ivce);cout<<" in closing edge "<<icE;
360         FUN_tool_trace(UVvce);
361 #ifdef DRAW     
362         TCollection_AsciiString bb("uv_");bb += TCollection_AsciiString(ivmapv);FUN_tool_draw(bb,UVvce);
363 #endif  
364       }
365 #endif
366       
367       Standard_Real tttolvce = BRep_Tool::Tolerance(vce);
368       Standard_Real tttuvvce = FUN_toluv(GAS,tttolvce);
369
370       Standard_Boolean isbound = mapVloe.IsBound(vce);
371       if (!isbound) continue; //xpu201198 cto016E2 (e3on)
372       
373       // <vceok> :
374       Standard_Boolean vceok = Standard_False;
375       const TopTools_ListOfShape& loe = mapVloe.Find(vce);
376       Standard_Integer nloe = loe.Extent();
377 #ifdef DRAW
378       Standard_Boolean tdr = Standard_False;
379       if (tdr) {
380         Standard_Integer inde = 1; 
381         for (TopTools_ListIteratorOfListOfShape ite(loe); ite.More(); ite.Next()) {
382           const TopoDS_Shape& eee = ite.Value(); FUN_drawe(eee,inde); inde++;
383         }
384       }
385 #endif
386       for (TopTools_ListIteratorOfListOfShape ite(loe); ite.More(); ite.Next()) {
387         const TopoDS_Edge& E = TopoDS::Edge(ite.Value());
388 //      if (E.IsSame(cE)) continue; // closing FORWARD and REVERSED EDGES are UV disjoint       
389 #ifdef DEB
390         Standard_Integer iE = FUN_addcheckepc(E,Fin);
391 #endif
392
393         Standard_Real tttolE = BRep_Tool::Tolerance(E);
394         Standard_Real tttuvE = FUN_toluv(GAS,tttolE);
395
396         TopTools_Array1OfShape vE(1,2); FUN_tool_Vertices(E,vE);        
397         for (Standard_Integer ive = 1; ive <=2; ive++) {          
398           const TopoDS_Vertex& ve = TopoDS::Vertex(vE(ive));      
399           Standard_Boolean samev = ve.IsSame(vce);
400           if (!samev) continue;
401           
402           if (ive == ivce) continue;
403           gp_Pnt2d UVve = FUN_GetVParonF(E, Fin, ive);  
404           
405           Standard_Real tttolve = BRep_Tool::Tolerance(ve);
406           Standard_Real tttuvve = FUN_toluv(GAS,tttolve);
407  
408           tttol = Max(tttol,Max(tttuvF,Max(tttuvE,Max(tttuvcE,Max(tttuvve,tttuvvce)))));
409 //        Standard_Boolean isequal = UVvce.IsEqual(UVve,tttol);   
410           Standard_Real dd=0., xperiod=0.;
411           if (uclosed && isou) {dd = UVve.X()-UVvce.X(); xperiod = uperiod;}
412           if (vclosed && isov) {dd = UVve.Y()-UVvce.Y(); xperiod = vperiod;}
413           Standard_Boolean xok = (Abs(dd)<tttol) || (Abs(Abs(dd)-xperiod)<tttol);
414           Standard_Boolean isequal = xok; 
415
416           if (isequal) {
417             vceok = Standard_True;
418 #ifdef DEB
419             if (trc) 
420               {cout<<"vertex ";FUN_tool_trace(ivce);cout<<" of closing edge "<<icE;
421                cout<<" is connexed to vertex ";FUN_tool_trace(ive);cout<<" of edge "<<iE<<endl;}
422 #endif  
423           }
424           break;
425         } // ive        
426         if (vceok) break;
427       } // ite(loe)      
428 #ifdef DEB
429       if (trc && !vceok) {cout<<" vertex ";FUN_tool_trace(ivce);
430                           cout<<"of closing edge "<<icE<<" is faulty"<<endl;}   
431 #endif    
432       cEKO = cEKO && (!vceok);
433     } // ivce
434
435 #ifdef DEB 
436     if (trc) {if (!cEKO) cout<<"-> valid edge"<<endl;
437               else cout<<"-> faulty edge"<<endl;}
438 #endif    
439     if (cEKO) {fyE.Append(cE);}
440   }
441   return (!fyE.IsEmpty());
442 }
443
444 Standard_EXPORT Standard_Boolean FUN_isUVClosed(const TopoDS_Face& Fin, const TopoDS_Face& fF)
445 // purpose : returns true is fF is UV connexed
446 {
447   TopTools_ListOfShape efF; 
448   TopExp_Explorer ex(fF, TopAbs_EDGE);
449   for (; ex.More(); ex.Next()) efF.Append(ex.Current());
450   Standard_Integer Ivfaulty; TopTools_ListOfShape lfyE; Standard_Boolean stopatfirst = Standard_True;
451   Standard_Boolean foundfaulty = FUN_DetectEdgeswithfaultyUV(Fin,fF,efF,Standard_False,lfyE,Ivfaulty,stopatfirst);
452   return !foundfaulty;
453 }*/