def isPathAdded(edges, faces, loops, remainingEdgeTable, vertexes, z):
 if (len(remainingEdgeTable) < 1):
  return False
 pathIndexes = []
 remainingEdgeIndexKey = remainingEdgeTable.keys()[0]
 pathIndexes.append(remainingEdgeIndexKey)
 del remainingEdgeTable[remainingEdgeIndexKey]
 nextEdgeIndexAroundZ = getNextEdgeIndexAroundZ(edges[remainingEdgeIndexKey], faces, remainingEdgeTable)
 while (nextEdgeIndexAroundZ != (-1)):
  pathIndexes.append(nextEdgeIndexAroundZ)
  del remainingEdgeTable[nextEdgeIndexAroundZ]
  nextEdgeIndexAroundZ = getNextEdgeIndexAroundZ(edges[nextEdgeIndexAroundZ], faces, remainingEdgeTable)
 if (len(pathIndexes) < 3):
  print ('Dangling edges, will use intersecting circles to get import layer at height %s' % z)
  del loops[:]
  return False
 loops.append(getPath(edges, pathIndexes, vertexes, z))
 return True

def isPathAdded ( edges , faces , loops , remainingEdgeTable , vertexes , z ) : if ( len ( remainingEdgeTable ) < 1 ) : return False pathIndexes = [ ] remainingEdgeIndexKey = remainingEdgeTable . keys ( ) [ 0 ] pathIndexes . append ( remainingEdgeIndexKey ) del remainingEdgeTable [ remainingEdgeIndexKey ] nextEdgeIndexAroundZ = getNextEdgeIndexAroundZ ( edges [ remainingEdgeIndexKey ] , faces , remainingEdgeTable ) while ( nextEdgeIndexAroundZ != ( - 1 ) ) : pathIndexes . append ( nextEdgeIndexAroundZ ) del remainingEdgeTable [ nextEdgeIndexAroundZ ] nextEdgeIndexAroundZ = getNextEdgeIndexAroundZ ( edges [ nextEdgeIndexAroundZ ] , faces , remainingEdgeTable ) if ( len ( pathIndexes ) < 3 ) : print ( 'Dangling edges, will use intersecting circles to get import layer at height %s' % z ) del loops [ : ] return False loops . append ( getPath ( edges , pathIndexes , vertexes , z ) ) return True
get the path indexes around a triangle mesh carve and add the path to the flat loops .