(points, edges, edgeBounds)
| 8924 | |
| 8925 | // Find all pairs of crossing edges in a pslg (given edge bounds) |
| 8926 | function getCrossings (points, edges, edgeBounds) { |
| 8927 | var result = [] |
| 8928 | boxIntersect(edgeBounds, function (i, j) { |
| 8929 | var e = edges[i] |
| 8930 | var f = edges[j] |
| 8931 | if (e[0] === f[0] || e[0] === f[1] || |
| 8932 | e[1] === f[0] || e[1] === f[1]) { |
| 8933 | return |
| 8934 | } |
| 8935 | var a = points[e[0]] |
| 8936 | var b = points[e[1]] |
| 8937 | var c = points[f[0]] |
| 8938 | var d = points[f[1]] |
| 8939 | if (segseg(a, b, c, d)) { |
| 8940 | result.push([i, j]) |
| 8941 | } |
| 8942 | }) |
| 8943 | return result |
| 8944 | } |
| 8945 | |
| 8946 | // Find all pairs of crossing vertices in a pslg (given edge/vert bounds) |
| 8947 | function getTJunctions (points, edges, edgeBounds, vertBounds) { |
no test coverage detected
searching dependent graphs…