function equalizeSegments(path1, path2, TL) {
    var c1 = getCurveArray(path1);
    var c2 = getCurveArray(path2);
    var L1 = c1.length;
    var L2 = c2.length;
    var l1 = c1.filter(function (x) { return x.l; }).length;
    var l2 = c2.filter(function (x) { return x.l; }).length;
    var m1 = c1.filter(function (x) { return x.l; }).reduce(function (a, ref) {
      var l = ref.l;

      return a + l;
    }, 0) / l1 || 0;
    var m2 = c2.filter(function (x) { return x.l; }).reduce(function (a, ref) {
      var l = ref.l;

      return a + l;
    }, 0) / l2 || 0;
    var tl = TL || Math.max(L1, L2);
    var mm = [m1, m2];
    var dif = [tl - L1, tl - L2];
    var canSplit = 0;
    var result = [c1, c2]
      .map(function (x, i) { return (x.l === tl
        ? x.map(function (y) { return y.s; })
        : x.map(function (y, j) {
          canSplit = j && dif[i] && y.l >= mm[i];
          dif[i] -= canSplit ? 1 : 0;
          return canSplit ? y.ss : [y.s];
        }).flat()); });

    return result[0].length === result[1].length
      ? result
      : equalizeSegments(result[0], result[1], tl);
  }
Returns two `curveArray` with same amount of segments.
@param {SVGPath.curveArray} path1 the first `curveArray`
@param {SVGPath.curveArray} path2 the second `curveArray`
@param {number} TL the maximum `curveArray` length
@returns {SVGPath.curveArray[]} equalized segments