Skip to content

Commit

Permalink
ensure stroke-weight is controlled by same time parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
dgtized committed Mar 5, 2024
1 parent 70739c4 commit 61d4096
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/shimmers/sketches/display_tree.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -327,17 +327,19 @@
osc1 osc2 draw)
(fn [p rotation t f]
(q/no-fill)
(q/stroke-weight (+ 0.75 (* 1.0 (Math/sin (+ (* (/ 1.0 major) t) (Math/sin (* t (/ 1.0 minor))))))))
(q/stroke (- 1.0 f))
(let [center (geometry/rotate-around (g/centroid bounds) p rotation)
t (* direction t)
weight-wob (Math/sin (* t (/ 1.0 minor)))
weight (+ 0.75 (* 1.0 (Math/sin (+ (* (/ 1.0 major) t) weight-wob))))
path (for [s (tm/norm-range 192)]
(->
(gv/vec2)
(tm/+ (R major ((:fe osc1) t s) 1.0 s))
(tm/+ (R minor ((:fe osc2) s s) 1.0 s))
(tm/* (* 0.15 radius))
(tm/+ center)))]
(q/stroke-weight weight)
(draw path t))
(q/stroke-weight 1.0)
(q/no-stroke))))
Expand Down

0 comments on commit 61d4096

Please sign in to comment.