Created
August 9, 2016 18:50
-
-
Save edap/032167b683f5c59cdaa1877c5d070007 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
(defn morphogen-mesh | |
[seed tree] | |
(-> seed | |
(mg/seed-box) | |
(mg/generate-mesh tree) | |
(g/center))) | |
(def strip-quad | |
"Arrangement of quads" | |
(let [quad (mg/apply-recursively (mg/reflect :e) 4 [1] 1) | |
reflected-quad (mg/reflect :n :out [{} quad]) | |
inject #(-> quad | |
(assoc-in (mg/child-path [1 1 0]) %) | |
(assoc-in (mg/child-path [1 1 1 1 0]) %) | |
) | |
seed-clone (mg/reflect :s :out [{} (inject reflected-quad)])] | |
(mg/reflect :s :out [(inject seed-clone) (inject reflected-quad)]))) | |
(defn quads-recursively | |
[] | |
[(mg/seed-box (mg/seed-box (mg/circle-lattice-seg 6 0.25 0.1))) strip-quads]) | |
(apply morphogen-mesh (quads-recursively)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment