| 133099 | if (visible1(x, y)) activeStream.point(x, y); |
| 133100 | } |
| 133101 | function polygonInside() { |
| 133102 | var winding = 0; |
| 133103 | for(var i = 0, n = polygon.length; i < n; ++i)for(var ring = polygon[i], j = 1, m = ring.length, point = ring[0], a0, a1, b0 = point[0], b1 = point[1]; j < m; ++j){ |
| 133104 | a0 = b0, a1 = b1, point = ring[j], b0 = point[0], b1 = point[1]; |
| 133105 | if (a1 <= y1) { |
| 133106 | if (b1 > y1 && (b0 - a0) * (y1 - a1) > (b1 - a1) * (x0 - a0)) ++winding; |
| 133107 | } else if (b1 <= y1 && (b0 - a0) * (y1 - a1) < (b1 - a1) * (x0 - a0)) --winding; |
| 133108 | } |
| 133109 | return winding; |
| 133110 | } |
| 133111 | // Buffer geometry within a polygon and then clip it en masse. |
| 133112 | function polygonStart() { |
| 133113 | activeStream = bufferStream, segments = [], polygon = [], clean = true; |