parameters: (wires,method=2,cleanup=False)
docstring: makeFace(wires): makes a face from a list of wires, finding which ones are holes
docstring_summary: makeFace(wires): makes a face from a list of wires, finding which ones are holes
docstring_tokens: makeFace ( wires ) : makes a face from a list of wires finding which ones are holes
function: def makeFace(wires,method=2,cleanup=False):
      '''makeFace(wires): makes a face from a list of wires, finding which ones are holes'''
      #print("makeFace: start:", wires)
      import Part
  
      if not isinstance(wires,list):
          if len(wires.Vertexes) < 3:
              raise
          return Part.Face(wires)
      elif len(wires) == 1:
          #import Draft;Draft.printShape(wires[0])
          if len(wires[0].Vertexes) < 3:
              raise
          return Part.Face(wires[0])
  
      wires = wires[:]
  
      #print("makeFace: inner wires found")
      ext = None
      max_length = 0
      # cleaning up rubbish in wires
      if cleanup:
          for i in range(len(wires)):
              wires[i] = DraftGeomUtils.removeInterVertices(wires[i])
          #print("makeFace: garbage removed")
      for w in wires:
          # we assume that the exterior boundary is that one with
          # the biggest bounding box
          if w.BoundBox.DiagonalLength > max_length:
              max_length = w.BoundBox.DiagonalLength
              ext = w
      #print("makeFace: exterior wire", ext)
      wires.remove(ext)
  
      if method == 1:
          # method 1: reverse inner wires
          # all interior wires mark a hole and must reverse
          # their orientation, otherwise Part.Face fails
          for w in wires:
              #print("makeFace: reversing", w)
              w.reverse()
              # make sure that the exterior wires comes as first in the list
          wires.insert(0, ext)
          #print("makeFace: done sorting", wires)
          if wires:
              return Part.Face(wires)
      else:
          # method 2: use the cut method
          mf = Part.Face(ext)
          #print("makeFace: external face:", mf)
          for w in wires:
              f = Part.Face(w)
              #print("makeFace: internal face:", f)
              mf = mf.cut(f)
          #print("makeFace: final face:", mf.Faces)
          return mf.Faces[0]
function_tokens: def makeFace ( wires , method = 2 , cleanup = False ) : #print("makeFace: start:", wires) import Part if not isinstance ( wires , list ) : if len ( wires . Vertexes ) < 3 : raise return Part . Face ( wires ) elif len ( wires ) == 1 : #import Draft;Draft.printShape(wires[0]) if len ( wires [ 0 ] . Vertexes ) < 3 : raise return Part . Face ( wires [ 0 ] ) wires = wires [ : ] #print("makeFace: inner wires found") ext = None max_length = 0 # cleaning up rubbish in wires if cleanup : for i in range ( len ( wires ) ) : wires [ i ] = DraftGeomUtils . removeInterVertices ( wires [ i ] ) #print("makeFace: garbage removed") for w in wires : # we assume that the exterior boundary is that one with # the biggest bounding box if w . BoundBox . DiagonalLength > max_length : max_length = w . BoundBox . DiagonalLength ext = w #print("makeFace: exterior wire", ext) wires . remove ( ext ) if method == 1 : # method 1: reverse inner wires # all interior wires mark a hole and must reverse # their orientation, otherwise Part.Face fails for w in wires : #print("makeFace: reversing", w) w . reverse ( ) # make sure that the exterior wires comes as first in the list wires . insert ( 0 , ext ) #print("makeFace: done sorting", wires) if wires : return Part . Face ( wires ) else : # method 2: use the cut method mf = Part . Face ( ext ) #print("makeFace: external face:", mf) for w in wires : f = Part . Face ( w ) #print("makeFace: internal face:", f) mf = mf . cut ( f ) #print("makeFace: final face:", mf.Faces) return mf . Faces [ 0 ]