As part of my continuing efforts to get the Clojure community to notice Karsten Schmidt and creative coders to notice Clojure, I’ve created a little interactive playground for experiments with Karsten’s th.ing libraries.
You can have a play with a live version here. The code and instructions are here.
Of particular note is the concision with which complex forms can be specified. For example, this L-system plant and the recursive function that produces it:
L-system plant, Jack Rusher
(defn branch "A recursive branching tree structure with half-cylinder flowers." [level] (if (= 0 level) [(length 1.5) cylinder] [(angle (fn [_] (m/random 3 5))) ry- (length (fn [t] (* (m/random 0.75 1.5) (or (:last-length t) 1.5)))) (map (fn [[a b]] (concat (take 8 (cycle [a b])) (branch (dec level)))) [[ry line] [ry- line] [rx line] [rx- line]])]))
Let me know if you make anything with it.
This entry is part of Jack Rusher’s journal, originally published November 23rd, 2015, in Berlin.