
/g,">").replace(/"/g,""").replace(/'/g,"'")}let o={},s=[];function d(e,n,t){o={...o,dynamic:e,core:n,leinProject:t}}function u(){s=["wh","with-style"]}window.onload=()=>{let{dynamic:n,core:t,leinProject:r}=o;if(n&&(document.getElementById("code-dynamic").innerHTML=c(n)),t&&(document.getElementById("code-core").innerHTML=c(t)),r&&(document.getElementById("code-lein-project").innerHTML=c(r)),s){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=s.map(n=>e[n]).join("\n");document.getElementById("code-helpers").innerHTML=c(n)}e(i).addPlugin((0,l.number)()),e(i).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 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 c=a("dZ8Um");(0,c.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 [easings.core :as ease]\n [artlib.color.dictionary :as color]\n [artlib.quil.global :refer :all]\n [genartlib.util :refer [w h]]\n [quil.core :as q]))\n\n(def dict (color/init))\n(def palette (color/get-combination-hsb dict :240))\n\n(defn draw-hex [[cx cy] r]\n (let [tau (* Math/PI 2)\n step (/ tau 6)]\n (q/begin-shape)\n (doseq [theta (range 0 tau step)]\n (let [x (+ cx (* r (Math/cos theta)))\n y (+ cy (* r (Math/sin theta)))]\n (q/vertex (w x) (h y))))\n (q/end-shape)))\n\n(def sqrt3-2 (/ (Math/sqrt 3) 2))\n\n(defn draw [state]\n (q/background 0 0 100)\n\n (let [frame (:frame state)\n f (/ frame 300)\n animations-per-cycle 4\n circumradius 0.015\n inradius (* (/ (Math/sqrt 3) 2) circumradius)\n side circumradius\n x-step (* 3 circumradius)\n offset-x (* 3/2 circumradius)\n y-step inradius\n rez (+ 2.1 (* 2 (Math/cos (* f Math/PI 2))))]\n (doseq [[idx y] (map-indexed vector (range 0 (+ 1 y-step) y-step))]\n (doseq [x (range (if (odd? idx) 0 offset-x) (+ 1 x-step) x-step)]\n (let [f2 (mod (+ (q/noise \n (- (* x rez) (/ rez 2) 9.1) \n (- (* y rez) (/ rez 2) 0.2)) \n f) 1.0)\n f2 (* f2 animations-per-cycle)\n current-animation (int f2)\n f3 (mod f2 1.0)\n ;;f3 (ease/ease-in-out-expo f3)\n draw-radius (* circumradius (- 1 f3))\n \n ;; hue (* 360 (q/noise x y (+ current-animation 0.23)))\n ;; hue-next (* 360 (q/noise x y (+ (inc current-animation) 0.23)))\n color (nth (cycle palette) current-animation)\n color-next (nth (cycle palette) (inc current-animation))\n ]\n\n (with-style\n (q/no-stroke)\n ;;(q/fill hue-next 40 70)\n (apply q/fill color-next)\n (draw-hex [x y] circumradius))\n\n (with-style\n (q/no-stroke)\n ;;(q/fill hue 40 70)\n (apply q/fill color)\n (draw-hex [x y] draw-radius)))))))\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-06"\n :setup (fn [] {})\n :draw dynamic/draw\n :update identity\n :size [1080 1080]\n :animation {:render? true :dirname "3"}\n :middleware [qm/fun-mode animation-mode])\n\n','(defproject genuary-2024-06 "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 "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,c.withDefaultHelpers)();
dynamic.clj
core.clj
helpers
project.clj