Skip to content

Commit

Permalink
add another line opposite
Browse files Browse the repository at this point in the history
  • Loading branch information
dgtized committed Aug 8, 2024
1 parent e02b582 commit 42a4b3b
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/shimmers/sketches/infographics.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,17 @@
(let [p (rp/sample-point-inside (g/scale-size bounds 0.75))
rp (g/map-point bounds p)
a-circle (gc/circle p (* 0.7 (g/dist p (g/closest-point bounds p))))
line (clip/line-through-point bounds p (angle-from-quadrant rp))]
isec-lines (lines bounds a-circle)
angle (g/heading (first isec-lines))
line (clip/line-through-point bounds p (angle-from-quadrant rp))
parallel (clip/line-through-point bounds
(if (tm/delta= angle 0) (gv/vec2 (- width (:x p)) (* 0.5 height))
(gv/vec2 (* width 0.5) (- height (:y p))))
angle)
]
(concat [(vary-meta a-circle assoc :stroke-width 2.0)]
(lines bounds a-circle)
[line])))
isec-lines
[line parallel])))

(defn scene [{:keys [scene-id]}]
(csvg/svg-timed {:id scene-id
Expand Down

0 comments on commit 42a4b3b

Please sign in to comment.