code: function getCrossings (points, edges, edgeBounds) {
    var result = []
    boxIntersect(edgeBounds, function (i, j) {
      var e = edges[i]
      var f = edges[j]
      if (e[0] === f[0] || e[0] === f[1] ||
        e[1] === f[0] || e[1] === f[1]) {
        return
      }
      var a = points[e[0]]
      var b = points[e[1]]
      var c = points[f[0]]
      var d = points[f[1]]
      if (segseg(a, b, c, d)) {
        result.push([i, j])
      }
    })
    return result
  }
docs: Find all pairs of crossing edges in a pslg (given edge bounds)