def load_mesh(path): with open(path, 'r') as f: width, height = f.readline().split(' ') mesh = Mesh(int(width), int(height)) points = mesh.get_points() for line in f.read().splitlines(): x, y, phase, id = line.split(' ') points[int(x)][int(y)].id = int(id) points[int(x)][int(y)].phase = int(phase) return mesh