def addFacesByConvexBottomTopLoop(faces, indexedLoopBottom, indexedLoopTop):
 if ((len(indexedLoopBottom) == 0) or (len(indexedLoopTop) == 0)):
  return
 for indexedPointIndex in xrange(max(len(indexedLoopBottom), len(indexedLoopTop))):
  indexedConvex = []
  if (len(indexedLoopBottom) > 1):
   indexedConvex.append(indexedLoopBottom[indexedPointIndex])
   indexedConvex.append(indexedLoopBottom[((indexedPointIndex + 1) % len(indexedLoopBottom))])
  else:
   indexedConvex.append(indexedLoopBottom[0])
  if (len(indexedLoopTop) > 1):
   indexedConvex.append(indexedLoopTop[((indexedPointIndex + 1) % len(indexedLoopTop))])
   indexedConvex.append(indexedLoopTop[indexedPointIndex])
  else:
   indexedConvex.append(indexedLoopTop[0])
  addFacesByConvex(faces, indexedConvex)

def addFacesByConvexBottomTopLoop ( faces , indexedLoopBottom , indexedLoopTop ) : if ( ( len ( indexedLoopBottom ) == 0 ) or ( len ( indexedLoopTop ) == 0 ) ) : return for indexedPointIndex in xrange ( max ( len ( indexedLoopBottom ) , len ( indexedLoopTop ) ) ) : indexedConvex = [ ] if ( len ( indexedLoopBottom ) > 1 ) : indexedConvex . append ( indexedLoopBottom [ indexedPointIndex ] ) indexedConvex . append ( indexedLoopBottom [ ( ( indexedPointIndex + 1 ) % len ( indexedLoopBottom ) ) ] ) else : indexedConvex . append ( indexedLoopBottom [ 0 ] ) if ( len ( indexedLoopTop ) > 1 ) : indexedConvex . append ( indexedLoopTop [ ( ( indexedPointIndex + 1 ) % len ( indexedLoopTop ) ) ] ) indexedConvex . append ( indexedLoopTop [ indexedPointIndex ] ) else : indexedConvex . append ( indexedLoopTop [ 0 ] ) addFacesByConvex ( faces , indexedConvex )
add faces from loops .