def getPillarOutput(loops):
 faces = []
 vertexDictionary = {}
 vertexes = []
 for loop in loops:
  for (vertexIndex, vertex) in enumerate(loop):
   position = (vertex.x, vertex.y, vertex.z)
   if (position in vertexDictionary):
    loop[vertexIndex] = vertexDictionary[position]
   else:
    if (vertex.__class__ != Vector3Index):
     loop[vertexIndex] = Vector3Index(len(vertexDictionary), vertex.x, vertex.y, vertex.z)
    vertexDictionary[position] = loop[vertexIndex]
    vertexes.append(loop[vertexIndex])
 addPillarByLoops(faces, loops)
 return {'trianglemesh': {'vertex': vertexes, 'face': faces}}

def getPillarOutput ( loops ) : faces = [ ] vertexDictionary = { } vertexes = [ ] for loop in loops : for ( vertexIndex , vertex ) in enumerate ( loop ) : position = ( vertex . x , vertex . y , vertex . z ) if ( position in vertexDictionary ) : loop [ vertexIndex ] = vertexDictionary [ position ] else : if ( vertex . __class__ != Vector3Index ) : loop [ vertexIndex ] = Vector3Index ( len ( vertexDictionary ) , vertex . x , vertex . y , vertex . z ) vertexDictionary [ position ] = loop [ vertexIndex ] vertexes . append ( loop [ vertexIndex ] ) addPillarByLoops ( faces , loops ) return { 'trianglemesh' : { 'vertex' : vertexes , 'face' : faces } }
get pillar output .