Skip to content

Commit

Permalink
add some little tracers projected along the lines between
Browse files Browse the repository at this point in the history
  • Loading branch information
dgtized committed Jul 31, 2023
1 parent 27911de commit f0fa7d0
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/shimmers/sketches/circle_connections.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand All @@ -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)))))

Expand Down

0 comments on commit f0fa7d0

Please sign in to comment.