How to use the desert.helpers.filename function in desert

To help you get started, we’ve selected a few desert examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github inconvergent / desert / examples / spline.py View on Github external
for _ in range(20):
      a = sorted(random(num)*TWOPI)
      spl.append(0.5 + column_stack((cos(a), sin(a)))*rad)

    res = []
    for i in range(1, 4000000):
      for xy in spl:
        n = xy.shape[0]
        xy += in_circle(n, 0, 0, 1)*reshape(arange(n), (n, 1))*noise
        res.append(xy.copy())

      if not i%400:
        c.draw([bzspl(res, density, noise=0.001)]).show(gamma=1.5)
        res = []
      if not i%(400*20):
        c.save(filename(arg), gamma=1.5)
github inconvergent / desert / examples / walker.py View on Github external
stackb = []

    drift = in_circle(1, 0, 0, 0.00001)

    for i in range(1, 100000):
      xya += in_circle(num, 0, 0, 0.001) + drift
      xyb += in_circle(num, 0, 0, 0.001) + drift
      stacka.append(xya.copy())
      stackb.append(xyb.copy())

      if not i%10000:
        desert.draw([stroke(stacka, stackb, 0.01)]).show(0.01)
        stacka = []
        stackb = []

    desert.show(1).save(filename(arg))
github inconvergent / desert / examples / main.py View on Github external
(0.45, 0.25),
                  (0.95, 0.15),
                  (0.95, 0.3),
                  (0.98, 0.45),
                  (0.85, 0.9),
                  (0.15, 0.87)]], 2)]).show()

    desert.set_fg(rgb(1, 0, 1, 1))

    draw([bzspl([[(0.5, 0.1),
                  (0.3, 0.2),
                  (0.1, 0.3),
                  (0.4, 0.3),
                  (0.95, 0.45),
                  (0.8, 0.9),
                  (0.1, 0.87)]], 2)]).gforce().show(3).save(filename(arg))
github inconvergent / desert / examples / circle.py View on Github external
for i in range(4000000):
      a += acc
      acc += (1-2*random(2))*noise

      resa.append((cos(a[0]), sin(a[0])))
      resb.append((cos(a[1]), sin(a[1])))

      if not i%100000:
        c.draw([stroke(0.5 + array(resa)*rad,
                       0.5 + array(resb)*rad,
                       density)]).show()
        resa = []
        resb = []

    c.save(filename(arg), gamma=1.5)