Skip to content

Commit

Permalink
identify remaining polygons
Browse files Browse the repository at this point in the history
  • Loading branch information
dgtized committed Nov 23, 2023
1 parent 04865a9 commit 6cb3556
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/shimmers/sketches/divisible.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
[thi.ng.geom.core :as g]
[thi.ng.geom.line :as gl]
[thi.ng.geom.rect :as rect]
[thi.ng.geom.types :refer [Polygon2]]
[thi.ng.geom.vector :as gv]
[thi.ng.math.core :as tm]))

Expand Down Expand Up @@ -108,9 +109,12 @@
(mapcat (fn [r] (punch-out r box)) rects))
[bounds]
punches)]
(concat (reduce reduce-overlapping
remaining
punches)
(concat (map (fn [s] (if (instance? Polygon2 s)
(vary-meta s assoc :fill "#ddd")
s))
(reduce reduce-overlapping
remaining
punches))
(map-indexed (fn [i s] (let [fill (csvg/hsv (/ i (count punches)) 1.0 0.5 0.33)]
(vary-meta s assoc :fill fill)))
punches))))
Expand Down

0 comments on commit 6cb3556

Please sign in to comment.