Last active
December 29, 2020 11:45
-
-
Save shspage/5b6b2f29b9d5be1a16e17f3b0a2eafd3 to your computer and use it in GitHub Desktop.
gilsp( https://github.com/baku89/glisp )用スクリプトです
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(def spiral_radius 30) | |
(def interval 1.2) | |
(def arc_angle (deg 80)) | |
(defn prepare [tr t r] | |
(if (> r spiral_radius) | |
tr | |
(let [t1 (+ t (atan2 interval r)) | |
r1 (+ r (/ interval t1))] | |
(prepare (conj tr t1 r1) t1 r1)))) | |
(defn uzu | |
[fill_col circle_size scale_val] | |
(let [trs (prepare [] 0 0)] | |
(style (fill fill_col) | |
(transform | |
(scale [scale_val scale_val]) | |
(for [n (range 0 (count trs) 2)] | |
(let [t (nth trs n) | |
r (nth trs (inc n))] | |
(arc [(* r (cos t)) | |
(* r (sin t))] | |
circle_size | |
t (+ t arc_angle)) | |
)))))) | |
:start-sketch | |
(background "#fff") | |
(uzu "#eee" 3 10.2) | |
(uzu "#aaa" 2.5 10.1) | |
(uzu "#000" 2 10) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment