Skip to content

Commit

Permalink
add a positive check version if v/contains-NaN?
Browse files Browse the repository at this point in the history
  • Loading branch information
dgtized committed Nov 27, 2024
1 parent def8a5a commit 554465e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/shimmers/math/vector.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,7 @@
#?(:cljs
(defn contains-NaN? [v]
(some js/isNaN v)))

#?(:cljs
(defn valid? [v]
(not-any? js/isNaN v)))
2 changes: 1 addition & 1 deletion src/shimmers/sketches/cilia_phase.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
(let [fy (spline cx x)]
(tm/+ (tm/mix a b x)
(tm/mix (tm/- axis) axis fy))))]
(when (not-any? v/contains-NaN? pts)
(when (every? v/valid? pts)
(csvg/path (csvg/segmented-path pts)))))

;; How to avoid intersecting cilia?
Expand Down

0 comments on commit 554465e

Please sign in to comment.