Skip to content

Commit

Permalink
implement a deterministic version of confused-midpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
dgtized committed Nov 29, 2023
1 parent 6ccc341 commit 8e19409
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/shimmers/sketches/superposition.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,15 @@
(point-at
[_ t] (gu/point-at t (get spline :points) arc-length-idx)))

(defn confused-midpoint [p q d]
(->> (* d 0.5 (g/dist p q))
(gc/circle (tm/mix p q 0.5))
rp/sample-point-inside))

(defn make-stroke
([p q] (make-stroke p q 0))
([p q d]
(let [curve (geometry/confused-midpoint p q d)
(let [curve (confused-midpoint p q d)
spline (bezier/auto-spline2 [p curve q])]
(Stroke. p q curve spline
(gu/arc-length-index (:points spline))))))
Expand Down

0 comments on commit 8e19409

Please sign in to comment.