Skip to content

Instantly share code, notes, and snippets.

@edap
Last active August 25, 2016 04:33
Show Gist options
  • Save edap/9f81ac4b5317835d46a582795236122d to your computer and use it in GitHub Desktop.
Save edap/9f81ac4b5317835d46a582795236122d to your computer and use it in GitHub Desktop.
(defn punch
{:op :sd-inset, :args {:dir :w, :inset 0.999}, :out [{} {} {} {} nil]}
[dir w & [out]]
(mg/subdiv-inset :dir dir :inset w :out (or out {4 nil})))
(defn petal
[scale offset punch-y]
(let [punch-it (mg/skew :e :e :offset offset
:out [(punch :y punch-y)])
tree (mg/scale-edge :ef :y :scale scale
:out[punch-it])]
tree))
(defn spritz []
(let [first-ring (mg/reflect :w :out [(petal 3.35 0.6 0.45)])
second-ring (mg/reflect :w :out [(petal 4.35 0.6 0.40)])
third-ring (mg/reflect :w :out [(petal 5.35 0.6 0.35)])
forth-ring (mg/reflect :w :out [(petal 6.35 0.6 0.30)])
fifth-ring (mg/reflect :w :out [(petal 7.35 0.6 0.25)])
sixth-ring (mg/reflect :w :out [(petal 8.35 0.6 0.15)])
seventh-ring (mg/reflect :w :out [(petal 9.35 0.6 0.05)])
eigth-ring (mg/reflect :w :out [(petal 10.35 0.6 0.0010)])
slices (mg/subdiv :rows 13 :out[
eigth-ring nil
seventh-ring nil
sixth-ring nil
fifth-ring nil
forth-ring nil
third-ring nil
second-ring nil
first-ring])
hex (mg/apply-recursively (mg/reflect :w :out [slices slices]) 7 [1] 1)
seed (mg/sphere-lattice-seg 8 1.605 0.10155 0.68)]
[seed hex]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment