
/g,">").replace(/"/g,""").replace(/'/g,"'")}let s={},c=[];function d(e,n,t){s={...s,dynamic:e,core:n,leinProject:t}}function p(){c=["wh","with-style"]}window.onload=()=>{let{dynamic:n,core:t,leinProject:r}=s;if(n&&(document.getElementById("code-dynamic").innerHTML=l(n)),t&&(document.getElementById("code-core").innerHTML=l(t)),r&&(document.getElementById("code-lein-project").innerHTML=l(r)),c){let e={wh:';; Copyright (c) 2016 Tyler Hobbs\n;; MIT License\n;; https://github.com/thobbs/genartlib/\n(defn h\n "Returns a given percentage of the height Quil-specific."\n ([] (h 1.0))\n ([percentage] (* (height) percentage)))\n\n;; Copyright (c) 2016 Tyler Hobbs\n;; MIT License\n;; https://github.com/thobbs/genartlib/\n(defn w\n "Returns a given percentage of the width. Quil-specific."\n ([] (w 1.0))\n ([percentage] (* (width) percentage)))\n',"with-style":"(defmacro with-style [& body]\n `(do\n (q/push-style)\n (try\n ~@body\n (finally (q/pop-style)))))\n"},n=c.map(n=>e[n]).join("\n");document.getElementById("code-helpers").innerHTML=l(n)}e(i).addPlugin((0,o.number)()),e(i).highlightAll()}}),o("3PmhV",function(e,t){n(e.exports,"number",()=>r);let r=e=>({"after:highlightElement":({el:e,result:n,text:t})=>{let r=n.value.split("\n");r.pop();let i=r.length.toString().length,a=r.map((e,n)=>{let t=(n+1).toString().padStart(i);return`${e}`}).join("\n");e.innerHTML=a}})}),a("d3dEA"),a("7Y8VX");var l=a("dZ8Um");(0,l.make)('(ns sketch.dynamic\n (:require ; [clojure.java.shell :refer [sh]]\n ; [kdtree :as kd]\n [easings.core :as ease]\n [sketch.verlet :as verlet]\n [artlib.quil.global :refer :all]\n [genartlib.util :refer [w h]]\n [quil.core :as q]))\n\n(defn spawn-world [world]\n (let [num-points 50\n pad 0.02\n points (->> (/ (- 1 pad pad) num-points)\n (range pad (- 1 pad))\n (map (fn [x] (let [x2 (ease/ease-in-out-circ x)\n x2 (* 1.8 (Math/sin (* x2 10)))\n y (+ 0.20 (* x2 0.1))]\n {:x x :y y :oldx x :oldy y})))\n (map-indexed vector)\n (map (fn [[idx p]] [(keyword (format "p%05d" idx)) p]))\n (apply concat)\n (apply hash-map))]\n {:points points :sticks []}))\n\n(def world (atom nil))\n(defn draw [state]\n (when (or (nil? @world) (zero? (:frame state)))\n (q/background 0 0 100)\n (reset! verlet/friction 1.0)\n (swap! world spawn-world))\n\n (let [frame (:frame state)\n f (/ frame 300)\n total-friction-to-add 0.020\n friction-to-add (/ total-friction-to-add 300)]\n (swap! verlet/friction - friction-to-add)\n\n (dotimes [n 3]\n (swap! world verlet/update-state) ;; step physics\n (let [points (into (sorted-map) (:points @world))]\n (q/stroke-weight (w 0.001))\n (with-style\n (q/stroke 0 0 0 0.1)\n (q/begin-shape)\n (doseq [{x :x y :y} (vals points)]\n (q/curve-vertex (w x) (h y)))\n (q/end-shape))))))\n','(ns sketch.core\n (:require [artlib.quil.middleware :refer [animation-mode]]\n [clojure.core.matrix :refer [set-current-implementation]]\n [quil.middleware :as qm]\n [sketch.dynamic :as dynamic]\n [quil.core :as q]))\n\n(set-current-implementation :vectorz)\n(println)\n\n(q/defsketch example\n :title "genuary-2024-15"\n :setup (fn [] {})\n :draw dynamic/draw\n :update identity\n :size [1080 1080]\n :animation {:render? true :dirname "1"}\n :middleware [qm/fun-mode animation-mode])\n\n','(defproject genuary-2024-15 "0.1.0-SNAPSHOT"\n :description "FIXME: write description"\n :url "https://example.com/FIXME"\n :license {:name "Apache License, Version 2.0"\n :url "https://www.apache.org/licenses/LICENSE-2.0.html"}\n :dependencies [[org.clojure/clojure "1.11.1"]\n [com.dedovic/artlib-core "0.0.10"]\n [com.dedovic/easings-clj "0.1.0"]\n [genartlib/genartlib "1.0.0"]] ; utility functions\n :jvm-opts ["-Xms4000m" "-Xmx4000M" ; 4GB heap size\n "-server"\n "-Dsun.java2d.uiScale=1.0"] ; adjust scaling for high DPI displays\n :source-paths ["src/clj"]\n :java-source-paths ["src/java"]\n :resource-paths ["resources"])\n'),(0,l.withDefaultHelpers)();
dynamic.clj
core.clj
helpers
project.clj