def addFacesByConvex(faces, indexedLoop):
 if (len(indexedLoop) < 3):
  return
 indexBegin = indexedLoop[0].index
 for indexedPointIndex in xrange(1, (len(indexedLoop) - 1)):
  indexCenter = indexedLoop[indexedPointIndex].index
  indexEnd = indexedLoop[((indexedPointIndex + 1) % len(indexedLoop))].index
  if ((indexBegin != indexCenter) and (indexCenter != indexEnd) and (indexEnd != indexBegin)):
   faceFromConvex = face.Face()
   faceFromConvex.index = len(faces)
   faceFromConvex.vertexIndexes.append(indexBegin)
   faceFromConvex.vertexIndexes.append(indexCenter)
   faceFromConvex.vertexIndexes.append(indexEnd)
   faces.append(faceFromConvex)

def addFacesByConvex ( faces , indexedLoop ) : if ( len ( indexedLoop ) < 3 ) : return indexBegin = indexedLoop [ 0 ] . index for indexedPointIndex in xrange ( 1 , ( len ( indexedLoop ) - 1 ) ) : indexCenter = indexedLoop [ indexedPointIndex ] . index indexEnd = indexedLoop [ ( ( indexedPointIndex + 1 ) % len ( indexedLoop ) ) ] . index if ( ( indexBegin != indexCenter ) and ( indexCenter != indexEnd ) and ( indexEnd != indexBegin ) ) : faceFromConvex = face . Face ( ) faceFromConvex . index = len ( faces ) faceFromConvex . vertexIndexes . append ( indexBegin ) faceFromConvex . vertexIndexes . append ( indexCenter ) faceFromConvex . vertexIndexes . append ( indexEnd ) faces . append ( faceFromConvex )
add faces from a convex polygon .