Created
August 31, 2020 12:53
-
-
Save cieloazul310/cb2b6c68e467aca2c6d0a2842801167c to your computer and use it in GitHub Desktop.
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 w 20) | |
(def items 2) | |
(def size (* w items)) | |
(def r (/ w (sqrt 3))) | |
(defn hoge [x y i] (transform | |
(mat2d/* | |
(translate [ | |
(if (even? (floor (/ i (+ items 1)))) x (+ x (/ w 2))) | |
y | |
]) | |
(rotate (deg 270)) | |
) | |
(ngon [0 0] r 3) | |
) | |
) | |
(def canvas (rect [0 0 size size])) | |
(artboard | |
{:bounds [0 0 size size] | |
:background "#fff"} | |
(style (fill "#fafafa") | |
(for [y (column 0 items w) x (column 0 items w) :index i] | |
(path/trim 0 size (hoge x y i)) | |
) | |
) | |
) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment