 (defn split-curve-with-step
   [curve-to-split step-size]
   (if (<= (count curve-to-split) 1)
-    curve-to-split
+    []
     (loop [curve (rest curve-to-split)
            segments (transient [])
            current-segment (transient [(first curve-to-split)])

    (let [total-length (curve-length curve)
          segment-length (/ total-length num-parts)]
      (split-curve-with-step curve segment-length))))

(ns genartlib.curves
  (:require
    [genartlib.algebra :refer [interpolate point-dist]]
    [genartlib.util :refer [enumerate]]))

(defn ^:private single-chaikin-step
  [points tightness]
  (mapcat (fn [[[start-x start-y] [end-x end-y]]]
            (let [q-x (interpolate start-x end-x (+ 0.0 tightness))
                  q-y (interpolate start-y end-y (+ 0.0 tightness))
