Ejemplo n.º 1
0
def main():
  import sys, traceback
  from fn import Fn
  from sand import Sand

  sand = Sand(SIZE)
  sand.set_bg_from_rgb_array(img)
  sand.set_rgba(FRONT)

  fn = Fn(prefix='./res/', postfix='.png')
  si = spline_iterator()

  while True:
    try:
      itt, xy = next(si)
      # sand.distort_dots_swap(xy)
      sand.distort_dots_wind(xy)

      if not itt%5000:
        print(itt)
        sand.write_to_png(fn.name())
    except Exception:
      sand.write_to_png(fn.name())
      traceback.print_exc(file=sys.stdout)
      return