code: function indexCurve (data, start, minX, minY, size) {
    var node = start
  
    do {
      if (node.z === null) {
        node.z = zOrder(data[node.i], data[node.i + 1], minX, minY, size)
      }
      node.prevZ = node.prev
      node.nextZ = node.next
      node = node.next
    } while (node !== start)
  
    node.prevZ.nextZ = null
    node.prevZ = null
  
    sortLinked(node)
  }
docs: interlink polygon nodes in z-order