Created
September 9, 2020 07:56
-
-
Save cieloazul310/4c66787c4094a7d0f6effba9e850791b 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 field 200) | |
(defvar width 40) | |
(def height (/ width 2)) | |
(def sq (* (* (sqrt 2) height) 2)) | |
(defn row [x i] | |
(rect [x 0 | |
(if (even? i) width height) | |
(if (even? i) height width) | |
]) | |
) | |
(defn col [y i] | |
(transform | |
(translate [ | |
(* y -1) | |
y | |
]) | |
(for [x (range (* field -1) field width):index i] (row x i) | |
) | |
) | |
) | |
(def higaki (transform (rotate (deg 315)) (for [y (range (* field -1) field height):index i] (col y i)))) | |
:start-sketch | |
(artboard | |
{ | |
:background "white" | |
:bounds [0 0 sq sq] | |
} | |
(style (stroke "#eee" 1) higaki) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment