| 8909 | |
| 8910 | // Convert a list of points into bounding boxes by duplicating coords |
| 8911 | function boundPoints (points) { |
| 8912 | var bounds = new Array(points.length) |
| 8913 | for (var i = 0; i < points.length; ++i) { |
| 8914 | var p = points[i] |
| 8915 | bounds[i] = [ |
| 8916 | nextafter(p[0], -Infinity), |
| 8917 | nextafter(p[1], -Infinity), |
| 8918 | nextafter(p[0], Infinity), |
| 8919 | nextafter(p[1], Infinity) |
| 8920 | ] |
| 8921 | } |
| 8922 | return bounds |
| 8923 | } |
| 8924 | |
| 8925 | // Find all pairs of crossing edges in a pslg (given edge bounds) |
| 8926 | function getCrossings (points, edges, edgeBounds) { |