diff --git a/src/shimmers/sketches/circle_connections.cljs b/src/shimmers/sketches/circle_connections.cljs index 866c17df4..f86efe9d3 100644 --- a/src/shimmers/sketches/circle_connections.cljs +++ b/src/shimmers/sketches/circle_connections.cljs @@ -9,7 +9,8 @@ [shimmers.math.equations :as eq] [shimmers.math.vector :as v] [shimmers.sketch :as sketch :include-macros true] - [thi.ng.geom.circle :as gc])) + [thi.ng.geom.circle :as gc] + [thi.ng.math.core :as tm])) (defn vertices [{:keys [p r]} n theta] (for [i (range n)] @@ -27,20 +28,25 @@ (q/ellipse-mode :radius) (q/fill 1.0) - (let [circles [(gc/circle (cq/rel-vec 0.10 0.5) (cq/rel-w 0.075)) + (let [circles [(gc/circle (cq/rel-vec 0.08 0.5) (cq/rel-w 0.075)) (gc/circle (cq/rel-vec 0.92 0.5) (cq/rel-w 0.075))] [c0 c1] circles - n 24 + n 20 v0 (vertices c0 n (* 0.075 Math/PI (Math/sin (* t 0.3)))) - v1 (vertices c1 n (* 0.075 Math/PI (Math/cos (* t 0.4))))] + v1 (vertices c1 n (* 0.075 Math/PI (Math/cos (* t 0.4)))) + d (* 0.3 (Math/cos (* 0.1 t)))] (q/stroke-weight 1.25) (doseq [c circles] (qdg/draw c)) (q/stroke-weight 0.5) - (doseq [[p0 p1] (map vector v0 v1)] - (q/line p0 p1)) + (q/fill 0.0) + (doseq [[p0 p1 i] (map vector v0 v1 (range n)) + :let [pt (eq/unit-cos (+ (* 0.2 t) (* d i)))]] + (q/line p0 p1) + (qdg/draw (gc/circle (tm/mix p0 p1 pt) 0.9))) + (q/fill 1.0) (doseq [p (concat v0 v1)] (qdg/draw (gc/circle p 2.0)))))