HOME | DD

Published: 2015-02-12 05:13:38 +0000 UTC; Views: 317; Favourites: 0; Downloads: 0
Redirect to original
Description
(eval-when (:compile-toplevel :load-toplevel)(require 'vecto))
(in-package :vecto)
(defun j (x n)
(+ (- x n) (random (* 2 n))))
(defun render (file)
(let* ((w (/ 10800 1)) (h (/ 7800 1)) (s (coerce (/ w 64) 'float)) (n 2))
(with-canvas (:width w :height h)
(set-rgba-fill 1 1 1 1)
(rectangle 0 0 w h)
(fill-path)
(set-line-cap :round)
(do ((v (* s 2) (incf v)))
((> v (* s 2.05)))
(do ((x 0 (incf x s)))
((> x w))
(do ((y 0 (incf y s)))
((> y h))
(move-to x y)
(do ((theta 0 (incf theta (random .5)))
(r (random v) (random v)))
((> theta (* 2 pi)))
(line-to (+ x (* (cos theta) r)) (+ y (* (sin theta) r))))
(if (= 0 (random 7))
(set-rgba-fill 0 0 0 1)
(set-rgba-fill (/ 198 255) (/ 179 255) (/ 161 255) (random .25)))
(move-to x y)
(fill-path)
)))
(do ((v (* s 10) (incf v)))
((> v (* s 10.05)))
(do ((x 0 (incf x v)))
((> x w))
(do ((y 0 (incf y v)))
((> y h))
(move-to x y)
(do ((theta 0 (incf theta (random .5)))
(r (random v) (random v)))
((> theta (* 2 pi)))
(line-to (+ x (* (cos theta) r)) (+ y (* (sin theta) r))))
(set-rgba-fill (/ 198 255) (/ 179 255) (/ 161 255) (random .25))
(move-to x y)
(fill-path)
)))
(save-png file))))
(render "x-B.png")