Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cieloazul310/cb2b6c68e467aca2c6d0a2842801167c to your computer and use it in GitHub Desktop.
Save cieloazul310/cb2b6c68e467aca2c6d0a2842801167c to your computer and use it in GitHub Desktop.
(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