
/g,">").replace(/"/g,""").replace(/'/g,"'")}let d={},o=[];function c(e,n,t){d={...d,dynamic:e,core:n,leinProject:t}}function u(){o=["wh","with-style"]}window.onload=()=>{let{dynamic:n,core:t,leinProject:r}=d;if(n&&(document.getElementById("code-dynamic").innerHTML=s(n)),t&&(document.getElementById("code-core").innerHTML=s(t)),r&&(document.getElementById("code-lein-project").innerHTML=s(r)),o){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=o.map(n=>e[n]).join("\n");document.getElementById("code-helpers").innerHTML=s(n)}e(a).addPlugin((0,l.number)()),e(a).highlightAll()}}),l("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 a=r.length.toString().length,i=r.map((e,n)=>{let t=(n+1).toString().padStart(a);return`${e}`}).join("\n");e.innerHTML=i}})}),i("d3dEA"),i("7Y8VX");var s=i("dZ8Um");(0,s.make)('(ns sketch.dynamic\n (:require ; [clojure.java.shell :refer [sh]]\n ; [genartlib.algebra :refer :all]\n ; [genartlib.curves :refer :all]\n ; [genartlib.geometry :refer :all]\n ; [genartlib.random :refer :all]\n ; [kdtree :as kd]\n [artlib.quil.global :refer :all]\n [genartlib.util :refer [w h]]\n [quil.core :as q]))\n\n(defn gauss\n "Samples a single value from a Gaussian distribution with the given mean\n and variance"\n [mean variance]\n (+ mean (* variance (q/random-gaussian))))\n\n(defn draw [state]\n (q/background 50 10 95)\n\n (with-matrix\n #_(q/translate (w 0.5) (h 0.5))\n (let [frame (:frame state)\n f (/ frame 300)]\n (with-style\n\n (let [rows-and-cols 8\n\n step (/ 1 rows-and-cols)\n halfstep (/ step 2)\n\n rwidth (+ 0.7 (* 0.3 (Math/sin (* f Math/PI 2))))\n rpadding (/ (- 1 rwidth) 2)\n awidth (* rwidth step)\n apadding (* rpadding step)\n\n rradius (* rwidth (+ 0.5 (* 1.5 (Math/cos (* f Math/PI 4)))))\n aradius (* rradius step)\n\n rradius2 (* rwidth (+ 0.5 (* 3 (Math/sin (* f Math/PI 2)))))\n aradius2 (* rradius2 step)]\n (doseq [x (range 0.2 (+ 0.7 halfstep) step)]\n (doseq [y (range 0.2 (+ 0.7 halfstep) step)]\n (let [l (+ x apadding)\n t (+ y apadding)\n\n l (if (zero? (mod (* 10 (+ x y)) (int (+ 1 (* f 5)))))\n (- l 0.1)\n l)\n\n t (if (zero? (mod (* 10 (+ x y)) (int (+ 2 (* f 3)))))\n (- t 0.1)\n t)\n \n\n rx (/ x 1)\n ry (/ y 1)\n\n hue (+ \n (* 90 (Math/cos (+ (* rx 2 Math/PI))))\n (* 90 (Math/sin (+ (* ry f 2 Math/PI))))\n (* f 2 180) \n (* f 1 360))\n hue (mod hue 360)\n bri (- 90 (* 30 ry))\n \n s 0.0015]\n (dotimes [n 10]\n (q/stroke 0 0 20 0.2)\n (q/no-fill)\n (q/rect (w (gauss l s)) (h (gauss t s)) (w awidth) (h awidth) (w aradius) (w aradius2) (w aradius) (w aradius2)))\n (with-style\n (q/fill hue 30 bri 0.5)\n (q/rect (w l) (h t) (w awidth) (h awidth) (w aradius) (w aradius2) (w aradius) (w aradius2))\n )))))\n\n ))))\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-02"\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-02 "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.8"]\n [genartlib/genartlib "0.1.21"]] ; 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 :aot :all)\n'),(0,s.withDefaultHelpers)();
dynamic.clj
core.clj
helpers
project.clj