Skip to content

Instantly share code, notes, and snippets.

@cassiel
Created February 19, 2012 12:33
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 cassiel/1863592 to your computer and use it in GitHub Desktop.
Save cassiel/1863592 to your computer and use it in GitHub Desktop.
(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