HOME | DD

#abstract #flag #lines #vector
Published: 2015-02-07 15:20:05 +0000 UTC; Views: 521; Favourites: 0; Downloads: 0
Redirect to original
Description
(eval-when (:compile-toplevel :load-toplevel)(require 'vecto))
(in-package :vecto)
(defun r (x)
(random (coerce x 'float)))
(defun r+ (x)
(1+ (random (coerce x 'float))))
(defun j (x n)
(+ (- x n) (r (* 2 n))))
(defun render (file)
;; 24" x 36" poster size @ 300dpi
(let* ((w 10800) (h 7200) (s (/ w 128)))
(with-canvas (:width w :height h)
;; clear
(set-rgba-fill 1 1 1 1)
(rectangle 0 0 w h)
(fill-path)
(do ((x 0 (incf x s))
(r 0 (incf r .01)))
((> x (/ w 2)))
(do ((y 0 (incf y s)))
((> y (/ h 2)))
(set-rgba-stroke 0 0 0 (r .25))
(set-line-width (r (/ s 2)))
(rectangle x y (- w x) (- h y))
(stroke)
))
(set-rgba-fill 0 0 0 1)
(set-font (get-font "~/OCRABold.ttf") (/ w 128))
(draw-string (- w (/ w 32)) (/ h 32) "X")
(fill-path)
(save-png file))))
(render "x-7.png")
;; burton samograd 2015