
/g,">").replace(/"/g,""").replace(/'/g,"'")}let s={},l=[];function d(e,n,t){s={...s,dynamic:e,core:n,leinProject:t}}function u(){l=["wh","with-style"]}window.onload=()=>{let{dynamic:n,core:t,leinProject:r}=s;if(n&&(document.getElementById("code-dynamic").innerHTML=o(n)),t&&(document.getElementById("code-core").innerHTML=o(t)),r&&(document.getElementById("code-lein-project").innerHTML=o(r)),l){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=l.map(n=>e[n]).join("\n");document.getElementById("code-helpers").innerHTML=o(n)}e(a).addPlugin((0,c.number)()),e(a).highlightAll()}}),c("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 o=i("dZ8Um");(0,o.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 color-dict (color/init))\n(def palette (color/get-combination-hsb color-dict :166))\n\n(defn draw-hex \n "Draw a hexagon centered at [cx, cy] with a circumradius of r rotated by theta radians."\n ([[cx cy] r]\n (draw-hex [cx cy] r 0))\n ([[cx cy] r theta]\n (let [tau (* Math/PI 2)\n step (/ tau 6)]\n (q/begin-shape)\n (doseq [theta (range theta (+ tau theta) step)]\n (let [x (+ cx (* r (Math/cos theta)))\n y (+ cy (* r (Math/sin theta)))]\n (q/vertex (h 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 5)\n\n (let [frame (:frame state)\n f (/ frame 300)\n animations-per-cycle 3\n circumradius 0.02\n inradius (* (/ (Math/sqrt 3) 2) circumradius)\n side circumradius\n x-step (* 3 circumradius)\n offset-x (* 3/2 circumradius)\n y-step (* 1 inradius)\n rez (+ 5.1 (* 2 (Math/cos (* f Math/PI 2))))\n ys (range 0 (+ 1 y-step) y-step)]\n (doseq [[idx y] (map-indexed vector ys)]\n (let [xs (range (if (odd? idx) 0 offset-x) (+ 1 x-step) x-step)]\n (doseq [[idx x] (map-indexed vector xs)]\n (let [rez 1.2\n r 15.0\n x2 (+ 1.2 (* r (Math/cos (* Math/PI 2))))\n y2 (+ 3.5 (* r (Math/sin (* Math/PI 2))))\n anim-offset (* (q/noise (* (- x x2) rez) (* (- y y2) rez 5) 3.2) 9)\n\n f2 (+ (* f animations-per-cycle) anim-offset)\n current-animation (int f2)\n\n f3 (ease/ease-out-quart (mod f2 1.0))\n draw-radius (* circumradius (- 1 f3))\n rot-dir (q/noise (* 5 x) (* 5 y) anim-offset)\n rot (* f3 Math/PI 1/6 (if (> 0.5 rot-dir) -1 1))\n y3 (- y (* 0.005 4 f3))\n x3 (- x (* 0.005 f3))\n \n colors (cycle palette)\n fg (nth colors current-animation)\n bg (nth colors (inc current-animation))]\n\n (with-style\n (apply q/fill bg)\n (draw-hex [x y] (* circumradius 1.01)))\n\n (with-style\n (q/no-stroke)\n (apply q/fill fg)\n (draw-hex [x3 y3] draw-radius rot))))))))\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-10"\n :setup (fn [] {})\n :draw dynamic/draw\n :update identity\n :size [1080 1080]\n :animation {:render? true :dirname "1-square"}\n :middleware [qm/fun-mode animation-mode])\n\n','(defproject genuary-2024-10 "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/easings-clj "0.1.0"]\n [com.dedovic/artlib-core "0.0.10"]\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,o.withDefaultHelpers)();
dynamic.clj
core.clj
helpers
project.clj