HOME | DD

burtonsamograd — X-12

Published: 2015-02-15 02:38:09 +0000 UTC; Views: 492; Favourites: 0; Downloads: 0
Redirect to original
Description (eval-when (:compile-toplevel :load-toplevel)
  (require 'vecto))
(in-package :vecto)

(defun j (x n)
  (if (not (= 0 n))
      (+ (- x n) (random (* 2 n)))
      x))

(defun heart (j)
  (move-to 0 0)
  (do ((x 0 (incf x .01)))
      ((> x (* 2 pi)))
      (let ((x (* 16 (expt (sin x) 3)))
            (y (- (* 13 (cos x)) (* 5 (cos (* 2 x))) (* 2 (cos (* 3 x))) (cos (* 4 x)))))
        (line-to (j x j) (j y j)))))

(defun render (file)
  (let* ((w (/ 10800 10)) (h (/ 7800 10)) (s (coerce (/ w 64) 'float)) (n 1500))
    (with-canvas (:width w :height h)
      (set-rgba-fill 1 1 1 1)
      (rectangle 0 0 w h)
      (set-line-cap :round)
      (fill-path)

      (translate (/ w 2) (/ h 2))
      (scale (/ w 64) (/ w 64))
      (do ((i 3 (decf i .5)))
          ((= i 1))
        (set-rgba-stroke 1 0 0 (random .5))
        (heart 0)
        (stroke)
        (set-rgba-fill 1 0 0 .5)
        (set-line-width .75)
        (fill-path)
        (heart 1)
        (stroke)
        (set-line-width .24)
        (set-rgba-stroke 0 0 0 (random .5))
        (heart 1)
        (stroke)
        )

      ;; signature
      (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-12.png")
Related content
Comments: 1

burtonsamograd [2015-02-15 04:25:11 +0000 UTC]

Shirt available: www.zazzle.com/heart-235292391…

👍: 0 ⏩: 0