code: function intersectsPolygon (data, start, a, b) {
    var node = start
    do {
      var p1 = node.i,
        p2 = node.next.i
  
      if (p1 !== a && p2 !== a && p1 !== b && p2 !== b && intersects(data, p1, p2, a, b)) {
        return true
      }
  
      node = node.next
    } while (node !== start)
  
    return false
  }
docs: check if a polygon diagonal intersects any polygon segments