Created
February 19, 2012 12:33
-
-
Save cassiel/1863592 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 kick | |
[m_Configuration m_Geometry] | |
(let [{:keys [DO_VORONOI TREE_DEPTH BRANCH_BEND_PATHS]} | |
(u/hashify m_Configuration) | |
{:keys [CELL_ROWS CELL_COLS CELL_SIZE DELTA | |
INITIAL_LEN LEN_MUL]} | |
(u/hashify m_Geometry)] | |
(fn [t] | |
(let [v-fn (if DO_VORONOI | |
(voronoi-with (* CELL_COLS CELL_SIZE 1/2) | |
(* CELL_ROWS CELL_SIZE 1/2)) | |
no-voronoi)] | |
(v-fn t | |
(d/fixed CELL_ROWS CELL_COLS CELL_SIZE) | |
(fn [t] (let [depth-here TREE_DEPTH | |
tip 1 | |
tree0 ((d/tree DELTA LEN_MUL tip BRANCH_BEND_PATHS) | |
t depth-here 0 [0 0] INITIAL_LEN nil) | |
tree1 (map rotate-R tree0) | |
tree2 (map flip-seg-Y tree0) | |
tree3 (map (comp flip-seg-X flip-seg-Y) tree0)] | |
(cons [[0 0] [0 0]] tree1)))))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment