Migrates model to the new paths

This commit is contained in:
alonso.torres 2020-11-20 09:38:33 +01:00
parent e2593c2dad
commit f339f1ee98
13 changed files with 114 additions and 82 deletions

View file

@ -213,18 +213,3 @@
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}]))))