Skip to content

Instantly share code, notes, and snippets.

@cieloazul310
Created September 9, 2020 07:56
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/4c66787c4094a7d0f6effba9e850791b to your computer and use it in GitHub Desktop.
Save cieloazul310/4c66787c4094a7d0f6effba9e850791b to your computer and use it in GitHub Desktop.
(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