♻️ Removed curves shapes

This commit is contained in:
alonso.torres 2020-11-19 18:12:15 +01:00
parent 55b71a111b
commit e2593c2dad
21 changed files with 41 additions and 511 deletions

View file

@ -213,3 +213,18 @@
opposite (gpt/add point (gpt/negate phv))]
opposite))
(defn segments->content [segments]
(let [initial (first segments)
closed? (= (first segments) (last segments))
lines (if closed?
(take (- (count segments) 2) (rest segments))
(rest segments))]
(d/concat [{:command :move-to
:params (select-keys initial [:x :y])}]
(->> lines
(mapv #(hash-map :command :line-to
:params (select-keys % [:x :y]))))
(when closed?
[{:command :close-path}]))))