├── .github └── workflows │ └── node.yml ├── .gitignore ├── LICENSE ├── README.md ├── bench ├── basic.js └── bench.js ├── eslint.config.js ├── package-lock.json ├── package.json ├── rollup.config.js ├── src └── earcut.js ├── test ├── expected.json ├── fixtures │ ├── bad-diagonals.json │ ├── bad-hole.json │ ├── boxy.json │ ├── building.json │ ├── collinear-diagonal.json │ ├── degenerate.json │ ├── dude.json │ ├── eberly-3.json │ ├── eberly-6.json │ ├── empty-square.json │ ├── filtered-bridge-jhl.json │ ├── hilbert.json │ ├── hole-touching-outer.json │ ├── hourglass.json │ ├── infinite-loop-jhl.json │ ├── issue107.json │ ├── issue111.json │ ├── issue119.json │ ├── issue131.json │ ├── issue142.json │ ├── issue149.json │ ├── issue16.json │ ├── issue17.json │ ├── issue29.json │ ├── issue34.json │ ├── issue35.json │ ├── issue45.json │ ├── issue52.json │ ├── issue83.json │ ├── outside-ring.json │ ├── rain.json │ ├── self-touching.json │ ├── shared-points.json │ ├── simplified-us-border.json │ ├── steiner.json │ ├── touching-holes.json │ ├── touching-holes2.json │ ├── touching-holes3.json │ ├── touching-holes4.json │ ├── touching-holes5.json │ ├── touching-holes6.json │ ├── touching2.json │ ├── touching3.json │ ├── touching4.json │ ├── water-huge.json │ ├── water-huge2.json │ ├── water.json │ ├── water2.json │ ├── water3.json │ ├── water3b.json │ └── water4.json └── test.js └── viz ├── index.html └── viz.js /.github/workflows/node.yml: -------------------------------------------------------------------------------- 1 | name: Node 2 | on: [push, pull_request] 3 | jobs: 4 | test: 5 | runs-on: ubuntu-latest 6 | steps: 7 | - name: Checkout 8 | uses: actions/checkout@v4 9 | 10 | - name: Setup Node 11 | uses: actions/setup-node@v4 12 | with: 13 | node-version: 20 14 | 15 | - name: Install dependencies 16 | run: npm ci 17 | 18 | - name: Build the bundle 19 | run: npm run build 20 | 21 | - name: Run tests 22 | run: npm test 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | coverage 2 | node_modules 3 | dist 4 | *.log 5 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | ISC License 2 | 3 | Copyright (c) 2024, Mapbox 4 | 5 | Permission to use, copy, modify, and/or distribute this software for any purpose 6 | with or without fee is hereby granted, provided that the above copyright notice 7 | and this permission notice appear in all copies. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 10 | REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND 11 | FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 12 | INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS 13 | OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER 14 | TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF 15 | THIS SOFTWARE. 16 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Earcut 2 | 3 | The fastest and smallest JavaScript polygon triangulation library. 3KB gzipped. 4 | 5 | [](https://github.com/mapbox/earcut/actions/workflows/node.yml) 6 | [](http://isitmaintained.com/project/mapbox/earcut "Average time to resolve an issue") 7 | [](http://isitmaintained.com/project/mapbox/earcut "Percentage of issues still open") 8 | [](https://github.com/mourner/projects) 9 | 10 | #### The algorithm 11 | 12 | The library implements a modified ear slicing algorithm, 13 | optimized by [z-order curve](http://en.wikipedia.org/wiki/Z-order_curve) hashing 14 | and extended to handle holes, twisted polygons, degeneracies and self-intersections 15 | in a way that doesn't _guarantee_ correctness of triangulation, 16 | but attempts to always produce acceptable results for practical data. 17 | 18 | It's based on ideas from 19 | [FIST: Fast Industrial-Strength Triangulation of Polygons](http://www.cosy.sbg.ac.at/~held/projects/triang/triang.html) by Martin Held 20 | and [Triangulation by Ear Clipping](http://www.geometrictools.com/Documentation/TriangulationByEarClipping.pdf) by David Eberly. 21 | 22 | #### Why another triangulation library? 23 | 24 | The aim of this project is to create a JS triangulation library 25 | that is **fast enough for real-time triangulation in the browser**, 26 | sacrificing triangulation quality for raw speed and simplicity, 27 | while being robust enough to handle most practical datasets without crashing or producing garbage. 28 | Some benchmarks using Node 0.12: 29 | 30 | (ops/sec) | pts | earcut | libtess | poly2tri | pnltri | polyk 31 | ------------------| ---- | --------- | -------- | -------- | --------- | ------ 32 | OSM building | 15 | _795,935_ | _50,640_ | _61,501_ | _122,966_ | _175,570_ 33 | dude shape | 94 | _35,658_ | _10,339_ | _8,784_ | _11,172_ | _13,557_ 34 | holed dude shape | 104 | _28,319_ | _8,883_ | _7,494_ | _2,130_ | n/a 35 | complex OSM water | 2523 | _543_ | _77.54_ | failure | failure | n/a 36 | huge OSM water | 5667 | _95_ | _29.30_ | failure | failure | n/a 37 | 38 | The original use case it was created for is [Mapbox GL](https://www.mapbox.com/mapbox-gl), WebGL-based interactive maps. 39 | 40 | If you want to get correct triangulation even on very bad data with lots of self-intersections 41 | and earcut is not precise enough, take a look at [libtess.js](https://github.com/brendankenny/libtess.js). 42 | 43 | #### Usage 44 | 45 | ```js 46 | const triangles = earcut([10,0, 0,50, 60,60, 70,10]); // returns [1,0,3, 3,2,1] 47 | ``` 48 | 49 | Signature: `earcut(vertices[, holes, dimensions = 2])`. 50 | 51 | * `vertices` is a flat array of vertex coordinates like `[x0,y0, x1,y1, x2,y2, ...]`. 52 | * `holes` is an array of hole _indices_ if any 53 | (e.g. `[5, 8]` for a 12-vertex input would mean one hole with vertices 5–7 and another with 8–11). 54 | * `dimensions` is the number of coordinates per vertex in the input array (`2` by default). Only two are used for triangulation (`x` and `y`), and the rest are ignored. 55 | 56 | Each group of three vertex indices in the resulting array forms a triangle. 57 | 58 | ```js 59 | // triangulating a polygon with a hole 60 | earcut([0,0, 100,0, 100,100, 0,100, 20,20, 80,20, 80,80, 20,80], [4]); 61 | // [3,0,4, 5,4,0, 3,4,7, 5,0,1, 2,3,7, 6,5,1, 2,7,6, 6,1,2] 62 | 63 | // triangulating a polygon with 3d coords 64 | earcut([10,0,1, 0,50,2, 60,60,3, 70,10,4], null, 3); 65 | // [1,0,3, 3,2,1] 66 | ``` 67 | 68 | If you pass a single vertex as a hole, Earcut treats it as a Steiner point. 69 | 70 | Note that Earcut is a **2D** triangulation algorithm, and handles 3D data as if it was projected onto the XY plane (with Z component ignored). 71 | 72 | If your input is a multi-dimensional array (e.g. [GeoJSON Polygon](http://geojson.org/geojson-spec.html#polygon)), 73 | you can convert it to the format expected by Earcut with `earcut.flatten`: 74 | 75 | ```js 76 | const data = earcut.flatten(geojson.geometry.coordinates); 77 | const triangles = earcut(data.vertices, data.holes, data.dimensions); 78 | ``` 79 | 80 | After getting a triangulation, you can verify its correctness with `earcut.deviation`: 81 | 82 | ```js 83 | const deviation = earcut.deviation(vertices, holes, dimensions, triangles); 84 | ``` 85 | 86 | Returns the relative difference between the total area of triangles and the area of the input polygon. 87 | `0` means the triangulation is fully correct. 88 | 89 | #### Install 90 | 91 | Install with NPM: `npm install earcut`, then import as a module: 92 | 93 | ```js 94 | import earcut from 'earcut'; 95 | ``` 96 | 97 | Or use as a module directly in the browser with [jsDelivr](https://www.jsdelivr.com/esm): 98 | 99 | ```html 100 | 103 | ``` 104 | 105 | Alternatively, there's a UMD browser bundle with an `earcut` global variable (exposing the main function as `earcut.default`): 106 | 107 | ```html 108 | 109 | ``` 110 | 111 |  112 | 113 | #### Ports to other languages 114 | 115 | - [mapbox/earcut.hpp](https://github.com/mapbox/earcut.hpp) (C++11) 116 | - [JaffaKetchup/dart_earcut](https://github.com/JaffaKetchup/dart_earcut) (Dart) 117 | - [earcut4j/earcut4j](https://github.com/earcut4j/earcut4j) (Java) 118 | - [the3deers/earcut-java](https://github.com/the3deers/earcut-java) (Java) 119 | - [Larpon/earcut](https://github.com/Larpon/earcut) (V) 120 | - [Cawfree/earcut-j](https://github.com/Cawfree/earcut-j) (Java, outdated) 121 | - [measuredweighed/SwiftEarcut](https://github.com/measuredweighed/SwiftEarcut) (Swift) 122 | -------------------------------------------------------------------------------- /bench/basic.js: -------------------------------------------------------------------------------- 1 | import earcut, {flatten} from '../src/earcut.js'; 2 | import {readFileSync} from 'fs'; 3 | 4 | const data = JSON.parse(readFileSync(new URL('../test/fixtures/building.json', import.meta.url))); 5 | const {vertices, holes} = flatten(data); 6 | 7 | const start = performance.now(); 8 | let ops = 0; 9 | let passed = 0; 10 | 11 | do { 12 | earcut(vertices, holes); 13 | 14 | ops++; 15 | passed = performance.now() - start; 16 | } while (passed < 1000); 17 | 18 | console.log(`${Math.round(ops * 1000 / passed).toLocaleString()} ops/s`); 19 | -------------------------------------------------------------------------------- /bench/bench.js: -------------------------------------------------------------------------------- 1 | import earcut, {flatten} from '../src/earcut.js'; 2 | import Benchmark from 'benchmark'; 3 | import {readFileSync} from 'fs'; 4 | 5 | function withoutHoles({vertices, holes, dimensions}) { 6 | return { 7 | vertices: vertices.slice(0, holes[0] * dimensions), 8 | holes: [] 9 | }; 10 | } 11 | 12 | function getFixture(name) { 13 | return flatten(JSON.parse(readFileSync(new URL(`../test/fixtures/${name}`, import.meta.url)))); 14 | } 15 | 16 | const samples = { 17 | 'typical OSM building': getFixture('building.json'), 18 | 'dude shape': withoutHoles(getFixture('dude.json')), 19 | 'dude shape with holes': getFixture('dude.json'), 20 | 'complex OSM water': getFixture('water.json') 21 | }; 22 | 23 | for (const name in samples) { 24 | const {vertices, holes, dimensions} = samples[name]; 25 | new Benchmark.Suite() 26 | .add(`${name} (${vertices.length / 2} vertices):`, () => { 27 | earcut(vertices, holes, dimensions); 28 | }) 29 | .on('cycle', logCycle) 30 | .run(); 31 | } 32 | 33 | function logCycle(event) { 34 | console.log(String(event.target)); 35 | } 36 | -------------------------------------------------------------------------------- /eslint.config.js: -------------------------------------------------------------------------------- 1 | export {default} from 'eslint-config-mourner'; 2 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "earcut", 3 | "version": "3.0.1", 4 | "description": "The fastest and smallest JavaScript polygon triangulation library for your WebGL apps", 5 | "main": "src/earcut.js", 6 | "type": "module", 7 | "exports": "./src/earcut.js", 8 | "files": [ 9 | "src/earcut.js", 10 | "dist/earcut.min.js", 11 | "dist/earcut.dev.js" 12 | ], 13 | "scripts": { 14 | "pretest": "eslint src test/test.js bench/*.js viz/viz.js", 15 | "test": "node --test", 16 | "build": "rollup -c", 17 | "prepublishOnly": "npm run build", 18 | "cov": "node --test --experimental-test-coverage" 19 | }, 20 | "author": "Vladimir Agafonkin", 21 | "license": "ISC", 22 | "devDependencies": { 23 | "@rollup/plugin-terser": "^0.4.4", 24 | "benchmark": "^2.1.4", 25 | "coveralls": "^3.1.1", 26 | "eslint": "^9.17.0", 27 | "eslint-config-mourner": "^4.0.2", 28 | "rollup": "^4.28.1", 29 | "uglify-js": "^3.19.3", 30 | "watchify": "^4.0.0" 31 | }, 32 | "eslintConfig": { 33 | "extends": "mourner", 34 | "parserOptions": { 35 | "sourceType": "module", 36 | "ecmaVersion": 2020 37 | } 38 | }, 39 | "repository": { 40 | "type": "git", 41 | "url": "git://github.com/mapbox/earcut.git" 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /rollup.config.js: -------------------------------------------------------------------------------- 1 | import terser from '@rollup/plugin-terser'; 2 | 3 | const config = (file, plugins) => ({ 4 | input: 'src/earcut.js', 5 | output: { 6 | name: 'earcut', 7 | exports: 'named', 8 | format: 'umd', 9 | indent: false, 10 | file 11 | }, 12 | plugins 13 | }); 14 | 15 | export default [ 16 | config('dist/earcut.dev.js', []), 17 | config('dist/earcut.min.js', [terser()]) 18 | ]; 19 | -------------------------------------------------------------------------------- /src/earcut.js: -------------------------------------------------------------------------------- 1 | 2 | export default function earcut(data, holeIndices, dim = 2) { 3 | 4 | const hasHoles = holeIndices && holeIndices.length; 5 | const outerLen = hasHoles ? holeIndices[0] * dim : data.length; 6 | let outerNode = linkedList(data, 0, outerLen, dim, true); 7 | const triangles = []; 8 | 9 | if (!outerNode || outerNode.next === outerNode.prev) return triangles; 10 | 11 | let minX, minY, invSize; 12 | 13 | if (hasHoles) outerNode = eliminateHoles(data, holeIndices, outerNode, dim); 14 | 15 | // if the shape is not too simple, we'll use z-order curve hash later; calculate polygon bbox 16 | if (data.length > 80 * dim) { 17 | minX = Infinity; 18 | minY = Infinity; 19 | let maxX = -Infinity; 20 | let maxY = -Infinity; 21 | 22 | for (let i = dim; i < outerLen; i += dim) { 23 | const x = data[i]; 24 | const y = data[i + 1]; 25 | if (x < minX) minX = x; 26 | if (y < minY) minY = y; 27 | if (x > maxX) maxX = x; 28 | if (y > maxY) maxY = y; 29 | } 30 | 31 | // minX, minY and invSize are later used to transform coords into integers for z-order calculation 32 | invSize = Math.max(maxX - minX, maxY - minY); 33 | invSize = invSize !== 0 ? 32767 / invSize : 0; 34 | } 35 | 36 | earcutLinked(outerNode, triangles, dim, minX, minY, invSize, 0); 37 | 38 | return triangles; 39 | } 40 | 41 | // create a circular doubly linked list from polygon points in the specified winding order 42 | function linkedList(data, start, end, dim, clockwise) { 43 | let last; 44 | 45 | if (clockwise === (signedArea(data, start, end, dim) > 0)) { 46 | for (let i = start; i < end; i += dim) last = insertNode(i / dim | 0, data[i], data[i + 1], last); 47 | } else { 48 | for (let i = end - dim; i >= start; i -= dim) last = insertNode(i / dim | 0, data[i], data[i + 1], last); 49 | } 50 | 51 | if (last && equals(last, last.next)) { 52 | removeNode(last); 53 | last = last.next; 54 | } 55 | 56 | return last; 57 | } 58 | 59 | // eliminate colinear or duplicate points 60 | function filterPoints(start, end) { 61 | if (!start) return start; 62 | if (!end) end = start; 63 | 64 | let p = start, 65 | again; 66 | do { 67 | again = false; 68 | 69 | if (!p.steiner && (equals(p, p.next) || area(p.prev, p, p.next) === 0)) { 70 | removeNode(p); 71 | p = end = p.prev; 72 | if (p === p.next) break; 73 | again = true; 74 | 75 | } else { 76 | p = p.next; 77 | } 78 | } while (again || p !== end); 79 | 80 | return end; 81 | } 82 | 83 | // main ear slicing loop which triangulates a polygon (given as a linked list) 84 | function earcutLinked(ear, triangles, dim, minX, minY, invSize, pass) { 85 | if (!ear) return; 86 | 87 | // interlink polygon nodes in z-order 88 | if (!pass && invSize) indexCurve(ear, minX, minY, invSize); 89 | 90 | let stop = ear; 91 | 92 | // iterate through ears, slicing them one by one 93 | while (ear.prev !== ear.next) { 94 | const prev = ear.prev; 95 | const next = ear.next; 96 | 97 | if (invSize ? isEarHashed(ear, minX, minY, invSize) : isEar(ear)) { 98 | triangles.push(prev.i, ear.i, next.i); // cut off the triangle 99 | 100 | removeNode(ear); 101 | 102 | // skipping the next vertex leads to less sliver triangles 103 | ear = next.next; 104 | stop = next.next; 105 | 106 | continue; 107 | } 108 | 109 | ear = next; 110 | 111 | // if we looped through the whole remaining polygon and can't find any more ears 112 | if (ear === stop) { 113 | // try filtering points and slicing again 114 | if (!pass) { 115 | earcutLinked(filterPoints(ear), triangles, dim, minX, minY, invSize, 1); 116 | 117 | // if this didn't work, try curing all small self-intersections locally 118 | } else if (pass === 1) { 119 | ear = cureLocalIntersections(filterPoints(ear), triangles); 120 | earcutLinked(ear, triangles, dim, minX, minY, invSize, 2); 121 | 122 | // as a last resort, try splitting the remaining polygon into two 123 | } else if (pass === 2) { 124 | splitEarcut(ear, triangles, dim, minX, minY, invSize); 125 | } 126 | 127 | break; 128 | } 129 | } 130 | } 131 | 132 | // check whether a polygon node forms a valid ear with adjacent nodes 133 | function isEar(ear) { 134 | const a = ear.prev, 135 | b = ear, 136 | c = ear.next; 137 | 138 | if (area(a, b, c) >= 0) return false; // reflex, can't be an ear 139 | 140 | // now make sure we don't have other points inside the potential ear 141 | const ax = a.x, bx = b.x, cx = c.x, ay = a.y, by = b.y, cy = c.y; 142 | 143 | // triangle bbox 144 | const x0 = Math.min(ax, bx, cx), 145 | y0 = Math.min(ay, by, cy), 146 | x1 = Math.max(ax, bx, cx), 147 | y1 = Math.max(ay, by, cy); 148 | 149 | let p = c.next; 150 | while (p !== a) { 151 | if (p.x >= x0 && p.x <= x1 && p.y >= y0 && p.y <= y1 && 152 | pointInTriangleExceptFirst(ax, ay, bx, by, cx, cy, p.x, p.y) && 153 | area(p.prev, p, p.next) >= 0) return false; 154 | p = p.next; 155 | } 156 | 157 | return true; 158 | } 159 | 160 | function isEarHashed(ear, minX, minY, invSize) { 161 | const a = ear.prev, 162 | b = ear, 163 | c = ear.next; 164 | 165 | if (area(a, b, c) >= 0) return false; // reflex, can't be an ear 166 | 167 | const ax = a.x, bx = b.x, cx = c.x, ay = a.y, by = b.y, cy = c.y; 168 | 169 | // triangle bbox 170 | const x0 = Math.min(ax, bx, cx), 171 | y0 = Math.min(ay, by, cy), 172 | x1 = Math.max(ax, bx, cx), 173 | y1 = Math.max(ay, by, cy); 174 | 175 | // z-order range for the current triangle bbox; 176 | const minZ = zOrder(x0, y0, minX, minY, invSize), 177 | maxZ = zOrder(x1, y1, minX, minY, invSize); 178 | 179 | let p = ear.prevZ, 180 | n = ear.nextZ; 181 | 182 | // look for points inside the triangle in both directions 183 | while (p && p.z >= minZ && n && n.z <= maxZ) { 184 | if (p.x >= x0 && p.x <= x1 && p.y >= y0 && p.y <= y1 && p !== a && p !== c && 185 | pointInTriangleExceptFirst(ax, ay, bx, by, cx, cy, p.x, p.y) && area(p.prev, p, p.next) >= 0) return false; 186 | p = p.prevZ; 187 | 188 | if (n.x >= x0 && n.x <= x1 && n.y >= y0 && n.y <= y1 && n !== a && n !== c && 189 | pointInTriangleExceptFirst(ax, ay, bx, by, cx, cy, n.x, n.y) && area(n.prev, n, n.next) >= 0) return false; 190 | n = n.nextZ; 191 | } 192 | 193 | // look for remaining points in decreasing z-order 194 | while (p && p.z >= minZ) { 195 | if (p.x >= x0 && p.x <= x1 && p.y >= y0 && p.y <= y1 && p !== a && p !== c && 196 | pointInTriangleExceptFirst(ax, ay, bx, by, cx, cy, p.x, p.y) && area(p.prev, p, p.next) >= 0) return false; 197 | p = p.prevZ; 198 | } 199 | 200 | // look for remaining points in increasing z-order 201 | while (n && n.z <= maxZ) { 202 | if (n.x >= x0 && n.x <= x1 && n.y >= y0 && n.y <= y1 && n !== a && n !== c && 203 | pointInTriangleExceptFirst(ax, ay, bx, by, cx, cy, n.x, n.y) && area(n.prev, n, n.next) >= 0) return false; 204 | n = n.nextZ; 205 | } 206 | 207 | return true; 208 | } 209 | 210 | // go through all polygon nodes and cure small local self-intersections 211 | function cureLocalIntersections(start, triangles) { 212 | let p = start; 213 | do { 214 | const a = p.prev, 215 | b = p.next.next; 216 | 217 | if (!equals(a, b) && intersects(a, p, p.next, b) && locallyInside(a, b) && locallyInside(b, a)) { 218 | 219 | triangles.push(a.i, p.i, b.i); 220 | 221 | // remove two nodes involved 222 | removeNode(p); 223 | removeNode(p.next); 224 | 225 | p = start = b; 226 | } 227 | p = p.next; 228 | } while (p !== start); 229 | 230 | return filterPoints(p); 231 | } 232 | 233 | // try splitting polygon into two and triangulate them independently 234 | function splitEarcut(start, triangles, dim, minX, minY, invSize) { 235 | // look for a valid diagonal that divides the polygon into two 236 | let a = start; 237 | do { 238 | let b = a.next.next; 239 | while (b !== a.prev) { 240 | if (a.i !== b.i && isValidDiagonal(a, b)) { 241 | // split the polygon in two by the diagonal 242 | let c = splitPolygon(a, b); 243 | 244 | // filter colinear points around the cuts 245 | a = filterPoints(a, a.next); 246 | c = filterPoints(c, c.next); 247 | 248 | // run earcut on each half 249 | earcutLinked(a, triangles, dim, minX, minY, invSize, 0); 250 | earcutLinked(c, triangles, dim, minX, minY, invSize, 0); 251 | return; 252 | } 253 | b = b.next; 254 | } 255 | a = a.next; 256 | } while (a !== start); 257 | } 258 | 259 | // link every hole into the outer loop, producing a single-ring polygon without holes 260 | function eliminateHoles(data, holeIndices, outerNode, dim) { 261 | const queue = []; 262 | 263 | for (let i = 0, len = holeIndices.length; i < len; i++) { 264 | const start = holeIndices[i] * dim; 265 | const end = i < len - 1 ? holeIndices[i + 1] * dim : data.length; 266 | const list = linkedList(data, start, end, dim, false); 267 | if (list === list.next) list.steiner = true; 268 | queue.push(getLeftmost(list)); 269 | } 270 | 271 | queue.sort(compareXYSlope); 272 | 273 | // process holes from left to right 274 | for (let i = 0; i < queue.length; i++) { 275 | outerNode = eliminateHole(queue[i], outerNode); 276 | } 277 | 278 | return outerNode; 279 | } 280 | 281 | function compareXYSlope(a, b) { 282 | let result = a.x - b.x; 283 | // when the left-most point of 2 holes meet at a vertex, sort the holes counterclockwise so that when we find 284 | // the bridge to the outer shell is always the point that they meet at. 285 | if (result === 0) { 286 | result = a.y - b.y; 287 | if (result === 0) { 288 | const aSlope = (a.next.y - a.y) / (a.next.x - a.x); 289 | const bSlope = (b.next.y - b.y) / (b.next.x - b.x); 290 | result = aSlope - bSlope; 291 | } 292 | } 293 | return result; 294 | } 295 | 296 | // find a bridge between vertices that connects hole with an outer ring and and link it 297 | function eliminateHole(hole, outerNode) { 298 | const bridge = findHoleBridge(hole, outerNode); 299 | if (!bridge) { 300 | return outerNode; 301 | } 302 | 303 | const bridgeReverse = splitPolygon(bridge, hole); 304 | 305 | // filter collinear points around the cuts 306 | filterPoints(bridgeReverse, bridgeReverse.next); 307 | return filterPoints(bridge, bridge.next); 308 | } 309 | 310 | // David Eberly's algorithm for finding a bridge between hole and outer polygon 311 | function findHoleBridge(hole, outerNode) { 312 | let p = outerNode; 313 | const hx = hole.x; 314 | const hy = hole.y; 315 | let qx = -Infinity; 316 | let m; 317 | 318 | // find a segment intersected by a ray from the hole's leftmost point to the left; 319 | // segment's endpoint with lesser x will be potential connection point 320 | // unless they intersect at a vertex, then choose the vertex 321 | if (equals(hole, p)) return p; 322 | do { 323 | if (equals(hole, p.next)) return p.next; 324 | else if (hy <= p.y && hy >= p.next.y && p.next.y !== p.y) { 325 | const x = p.x + (hy - p.y) * (p.next.x - p.x) / (p.next.y - p.y); 326 | if (x <= hx && x > qx) { 327 | qx = x; 328 | m = p.x < p.next.x ? p : p.next; 329 | if (x === hx) return m; // hole touches outer segment; pick leftmost endpoint 330 | } 331 | } 332 | p = p.next; 333 | } while (p !== outerNode); 334 | 335 | if (!m) return null; 336 | 337 | // look for points inside the triangle of hole point, segment intersection and endpoint; 338 | // if there are no points found, we have a valid connection; 339 | // otherwise choose the point of the minimum angle with the ray as connection point 340 | 341 | const stop = m; 342 | const mx = m.x; 343 | const my = m.y; 344 | let tanMin = Infinity; 345 | 346 | p = m; 347 | 348 | do { 349 | if (hx >= p.x && p.x >= mx && hx !== p.x && 350 | pointInTriangle(hy < my ? hx : qx, hy, mx, my, hy < my ? qx : hx, hy, p.x, p.y)) { 351 | 352 | const tan = Math.abs(hy - p.y) / (hx - p.x); // tangential 353 | 354 | if (locallyInside(p, hole) && 355 | (tan < tanMin || (tan === tanMin && (p.x > m.x || (p.x === m.x && sectorContainsSector(m, p)))))) { 356 | m = p; 357 | tanMin = tan; 358 | } 359 | } 360 | 361 | p = p.next; 362 | } while (p !== stop); 363 | 364 | return m; 365 | } 366 | 367 | // whether sector in vertex m contains sector in vertex p in the same coordinates 368 | function sectorContainsSector(m, p) { 369 | return area(m.prev, m, p.prev) < 0 && area(p.next, m, m.next) < 0; 370 | } 371 | 372 | // interlink polygon nodes in z-order 373 | function indexCurve(start, minX, minY, invSize) { 374 | let p = start; 375 | do { 376 | if (p.z === 0) p.z = zOrder(p.x, p.y, minX, minY, invSize); 377 | p.prevZ = p.prev; 378 | p.nextZ = p.next; 379 | p = p.next; 380 | } while (p !== start); 381 | 382 | p.prevZ.nextZ = null; 383 | p.prevZ = null; 384 | 385 | sortLinked(p); 386 | } 387 | 388 | // Simon Tatham's linked list merge sort algorithm 389 | // http://www.chiark.greenend.org.uk/~sgtatham/algorithms/listsort.html 390 | function sortLinked(list) { 391 | let numMerges; 392 | let inSize = 1; 393 | 394 | do { 395 | let p = list; 396 | let e; 397 | list = null; 398 | let tail = null; 399 | numMerges = 0; 400 | 401 | while (p) { 402 | numMerges++; 403 | let q = p; 404 | let pSize = 0; 405 | for (let i = 0; i < inSize; i++) { 406 | pSize++; 407 | q = q.nextZ; 408 | if (!q) break; 409 | } 410 | let qSize = inSize; 411 | 412 | while (pSize > 0 || (qSize > 0 && q)) { 413 | 414 | if (pSize !== 0 && (qSize === 0 || !q || p.z <= q.z)) { 415 | e = p; 416 | p = p.nextZ; 417 | pSize--; 418 | } else { 419 | e = q; 420 | q = q.nextZ; 421 | qSize--; 422 | } 423 | 424 | if (tail) tail.nextZ = e; 425 | else list = e; 426 | 427 | e.prevZ = tail; 428 | tail = e; 429 | } 430 | 431 | p = q; 432 | } 433 | 434 | tail.nextZ = null; 435 | inSize *= 2; 436 | 437 | } while (numMerges > 1); 438 | 439 | return list; 440 | } 441 | 442 | // z-order of a point given coords and inverse of the longer side of data bbox 443 | function zOrder(x, y, minX, minY, invSize) { 444 | // coords are transformed into non-negative 15-bit integer range 445 | x = (x - minX) * invSize | 0; 446 | y = (y - minY) * invSize | 0; 447 | 448 | x = (x | (x << 8)) & 0x00FF00FF; 449 | x = (x | (x << 4)) & 0x0F0F0F0F; 450 | x = (x | (x << 2)) & 0x33333333; 451 | x = (x | (x << 1)) & 0x55555555; 452 | 453 | y = (y | (y << 8)) & 0x00FF00FF; 454 | y = (y | (y << 4)) & 0x0F0F0F0F; 455 | y = (y | (y << 2)) & 0x33333333; 456 | y = (y | (y << 1)) & 0x55555555; 457 | 458 | return x | (y << 1); 459 | } 460 | 461 | // find the leftmost node of a polygon ring 462 | function getLeftmost(start) { 463 | let p = start, 464 | leftmost = start; 465 | do { 466 | if (p.x < leftmost.x || (p.x === leftmost.x && p.y < leftmost.y)) leftmost = p; 467 | p = p.next; 468 | } while (p !== start); 469 | 470 | return leftmost; 471 | } 472 | 473 | // check if a point lies within a convex triangle 474 | function pointInTriangle(ax, ay, bx, by, cx, cy, px, py) { 475 | return (cx - px) * (ay - py) >= (ax - px) * (cy - py) && 476 | (ax - px) * (by - py) >= (bx - px) * (ay - py) && 477 | (bx - px) * (cy - py) >= (cx - px) * (by - py); 478 | } 479 | 480 | // check if a point lies within a convex triangle but false if its equal to the first point of the triangle 481 | function pointInTriangleExceptFirst(ax, ay, bx, by, cx, cy, px, py) { 482 | return !(ax === px && ay === py) && pointInTriangle(ax, ay, bx, by, cx, cy, px, py); 483 | } 484 | 485 | // check if a diagonal between two polygon nodes is valid (lies in polygon interior) 486 | function isValidDiagonal(a, b) { 487 | return a.next.i !== b.i && a.prev.i !== b.i && !intersectsPolygon(a, b) && // doesn't intersect other edges 488 | (locallyInside(a, b) && locallyInside(b, a) && middleInside(a, b) && // locally visible 489 | (area(a.prev, a, b.prev) || area(a, b.prev, b)) || // does not create opposite-facing sectors 490 | equals(a, b) && area(a.prev, a, a.next) > 0 && area(b.prev, b, b.next) > 0); // special zero-length case 491 | } 492 | 493 | // signed area of a triangle 494 | function area(p, q, r) { 495 | return (q.y - p.y) * (r.x - q.x) - (q.x - p.x) * (r.y - q.y); 496 | } 497 | 498 | // check if two points are equal 499 | function equals(p1, p2) { 500 | return p1.x === p2.x && p1.y === p2.y; 501 | } 502 | 503 | // check if two segments intersect 504 | function intersects(p1, q1, p2, q2) { 505 | const o1 = sign(area(p1, q1, p2)); 506 | const o2 = sign(area(p1, q1, q2)); 507 | const o3 = sign(area(p2, q2, p1)); 508 | const o4 = sign(area(p2, q2, q1)); 509 | 510 | if (o1 !== o2 && o3 !== o4) return true; // general case 511 | 512 | if (o1 === 0 && onSegment(p1, p2, q1)) return true; // p1, q1 and p2 are collinear and p2 lies on p1q1 513 | if (o2 === 0 && onSegment(p1, q2, q1)) return true; // p1, q1 and q2 are collinear and q2 lies on p1q1 514 | if (o3 === 0 && onSegment(p2, p1, q2)) return true; // p2, q2 and p1 are collinear and p1 lies on p2q2 515 | if (o4 === 0 && onSegment(p2, q1, q2)) return true; // p2, q2 and q1 are collinear and q1 lies on p2q2 516 | 517 | return false; 518 | } 519 | 520 | // for collinear points p, q, r, check if point q lies on segment pr 521 | function onSegment(p, q, r) { 522 | return q.x <= Math.max(p.x, r.x) && q.x >= Math.min(p.x, r.x) && q.y <= Math.max(p.y, r.y) && q.y >= Math.min(p.y, r.y); 523 | } 524 | 525 | function sign(num) { 526 | return num > 0 ? 1 : num < 0 ? -1 : 0; 527 | } 528 | 529 | // check if a polygon diagonal intersects any polygon segments 530 | function intersectsPolygon(a, b) { 531 | let p = a; 532 | do { 533 | if (p.i !== a.i && p.next.i !== a.i && p.i !== b.i && p.next.i !== b.i && 534 | intersects(p, p.next, a, b)) return true; 535 | p = p.next; 536 | } while (p !== a); 537 | 538 | return false; 539 | } 540 | 541 | // check if a polygon diagonal is locally inside the polygon 542 | function locallyInside(a, b) { 543 | return area(a.prev, a, a.next) < 0 ? 544 | area(a, b, a.next) >= 0 && area(a, a.prev, b) >= 0 : 545 | area(a, b, a.prev) < 0 || area(a, a.next, b) < 0; 546 | } 547 | 548 | // check if the middle point of a polygon diagonal is inside the polygon 549 | function middleInside(a, b) { 550 | let p = a; 551 | let inside = false; 552 | const px = (a.x + b.x) / 2; 553 | const py = (a.y + b.y) / 2; 554 | do { 555 | if (((p.y > py) !== (p.next.y > py)) && p.next.y !== p.y && 556 | (px < (p.next.x - p.x) * (py - p.y) / (p.next.y - p.y) + p.x)) 557 | inside = !inside; 558 | p = p.next; 559 | } while (p !== a); 560 | 561 | return inside; 562 | } 563 | 564 | // link two polygon vertices with a bridge; if the vertices belong to the same ring, it splits polygon into two; 565 | // if one belongs to the outer ring and another to a hole, it merges it into a single ring 566 | function splitPolygon(a, b) { 567 | const a2 = createNode(a.i, a.x, a.y), 568 | b2 = createNode(b.i, b.x, b.y), 569 | an = a.next, 570 | bp = b.prev; 571 | 572 | a.next = b; 573 | b.prev = a; 574 | 575 | a2.next = an; 576 | an.prev = a2; 577 | 578 | b2.next = a2; 579 | a2.prev = b2; 580 | 581 | bp.next = b2; 582 | b2.prev = bp; 583 | 584 | return b2; 585 | } 586 | 587 | // create a node and optionally link it with previous one (in a circular doubly linked list) 588 | function insertNode(i, x, y, last) { 589 | const p = createNode(i, x, y); 590 | 591 | if (!last) { 592 | p.prev = p; 593 | p.next = p; 594 | 595 | } else { 596 | p.next = last.next; 597 | p.prev = last; 598 | last.next.prev = p; 599 | last.next = p; 600 | } 601 | return p; 602 | } 603 | 604 | function removeNode(p) { 605 | p.next.prev = p.prev; 606 | p.prev.next = p.next; 607 | 608 | if (p.prevZ) p.prevZ.nextZ = p.nextZ; 609 | if (p.nextZ) p.nextZ.prevZ = p.prevZ; 610 | } 611 | 612 | function createNode(i, x, y) { 613 | return { 614 | i, // vertex index in coordinates array 615 | x, y, // vertex coordinates 616 | prev: null, // previous and next vertex nodes in a polygon ring 617 | next: null, 618 | z: 0, // z-order curve value 619 | prevZ: null, // previous and next nodes in z-order 620 | nextZ: null, 621 | steiner: false // indicates whether this is a steiner point 622 | }; 623 | } 624 | 625 | // return a percentage difference between the polygon area and its triangulation area; 626 | // used to verify correctness of triangulation 627 | export function deviation(data, holeIndices, dim, triangles) { 628 | const hasHoles = holeIndices && holeIndices.length; 629 | const outerLen = hasHoles ? holeIndices[0] * dim : data.length; 630 | 631 | let polygonArea = Math.abs(signedArea(data, 0, outerLen, dim)); 632 | if (hasHoles) { 633 | for (let i = 0, len = holeIndices.length; i < len; i++) { 634 | const start = holeIndices[i] * dim; 635 | const end = i < len - 1 ? holeIndices[i + 1] * dim : data.length; 636 | polygonArea -= Math.abs(signedArea(data, start, end, dim)); 637 | } 638 | } 639 | 640 | let trianglesArea = 0; 641 | for (let i = 0; i < triangles.length; i += 3) { 642 | const a = triangles[i] * dim; 643 | const b = triangles[i + 1] * dim; 644 | const c = triangles[i + 2] * dim; 645 | trianglesArea += Math.abs( 646 | (data[a] - data[c]) * (data[b + 1] - data[a + 1]) - 647 | (data[a] - data[b]) * (data[c + 1] - data[a + 1])); 648 | } 649 | 650 | return polygonArea === 0 && trianglesArea === 0 ? 0 : 651 | Math.abs((trianglesArea - polygonArea) / polygonArea); 652 | } 653 | 654 | function signedArea(data, start, end, dim) { 655 | let sum = 0; 656 | for (let i = start, j = end - dim; i < end; i += dim) { 657 | sum += (data[j] - data[i]) * (data[i + 1] + data[j + 1]); 658 | j = i; 659 | } 660 | return sum; 661 | } 662 | 663 | // turn a polygon in a multi-dimensional array form (e.g. as in GeoJSON) into a form Earcut accepts 664 | export function flatten(data) { 665 | const vertices = []; 666 | const holes = []; 667 | const dimensions = data[0][0].length; 668 | let holeIndex = 0; 669 | let prevLen = 0; 670 | 671 | for (const ring of data) { 672 | for (const p of ring) { 673 | for (let d = 0; d < dimensions; d++) vertices.push(p[d]); 674 | } 675 | if (prevLen) { 676 | holeIndex += prevLen; 677 | holes.push(holeIndex); 678 | } 679 | prevLen = ring.length; 680 | } 681 | return {vertices, holes, dimensions}; 682 | } 683 | -------------------------------------------------------------------------------- /test/expected.json: -------------------------------------------------------------------------------- 1 | { 2 | "triangles": { 3 | "building": 13, 4 | "dude": 106, 5 | "water": 2482, 6 | "water2": 1212, 7 | "water3": 197, 8 | "water3b": 25, 9 | "water4": 705, 10 | "water-huge": 5176, 11 | "water-huge2": 4462, 12 | "degenerate": 0, 13 | "bad-hole": 42, 14 | "empty-square": 0, 15 | "issue16": 12, 16 | "issue17": 11, 17 | "steiner": 9, 18 | "issue29": 40, 19 | "issue34": 139, 20 | "issue35": 844, 21 | "self-touching": 124, 22 | "outside-ring": 64, 23 | "simplified-us-border": 120, 24 | "touching-holes": 57, 25 | "touching-holes2": 10, 26 | "touching-holes3": 82, 27 | "touching-holes4": 55, 28 | "touching-holes5": 133, 29 | "touching-holes6": 3098, 30 | "hole-touching-outer": 77, 31 | "hilbert": 1024, 32 | "issue45": 10, 33 | "eberly-3": 73, 34 | "eberly-6": 1429, 35 | "issue52": 109, 36 | "shared-points": 4, 37 | "bad-diagonals": 7, 38 | "issue83": 0, 39 | "issue107": 0, 40 | "issue111": 18, 41 | "boxy": 58, 42 | "collinear-diagonal": 14, 43 | "issue119": 18, 44 | "hourglass": 2, 45 | "touching2": 8, 46 | "touching3": 15, 47 | "touching4": 19, 48 | "rain": 2681, 49 | "issue131": 12, 50 | "infinite-loop-jhl": 0, 51 | "filtered-bridge-jhl": 25, 52 | "issue149": 2, 53 | "issue142": 4 54 | }, 55 | "errors": { 56 | "dude": 2e-15, 57 | "water": 0.0008, 58 | "water-huge": 0.0011, 59 | "water-huge2": 0.004, 60 | "bad-hole": 0.019, 61 | "issue16": 4e-16, 62 | "issue17": 2e-16, 63 | "issue29": 2e-15, 64 | "self-touching": 2e-13, 65 | "eberly-6": 2e-14, 66 | "issue142": 0.13 67 | }, 68 | "errors-with-rotation": { 69 | "water-huge": 0.0035, 70 | "water-huge2": 0.061, 71 | "bad-hole": 0.04, 72 | "issue16": 8e-16 73 | } 74 | } -------------------------------------------------------------------------------- /test/fixtures/bad-diagonals.json: -------------------------------------------------------------------------------- 1 | [[[440,4152],[440,4208],[296,4192],[368,4192],[400,4200],[400,4176],[368,4192],[296,4192],[264,4200],[288,4160],[296,4192]]] 2 | -------------------------------------------------------------------------------- /test/fixtures/bad-hole.json: -------------------------------------------------------------------------------- 1 | [ 2 | [[810,2828],[818,2828],[832,2818],[844,2806],[855,2808],[866,2816],[867,2824],[876,2827],[883,2834],[875,2834],[867,2840],[878,2838],[889,2844],[880,2847],[870,2847],[860,2864],[852,2879],[847,2867],[810,2828],[810,2828]], 3 | [[818,2834],[823,2833],[831,2828],[839,2829],[839,2837],[851,2845],[847,2835],[846,2827],[847,2827],[837,2827],[840,2815],[835,2823],[818,2834],[818,2834]], 4 | [[857,2846],[864,2850],[866,2839],[857,2846],[857,2846]], 5 | [[848,2863],[848,2866],[854,2852],[846,2854],[847,2862],[838,2851],[838,2859],[848,2863],[848,2863]] 6 | ] 7 | -------------------------------------------------------------------------------- /test/fixtures/boxy.json: -------------------------------------------------------------------------------- 1 | [[[3432,2779],[3432,2794],[3450,2794],[3450,2825],[3413,2825],[3413,2856],[3395,2856],[3395,2871],[3377,2871],[3377,2856],[3359,2856],[3359,2840],[3341,2840],[3341,2871],[3322,2871],[3322,2887],[3249,2887],[3249,2871],[3268,2871],[3268,2840],[3304,2840],[3304,2825],[3322,2825],[3322,2810],[3304,2810],[3304,2794],[3322,2794],[3322,2779],[3341,2779],[3341,2733],[3359,2733],[3359,2687],[3395,2687],[3395,2702],[3432,2702],[3432,2717],[3450,2717],[3450,2733],[3486,2733],[3486,2748],[3468,2748],[3468,2763],[3450,2763],[3450,2779],[3432,2779]],[[3359,2794],[3341,2794],[3341,2810],[3395,2810],[3395,2794],[3377,2794],[3377,2779],[3359,2779],[3359,2794]],[[3432,2779],[3432,2748],[3413,2748],[3413,2779],[3432,2779]],[[3377,2779],[3395,2779],[3395,2748],[3377,2748],[3377,2779]],[[3377,2717],[3395,2717],[3395,2702],[3377,2702],[3377,2717]]] 2 | -------------------------------------------------------------------------------- /test/fixtures/building.json: -------------------------------------------------------------------------------- 1 | [[[661,112],[661,96],[666,96],[666,87],[743,87],[771,87],[771,114],[750,114],[750,113],[742,113],[742,106],[710,106],[710,113],[666,113],[666,112]]] 2 | -------------------------------------------------------------------------------- /test/fixtures/collinear-diagonal.json: -------------------------------------------------------------------------------- 1 | [[[3468,1913],[3486,1884],[3413,1869],[3322,1869],[3413,1854],[3413,1869],[3486,1869],[3486,1884],[3504,1884],[3504,1869],[3432,1869],[3432,1854],[3395,1854],[3432,1839],[3432,1854],[3450,1839],[3341,1839],[3341,1825],[3195,1825],[3341,1810],[3341,1825],[3450,1825],[3523,1854],[3523,1913]]] 2 | -------------------------------------------------------------------------------- /test/fixtures/degenerate.json: -------------------------------------------------------------------------------- 1 | [[[100,100],[100,100],[200,100],[200,200],[200,100],[0,100]]] 2 | -------------------------------------------------------------------------------- /test/fixtures/dude.json: -------------------------------------------------------------------------------- 1 | [ 2 | [[280.35714, 648.79075],[286.78571, 662.8979],[263.28607, 661.17871],[262.31092, 671.41548],[250.53571, 677.00504],[250.53571, 683.43361],[256.42857, 685.21933],[297.14286, 669.50504],[289.28571, 649.50504],[285, 631.6479],[285, 608.79075],[292.85714, 585.21932],[306.42857, 563.79075],[323.57143, 548.79075],[339.28571, 545.21932],[357.85714, 547.36218],[375, 550.21932],[391.42857, 568.07647],[404.28571, 588.79075],[413.57143, 612.36218],[417.14286, 628.07647],[438.57143, 619.1479],[438.03572, 618.96932],[437.5, 609.50504],[426.96429, 609.86218],[424.64286, 615.57647],[419.82143, 615.04075],[420.35714, 605.04075],[428.39286, 598.43361],[437.85714, 599.68361],[443.57143, 613.79075],[450.71429, 610.21933],[431.42857, 575.21932],[405.71429, 550.21932],[372.85714, 534.50504],[349.28571, 531.6479],[346.42857, 521.6479],[346.42857, 511.6479],[350.71429, 496.6479],[367.85714, 476.6479],[377.14286, 460.93361],[385.71429, 445.21932],[388.57143, 404.50504],[360, 352.36218],[337.14286, 325.93361],[330.71429, 334.50504],[347.14286, 354.50504],[337.85714, 370.21932],[333.57143, 359.50504],[319.28571, 353.07647],[312.85714, 366.6479],[350.71429, 387.36218],[368.57143, 408.07647],[375.71429, 431.6479],[372.14286, 454.50504],[366.42857, 462.36218],[352.85714, 462.36218],[336.42857, 456.6479],[332.85714, 438.79075],[338.57143, 423.79075],[338.57143, 411.6479],[327.85714, 405.93361],[320.71429, 407.36218],[315.71429, 423.07647],[314.28571, 440.21932],[325, 447.71932],[324.82143, 460.93361],[317.85714, 470.57647],[304.28571, 483.79075],[287.14286, 491.29075],[263.03571, 498.61218],[251.60714, 503.07647],[251.25, 533.61218],[260.71429, 533.61218],[272.85714, 528.43361],[286.07143, 518.61218],[297.32143, 508.25504],[297.85714, 507.36218],[298.39286, 506.46932],[307.14286, 496.6479],[312.67857, 491.6479],[317.32143, 503.07647],[322.5, 514.1479],[325.53571, 521.11218],[327.14286, 525.75504],[326.96429, 535.04075],[311.78571, 540.04075],[291.07143, 552.71932],[274.82143, 568.43361],[259.10714, 592.8979],[254.28571, 604.50504],[251.07143, 621.11218],[250.53571, 649.1479],[268.1955, 654.36208]], 3 | [[325, 437], [320, 423], [329, 413], [332, 423]], 4 | [[320.72342, 480], [338.90617, 465.96863], [347.99754, 480.61584], [329.8148, 510.41534], [339.91632, 480.11077], [334.86556, 478.09046]] 5 | ] 6 | -------------------------------------------------------------------------------- /test/fixtures/eberly-3.json: -------------------------------------------------------------------------------- 1 | [[[2328,2408],[2328,2472],[2344,2472],[2344,2432],[2384,2448],[2384,2536],[2408,2552],[2448,2544],[2456,2560],[2496,2544],[2480,2624],[2456,2664],[2424,2680],[2400,2768],[2376,2768],[2368,2704],[2336,2704],[2264,2784],[2216,2784],[2200,2760],[2168,2760],[2152,2744],[2128,2744],[2128,2784],[2072,2768],[2032,2720],[2000,2720],[2000,2688],[1936,2696],[1920,2736],[1888,2728],[1896,2696],[1928,2688],[1928,2664],[1896,2664],[1896,2640],[1912,2632],[1872,2608],[1888,2576],[2056,2576],[2088,2600],[2184,2608],[2216,2632],[2256,2624],[2248,2600],[2216,2592],[2192,2560],[2120,2576],[2072,2544],[2096,2544],[2080,2520],[2080,2488],[2096,2480],[2080,2448],[2096,2432],[2176,2496],[2200,2488],[2224,2528],[2248,2528],[2240,2488],[2256,2472],[2280,2480],[2264,2416],[2272,2392],[2328,2408]],[[2320,2608],[2304,2640],[2312,2664],[2360,2632],[2352,2608],[2320,2608]],[[1912,2632],[1936,2632],[1936,2616],[1912,2608],[1912,2632]]] 2 | -------------------------------------------------------------------------------- /test/fixtures/eberly-6.json: -------------------------------------------------------------------------------- 1 | [ 2 | [[142.807,-11.178],[142.810,-11.171],[142.807,-11.168],[142.797,-11.143],[142.795,-11.113],[142.790,-11.085],[142.778,-11.054],[142.770,-11.039],[142.759,-11.027],[142.752,-11.015],[142.746,-10.986],[142.742,-10.975],[142.725,-10.968],[142.701,-10.970],[142.678,-10.982],[142.666,-11.003],[142.660,-10.983],[142.668,-10.951],[142.659,-10.934],[142.649,-10.929],[142.640,-10.932],[142.634,-10.931],[142.625,-10.882],[142.615,-10.868],[142.591,-10.865],[142.567,-10.870],[142.556,-10.882],[142.552,-10.904],[142.540,-10.925],[142.523,-10.942],[142.502,-10.948],[142.515,-10.924],[142.514,-10.900],[142.510,-10.877],[142.515,-10.852],[142.521,-10.847],[142.542,-10.842],[142.550,-10.838],[142.555,-10.829],[142.564,-10.806],[142.570,-10.797],[142.577,-10.792],[142.593,-10.786],[142.601,-10.780],[142.606,-10.772],[142.612,-10.762],[142.616,-10.752],[142.615,-10.745],[142.601,-10.735],[142.564,-10.717],[142.550,-10.708],[142.548,-10.703],[142.550,-10.696],[142.550,-10.690],[142.546,-10.688],[142.540,-10.689],[142.537,-10.691],[142.535,-10.693],[142.532,-10.695],[142.527,-10.698],[142.511,-10.712],[142.505,-10.715],[142.463,-10.711],[142.449,-10.715],[142.434,-10.728],[142.425,-10.745],[142.409,-10.792],[142.406,-10.807],[142.401,-10.820],[142.365,-10.858],[142.340,-10.890],[142.323,-10.902],[142.300,-10.906],[142.280,-10.907],[142.258,-10.911],[142.239,-10.918],[142.228,-10.927],[142.221,-10.920],[142.175,-10.930],[142.151,-10.951],[142.145,-10.983],[142.158,-11.067],[142.159,-11.151],[142.154,-11.178],[136.720,-11.178],[136.720,-11.174],[136.734,-11.138],[136.747,-11.093],[136.764,-11.040],[136.762,-11.019],[136.756,-11.027],[136.752,-11.037],[136.749,-11.035],[136.746,-11.034],[136.742,-11.033],[136.739,-11.030],[136.719,-11.051],[136.735,-11.064],[136.731,-11.079],[136.723,-11.086],[136.711,-11.097],[136.710,-11.121],[136.700,-11.140],[136.688,-11.178],[136.685,-11.178],[135.000,-11.178],[135.000,-4.342],[135.186,-4.449],[135.228,-4.461],[135.272,-4.458],[135.331,-4.440],[135.359,-4.444],[135.413,-4.436],[135.430,-4.430],[135.444,-4.441],[135.467,-4.446],[135.587,-4.460],[135.605,-4.468],[135.614,-4.475],[135.656,-4.486],[135.700,-4.487],[135.708,-4.489],[135.725,-4.495],[135.750,-4.497],[135.776,-4.495],[135.793,-4.486],[135.829,-4.499],[135.912,-4.498],[135.950,-4.506],[135.970,-4.520],[136.016,-4.571],[136.036,-4.586],[136.050,-4.590],[136.063,-4.591],[136.081,-4.595],[136.095,-4.603],[136.107,-4.612],[136.122,-4.619],[136.146,-4.622],[136.147,-4.626],[136.177,-4.650],[136.267,-4.676],[136.355,-4.677],[136.376,-4.684],[136.403,-4.708],[136.413,-4.712],[136.433,-4.712],[136.440,-4.715],[136.464,-4.736],[136.538,-4.774],[136.626,-4.823],[136.696,-4.847],[136.743,-4.882],[136.753,-4.880],[136.763,-4.874],[136.786,-4.876],[136.799,-4.880],[136.803,-4.883],[136.801,-4.900],[136.804,-4.910],[136.812,-4.920],[136.822,-4.928],[136.832,-4.931],[136.854,-4.928],[136.875,-4.920],[136.947,-4.876],[136.969,-4.870],[136.979,-4.880],[136.974,-4.885],[136.962,-4.891],[136.950,-4.899],[136.944,-4.910],[136.947,-4.918],[136.954,-4.923],[137.007,-4.946],[137.042,-4.943],[137.073,-4.924],[137.095,-4.889],[137.102,-4.889],[137.096,-4.922],[137.088,-4.943],[137.090,-4.960],[137.115,-4.979],[137.150,-4.945],[137.152,-4.974],[137.169,-4.991],[137.219,-5.013],[137.232,-4.999],[137.224,-4.982],[137.232,-4.969],[137.279,-4.937],[137.283,-4.940],[137.267,-4.999],[137.268,-5.014],[137.277,-5.020],[137.302,-5.027],[137.309,-5.022],[137.308,-4.999],[137.335,-5.031],[137.350,-5.040],[137.363,-5.026],[137.369,-5.026],[137.370,-5.037],[137.368,-5.046],[137.363,-5.055],[137.356,-5.062],[137.378,-5.082],[137.404,-5.098],[137.433,-5.103],[137.465,-5.096],[137.468,-5.110],[137.474,-5.115],[137.482,-5.117],[137.492,-5.123],[137.509,-5.142],[137.519,-5.149],[137.533,-5.150],[137.540,-5.144],[137.556,-5.121],[137.561,-5.116],[137.573,-5.121],[137.581,-5.143],[137.595,-5.150],[137.595,-5.157],[137.574,-5.167],[137.580,-5.182],[137.598,-5.196],[137.616,-5.205],[137.647,-5.212],[137.663,-5.220],[137.673,-5.218],[137.682,-5.213],[137.691,-5.211],[137.706,-5.222],[137.716,-5.257],[137.732,-5.273],[137.752,-5.278],[137.771,-5.272],[137.808,-5.253],[137.802,-5.270],[137.783,-5.298],[137.780,-5.315],[137.783,-5.318],[137.809,-5.353],[137.814,-5.358],[137.822,-5.363],[137.853,-5.362],[137.904,-5.324],[137.925,-5.329],[137.908,-5.363],[137.915,-5.387],[137.959,-5.431],[137.987,-5.470],[137.999,-5.479],[138.026,-5.485],[138.036,-5.475],[138.035,-5.455],[138.027,-5.431],[138.041,-5.436],[138.051,-5.432],[138.058,-5.420],[138.061,-5.404],[138.071,-5.410],[138.075,-5.420],[138.074,-5.445],[138.064,-5.489],[138.064,-5.511],[138.078,-5.520],[138.085,-5.522],[138.105,-5.531],[138.110,-5.534],[138.108,-5.545],[138.101,-5.549],[138.092,-5.550],[138.082,-5.555],[138.069,-5.565],[138.060,-5.575],[138.055,-5.590],[138.053,-5.613],[138.057,-5.658],[138.068,-5.698],[138.069,-5.708],[138.069,-5.720],[138.071,-5.729],[138.082,-5.734],[138.083,-5.738],[138.086,-5.740],[138.106,-5.726],[138.152,-5.723],[138.172,-5.717],[138.214,-5.692],[138.233,-5.684],[138.253,-5.680],[138.277,-5.679],[138.320,-5.671],[138.343,-5.670],[138.363,-5.679],[138.307,-5.696],[138.252,-5.719],[138.158,-5.774],[138.170,-5.787],[138.176,-5.796],[138.178,-5.804],[138.182,-5.810],[138.209,-5.825],[138.322,-5.851],[138.343,-5.849],[138.386,-5.837],[138.404,-5.836],[138.377,-5.856],[138.304,-5.868],[138.271,-5.887],[138.262,-5.915],[138.276,-5.946],[138.339,-6.043],[138.343,-6.058],[138.347,-6.071],[138.365,-6.092],[138.370,-6.106],[138.372,-6.124],[138.390,-6.172],[138.392,-6.186],[138.390,-6.234],[138.395,-6.253],[138.414,-6.291],[138.421,-6.319],[138.466,-6.402],[138.604,-6.528],[138.619,-6.535],[138.632,-6.544],[138.678,-6.603],[138.709,-6.630],[138.829,-6.706],[138.763,-6.670],[138.743,-6.665],[138.703,-6.645],[138.682,-6.645],[138.671,-6.672],[138.673,-6.695],[138.683,-6.715],[138.700,-6.728],[138.746,-6.740],[138.768,-6.757],[138.822,-6.806],[138.838,-6.815],[138.857,-6.820],[138.924,-6.826],[138.966,-6.836],[139.000,-6.853],[139.069,-6.918],[139.115,-6.941],[139.123,-6.949],[139.133,-6.952],[139.157,-6.954],[139.180,-6.959],[139.192,-6.973],[139.182,-6.971],[139.140,-6.973],[139.126,-6.972],[139.118,-6.968],[139.104,-6.959],[139.083,-6.953],[139.073,-6.949],[139.069,-6.942],[139.038,-6.918],[139.018,-6.909],[138.989,-6.866],[138.970,-6.856],[138.960,-6.854],[138.940,-6.845],[138.931,-6.843],[138.917,-6.842],[138.884,-6.849],[138.798,-6.856],[138.783,-6.862],[138.756,-6.888],[138.740,-6.897],[138.716,-6.898],[138.675,-6.881],[138.654,-6.877],[138.613,-6.877],[138.597,-6.881],[138.581,-6.891],[138.562,-6.919],[138.572,-6.942],[138.646,-7.000],[138.748,-7.098],[138.753,-7.107],[138.762,-7.114],[138.815,-7.131],[138.843,-7.146],[138.858,-7.150],[138.925,-7.153],[138.946,-7.157],[138.966,-7.165],[139.019,-7.194],[139.038,-7.212],[139.061,-7.212],[139.104,-7.206],[139.147,-7.206],[139.159,-7.203],[139.167,-7.195],[139.181,-7.175],[139.206,-7.150],[139.222,-7.144],[139.240,-7.151],[139.240,-7.158],[139.215,-7.167],[139.199,-7.189],[139.188,-7.215],[139.175,-7.237],[139.157,-7.243],[139.004,-7.240],[138.991,-7.236],[138.962,-7.215],[138.945,-7.206],[138.905,-7.199],[138.688,-7.193],[138.667,-7.198],[138.666,-7.210],[138.677,-7.223],[138.691,-7.234],[138.700,-7.237],[138.709,-7.239],[138.729,-7.240],[138.739,-7.244],[138.746,-7.251],[138.751,-7.258],[138.767,-7.265],[138.841,-7.315],[138.865,-7.336],[138.886,-7.361],[138.926,-7.427],[138.935,-7.449],[138.944,-7.497],[138.958,-7.507],[139.000,-7.508],[139.036,-7.515],[139.071,-7.533],[139.093,-7.560],[139.089,-7.597],[139.081,-7.606],[139.069,-7.614],[139.059,-7.623],[139.055,-7.634],[139.048,-7.668],[139.045,-7.675],[139.035,-7.690],[139.007,-7.754],[139.002,-7.836],[138.994,-7.865],[138.966,-7.885],[138.927,-7.894],[138.915,-7.903],[138.911,-7.923],[138.911,-8.008],[138.906,-8.031],[138.906,-8.044],[138.920,-8.052],[138.924,-8.061],[138.925,-8.070],[138.921,-8.080],[138.901,-8.092],[138.859,-8.101],[138.843,-8.117],[138.839,-8.138],[138.843,-8.161],[138.853,-8.184],[138.876,-8.219],[138.914,-8.292],[138.921,-8.295],[138.935,-8.296],[138.943,-8.291],[138.951,-8.281],[138.957,-8.271],[138.959,-8.265],[138.963,-8.246],[138.973,-8.230],[139.090,-8.134],[139.123,-8.117],[139.201,-8.096],[139.224,-8.074],[139.227,-8.028],[139.230,-8.023],[139.232,-8.018],[139.230,-8.011],[139.225,-8.009],[139.214,-8.007],[139.212,-8.004],[139.211,-7.994],[139.207,-7.974],[139.206,-7.963],[139.217,-7.951],[139.243,-7.957],[139.288,-7.973],[139.269,-7.986],[139.252,-7.982],[139.235,-7.975],[139.219,-7.980],[139.240,-8.003],[139.245,-8.015],[139.248,-8.049],[139.252,-8.067],[139.250,-8.073],[139.246,-8.080],[139.243,-8.091],[139.240,-8.102],[139.240,-8.111],[139.255,-8.146],[139.283,-8.173],[139.320,-8.190],[139.357,-8.199],[139.395,-8.201],[139.435,-8.197],[139.515,-8.179],[139.547,-8.166],[139.599,-8.135],[139.631,-8.125],[139.769,-8.110],[139.932,-8.109],[139.974,-8.097],[140.015,-8.074],[140.034,-8.059],[140.042,-8.046],[140.046,-7.980],[140.054,-7.936],[140.061,-7.924],[140.075,-7.920],[140.100,-7.920],[140.119,-7.915],[140.135,-7.893],[140.152,-7.885],[140.129,-7.936],[140.112,-7.947],[140.083,-7.933],[140.061,-7.948],[140.054,-7.972],[140.057,-7.996],[140.066,-8.029],[140.062,-8.066],[140.058,-8.082],[140.048,-8.087],[140.035,-8.087],[140.021,-8.090],[139.998,-8.104],[139.980,-8.122],[139.971,-8.142],[139.974,-8.165],[139.988,-8.192],[140.032,-8.246],[140.252,-8.409],[140.267,-8.431],[140.301,-8.467],[140.354,-8.489],[140.363,-8.491],[140.368,-8.508],[140.378,-8.522],[140.446,-8.578],[140.453,-8.587],[140.507,-8.638],[140.622,-8.807],[140.857,-9.049],[140.921,-9.079],[140.933,-9.080],[140.977,-9.106],[140.977,-9.106],[141.008,-9.124],[141.115,-9.218],[141.153,-9.232],[141.200,-9.228],[141.232,-9.213],[141.310,-9.152],[141.346,-9.142],[141.385,-9.142],[141.422,-9.150],[141.453,-9.166],[141.495,-9.195],[141.510,-9.215],[141.530,-9.218],[141.551,-9.218],[141.563,-9.220],[141.579,-9.213],[141.593,-9.219],[141.606,-9.229],[141.621,-9.234],[141.635,-9.232],[141.651,-9.227],[141.665,-9.220],[141.673,-9.214],[141.698,-9.215],[141.783,-9.200],[141.806,-9.203],[141.847,-9.217],[141.868,-9.220],[141.893,-9.219],[141.913,-9.215],[141.974,-9.193],[141.994,-9.189],[142.136,-9.178],[142.169,-9.179],[142.181,-9.176],[142.200,-9.162],[142.211,-9.159],[142.223,-9.161],[142.276,-9.179],[142.319,-9.204],[142.334,-9.207],[142.358,-9.209],[142.373,-9.215],[142.399,-9.228],[142.429,-9.225],[142.465,-9.240],[142.499,-9.263],[142.547,-9.304],[142.577,-9.324],[142.612,-9.335],[142.653,-9.330],[142.708,-9.299],[142.715,-9.288],[142.731,-9.278],[142.838,-9.237],[142.874,-9.209],[142.920,-9.190],[142.941,-9.179],[142.949,-9.169],[142.958,-9.156],[142.967,-9.144],[142.978,-9.138],[142.988,-9.136],[143.011,-9.122],[143.036,-9.102],[143.053,-9.093],[143.142,-9.066],[143.156,-9.063],[143.163,-9.060],[143.168,-9.053],[143.171,-9.046],[143.173,-9.043],[143.178,-9.042],[143.189,-9.044],[143.204,-9.041],[143.225,-9.039],[143.235,-9.036],[143.229,-9.029],[143.258,-9.024],[143.315,-9.024],[143.345,-9.016],[143.361,-9.007],[143.373,-9.000],[143.396,-8.978],[143.406,-8.962],[143.406,-8.945],[143.400,-8.912],[143.400,-8.782],[143.395,-8.769],[143.386,-8.753],[143.348,-8.708],[143.318,-8.659],[143.262,-8.592],[143.132,-8.486],[143.102,-8.467],[143.063,-8.453],[142.938,-8.428],[142.900,-8.413],[142.835,-8.370],[142.814,-8.365],[142.804,-8.360],[142.769,-8.330],[142.728,-8.317],[142.712,-8.323],[142.632,-8.309],[142.596,-8.321],[142.530,-8.365],[142.494,-8.378],[142.452,-8.373],[142.420,-8.355],[142.397,-8.328],[142.367,-8.232],[142.365,-8.210],[142.354,-8.189],[142.330,-8.184],[142.302,-8.188],[142.260,-8.199],[142.247,-8.200],[142.231,-8.194],[142.225,-8.198],[142.219,-8.204],[142.211,-8.207],[142.196,-8.211],[142.182,-8.220],[142.160,-8.241],[142.144,-8.234],[142.140,-8.226],[142.146,-8.217],[142.160,-8.207],[142.171,-8.203],[142.182,-8.201],[142.193,-8.198],[142.204,-8.189],[142.211,-8.181],[142.217,-8.175],[142.225,-8.173],[142.260,-8.171],[142.317,-8.159],[142.360,-8.167],[142.381,-8.193],[142.405,-8.293],[142.414,-8.310],[142.429,-8.324],[142.451,-8.330],[142.494,-8.333],[142.514,-8.332],[142.536,-8.324],[142.593,-8.287],[142.615,-8.282],[142.634,-8.280],[142.684,-8.269],[142.700,-8.261],[142.710,-8.267],[142.715,-8.268],[142.841,-8.288],[142.940,-8.333],[142.958,-8.337],[142.980,-8.336],[143.215,-8.275],[143.300,-8.269],[143.328,-8.252],[143.338,-8.248],[143.592,-8.242],[143.612,-8.239],[143.629,-8.230],[143.635,-8.211],[143.628,-8.186],[143.570,-8.085],[143.560,-8.045],[143.548,-8.032],[143.467,-7.996],[143.448,-7.982],[143.441,-7.963],[143.437,-7.938],[143.426,-7.930],[143.386,-7.926],[143.375,-7.922],[143.367,-7.918],[143.361,-7.911],[143.359,-7.902],[143.364,-7.896],[143.375,-7.899],[143.386,-7.903],[143.389,-7.906],[143.416,-7.906],[143.434,-7.909],[143.448,-7.919],[143.461,-7.939],[143.478,-7.976],[143.489,-7.989],[143.506,-7.994],[143.563,-7.998],[143.628,-7.982],[143.651,-7.981],[143.670,-7.990],[143.680,-7.997],[143.715,-8.008],[143.723,-8.014],[143.741,-8.029],[143.749,-8.035],[143.767,-8.040],[143.861,-8.041],[143.881,-8.038],[143.898,-8.028],[143.914,-8.008],[143.876,-7.970],[143.859,-7.960],[143.850,-7.957],[143.833,-7.956],[143.824,-7.953],[143.818,-7.948],[143.810,-7.937],[143.804,-7.933],[143.862,-7.935],[143.879,-7.939],[143.894,-7.953],[143.908,-7.972],[143.923,-7.989],[143.941,-7.994],[143.943,-7.992],[143.957,-7.972],[143.941,-7.930],[143.893,-7.857],[143.867,-7.826],[143.856,-7.808],[143.852,-7.785],[143.851,-7.761],[143.847,-7.740],[143.841,-7.720],[143.760,-7.583],[143.742,-7.542],[143.744,-7.536],[143.747,-7.529],[143.746,-7.524],[143.723,-7.519],[143.700,-7.510],[143.691,-7.508],[143.681,-7.502],[143.649,-7.468],[143.639,-7.452],[143.646,-7.438],[143.650,-7.449],[143.653,-7.452],[143.662,-7.462],[143.696,-7.488],[143.711,-7.494],[143.723,-7.494],[143.746,-7.497],[143.756,-7.500],[143.766,-7.506],[143.769,-7.510],[143.777,-7.528],[143.813,-7.594],[143.818,-7.614],[143.828,-7.632],[143.851,-7.652],[143.924,-7.694],[144.112,-7.758],[144.129,-7.772],[144.139,-7.777],[144.151,-7.774],[144.163,-7.770],[144.174,-7.768],[144.187,-7.772],[144.196,-7.778],[144.215,-7.796],[144.229,-7.789],[144.266,-7.776],[144.276,-7.768],[144.275,-7.756],[144.265,-7.742],[144.252,-7.731],[144.242,-7.726],[144.255,-7.706],[144.261,-7.684],[144.254,-7.667],[144.229,-7.666],[144.229,-7.658],[144.241,-7.655],[144.253,-7.650],[144.263,-7.643],[144.270,-7.631],[144.285,-7.647],[144.307,-7.693],[144.324,-7.700],[144.334,-7.689],[144.327,-7.665],[144.316,-7.637],[144.311,-7.610],[144.344,-7.659],[144.355,-7.687],[144.360,-7.717],[144.367,-7.744],[144.385,-7.752],[144.403,-7.743],[144.413,-7.720],[144.424,-7.727],[144.438,-7.740],[144.450,-7.754],[144.455,-7.765],[144.460,-7.769],[144.480,-7.796],[144.482,-7.802],[144.508,-7.798],[144.500,-7.774],[144.480,-7.748],[144.469,-7.737],[144.465,-7.721],[144.457,-7.708],[144.447,-7.696],[144.441,-7.686],[144.436,-7.660],[144.434,-7.627],[144.431,-7.612],[144.418,-7.585],[144.413,-7.569],[144.412,-7.531],[144.407,-7.514],[144.413,-7.514],[144.422,-7.527],[144.433,-7.559],[144.441,-7.576],[144.446,-7.580],[144.453,-7.584],[144.459,-7.588],[144.462,-7.593],[144.462,-7.599],[144.466,-7.617],[144.469,-7.624],[144.478,-7.635],[144.504,-7.656],[144.510,-7.669],[144.514,-7.672],[144.523,-7.669],[144.533,-7.662],[144.538,-7.652],[144.515,-7.633],[144.510,-7.624],[144.509,-7.611],[144.517,-7.579],[144.517,-7.508],[144.522,-7.496],[144.538,-7.514],[144.539,-7.525],[144.537,-7.549],[144.541,-7.559],[144.547,-7.566],[144.550,-7.573],[144.551,-7.582],[144.551,-7.593],[144.555,-7.607],[144.564,-7.625],[144.575,-7.642],[144.585,-7.652],[144.604,-7.657],[144.629,-7.656],[144.652,-7.649],[144.661,-7.634],[144.658,-7.616],[144.651,-7.598],[144.648,-7.580],[144.654,-7.561],[144.679,-7.582],[144.690,-7.594],[144.699,-7.617],[144.736,-7.644],[144.757,-7.669],[144.771,-7.681],[144.787,-7.686],[144.805,-7.686],[144.825,-7.683],[144.837,-7.674],[144.831,-7.658],[144.840,-7.637],[144.844,-7.589],[144.852,-7.569],[144.864,-7.586],[144.867,-7.608],[144.866,-7.706],[144.858,-7.724],[144.842,-7.744],[144.843,-7.750],[144.851,-7.758],[144.861,-7.765],[144.870,-7.768],[144.872,-7.770],[144.878,-7.779],[144.880,-7.782],[144.885,-7.782],[144.897,-7.777],[144.904,-7.775],[144.920,-7.781],[144.932,-7.790],[144.943,-7.792],[144.955,-7.775],[144.985,-7.810],[144.996,-7.817],[145.058,-7.817],[145.068,-7.812],[145.071,-7.806],[145.071,-7.785],[145.075,-7.776],[145.082,-7.779],[145.089,-7.788],[145.093,-7.799],[145.102,-7.817],[145.124,-7.831],[145.150,-7.838],[145.168,-7.836],[145.167,-7.831],[145.175,-7.816],[145.184,-7.806],[145.192,-7.818],[145.206,-7.828],[145.213,-7.840],[145.234,-7.859],[145.243,-7.864],[145.255,-7.865],[145.265,-7.863],[145.275,-7.859],[145.284,-7.857],[145.322,-7.862],[145.350,-7.877],[145.408,-7.932],[145.423,-7.940],[145.442,-7.944],[145.466,-7.945],[145.533,-7.933],[145.552,-7.939],[145.552,-7.933],[145.568,-7.939],[145.583,-7.937],[145.598,-7.933],[145.613,-7.933],[145.627,-7.938],[145.645,-7.956],[145.658,-7.960],[145.719,-7.960],[145.737,-7.953],[145.723,-7.933],[145.741,-7.924],[145.758,-7.927],[145.772,-7.927],[145.785,-7.912],[145.791,-7.912],[145.779,-7.936],[145.778,-7.942],[145.780,-7.947],[145.785,-7.950],[145.790,-7.954],[145.791,-7.960],[145.787,-7.965],[145.774,-7.967],[145.771,-7.970],[145.773,-7.978],[145.778,-7.983],[145.782,-7.987],[145.785,-7.990],[145.798,-8.007],[145.861,-8.028],[145.881,-8.042],[145.907,-8.033],[145.939,-8.035],[145.997,-8.049],[146.050,-8.076],[146.079,-8.087],[146.100,-8.083],[146.105,-8.093],[146.103,-8.100],[146.096,-8.106],[146.086,-8.111],[146.098,-8.122],[146.110,-8.138],[146.113,-8.154],[146.100,-8.165],[146.117,-8.200],[146.127,-8.210],[146.151,-8.214],[146.160,-8.220],[146.189,-8.248],[146.222,-8.260],[146.235,-8.274],[146.245,-8.292],[146.250,-8.307],[146.250,-11.178],[142.807,-11.178]], 3 | [[138.623,-6.767],[138.639,-6.787],[138.650,-6.797],[138.661,-6.802],[138.673,-6.810],[138.682,-6.848],[138.695,-6.856],[138.707,-6.859],[138.716,-6.865],[138.728,-6.868],[138.747,-6.863],[138.769,-6.849],[138.782,-6.839],[138.787,-6.830],[138.783,-6.814],[138.759,-6.792],[138.753,-6.778],[138.747,-6.768],[138.731,-6.763],[138.695,-6.761],[138.679,-6.758],[138.666,-6.750],[138.641,-6.731],[138.627,-6.720],[138.619,-6.729],[138.617,-6.748],[138.623,-6.767]], 4 | [[138.395,-7.405],[138.244,-7.456],[138.089,-7.560],[138.028,-7.610],[138.007,-7.638],[137.985,-7.679],[137.976,-7.703],[137.973,-7.723],[137.966,-7.739],[137.918,-7.782],[137.895,-7.816],[137.824,-7.964],[137.818,-7.973],[137.810,-7.984],[137.801,-8.042],[137.789,-8.052],[137.759,-8.073],[137.753,-8.087],[137.750,-8.101],[137.726,-8.145],[137.637,-8.389],[137.638,-8.426],[137.677,-8.426],[137.760,-8.394],[137.802,-8.383],[137.849,-8.378],[138.034,-8.382],[138.178,-8.385],[138.223,-8.392],[138.293,-8.419],[138.336,-8.419],[138.376,-8.410],[138.412,-8.396],[138.444,-8.379],[138.472,-8.358],[138.508,-8.316],[138.518,-8.309],[138.536,-8.302],[138.603,-8.255],[138.621,-8.234],[138.646,-8.189],[138.661,-8.169],[138.680,-8.157],[138.701,-8.154],[138.747,-8.152],[138.772,-8.143],[138.788,-8.130],[138.818,-8.093],[138.837,-8.080],[138.858,-8.075],[138.904,-8.076],[138.893,-8.041],[138.886,-8.007],[138.884,-7.933],[138.891,-7.898],[138.911,-7.879],[138.966,-7.851],[138.977,-7.841],[138.983,-7.830],[138.989,-7.738],[138.994,-7.720],[139.020,-7.672],[139.035,-7.630],[139.044,-7.611],[139.057,-7.595],[139.076,-7.576],[139.046,-7.562],[138.974,-7.553],[138.939,-7.542],[138.923,-7.532],[138.909,-7.520],[138.896,-7.505],[138.848,-7.435],[138.843,-7.422],[138.805,-7.374],[138.717,-7.360],[138.621,-7.365],[138.556,-7.377],[138.529,-7.386],[138.395,-7.405]], 5 | [[138.558,-8.367],[138.582,-8.373],[138.630,-8.371],[138.654,-8.376],[138.700,-8.395],[138.894,-8.405],[138.910,-8.396],[138.911,-8.375],[138.904,-8.352],[138.897,-8.337],[138.858,-8.297],[138.842,-8.277],[138.835,-8.251],[138.835,-8.219],[138.831,-8.186],[138.817,-8.162],[138.785,-8.159],[138.729,-8.177],[138.689,-8.181],[138.675,-8.189],[138.667,-8.203],[138.665,-8.224],[138.657,-8.241],[138.640,-8.257],[138.564,-8.307],[138.552,-8.323],[138.548,-8.347],[138.558,-8.367]], 6 | [[142.181,-9.285],[142.222,-9.291],[142.261,-9.290],[142.279,-9.287],[142.284,-9.278],[142.280,-9.262],[142.207,-9.240],[142.164,-9.251],[142.151,-9.271],[142.181,-9.285]], 7 | [[142.755,-9.370],[142.719,-9.378],[142.694,-9.380],[142.665,-9.374],[142.637,-9.374],[142.612,-9.383],[142.601,-9.400],[142.612,-9.416],[142.629,-9.425],[142.642,-9.428],[142.714,-9.429],[142.732,-9.425],[142.742,-9.419],[142.752,-9.408],[142.768,-9.398],[142.783,-9.386],[142.771,-9.374],[142.755,-9.370]], 8 | [[142.125,-10.158],[142.139,-10.173],[142.143,-10.186],[142.155,-10.188],[142.167,-10.182],[142.176,-10.161],[142.183,-10.153],[142.190,-10.144],[142.198,-10.102],[142.198,-10.092],[142.190,-10.081],[142.170,-10.060],[142.157,-10.053],[142.142,-10.050],[142.097,-10.119],[142.099,-10.136],[142.110,-10.148],[142.125,-10.158]], 9 | [[142.211,-10.183],[142.204,-10.188],[142.193,-10.194],[142.195,-10.207],[142.201,-10.220],[142.211,-10.232],[142.221,-10.242],[142.234,-10.238],[142.249,-10.240],[142.264,-10.247],[142.276,-10.256],[142.290,-10.260],[142.317,-10.213],[142.334,-10.200],[142.341,-10.191],[142.332,-10.170],[142.314,-10.149],[142.293,-10.139],[142.254,-10.138],[142.232,-10.142],[142.214,-10.153],[142.213,-10.158],[142.214,-10.177],[142.211,-10.183]], 10 | [[143.492,-8.553],[143.482,-8.534],[143.475,-8.525],[143.465,-8.522],[143.443,-8.518],[143.359,-8.489],[143.271,-8.469],[143.256,-8.457],[143.219,-8.415],[143.207,-8.414],[143.194,-8.417],[143.179,-8.419],[143.188,-8.430],[143.209,-8.444],[143.221,-8.453],[143.244,-8.485],[143.255,-8.495],[143.282,-8.506],[143.338,-8.522],[143.401,-8.573],[143.407,-8.587],[143.412,-8.596],[143.425,-8.600],[143.440,-8.602],[143.451,-8.608],[143.474,-8.625],[143.591,-8.679],[143.606,-8.689],[143.612,-8.703],[143.617,-8.722],[143.629,-8.730],[143.642,-8.726],[143.653,-8.706],[143.653,-8.683],[143.644,-8.661],[143.629,-8.645],[143.608,-8.638],[143.588,-8.631],[143.492,-8.553]], 11 | [[143.530,-8.486],[143.582,-8.487],[143.601,-8.484],[143.611,-8.475],[143.612,-8.462],[143.605,-8.447],[143.589,-8.421],[143.586,-8.406],[143.585,-8.381],[143.574,-8.374],[143.484,-8.364],[143.417,-8.365],[143.385,-8.371],[143.373,-8.371],[143.365,-8.368],[143.359,-8.362],[143.351,-8.357],[143.338,-8.358],[143.317,-8.372],[143.330,-8.394],[143.358,-8.415],[143.379,-8.426],[143.424,-8.433],[143.445,-8.439],[143.462,-8.458],[143.510,-8.481],[143.530,-8.486]], 12 | [[143.541,-8.350],[143.590,-8.372],[143.626,-8.412],[143.648,-8.426],[143.668,-8.428],[143.679,-8.421],[143.682,-8.413],[143.676,-8.400],[143.674,-8.391],[143.669,-8.373],[143.657,-8.355],[143.638,-8.341],[143.600,-8.333],[143.551,-8.336],[143.541,-8.350]], 13 | [[143.783,-8.528],[143.796,-8.538],[143.813,-8.531],[143.823,-8.510],[143.822,-8.500],[143.816,-8.495],[143.810,-8.497],[143.803,-8.501],[143.792,-8.504],[143.780,-8.513],[143.783,-8.528]], 14 | [[143.654,-8.104],[143.641,-8.099],[143.613,-8.095],[143.599,-8.111],[143.614,-8.139],[143.634,-8.165],[143.667,-8.167],[143.688,-8.154],[143.690,-8.137],[143.680,-8.121],[143.663,-8.109],[143.654,-8.104]], 15 | [[143.676,-8.093],[143.690,-8.100],[143.698,-8.091],[143.686,-8.066],[143.676,-8.054],[143.656,-8.040],[143.613,-8.020],[143.578,-8.018],[143.564,-8.030],[143.574,-8.051],[143.582,-8.069],[143.607,-8.082],[143.648,-8.085],[143.676,-8.093]], 16 | 17 | [[142.255,-10.667],[142.229,-10.620],[142.212,-10.598],[142.193,-10.591],[142.182,-10.610],[142.180,-10.615],[142.177,-10.616],[142.160,-10.626],[142.152,-10.632],[142.150,-10.636],[142.146,-10.639],[142.128,-10.641],[142.124,-10.644],[142.121,-10.648],[142.118,-10.653],[142.112,-10.684],[142.122,-10.710],[142.137,-10.731],[142.146,-10.749],[142.153,-10.756],[142.187,-10.770],[142.190,-10.758],[142.197,-10.745],[142.206,-10.733],[142.218,-10.728],[142.230,-10.726],[142.253,-10.717],[142.263,-10.716],[142.273,-10.718],[142.280,-10.719],[142.283,-10.715],[142.283,-10.701],[142.279,-10.691],[142.255,-10.667]], 18 | [[142.254,-10.625],[142.274,-10.641],[142.303,-10.633],[142.325,-10.612],[142.319,-10.589],[142.294,-10.573],[142.262,-10.578],[142.247,-10.600],[142.254,-10.625]] 19 | ] 20 | 21 | -------------------------------------------------------------------------------- /test/fixtures/empty-square.json: -------------------------------------------------------------------------------- 1 | [ 2 | [[0,0],[4000,0],[4000,4000],[0,4000]], 3 | [[0,0],[4000,0],[4000,4000],[0,4000]] 4 | ] 5 | -------------------------------------------------------------------------------- /test/fixtures/filtered-bridge-jhl.json: -------------------------------------------------------------------------------- 1 | [ 2 | [[ 22.0, 14.0 ], [ 17.0, 12.0 ], [ 5.0, 12.0 ], [ 0.0, 12.0 ], [ 0.0, 0.0 ], [ 22.0, 0.0 ]], 3 | [[ 9.0, 4.0 ], [ 10.0, 4.0 ], [ 10.0, 3.0 ], [ 9.0, 3.0 ]], 4 | [[ 6.0, 9.0 ], [ 7.0, 9.0 ], [ 7.0, 8.0 ], [ 6.0, 8.0 ]], 5 | [[ 7.0, 10.0 ], [ 17.0, 10.0 ], [ 17.0, 5.0 ], [ 8.0, 5.0 ]], 6 | [[ 13.0, 4.0 ], [ 14.0, 4.0 ], [ 14.0, 3.0 ], [ 13.0, 3.0 ]] 7 | ] 8 | -------------------------------------------------------------------------------- /test/fixtures/hilbert.json: -------------------------------------------------------------------------------- 1 | [[[0,0],[-1,0],[-1,-1],[0,-1],[0,-2],[0,-3],[-1,-3],[-1,-2],[-2,-2],[-2,-3],[-3,-3],[-3,-2],[-3,-1],[-2,-1],[-2,0],[-3,0],[-4,0],[-4,-1],[-5,-1],[-5,0],[-6,0],[-7,0],[-7,-1],[-6,-1],[-6,-2],[-7,-2],[-7,-3],[-6,-3],[-5,-3],[-5,-2],[-4,-2],[-4,-3],[-4,-4],[-4,-5],[-5,-5],[-5,-4],[-6,-4],[-7,-4],[-7,-5],[-6,-5],[-6,-6],[-7,-6],[-7,-7],[-6,-7],[-5,-7],[-5,-6],[-4,-6],[-4,-7],[-3,-7],[-2,-7],[-2,-6],[-3,-6],[-3,-5],[-3,-4],[-2,-4],[-2,-5],[-1,-5],[-1,-4],[0,-4],[0,-5],[0,-6],[-1,-6],[-1,-7],[0,-7],[0,-8],[0,-9],[-1,-9],[-1,-8],[-2,-8],[-3,-8],[-3,-9],[-2,-9],[-2,-10],[-3,-10],[-3,-11],[-2,-11],[-1,-11],[-1,-10],[0,-10],[0,-11],[0,-12],[-1,-12],[-1,-13],[0,-13],[0,-14],[0,-15],[-1,-15],[-1,-14],[-2,-14],[-2,-15],[-3,-15],[-3,-14],[-3,-13],[-2,-13],[-2,-12],[-3,-12],[-4,-12],[-5,-12],[-5,-13],[-4,-13],[-4,-14],[-4,-15],[-5,-15],[-5,-14],[-6,-14],[-6,-15],[-7,-15],[-7,-14],[-7,-13],[-6,-13],[-6,-12],[-7,-12],[-7,-11],[-7,-10],[-6,-10],[-6,-11],[-5,-11],[-4,-11],[-4,-10],[-5,-10],[-5,-9],[-4,-9],[-4,-8],[-5,-8],[-6,-8],[-6,-9],[-7,-9],[-7,-8],[-8,-8],[-8,-9],[-9,-9],[-9,-8],[-10,-8],[-11,-8],[-11,-9],[-10,-9],[-10,-10],[-11,-10],[-11,-11],[-10,-11],[-9,-11],[-9,-10],[-8,-10],[-8,-11],[-8,-12],[-9,-12],[-9,-13],[-8,-13],[-8,-14],[-8,-15],[-9,-15],[-9,-14],[-10,-14],[-10,-15],[-11,-15],[-11,-14],[-11,-13],[-10,-13],[-10,-12],[-11,-12],[-12,-12],[-13,-12],[-13,-13],[-12,-13],[-12,-14],[-12,-15],[-13,-15],[-13,-14],[-14,-14],[-14,-15],[-15,-15],[-15,-14],[-15,-13],[-14,-13],[-14,-12],[-15,-12],[-15,-11],[-15,-10],[-14,-10],[-14,-11],[-13,-11],[-12,-11],[-12,-10],[-13,-10],[-13,-9],[-12,-9],[-12,-8],[-13,-8],[-14,-8],[-14,-9],[-15,-9],[-15,-8],[-15,-7],[-14,-7],[-14,-6],[-15,-6],[-15,-5],[-15,-4],[-14,-4],[-14,-5],[-13,-5],[-13,-4],[-12,-4],[-12,-5],[-12,-6],[-13,-6],[-13,-7],[-12,-7],[-11,-7],[-11,-6],[-10,-6],[-10,-7],[-9,-7],[-8,-7],[-8,-6],[-9,-6],[-9,-5],[-8,-5],[-8,-4],[-9,-4],[-10,-4],[-10,-5],[-11,-5],[-11,-4],[-11,-3],[-11,-2],[-10,-2],[-10,-3],[-9,-3],[-8,-3],[-8,-2],[-9,-2],[-9,-1],[-8,-1],[-8,0],[-9,0],[-10,0],[-10,-1],[-11,-1],[-11,0],[-12,0],[-13,0],[-13,-1],[-12,-1],[-12,-2],[-12,-3],[-13,-3],[-13,-2],[-14,-2],[-14,-3],[-15,-3],[-15,-2],[-15,-1],[-14,-1],[-14,0],[-15,0],[-16,0],[-16,-1],[-17,-1],[-17,0],[-18,0],[-19,0],[-19,-1],[-18,-1],[-18,-2],[-19,-2],[-19,-3],[-18,-3],[-17,-3],[-17,-2],[-16,-2],[-16,-3],[-16,-4],[-17,-4],[-17,-5],[-16,-5],[-16,-6],[-16,-7],[-17,-7],[-17,-6],[-18,-6],[-18,-7],[-19,-7],[-19,-6],[-19,-5],[-18,-5],[-18,-4],[-19,-4],[-20,-4],[-21,-4],[-21,-5],[-20,-5],[-20,-6],[-20,-7],[-21,-7],[-21,-6],[-22,-6],[-22,-7],[-23,-7],[-23,-6],[-23,-5],[-22,-5],[-22,-4],[-23,-4],[-23,-3],[-23,-2],[-22,-2],[-22,-3],[-21,-3],[-20,-3],[-20,-2],[-21,-2],[-21,-1],[-20,-1],[-20,0],[-21,0],[-22,0],[-22,-1],[-23,-1],[-23,0],[-24,0],[-25,0],[-25,-1],[-24,-1],[-24,-2],[-24,-3],[-25,-3],[-25,-2],[-26,-2],[-26,-3],[-27,-3],[-27,-2],[-27,-1],[-26,-1],[-26,0],[-27,0],[-28,0],[-28,-1],[-29,-1],[-29,0],[-30,0],[-31,0],[-31,-1],[-30,-1],[-30,-2],[-31,-2],[-31,-3],[-30,-3],[-29,-3],[-29,-2],[-28,-2],[-28,-3],[-28,-4],[-28,-5],[-29,-5],[-29,-4],[-30,-4],[-31,-4],[-31,-5],[-30,-5],[-30,-6],[-31,-6],[-31,-7],[-30,-7],[-29,-7],[-29,-6],[-28,-6],[-28,-7],[-27,-7],[-26,-7],[-26,-6],[-27,-6],[-27,-5],[-27,-4],[-26,-4],[-26,-5],[-25,-5],[-25,-4],[-24,-4],[-24,-5],[-24,-6],[-25,-6],[-25,-7],[-24,-7],[-24,-8],[-25,-8],[-25,-9],[-24,-9],[-24,-10],[-24,-11],[-25,-11],[-25,-10],[-26,-10],[-26,-11],[-27,-11],[-27,-10],[-27,-9],[-26,-9],[-26,-8],[-27,-8],[-28,-8],[-28,-9],[-29,-9],[-29,-8],[-30,-8],[-31,-8],[-31,-9],[-30,-9],[-30,-10],[-31,-10],[-31,-11],[-30,-11],[-29,-11],[-29,-10],[-28,-10],[-28,-11],[-28,-12],[-28,-13],[-29,-13],[-29,-12],[-30,-12],[-31,-12],[-31,-13],[-30,-13],[-30,-14],[-31,-14],[-31,-15],[-30,-15],[-29,-15],[-29,-14],[-28,-14],[-28,-15],[-27,-15],[-26,-15],[-26,-14],[-27,-14],[-27,-13],[-27,-12],[-26,-12],[-26,-13],[-25,-13],[-25,-12],[-24,-12],[-24,-13],[-24,-14],[-25,-14],[-25,-15],[-24,-15],[-23,-15],[-23,-14],[-22,-14],[-22,-15],[-21,-15],[-20,-15],[-20,-14],[-21,-14],[-21,-13],[-20,-13],[-20,-12],[-21,-12],[-22,-12],[-22,-13],[-23,-13],[-23,-12],[-23,-11],[-22,-11],[-22,-10],[-23,-10],[-23,-9],[-23,-8],[-22,-8],[-22,-9],[-21,-9],[-21,-8],[-20,-8],[-20,-9],[-20,-10],[-21,-10],[-21,-11],[-20,-11],[-19,-11],[-18,-11],[-18,-10],[-19,-10],[-19,-9],[-19,-8],[-18,-8],[-18,-9],[-17,-9],[-17,-8],[-16,-8],[-16,-9],[-16,-10],[-17,-10],[-17,-11],[-16,-11],[-16,-12],[-16,-13],[-17,-13],[-17,-12],[-18,-12],[-19,-12],[-19,-13],[-18,-13],[-18,-14],[-19,-14],[-19,-15],[-18,-15],[-17,-15],[-17,-14],[-16,-14],[-16,-15],[-16,-16],[-16,-17],[-17,-17],[-17,-16],[-18,-16],[-19,-16],[-19,-17],[-18,-17],[-18,-18],[-19,-18],[-19,-19],[-18,-19],[-17,-19],[-17,-18],[-16,-18],[-16,-19],[-16,-20],[-17,-20],[-17,-21],[-16,-21],[-16,-22],[-16,-23],[-17,-23],[-17,-22],[-18,-22],[-18,-23],[-19,-23],[-19,-22],[-19,-21],[-18,-21],[-18,-20],[-19,-20],[-20,-20],[-21,-20],[-21,-21],[-20,-21],[-20,-22],[-20,-23],[-21,-23],[-21,-22],[-22,-22],[-22,-23],[-23,-23],[-23,-22],[-23,-21],[-22,-21],[-22,-20],[-23,-20],[-23,-19],[-23,-18],[-22,-18],[-22,-19],[-21,-19],[-20,-19],[-20,-18],[-21,-18],[-21,-17],[-20,-17],[-20,-16],[-21,-16],[-22,-16],[-22,-17],[-23,-17],[-23,-16],[-24,-16],[-25,-16],[-25,-17],[-24,-17],[-24,-18],[-24,-19],[-25,-19],[-25,-18],[-26,-18],[-26,-19],[-27,-19],[-27,-18],[-27,-17],[-26,-17],[-26,-16],[-27,-16],[-28,-16],[-28,-17],[-29,-17],[-29,-16],[-30,-16],[-31,-16],[-31,-17],[-30,-17],[-30,-18],[-31,-18],[-31,-19],[-30,-19],[-29,-19],[-29,-18],[-28,-18],[-28,-19],[-28,-20],[-28,-21],[-29,-21],[-29,-20],[-30,-20],[-31,-20],[-31,-21],[-30,-21],[-30,-22],[-31,-22],[-31,-23],[-30,-23],[-29,-23],[-29,-22],[-28,-22],[-28,-23],[-27,-23],[-26,-23],[-26,-22],[-27,-22],[-27,-21],[-27,-20],[-26,-20],[-26,-21],[-25,-21],[-25,-20],[-24,-20],[-24,-21],[-24,-22],[-25,-22],[-25,-23],[-24,-23],[-24,-24],[-25,-24],[-25,-25],[-24,-25],[-24,-26],[-24,-27],[-25,-27],[-25,-26],[-26,-26],[-26,-27],[-27,-27],[-27,-26],[-27,-25],[-26,-25],[-26,-24],[-27,-24],[-28,-24],[-28,-25],[-29,-25],[-29,-24],[-30,-24],[-31,-24],[-31,-25],[-30,-25],[-30,-26],[-31,-26],[-31,-27],[-30,-27],[-29,-27],[-29,-26],[-28,-26],[-28,-27],[-28,-28],[-28,-29],[-29,-29],[-29,-28],[-30,-28],[-31,-28],[-31,-29],[-30,-29],[-30,-30],[-31,-30],[-31,-31],[-30,-31],[-29,-31],[-29,-30],[-28,-30],[-28,-31],[-27,-31],[-26,-31],[-26,-30],[-27,-30],[-27,-29],[-27,-28],[-26,-28],[-26,-29],[-25,-29],[-25,-28],[-24,-28],[-24,-29],[-24,-30],[-25,-30],[-25,-31],[-24,-31],[-23,-31],[-23,-30],[-22,-30],[-22,-31],[-21,-31],[-20,-31],[-20,-30],[-21,-30],[-21,-29],[-20,-29],[-20,-28],[-21,-28],[-22,-28],[-22,-29],[-23,-29],[-23,-28],[-23,-27],[-22,-27],[-22,-26],[-23,-26],[-23,-25],[-23,-24],[-22,-24],[-22,-25],[-21,-25],[-21,-24],[-20,-24],[-20,-25],[-20,-26],[-21,-26],[-21,-27],[-20,-27],[-19,-27],[-18,-27],[-18,-26],[-19,-26],[-19,-25],[-19,-24],[-18,-24],[-18,-25],[-17,-25],[-17,-24],[-16,-24],[-16,-25],[-16,-26],[-17,-26],[-17,-27],[-16,-27],[-16,-28],[-16,-29],[-17,-29],[-17,-28],[-18,-28],[-19,-28],[-19,-29],[-18,-29],[-18,-30],[-19,-30],[-19,-31],[-18,-31],[-17,-31],[-17,-30],[-16,-30],[-16,-31],[-15,-31],[-14,-31],[-14,-30],[-15,-30],[-15,-29],[-15,-28],[-14,-28],[-14,-29],[-13,-29],[-13,-28],[-12,-28],[-12,-29],[-12,-30],[-13,-30],[-13,-31],[-12,-31],[-11,-31],[-11,-30],[-10,-30],[-10,-31],[-9,-31],[-8,-31],[-8,-30],[-9,-30],[-9,-29],[-8,-29],[-8,-28],[-9,-28],[-10,-28],[-10,-29],[-11,-29],[-11,-28],[-11,-27],[-11,-26],[-10,-26],[-10,-27],[-9,-27],[-8,-27],[-8,-26],[-9,-26],[-9,-25],[-8,-25],[-8,-24],[-9,-24],[-10,-24],[-10,-25],[-11,-25],[-11,-24],[-12,-24],[-13,-24],[-13,-25],[-12,-25],[-12,-26],[-12,-27],[-13,-27],[-13,-26],[-14,-26],[-14,-27],[-15,-27],[-15,-26],[-15,-25],[-14,-25],[-14,-24],[-15,-24],[-15,-23],[-15,-22],[-14,-22],[-14,-23],[-13,-23],[-12,-23],[-12,-22],[-13,-22],[-13,-21],[-12,-21],[-12,-20],[-13,-20],[-14,-20],[-14,-21],[-15,-21],[-15,-20],[-15,-19],[-14,-19],[-14,-18],[-15,-18],[-15,-17],[-15,-16],[-14,-16],[-14,-17],[-13,-17],[-13,-16],[-12,-16],[-12,-17],[-12,-18],[-13,-18],[-13,-19],[-12,-19],[-11,-19],[-10,-19],[-10,-18],[-11,-18],[-11,-17],[-11,-16],[-10,-16],[-10,-17],[-9,-17],[-9,-16],[-8,-16],[-8,-17],[-8,-18],[-9,-18],[-9,-19],[-8,-19],[-8,-20],[-8,-21],[-9,-21],[-9,-20],[-10,-20],[-11,-20],[-11,-21],[-10,-21],[-10,-22],[-11,-22],[-11,-23],[-10,-23],[-9,-23],[-9,-22],[-8,-22],[-8,-23],[-7,-23],[-7,-22],[-6,-22],[-6,-23],[-5,-23],[-4,-23],[-4,-22],[-5,-22],[-5,-21],[-4,-21],[-4,-20],[-5,-20],[-6,-20],[-6,-21],[-7,-21],[-7,-20],[-7,-19],[-6,-19],[-6,-18],[-7,-18],[-7,-17],[-7,-16],[-6,-16],[-6,-17],[-5,-17],[-5,-16],[-4,-16],[-4,-17],[-4,-18],[-5,-18],[-5,-19],[-4,-19],[-3,-19],[-2,-19],[-2,-18],[-3,-18],[-3,-17],[-3,-16],[-2,-16],[-2,-17],[-1,-17],[-1,-16],[0,-16],[0,-17],[0,-18],[-1,-18],[-1,-19],[0,-19],[0,-20],[0,-21],[-1,-21],[-1,-20],[-2,-20],[-3,-20],[-3,-21],[-2,-21],[-2,-22],[-3,-22],[-3,-23],[-2,-23],[-1,-23],[-1,-22],[0,-22],[0,-23],[0,-24],[-1,-24],[-1,-25],[0,-25],[0,-26],[0,-27],[-1,-27],[-1,-26],[-2,-26],[-2,-27],[-3,-27],[-3,-26],[-3,-25],[-2,-25],[-2,-24],[-3,-24],[-4,-24],[-4,-25],[-5,-25],[-5,-24],[-6,-24],[-7,-24],[-7,-25],[-6,-25],[-6,-26],[-7,-26],[-7,-27],[-6,-27],[-5,-27],[-5,-26],[-4,-26],[-4,-27],[-4,-28],[-4,-29],[-5,-29],[-5,-28],[-6,-28],[-7,-28],[-7,-29],[-6,-29],[-6,-30],[-7,-30],[-7,-31],[-6,-31],[-5,-31],[-5,-30],[-4,-30],[-4,-31],[-3,-31],[-2,-31],[-2,-30],[-3,-30],[-3,-29],[-3,-28],[-2,-28],[-2,-29],[-1,-29],[-1,-28],[0,-28],[0,-29],[0,-30],[-1,-30],[-1,-31],[0,-31],[1,-31],[1,0],[0,0]]] 2 | -------------------------------------------------------------------------------- /test/fixtures/hole-touching-outer.json: -------------------------------------------------------------------------------- 1 | [[[-64,-64],[253,-64],[491,358],[697,298],[928,197],[929,505],[1346,507],[1347,303],[1771,306],[1770,512],[2191,509],[2198,933],[2621,932],[2623,1115],[2577,1120],[2494,1183],[2390,1329],[2326,1590],[2287,1678],[2286,1407],[2229,1407],[2182,1493],[2106,1494],[2068,1460],[2019,1460],[2016,1775],[1889,1923],[1953,1989],[2097,1866],[2198,1925],[2203,1973],[2311,1976],[2320,1831],[2352,1824],[2358,1797],[2378,1780],[3350,1782],[3307,2086],[3139,2088],[3143,2203],[3493,2205],[3543,2187],[3540,2260],[3661,2264],[3665,1906],[3630,1902],[3626,1784],[4160,1786],[4160,2631],[4076,2631],[4021,2683],[3930,2701],[3915,2693],[3898,2639],[2630,2630],[2635,3476],[2287,3478],[2118,3203],[2180,3145],[2327,3087],[2610,2643],[2613,2536],[2658,2495],[2650,2203],[1829,2189],[1732,2241],[1551,2245],[933,1183],[890,1152],[455,401],[398,412],[89,547],[-64,606],[-64,-64]],[[1762,928],[1770,512],[1343,513],[1345,715],[931,719],[932,930],[1762,928]]] 2 | -------------------------------------------------------------------------------- /test/fixtures/hourglass.json: -------------------------------------------------------------------------------- 1 | [[[7,18],[7,15],[5,15],[7,13],[7,15],[17,17]]] 2 | -------------------------------------------------------------------------------- /test/fixtures/infinite-loop-jhl.json: -------------------------------------------------------------------------------- 1 | [ 2 | [[-1.0, 2.0], [0.0, 0.0], [2.0, -1.0]], 3 | [[2.0, -1.0], [0.0, 1.0e-28], [-1.0, 2.0]] 4 | ] 5 | -------------------------------------------------------------------------------- /test/fixtures/issue107.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | [7.943741826741378, 46.46223436733343], 4 | [7.943741826741378, 46.43293749233343], 5 | [7.943741826741378, 46.46223436733343] 6 | ], 7 | [ 8 | [7.973038701741378, 46.46223436733343], 9 | [8.002335576741377, 46.46223436733343], 10 | [8.002335576741377, 46.43293749233343], 11 | [8.031632451741377, 46.43293749233343], 12 | [8.002335576741377, 46.43293749233343], 13 | [8.002335576741377, 46.46223436733343], 14 | [8.031632451741377, 46.46223436733343], 15 | [8.031632451741377, 46.49153124233343], 16 | [8.002335576741377, 46.49153124233343], 17 | [8.002335576741377, 46.46223436733343], 18 | [7.973038701741378, 46.46223436733343] 19 | ] 20 | ] 21 | -------------------------------------------------------------------------------- /test/fixtures/issue111.json: -------------------------------------------------------------------------------- 1 | [ 2 | [[800,4520],[800,4700],[796,4702],[800,4692],[734,4644],[734,4628],[730,4632],[726,4630],[718,4640],[690,4623],[722,4598],[690,4608],[690,4520],[800,4520]], 3 | [[718,4640],[716,4630],[710,4628],[718,4640]], 4 | [[734,4610],[734,4628],[740,4622],[734,4610]], 5 | [[734,4610],[745,4600],[734,4602],[734,4610]] 6 | ] 7 | -------------------------------------------------------------------------------- /test/fixtures/issue119.json: -------------------------------------------------------------------------------- 1 | [ 2 | [[2,12],[2,20],[25,20],[25,12]], 3 | [[7,18],[7,15],[5,15]], 4 | [[19,18],[19,17],[17,17]], 5 | [[19,17],[21,17],[19,16]], 6 | [[7,15],[9,15],[7,13]] 7 | ] 8 | -------------------------------------------------------------------------------- /test/fixtures/issue131.json: -------------------------------------------------------------------------------- 1 | [ 2 | [[3506,-2048],[7464,402],[-2048,2685],[-2048,-2048],[3506,-2048]], 3 | [[-2048,-37],[1235,747],[338,-1464],[-116,-1188],[-2048,-381],[-2048,-37]], 4 | [[-1491,-1981],[-1300,-1800],[-1155,-1981],[-1491,-1981]] 5 | ] 6 | -------------------------------------------------------------------------------- /test/fixtures/issue142.json: -------------------------------------------------------------------------------- 1 | [ 2 | [[5.62675358811389, 31.94879819160804], [-16.369709114391867, 28.341954255099814], [-10.786562672455382, -1.2779295357476745], [10.819423740334923, 2.069348113719755]], 3 | [[3.220439475288522, 4.197526331591453], [5.024815373142793, 1.1716264034331543], [10.819423740334923, 2.069348113719755], [5.62675358811389, 31.94879819160804], [-16.369709114391867, 28.341954255099814], [-10.786562672455382, -1.2779295357476745], [-6.833718161055838, -0.6655405509524673], [-8.602352370111433, 2.142874784407777], [-5.34630560403934, 6.768689248602321], [-1.4053749889060216, 7.453573097663546]] 4 | ] 5 | -------------------------------------------------------------------------------- /test/fixtures/issue149.json: -------------------------------------------------------------------------------- 1 | [ 2 | [[1888,5504],[1872,5504],[1872,5536],[1856,5536],[1856,5520],[1840,5520],[1840,5504],[1856,5504],[1856,5520],[1872,5520],[1872,5504],[1888,5504]], 3 | [[1856,5520],[1856,5536],[1872,5536],[1872,5520]] 4 | ] 5 | -------------------------------------------------------------------------------- /test/fixtures/issue16.json: -------------------------------------------------------------------------------- 1 | [ 2 | [[143.129527283745121, 61.240160826593640], 3 | [147.399527283763751, 74.780160826630892], 4 | [154.049527283757931, 90.260160827077932], 5 | [174.429527283762581, 81.710160826332872], 6 | [168.03952728374861, 67.040160826407372], 7 | [159.099527283746281, 53.590160826221112]], 8 | [[156.85952728375561, 67.430160827003422], 9 | [157.489527283760251, 67.160160826519132], 10 | [159.969527283741631, 68.350160826928912], 11 | [161.339527283766071, 67.640160826966172], 12 | [159.649527283763751, 63.310160826891662], 13 | [155.759527283749781, 64.880160826258362]] 14 | ] 15 | -------------------------------------------------------------------------------- /test/fixtures/issue17.json: -------------------------------------------------------------------------------- 1 | [ 2 | [[-20037508.34,19971868.877628453], 3 | [-20037508.34,-19971868.877628453], 4 | [20037508.34,-19971868.877628453], 5 | [20037508.34,19971868.877628453]], 6 | [[537637.6007702783,5907542.234420554], 7 | [539500.1483225027,5905165.501947839], 8 | [538610.3146341922,5905217.430281373], 9 | [538040.6306361248,5906132.0755739985], 10 | [538068.958329954,5906571.138846622], 11 | [537711.0379352621,5906645.06648362], 12 | [537629.886026485,5907533.69114742]] 13 | ] 14 | -------------------------------------------------------------------------------- /test/fixtures/issue29.json: -------------------------------------------------------------------------------- 1 | [ 2 | [[200.95000055654114,69.90565782485673],[201.73186418809928,76.50881049432792],[204.05247248713854,82.73234962527638],[207.79442497901618,88.23839184455574],[212.7323883100471,92.70045673093409],[218.58296075442922,95.86217257360113],[225.00460918453172,97.53918036725955],[231.66534446463922,97.66082593216561],[238.15796607054654,96.21973398409901],[244.1176358256489,93.27806596420706],[249.2188404462824,88.99822680730722],[253.15628113771672,83.64108043884043],[255.70631344406866,77.51111824424007],[256.73126424155197,70.93641692795792],[256.19351709797047,64.30797780468129],[254.1057433114911,57.996416078653425],[250.56431880965246,52.346517799043795],[245.8112865351897,47.719993951247304],[240.07834375849924,44.33761266223155],[233.71343464441597,42.419284673407674],[227.06488359675492,42.055728640102465],[220.51757991796475,43.257153422775446],[214.45449861431845,45.97523169373744],[209.20995664413203,50.053084840223896],[205.06721924245355,55.271000209450726],[202.29122001552022,61.30178454495035],[201.02451470680535,67.8368895214051]], 3 | [[242.34999892718187,69.90549289577612],[240.7584948063828,76.30057721128688],[236.31611852571368,81.17358751371503],[230.07699953842675,83.34595728587593],[223.55761859836056,82.33733346881347],[218.2910646148026,78.34856240227819],[215.5668820463121,72.34290095195175],[215.9904494531453,65.75019118711353],[219.47497291108593,60.1536534355022],[225.2189893186092,56.88651757836341],[231.8100271829404,56.72041164720431],[237.70269737243652,59.67713584899902],[241.47838292121884,65.0856644153595]] 4 | ] 5 | -------------------------------------------------------------------------------- /test/fixtures/issue34.json: -------------------------------------------------------------------------------- 1 | [ 2 | [[1500,0],[0,0],[0,1000],[1500,1000],[1500,0]], 3 | [[804,642],[814,644],[818,676],[850,690],[838,728],[806,728],[772,752],[748,746],[764,724],[728,726],[710,708],[738,656],[764,668],[784,700],[806,702],[792,666],[804,642]], 4 | [[1176,214],[1254,216],[1292,242],[1324,242],[1332,268],[1352,278],[1352,298],[1290,348],[1290,358],[1312,350],[1314,362],[1266,416],[1240,474],[1182,500],[1200,510],[1200,520],[1186,520],[1200,544],[1186,580],[1160,584],[1162,606],[1146,620],[1162,650],[1136,672],[1124,658],[1076,668],[1022,658],[1036,698],[1066,706],[1118,688],[1144,708],[1132,746],[1064,748],[1004,740],[990,668],[966,670],[946,648],[948,632],[962,628],[992,650],[1016,648],[1054,622],[1044,592],[1054,584],[1078,606],[1076,576],[1052,570],[1056,540],[1038,568],[1004,570],[976,526],[996,502],[958,496],[948,454],[962,454],[952,436],[964,390],[986,382],[974,368],[1004,376],[1018,420],[1052,434],[1060,482],[1078,490],[1062,472],[1062,442],[1104,450],[1104,436],[1142,422],[1154,402],[1110,424],[1046,416],[1022,388],[1022,344],[1002,344],[1018,318],[1060,308],[1076,272],[1104,288],[1122,246],[1140,230],[1168,234],[1176,214]], 5 | [[974,698],[986,738],[964,740],[952,714],[974,698]], 6 | [[842,596],[860,626],[848,622],[842,596]], 7 | [[798,572],[792,606],[768,614],[740,580],[758,586],[798,572]], 8 | [[892,584],[894,594],[882,588],[892,584]], 9 | [[870,500],[912,538],[922,586],[908,590],[894,568],[864,564],[854,550],[868,538],[846,520],[854,500],[870,500]] 10 | ] 11 | -------------------------------------------------------------------------------- /test/fixtures/issue35.json: -------------------------------------------------------------------------------- 1 | [ 2 | [[216,-128],[218,-98],[232,-104],[238,-98],[234,-58],[242,-32],[232,-16],[254,-2],[256,20],[268,6],[274,6],[278,20],[284,16],[284,6],[266,-4],[276,-28],[262,-64],[296,-68],[312,-60],[308,-50],[322,-46],[338,-46],[344,-52],[378,-50],[396,-16],[434,22],[446,26],[452,38],[470,42],[466,58],[450,56],[436,68],[428,102],[406,96],[408,116],[370,114],[340,96],[356,124],[358,164],[352,174],[328,186],[326,208],[342,208],[346,232],[328,232],[318,248],[306,246],[302,236],[284,238],[240,190],[218,194],[194,176],[184,124],[142,102],[134,102],[118,118],[72,118],[70,90],[52,68],[68,42],[68,24],[54,40],[36,28],[30,46],[12,48],[14,82],[30,98],[18,150],[-8,170],[-22,190],[-40,194],[-50,204],[-70,208],[-112,198],[-116,212],[-114,230],[-96,250],[-72,244],[-58,276],[-50,332],[-24,364],[-30,384],[-20,390],[-16,410],[-26,426],[-36,428],[-38,444],[-92,422],[-128,422],[-128,4224],[4224,4224],[4224,3520],[4204,3506],[4204,3498],[4212,3498],[4210,3486],[4164,3492],[4132,3478],[4104,3474],[4074,3458],[4034,3456],[3992,3428],[3928,3362],[3880,3342],[3870,3342],[3850,3360],[3814,3374],[3790,3374],[3768,3362],[3742,3360],[3706,3344],[3698,3334],[3656,3326],[3640,3314],[3592,3298],[3554,3266],[3534,3266],[3488,3252],[3464,3224],[3416,3202],[3384,3154],[3386,3142],[3398,3140],[3392,3124],[3400,3116],[3402,3094],[3392,3088],[3388,3070],[3394,3062],[3382,3052],[3378,3038],[3346,3010],[3316,2966],[3278,2938],[3278,2926],[3264,2910],[3212,2880],[3212,2866],[3220,2858],[3218,2844],[3208,2834],[3198,2836],[3184,2814],[3162,2802],[3158,2776],[3130,2768],[3090,2720],[3080,2728],[3070,2724],[3080,2698],[3044,2628],[3044,2602],[3024,2596],[3010,2580],[2992,2584],[2980,2574],[2966,2580],[2966,2608],[2972,2614],[2980,2664],[3022,2700],[3026,2718],[3056,2746],[3062,2778],[3080,2792],[3098,2824],[3112,2832],[3122,2848],[3130,2884],[3156,2922],[3156,2954],[3162,2960],[3176,2954],[3186,2960],[3202,2988],[3212,2994],[3212,3010],[3186,3026],[3170,2992],[3112,2946],[3102,2944],[3086,2926],[3090,2882],[3078,2860],[3062,2854],[3040,2832],[3018,2832],[3012,2822],[2986,2812],[2958,2782],[2960,2776],[2994,2776],[3000,2742],[2958,2696],[2928,2680],[2920,2648],[2910,2638],[2910,2624],[2900,2616],[2896,2598],[2882,2582],[2882,2566],[2862,2538],[2852,2496],[2828,2472],[2804,2464],[2796,2448],[2772,2446],[2754,2428],[2708,2424],[2702,2418],[2700,2388],[2644,2322],[2642,2304],[2648,2292],[2624,2276],[2616,2234],[2598,2224],[2590,2202],[2564,2176],[2556,2120],[2530,2086],[2542,2054],[2544,2012],[2530,1976],[2524,1928],[2542,1870],[2554,1718],[2546,1710],[2546,1668],[2540,1664],[2528,1616],[2518,1606],[2516,1576],[2524,1574],[2552,1588],[2612,1594],[2614,1588],[2606,1580],[2616,1564],[2616,1552],[2600,1528],[2586,1528],[2580,1506],[2552,1498],[2542,1480],[2534,1480],[2534,1494],[2512,1456],[2498,1452],[2498,1470],[2524,1504],[2552,1514],[2560,1520],[2564,1536],[2578,1540],[2578,1572],[2556,1576],[2498,1550],[2498,1534],[2474,1532],[2460,1514],[2434,1502],[2430,1490],[2418,1486],[2414,1472],[2402,1468],[2400,1460],[2374,1452],[2368,1428],[2350,1414],[2352,1402],[2380,1396],[2396,1412],[2418,1420],[2426,1420],[2430,1410],[2394,1396],[2378,1380],[2380,1352],[2364,1356],[2360,1350],[2360,1340],[2370,1336],[2370,1328],[2358,1328],[2356,1312],[2348,1306],[2350,1290],[2344,1284],[2332,1288],[2330,1270],[2318,1278],[2308,1264],[2314,1246],[2294,1236],[2306,1220],[2288,1220],[2278,1228],[2252,1202],[2258,1180],[2246,1174],[2246,1164],[2264,1158],[2254,1140],[2258,1112],[2232,1102],[2230,1082],[2222,1070],[2216,1070],[2220,1096],[2208,1092],[2202,1072],[2190,1068],[2196,1032],[2188,1044],[2172,1048],[2186,1068],[2182,1110],[2170,1108],[2168,1096],[2154,1084],[2144,1090],[2154,1092],[2154,1106],[2144,1108],[2130,1086],[2130,1074],[2106,1048],[2108,1042],[2122,1040],[2110,1022],[2120,1022],[2122,1014],[2102,1012],[2112,996],[2110,980],[2136,980],[2140,966],[2110,970],[2102,964],[2096,992],[2082,992],[2080,976],[2088,966],[2076,950],[2076,934],[2090,930],[2100,938],[2094,916],[2134,922],[2114,906],[2120,892],[2108,872],[2112,858],[2100,842],[2094,840],[2098,896],[2090,898],[2074,920],[2066,920],[2068,880],[2060,868],[2050,814],[2038,820],[2028,808],[2002,802],[1996,812],[1970,818],[1960,806],[1948,804],[1918,776],[1900,748],[1832,708],[1840,692],[1836,674],[1810,690],[1792,690],[1762,678],[1758,662],[1738,666],[1690,654],[1638,662],[1630,652],[1602,640],[1596,624],[1578,632],[1548,616],[1538,630],[1520,638],[1516,622],[1546,612],[1548,604],[1534,596],[1520,598],[1514,570],[1492,580],[1476,574],[1472,582],[1452,590],[1454,570],[1448,570],[1440,592],[1450,594],[1450,608],[1458,614],[1456,632],[1448,642],[1460,654],[1460,664],[1440,658],[1432,668],[1392,664],[1354,706],[1340,710],[1334,722],[1286,738],[1276,730],[1276,720],[1310,696],[1310,690],[1288,694],[1280,686],[1286,660],[1298,646],[1306,622],[1302,596],[1340,568],[1350,568],[1358,578],[1376,572],[1364,548],[1332,546],[1312,566],[1296,570],[1286,580],[1286,594],[1272,602],[1262,614],[1258,634],[1244,644],[1248,660],[1238,674],[1228,676],[1228,688],[1222,694],[1206,694],[1196,712],[1180,722],[1176,744],[1212,754],[1212,774],[1182,798],[1172,828],[1140,838],[1124,860],[1112,862],[1104,876],[1076,892],[1076,912],[1068,924],[1056,926],[1040,940],[1028,940],[1022,956],[1006,956],[1006,966],[984,970],[982,978],[990,988],[980,1002],[940,1018],[930,1034],[918,1020],[890,1044],[868,1048],[856,1058],[842,1056],[846,1040],[838,1038],[820,1078],[806,1086],[792,1082],[788,1090],[776,1090],[768,1080],[772,1092],[762,1102],[766,1108],[752,1116],[720,1118],[704,1134],[688,1132],[686,1118],[706,1092],[718,1092],[734,1082],[758,1088],[762,1076],[794,1056],[806,1030],[836,1010],[864,1008],[870,1020],[888,1016],[886,1000],[900,974],[952,938],[970,936],[976,910],[998,894],[1004,882],[1016,878],[1022,800],[1044,774],[1044,766],[1036,766],[990,786],[976,762],[970,762],[964,776],[968,800],[956,804],[928,764],[912,770],[898,760],[896,750],[888,750],[842,786],[826,786],[830,744],[820,740],[818,730],[830,704],[802,646],[794,664],[766,678],[724,678],[718,660],[702,642],[680,630],[676,616],[666,614],[682,596],[684,580],[674,574],[680,564],[674,558],[658,562],[652,544],[640,534],[644,522],[630,518],[630,510],[638,506],[634,492],[650,488],[650,460],[674,424],[688,418],[690,382],[706,354],[732,350],[756,370],[768,370],[794,346],[806,322],[818,328],[848,328],[868,310],[874,286],[866,254],[844,230],[844,220],[866,216],[872,210],[872,194],[854,182],[846,194],[814,202],[794,220],[788,236],[782,236],[778,220],[768,210],[768,230],[750,216],[710,216],[676,228],[634,216],[616,204],[618,182],[600,160],[614,150],[620,136],[570,124],[542,104],[542,96],[566,86],[570,74],[588,72],[620,38],[652,44],[644,24],[652,16],[684,8],[696,-4],[716,-10],[740,-4],[732,34],[738,48],[828,54],[840,30],[860,32],[854,18],[824,16],[826,2],[846,4],[826,-20],[826,-36],[836,-54],[820,-60],[798,-52],[748,-66],[724,-128],[216,-128]], 3 | [[4124,4134],[4118,4136],[4120,4130],[4126,4130],[4124,4134]], 4 | [[4086,4128],[4074,4130],[4072,4122],[4086,4118],[4086,4128]], 5 | [[4068,4106],[4068,4112],[4060,4112],[4060,4104],[4068,4106]], 6 | [[1032,4014],[1026,4014],[1026,4008],[1032,4014]], 7 | [[1122,3162],[1144,3186],[1142,3198],[1124,3204],[1108,3218],[1096,3212],[1090,3176],[1098,3168],[1098,3156],[1122,3162]], 8 | [[1088,3124],[1092,3134],[1074,3138],[1062,3126],[1064,3118],[1088,3124]], 9 | [[1054,3114],[1038,3114],[1038,3108],[1050,3108],[1054,3114]], 10 | [[1014,3104],[994,3102],[994,3088],[1006,3086],[1014,3104]], 11 | [[940,3068],[934,3076],[926,3074],[922,3062],[940,3058],[940,3068]], 12 | [[3042,2702],[3042,2710],[3034,2710],[3022,2694],[3030,2690],[3042,2702]], 13 | [[2598,1566],[2590,1566],[2588,1558],[2594,1554],[2600,1554],[2598,1566]], 14 | [[158,1326],[170,1326],[168,1334],[142,1342],[140,1336],[150,1318],[158,1326]], 15 | [[100,1326],[98,1340],[90,1340],[84,1322],[100,1326]], 16 | [[130,1336],[120,1338],[128,1326],[130,1336]], 17 | [[-12,1318],[-14,1324],[-22,1324],[-18,1314],[-12,1318]], 18 | [[-112,1318],[-116,1320],[-110,1312],[-112,1318]], 19 | [[182,1314],[174,1316],[174,1310],[182,1314]], 20 | [[272,1288],[266,1308],[234,1312],[248,1304],[260,1286],[272,1288]], 21 | [[300,1312],[278,1308],[296,1306],[300,1312]], 22 | [[2172,1156],[2180,1162],[2200,1160],[2188,1196],[2188,1222],[2200,1232],[2198,1260],[2208,1264],[2206,1278],[2226,1294],[2228,1310],[2208,1298],[2202,1282],[2160,1236],[2156,1210],[2142,1202],[2132,1178],[2136,1152],[2172,1156]], 23 | [[348,1290],[346,1296],[338,1294],[342,1288],[348,1290]], 24 | [[428,1270],[420,1272],[420,1266],[428,1270]], 25 | [[610,1170],[626,1168],[626,1186],[616,1192],[604,1206],[588,1208],[568,1222],[552,1214],[536,1222],[518,1244],[506,1246],[512,1224],[526,1220],[532,1202],[546,1198],[554,1212],[580,1206],[590,1188],[586,1172],[596,1164],[608,1164],[610,1170]], 26 | [[648,1152],[642,1160],[632,1158],[636,1148],[648,1152]], 27 | [[2240,1118],[2238,1126],[2232,1124],[2234,1116],[2240,1118]], 28 | [[806,1096],[802,1090],[808,1090],[806,1096]], 29 | [[908,1080],[906,1076],[914,1072],[908,1080]], 30 | [[894,1060],[884,1072],[872,1070],[876,1054],[894,1060]], 31 | [[2024,826],[2052,836],[2048,856],[2056,876],[2054,904],[2066,948],[2062,986],[2052,980],[2044,954],[2030,938],[2028,912],[2020,922],[2010,922],[2012,894],[1976,846],[1976,834],[1988,820],[2016,816],[2024,826]] 32 | ] 33 | -------------------------------------------------------------------------------- /test/fixtures/issue45.json: -------------------------------------------------------------------------------- 1 | [[[10,10], [25,10], [25,40], [10,40]], [[15,30], [20,35], [10,40]], [[15,15], [15,20], [20,15]]] 2 | -------------------------------------------------------------------------------- /test/fixtures/issue52.json: -------------------------------------------------------------------------------- 1 | [ 2 | [[1920,552],[1904,616],[1912,664],[1984,672],[2008,712],[1944,720],[1904,760],[1896,800],[1856,760],[1824,768],[1824,832],[1864,864],[1888,864],[1904,936],[1936,944],[1936,1064],[1936,1112],[1872,1136],[1856,1160],[1840,1144],[1792,1152],[1784,1112],[1752,1096],[1608,1096],[1600,1064],[1640,1040],[1664,992],[1640,968],[1568,1024],[1560,1056],[1480,1048],[1440,1072],[1440,1032],[1400,1032],[1400,1088],[1336,1136],[1320,1136],[1264,1072],[1232,1080],[1240,1104],[1200,1096],[1232,1048],[1272,1032],[1272,1000],[1232,1024],[1176,1024],[1176,1000],[1248,952],[1344,944],[1352,904],[1424,880],[1448,848],[1496,840],[1512,800],[1568,760],[1616,752],[1640,640],[1680,600],[1736,592],[1776,560],[1776,536],[1840,464],[1848,400],[1888,328],[1952,264],[2000,240],[2040,240],[2040,264],[1968,376],[1912,424],[1936,512],[1920,528],[1880,528],[1872,552],[1920,552]], 3 | [[1608,800],[1576,848],[1520,840],[1512,872],[1456,904],[1440,952],[1528,936],[1552,912],[1584,912],[1608,880],[1664,864],[1680,816],[1656,776],[1608,800]], 4 | [[1720,792],[1736,792],[1720,780],[1720,792]], 5 | [[1656,728],[1670,752],[1672,728],[1656,728]], 6 | [[1712,680],[1696,720],[1720,728],[1736,704],[1736,680],[1712,680]], 7 | [[1968,712],[2000,712],[1968,688],[1968,712]] 8 | ] 9 | -------------------------------------------------------------------------------- /test/fixtures/issue83.json: -------------------------------------------------------------------------------- 1 | [ 2 | [[0,0],[4000,0],[4000,4000],[0,4000]], 3 | [[0,0],[4000,0],[4000,4000],[0,4000]], 4 | [[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1]] 5 | ] 6 | -------------------------------------------------------------------------------- /test/fixtures/outside-ring.json: -------------------------------------------------------------------------------- 1 | [[[2181,1228],[2182,1231],[2178,1231],[2180,1228],[2175,1225],[2174,1212],[2182,1210],[2182,1193],[2190,1187],[2187,1166],[2194,1158],[2186,1149],[2186,1103],[2195,1091],[2207,1092],[2209,1080],[2203,1077],[2213,1057],[2213,1035],[2224,1031],[2238,983],[2251,982],[2254,965],[2275,970],[2277,948],[2317,982],[2317,1030],[2323,1044],[2306,1041],[2303,1051],[2290,1057],[2294,1062],[2287,1071],[2294,1081],[2255,1123],[2249,1118],[2253,1128],[2245,1131],[2249,1137],[2243,1168],[2265,1195],[2253,1203],[2260,1204],[2252,1215],[2249,1208],[2245,1217],[2232,1220],[2241,1223],[2235,1223],[2238,1245],[2229,1274],[2215,1272],[2209,1288],[2196,1288],[2190,1269],[2194,1271],[2195,1262],[2181,1240],[2182,1233],[2183,1229],[2181,1228]],[[2181,1228],[2181,1227],[2180,1228],[2181,1228]],[[2246,1197],[2230,1201],[2251,1203],[2246,1197]]] 2 | -------------------------------------------------------------------------------- /test/fixtures/rain.json: -------------------------------------------------------------------------------- 1 | [ 2 | [[3755,1974],[3755,1982],[3746,1982],[3746,2020],[3755,2020],[3755,2035],[3773,2042],[3773,2058],[3837,2058],[3837,2050],[3827,2050],[3827,2042],[3873,2042],[3873,2050],[3882,2050],[3882,2065],[3891,2065],[3891,2073],[3900,2073],[3900,2081],[3909,2081],[3909,2088],[3928,2088],[3928,2081],[3937,2081],[3937,2065],[3955,2058],[3955,2042],[3964,2042],[3964,2027],[4028,2020],[4028,2035],[4010,2042],[4010,2058],[3991,2058],[3991,2073],[4000,2073],[4000,2103],[3991,2103],[3991,2111],[3973,2111],[3973,2126],[3964,2126],[3964,2164],[3955,2164],[3955,2179],[3946,2179],[3946,2218],[3937,2218],[3937,2240],[3919,2248],[3919,2263],[3909,2263],[3909,2271],[3891,2271],[3891,2278],[3736,2278],[3736,2271],[3727,2271],[3727,2256],[3718,2256],[3718,2225],[3700,2218],[3700,2210],[3682,2210],[3682,2202],[3664,2202],[3664,2210],[3645,2202],[3645,2195],[3655,2195],[3655,2179],[3664,2179],[3664,2164],[3655,2164],[3655,2149],[3636,2149],[3636,2141],[3609,2141],[3609,2134],[3600,2134],[3600,2126],[3591,2126],[3591,2119],[3582,2119],[3582,2134],[3573,2134],[3573,2126],[3554,2119],[3554,2111],[3536,2119],[3536,2126],[3545,2126],[3545,2141],[3527,2149],[3527,2141],[3518,2141],[3518,2126],[3509,2126],[3509,2111],[3500,2111],[3500,2119],[3482,2119],[3482,2134],[3500,2141],[3500,2157],[3482,2157],[3482,2164],[3472,2164],[3472,2179],[3463,2179],[3463,2187],[3482,2195],[3482,2218],[3500,2225],[3500,2233],[3518,2233],[3518,2240],[3527,2240],[3527,2248],[3536,2248],[3536,2256],[3545,2256],[3545,2271],[3536,2271],[3536,2309],[3509,2309],[3509,2324],[3472,2324],[3472,2316],[3482,2316],[3482,2309],[3472,2309],[3472,2301],[3463,2301],[3463,2294],[3445,2294],[3445,2286],[3436,2286],[3436,2294],[3454,2301],[3454,2309],[3427,2309],[3427,2316],[3354,2309],[3354,2301],[3345,2301],[3345,2286],[3336,2286],[3336,2271],[3327,2271],[3327,2263],[3318,2263],[3318,2256],[3309,2256],[3309,2263],[3290,2263],[3290,2256],[3300,2256],[3300,2233],[3290,2233],[3290,2218],[3281,2218],[3281,2195],[3272,2195],[3272,2179],[3263,2179],[3263,2164],[3245,2157],[3245,2141],[3227,2134],[3227,2126],[3190,2119],[3190,2103],[3172,2103],[3172,2096],[3118,2096],[3118,2119],[3127,2119],[3127,2111],[3163,2111],[3163,2119],[3181,2119],[3181,2126],[3190,2126],[3190,2141],[3199,2141],[3199,2149],[3190,2149],[3190,2172],[3199,2172],[3199,2179],[3190,2179],[3190,2187],[3199,2187],[3199,2202],[3218,2202],[3218,2210],[3236,2210],[3236,2233],[3227,2233],[3227,2240],[3245,2240],[3254,2256],[3263,2256],[3263,2263],[3272,2263],[3272,2271],[3290,2278],[3290,2286],[3300,2286],[3300,2271],[3309,2271],[3309,2286],[3318,2286],[3318,2301],[3309,2301],[3309,2309],[3318,2309],[3318,2324],[3327,2324],[3327,2339],[3309,2347],[3309,2362],[3318,2362],[3318,2385],[3327,2385],[3327,2392],[3345,2392],[3345,2400],[3372,2400],[3372,2408],[3381,2408],[3381,2415],[3409,2415],[3409,2423],[3418,2423],[3418,2430],[3463,2430],[3463,2438],[3482,2438],[3482,2446],[3491,2446],[3491,2453],[3509,2453],[3509,2461],[3454,2461],[3454,2453],[3436,2453],[3436,2446],[3427,2446],[3427,2438],[3409,2438],[3409,2430],[3400,2430],[3400,2423],[3336,2423],[3336,2461],[3436,2468],[3436,2476],[3454,2476],[3454,2468],[3463,2468],[3463,2476],[3472,2476],[3472,2484],[3436,2484],[3436,2499],[3427,2499],[3427,2514],[3418,2514],[3418,2507],[3381,2507],[3381,2514],[3354,2514],[3354,2507],[3345,2507],[3345,2499],[3272,2499],[3272,2491],[3254,2491],[3254,2484],[3263,2484],[3254,2468],[3227,2468],[3227,2484],[3245,2491],[3245,2507],[3218,2507],[3218,2499],[3181,2499],[3181,2491],[3163,2491],[3163,2484],[3118,2484],[3118,2476],[3072,2476],[3072,2468],[3054,2461],[3054,2453],[3045,2453],[3045,2446],[3026,2446],[3017,2430],[2999,2423],[2999,2377],[2990,2377],[2990,2370],[2999,2370],[2999,2339],[3017,2332],[3017,2316],[3036,2309],[3036,2271],[3026,2271],[3026,2240],[3036,2240],[3036,2248],[3054,2248],[3054,2271],[3090,2263],[3090,2256],[3099,2256],[3099,2218],[3127,2218],[3127,2210],[3118,2210],[3118,2202],[3127,2202],[3127,2195],[3108,2195],[3108,2179],[3081,2179],[3081,2187],[3072,2187],[3072,2195],[3063,2195],[3063,2202],[3036,2202],[3036,2225],[2999,2225],[2999,2218],[2981,2218],[2981,2210],[2917,2210],[2917,2195],[2899,2187],[2899,2179],[2926,2179],[2926,2172],[2917,2172],[2917,2164],[2890,2164],[2890,2187],[2881,2187],[2881,2195],[2863,2195],[2863,2187],[2844,2187],[2844,2179],[2826,2172],[2826,2164],[2808,2157],[2808,2149],[2799,2149],[2799,2141],[2781,2134],[2781,2119],[2763,2111],[2763,2096],[2753,2096],[2753,2088],[2744,2088],[2744,2081],[2726,2081],[2726,2111],[2735,2111],[2735,2126],[2744,2126],[2744,2157],[2753,2157],[2753,2172],[2763,2172],[2763,2179],[2772,2179],[2772,2187],[2781,2187],[2781,2195],[2790,2195],[2790,2218],[2781,2218],[2781,2233],[2772,2233],[2772,2240],[2753,2240],[2753,2233],[2744,2233],[2744,2225],[2726,2225],[2726,2218],[2708,2218],[2708,2210],[2690,2210],[2690,2202],[2672,2195],[2672,2187],[2662,2187],[2662,2179],[2644,2179],[2644,2172],[2635,2172],[2635,2164],[2626,2164],[2626,2149],[2617,2149],[2617,2134],[2608,2134],[2608,2126],[2599,2126],[2599,2119],[2590,2119],[2590,2134],[2580,2134],[2580,2141],[2590,2141],[2590,2179],[2599,2179],[2599,2195],[2617,2202],[2617,2218],[2626,2218],[2626,2233],[2635,2233],[2635,2263],[2653,2263],[2653,2271],[2681,2271],[2681,2278],[2690,2278],[2690,2286],[2699,2286],[2699,2294],[2708,2294],[2708,2309],[2735,2309],[2735,2294],[2753,2286],[2753,2278],[2763,2278],[2763,2263],[2799,2263],[2799,2271],[2817,2278],[2817,2294],[2826,2294],[2826,2301],[2817,2301],[2817,2392],[2799,2400],[2799,2392],[2772,2392],[2772,2385],[2763,2385],[2763,2377],[2726,2377],[2726,2385],[2717,2385],[2717,2415],[2708,2415],[2708,2423],[2717,2423],[2717,2438],[2726,2438],[2726,2453],[2735,2453],[2735,2484],[2744,2484],[2744,2507],[2753,2507],[2753,2567],[2763,2567],[2772,2583],[2817,2583],[2817,2590],[2826,2590],[2826,2621],[2808,2628],[2808,2658],[2817,2658],[2817,2674],[2808,2674],[2808,2689],[2790,2689],[2790,2681],[2772,2681],[2772,2674],[2726,2674],[2726,2658],[2708,2651],[2708,2636],[2699,2636],[2699,2613],[2690,2613],[2690,2598],[2672,2598],[2672,2590],[2662,2590],[2662,2598],[2644,2598],[2644,2590],[2635,2590],[2635,2583],[2580,2583],[2580,2575],[2553,2575],[2553,2567],[2535,2567],[2535,2575],[2526,2575],[2526,2583],[2508,2590],[2508,2598],[2489,2605],[2489,2621],[2480,2621],[2480,2628],[2462,2628],[2462,2636],[2444,2636],[2444,2628],[2371,2628],[2371,2621],[2353,2621],[2353,2628],[2344,2628],[2344,2621],[2298,2621],[2289,2605],[2271,2598],[2271,2575],[2262,2575],[2262,2567],[2244,2560],[2244,2552],[2235,2552],[2235,2545],[2216,2545],[2216,2537],[2198,2537],[2198,2529],[2189,2529],[2189,2522],[2171,2522],[2171,2507],[2162,2507],[2162,2499],[2153,2499],[2153,2491],[2144,2491],[2144,2484],[2134,2484],[2134,2476],[2125,2476],[2125,2468],[2107,2461],[2107,2453],[2098,2453],[2098,2461],[2089,2461],[2089,2468],[2071,2468],[2071,2484],[2062,2484],[2062,2491],[2053,2491],[2053,2499],[2043,2499],[2043,2507],[2025,2514],[2025,2529],[2016,2529],[2016,2552],[2007,2552],[2007,2567],[1998,2567],[1998,2590],[1989,2590],[1989,2605],[1980,2605],[1980,2621],[1962,2628],[1962,2636],[1952,2636],[1952,2651],[1943,2651],[1943,2666],[1925,2666],[1925,2674],[1916,2674],[1916,2666],[1880,2658],[1880,2674],[1871,2674],[1871,2696],[1861,2696],[1861,2712],[1852,2712],[1852,2727],[1843,2727],[1843,2734],[1816,2734],[1816,2742],[1807,2742],[1807,2765],[1798,2765],[1798,2757],[1789,2757],[1789,2750],[1779,2750],[1779,2742],[1725,2742],[1725,2757],[1698,2757],[1698,2788],[1688,2788],[1688,2803],[1679,2803],[1679,2810],[1652,2810],[1652,2818],[1634,2818],[1634,2826],[1607,2826],[1607,2833],[1597,2833],[1597,2841],[1588,2841],[1588,2864],[1579,2864],[1579,2879],[1534,2879],[1534,2871],[1525,2871],[1525,2886],[1516,2886],[1516,2879],[1488,2879],[1488,2871],[1470,2871],[1470,2864],[1452,2864],[1452,2856],[1434,2856],[1434,2848],[1379,2848],[1379,2841],[1370,2841],[1370,2833],[1352,2826],[1352,2818],[1343,2818],[1343,2803],[1370,2803],[1370,2795],[1379,2795],[1379,2772],[1361,2765],[1361,2757],[1343,2757],[1343,2750],[1261,2750],[1261,2742],[1224,2742],[1224,2734],[1215,2734],[1215,2750],[1197,2750],[1197,2757],[1188,2757],[1188,2765],[1179,2765],[1179,2772],[1161,2772],[1161,2780],[1142,2780],[1142,2772],[1133,2772],[1133,2780],[1115,2780],[1115,2772],[1088,2772],[1088,2765],[1070,2765],[1070,2757],[1060,2757],[1060,2750],[1051,2750],[1051,2742],[1042,2742],[1042,2734],[1024,2734],[1015,2750],[997,2750],[997,2742],[978,2742],[978,2719],[969,2719],[969,2712],[933,2712],[933,2719],[942,2719],[942,2727],[951,2727],[951,2734],[915,2734],[915,2742],[887,2742],[887,2772],[878,2772],[878,2788],[860,2788],[860,2795],[833,2795],[833,2803],[815,2810],[815,2826],[806,2826],[806,2856],[787,2864],[787,2879],[778,2879],[778,2894],[769,2894],[769,2909],[760,2909],[760,2917],[751,2917],[751,2924],[733,2924],[733,2932],[724,2932],[724,2947],[715,2947],[715,2977],[724,2977],[724,2985],[715,2985],[715,2993],[724,2993],[724,3038],[715,3038],[715,3053],[724,3053],[724,3061],[715,3061],[715,3091],[705,3091],[705,3114],[715,3114],[715,3129],[733,3137],[733,3144],[724,3144],[724,3152],[733,3152],[733,3159],[724,3159],[724,3190],[733,3190],[733,3205],[742,3205],[742,3220],[760,3220],[760,3228],[787,3228],[787,3235],[796,3235],[796,3250],[806,3250],[806,3266],[815,3266],[815,3334],[824,3334],[824,3349],[833,3349],[833,3364],[824,3364],[824,3394],[842,3394],[842,3402],[851,3402],[851,3410],[860,3410],[860,3417],[887,3417],[887,3425],[915,3425],[915,3417],[924,3417],[924,3425],[942,3425],[942,3417],[969,3417],[969,3410],[978,3410],[978,3425],[988,3425],[988,3440],[1015,3440],[1015,3447],[1024,3447],[1024,3463],[1042,3470],[1042,3478],[1060,3485],[1060,3493],[1070,3493],[1070,3500],[1079,3500],[1079,3516],[1088,3516],[1088,3523],[1097,3523],[1097,3531],[1106,3531],[1106,3546],[1115,3546],[1115,3554],[1124,3554],[1124,3569],[1133,3569],[1133,3599],[1142,3599],[1142,3637],[1133,3637],[1133,3660],[1124,3660],[1124,3675],[1106,3682],[1106,3720],[1115,3720],[1115,3750],[1124,3750],[1124,3811],[1115,3811],[1115,3841],[1133,3841],[1133,3849],[1151,3849],[1151,3856],[1170,3849],[1170,3834],[1161,3834],[1161,3826],[1179,3826],[1179,3796],[1197,3796],[1197,3788],[1188,3788],[1188,3765],[1161,3765],[1161,3750],[1170,3750],[1170,3743],[1197,3743],[1197,3750],[1206,3750],[1206,3758],[1224,3758],[1224,3743],[1233,3743],[1233,3728],[1252,3728],[1252,3705],[1261,3705],[1261,3682],[1270,3682],[1270,3667],[1279,3667],[1279,3652],[1297,3652],[1297,3614],[1306,3614],[1306,3599],[1315,3599],[1315,3591],[1306,3591],[1306,3584],[1333,3584],[1333,3576],[1343,3576],[1343,3569],[1361,3569],[1361,3561],[1388,3561],[1388,3554],[1397,3554],[1397,3546],[1406,3546],[1406,3538],[1424,3531],[1424,3516],[1434,3516],[1434,3485],[1443,3485],[1443,3478],[1461,3478],[1461,3470],[1488,3470],[1488,3478],[1497,3478],[1497,3463],[1516,3463],[1516,3455],[1525,3455],[1525,3463],[1543,3463],[1543,3478],[1525,3470],[1525,3493],[1552,3493],[1552,3516],[1543,3516],[1543,3546],[1552,3546],[1552,3561],[1561,3561],[1561,3591],[1525,3591],[1525,3607],[1534,3607],[1534,3614],[1525,3614],[1525,3629],[1516,3629],[1516,3637],[1488,3637],[1488,3629],[1479,3629],[1479,3697],[1488,3697],[1488,3712],[1497,3712],[1497,3758],[1488,3758],[1488,3765],[1479,3765],[1479,3773],[1470,3773],[1470,3818],[1461,3818],[1461,3856],[1452,3856],[1452,3864],[1434,3864],[1434,3879],[1379,3879],[1379,3871],[1361,3871],[1361,3879],[1343,3879],[1343,3887],[1306,3887],[1306,3894],[1297,3894],[1297,3902],[1288,3902],[1288,3909],[1270,3909],[1270,3924],[1261,3924],[1261,3962],[1252,3962],[1252,3985],[1242,3985],[1242,3992],[1224,3992],[1215,4008],[1197,4015],[1197,4023],[1179,4030],[1179,4038],[1170,4038],[1170,4053],[1179,4053],[1179,4045],[1206,4045],[1206,4038],[1224,4038],[1224,4030],[1242,4030],[1242,4023],[1252,4023],[1252,4045],[1233,4045],[1233,4053],[1224,4053],[1224,4076],[1206,4083],[1206,4098],[1197,4098],[1197,4116],[771,4116],[778,4113],[778,4106],[769,4106],[769,4068],[787,4076],[796,4060],[815,4060],[815,4045],[833,4045],[833,4038],[824,4038],[824,4030],[815,4030],[815,4015],[806,4015],[806,4008],[824,4008],[824,3992],[815,3992],[815,4000],[806,4000],[806,3985],[796,3985],[796,4015],[787,4015],[787,4023],[778,4023],[778,4015],[751,4015],[751,4008],[760,4008],[760,3992],[769,3992],[769,3985],[760,3985],[760,3977],[733,3977],[733,3970],[715,3970],[715,3962],[705,3962],[705,3955],[687,3955],[687,3947],[660,3947],[660,3939],[624,3939],[624,3932],[605,3932],[605,3939],[587,3939],[578,3955],[569,3955],[569,3970],[587,3970],[587,3985],[569,3992],[569,4000],[578,4000],[578,3992],[587,3992],[587,4000],[605,4000],[605,4030],[614,4030],[614,4015],[633,4015],[633,4023],[660,4023],[660,4030],[651,4030],[651,4038],[660,4038],[660,4045],[669,4045],[669,4023],[687,4030],[687,4045],[705,4038],[705,4030],[733,4030],[733,4038],[724,4038],[724,4060],[733,4060],[733,4045],[742,4045],[742,4060],[751,4060],[751,4083],[742,4083],[742,4091],[760,4098],[760,4116],[742,4116],[742,4113],[724,4106],[724,4098],[705,4098],[705,4091],[696,4091],[696,4076],[669,4076],[669,4091],[660,4091],[660,4083],[651,4083],[651,4068],[633,4068],[633,4060],[624,4060],[624,4053],[596,4053],[596,4045],[578,4045],[578,4038],[542,4038],[542,4045],[551,4045],[551,4053],[532,4053],[532,4045],[523,4045],[523,4038],[532,4038],[532,4023],[514,4023],[514,4038],[505,4038],[505,4030],[496,4030],[496,4023],[505,4023],[505,4015],[469,4015],[469,4000],[460,4000],[460,4015],[441,4015],[441,4008],[414,4008],[414,4000],[432,4000],[432,3985],[414,3977],[414,3955],[405,3955],[405,3939],[396,3939],[396,3932],[387,3932],[387,3924],[378,3924],[378,3909],[369,3909],[369,3894],[360,3894],[360,3864],[341,3856],[341,3818],[332,3818],[332,3796],[314,3788],[314,3765],[278,3773],[278,3765],[232,3765],[232,3758],[223,3758],[223,3765],[214,3765],[214,3773],[205,3773],[205,3781],[177,3781],[177,3773],[168,3773],[168,3758],[159,3758],[159,3750],[150,3750],[150,3743],[141,3743],[141,3735],[132,3735],[132,3720],[77,3720],[77,3728],[59,3728],[59,3750],[5,3750],[5,3743],[-5,3743],[-5,3750],[-20,3750],[-20,3538],[-14,3538],[-14,3523],[5,3523],[5,3516],[14,3516],[14,3500],[23,3500],[23,3508],[50,3508],[50,3523],[41,3523],[41,3531],[23,3531],[23,3546],[32,3546],[32,3569],[41,3569],[41,3576],[86,3576],[86,3584],[105,3584],[105,3599],[114,3599],[114,3607],[132,3607],[132,3591],[141,3591],[141,3569],[150,3569],[150,3561],[168,3554],[168,3531],[159,3531],[159,3508],[141,3508],[141,3516],[132,3516],[132,3493],[123,3493],[123,3463],[132,3463],[132,3432],[123,3432],[123,3357],[141,3357],[141,3341],[159,3341],[159,3326],[150,3326],[150,3311],[159,3311],[159,3296],[168,3296],[168,3288],[141,3288],[141,3281],[132,3281],[132,3266],[96,3258],[96,3235],[68,3235],[68,3243],[59,3243],[59,3258],[50,3258],[50,3266],[23,3266],[23,3258],[32,3258],[32,3228],[23,3228],[23,3220],[32,3220],[32,3205],[68,3197],[68,3190],[59,3190],[59,3175],[50,3175],[50,3152],[41,3152],[41,3137],[32,3137],[32,3106],[41,3106],[41,3099],[68,3099],[68,3106],[123,3106],[123,3091],[105,3091],[105,3076],[96,3076],[96,3068],[114,3068],[114,3061],[105,3061],[105,3053],[159,3046],[159,3053],[150,3053],[150,3076],[187,3076],[187,3053],[196,3053],[196,3046],[232,3046],[232,3023],[205,3023],[205,3008],[196,3008],[196,2993],[187,2993],[187,3023],[177,3023],[177,3038],[150,3038],[150,3023],[123,3023],[123,3008],[114,3008],[114,2977],[96,2970],[96,2962],[86,2962],[86,2955],[14,2955],[14,2962],[5,2962],[5,2977],[-5,2977],[-5,2985],[-20,2985],[-20,2947],[-5,2947],[-5,2939],[32,2932],[32,2924],[41,2924],[41,2917],[59,2917],[59,2909],[14,2909],[14,2894],[-20,2894],[-20,2119],[14,2119],[14,2126],[23,2126],[23,2134],[32,2134],[32,2126],[41,2126],[41,2096],[32,2096],[32,2088],[23,2088],[23,2081],[5,2081],[5,2073],[-14,2073],[-14,2042],[-5,2042],[-5,2020],[5,2020],[14,2004],[41,2004],[41,1997],[86,1997],[86,2004],[105,2004],[105,2020],[114,2020],[114,2027],[123,2027],[123,2035],[132,2035],[132,2027],[150,2020],[150,2004],[159,2004],[159,1997],[177,1997],[177,1989],[196,1989],[196,1982],[223,1982],[223,1974],[259,1974],[259,1966],[278,1966],[287,1982],[296,1982],[296,1989],[305,1989],[305,1997],[314,1997],[314,2020],[305,2020],[305,2065],[287,2073],[287,2096],[269,2096],[269,2111],[259,2111],[259,2187],[250,2187],[250,2218],[259,2218],[259,2324],[250,2324],[250,2332],[259,2332],[259,2347],[250,2347],[250,2400],[241,2400],[241,2408],[232,2408],[232,2415],[223,2415],[223,2423],[214,2423],[214,2446],[196,2453],[196,2461],[187,2461],[187,2468],[177,2468],[177,2484],[168,2484],[168,2529],[177,2529],[177,2537],[168,2537],[168,2545],[150,2545],[150,2552],[132,2552],[132,2560],[123,2560],[123,2575],[114,2575],[114,2583],[123,2583],[123,2651],[132,2651],[132,2666],[141,2666],[141,2681],[150,2681],[150,2696],[159,2696],[159,2727],[168,2727],[168,2742],[177,2742],[177,2757],[196,2765],[196,2780],[187,2780],[187,2788],[196,2788],[196,2810],[214,2818],[214,2826],[232,2826],[232,2818],[250,2818],[250,2810],[269,2810],[269,2795],[305,2795],[305,2780],[323,2772],[323,2757],[332,2757],[332,2712],[341,2712],[341,2696],[350,2696],[350,2681],[360,2681],[360,2674],[369,2674],[369,2666],[378,2666],[378,2658],[387,2658],[387,2605],[378,2605],[378,2598],[387,2598],[387,2583],[396,2583],[396,2575],[487,2575],[487,2583],[496,2583],[496,2575],[505,2575],[505,2567],[523,2560],[523,2552],[560,2545],[569,2529],[578,2529],[578,2453],[587,2453],[587,2446],[605,2446],[605,2438],[614,2438],[614,2446],[633,2446],[633,2453],[642,2453],[642,2468],[651,2468],[651,2491],[642,2491],[642,2507],[633,2507],[633,2522],[624,2522],[624,2529],[660,2545],[660,2560],[669,2560],[669,2567],[678,2567],[678,2575],[687,2575],[687,2590],[696,2590],[696,2605],[705,2605],[705,2613],[733,2613],[733,2621],[724,2621],[724,2666],[733,2666],[733,2681],[751,2689],[751,2719],[769,2719],[769,2712],[796,2712],[796,2696],[806,2696],[806,2681],[815,2681],[815,2674],[824,2674],[824,2666],[833,2666],[833,2643],[842,2643],[842,2636],[851,2636],[851,2628],[860,2628],[860,2613],[869,2613],[869,2605],[878,2605],[878,2598],[915,2605],[915,2613],[933,2613],[933,2605],[960,2605],[960,2598],[1015,2598],[1015,2605],[1024,2605],[1024,2613],[1042,2613],[1042,2621],[1060,2621],[1060,2613],[1079,2613],[1079,2605],[1170,2598],[1170,2590],[1188,2583],[1188,2537],[1206,2529],[1206,2491],[1215,2491],[1215,2476],[1233,2468],[1233,2453],[1242,2453],[1242,2438],[1270,2438],[1270,2446],[1288,2446],[1288,2453],[1324,2453],[1324,2461],[1343,2461],[1343,2468],[1361,2468],[1361,2476],[1379,2476],[1379,2491],[1397,2499],[1397,2507],[1434,2514],[1434,2522],[1452,2522],[1452,2529],[1461,2529],[1461,2537],[1488,2537],[1488,2529],[1497,2529],[1497,2522],[1516,2522],[1516,2537],[1506,2537],[1506,2545],[1525,2545],[1525,2560],[1561,2545],[1561,2529],[1570,2529],[1570,2522],[1607,2529],[1607,2537],[1625,2537],[1625,2507],[1652,2507],[1652,2522],[1661,2522],[1661,2552],[1652,2552],[1652,2560],[1670,2567],[1670,2575],[1688,2575],[1688,2583],[1698,2583],[1698,2590],[1725,2590],[1725,2598],[1743,2598],[1743,2605],[1789,2605],[1789,2598],[1798,2598],[1798,2590],[1852,2590],[1852,2575],[1871,2567],[1871,2552],[1889,2545],[1889,2529],[1898,2529],[1898,2507],[1916,2499],[1916,2484],[1925,2484],[1925,2468],[1943,2461],[1943,2446],[1952,2446],[1952,2430],[1962,2430],[1962,2377],[1943,2370],[1943,2347],[1934,2347],[1934,2339],[1925,2339],[1925,2332],[1907,2332],[1907,2316],[1898,2316],[1898,2309],[1907,2309],[1907,2301],[1898,2301],[1898,2248],[1907,2248],[1907,2256],[1925,2263],[1925,2256],[1934,2256],[1934,2225],[1925,2225],[1925,2218],[1907,2218],[1907,2210],[1898,2210],[1898,2187],[1889,2187],[1889,2134],[1880,2134],[1880,2058],[1871,2058],[1871,2035],[1861,2035],[1861,2020],[1871,2020],[1871,2004],[1880,2004],[1880,1974],[1889,1974],[1889,1943],[1898,1943],[1898,1905],[1907,1905],[1907,1898],[1989,1898],[1989,1905],[2007,1905],[2016,1921],[2053,1928],[2053,1936],[2071,1936],[2071,1943],[2080,1943],[2080,1951],[2089,1951],[2089,1959],[2098,1959],[2098,1966],[2116,1966],[2116,1959],[2134,1959],[2134,1951],[2153,1951],[2153,1943],[2162,1943],[2162,1913],[2171,1913],[2171,1890],[2189,1890],[2189,1882],[2216,1882],[2216,1837],[2207,1837],[2207,1814],[2198,1814],[2198,1806],[2180,1799],[2180,1791],[2171,1791],[2171,1783],[2153,1776],[2153,1768],[2144,1768],[2144,1753],[2125,1753],[2125,1745],[2107,1738],[2098,1722],[2080,1715],[2080,1684],[2071,1684],[2071,1661],[2062,1661],[2062,1639],[2053,1639],[2053,1631],[2034,1623],[2034,1608],[2043,1608],[2043,1585],[2053,1585],[2053,1578],[2043,1578],[2043,1570],[2053,1570],[2053,1501],[2062,1501],[2062,1494],[2071,1494],[2071,1486],[2080,1486],[2080,1471],[2071,1471],[2071,1456],[2053,1456],[2053,1463],[2043,1463],[2043,1471],[2034,1471],[2034,1486],[2025,1486],[2025,1478],[2007,1471],[2007,1463],[1989,1463],[1989,1448],[1980,1448],[1980,1425],[1971,1425],[1971,1410],[1952,1402],[1952,1387],[1943,1387],[1943,1379],[1925,1379],[1925,1372],[1861,1372],[1861,1379],[1852,1379],[1852,1387],[1834,1394],[1834,1410],[1816,1417],[1816,1440],[1807,1440],[1807,1494],[1816,1494],[1816,1562],[1825,1562],[1825,1578],[1816,1578],[1816,1585],[1807,1585],[1807,1578],[1789,1578],[1789,1585],[1779,1585],[1779,1593],[1770,1593],[1770,1600],[1752,1600],[1752,1608],[1734,1608],[1734,1600],[1707,1600],[1698,1616],[1688,1616],[1688,1669],[1698,1669],[1698,1677],[1688,1677],[1688,1692],[1698,1692],[1698,1715],[1707,1715],[1707,1745],[1698,1745],[1698,1799],[1688,1799],[1688,1806],[1679,1806],[1679,1814],[1670,1814],[1670,1829],[1652,1837],[1652,1852],[1634,1852],[1634,1860],[1625,1860],[1625,1867],[1588,1867],[1588,1860],[1579,1860],[1579,1852],[1570,1852],[1570,1844],[1552,1844],[1552,1837],[1543,1837],[1543,1776],[1534,1776],[1534,1745],[1525,1745],[1525,1700],[1543,1692],[1543,1669],[1525,1677],[1525,1692],[1516,1692],[1516,1700],[1497,1707],[1497,1715],[1479,1722],[1479,1730],[1470,1730],[1470,1738],[1461,1738],[1461,1745],[1424,1745],[1424,1738],[1415,1738],[1415,1715],[1424,1715],[1424,1700],[1434,1700],[1434,1684],[1443,1684],[1443,1639],[1452,1639],[1452,1623],[1470,1616],[1479,1600],[1497,1600],[1497,1593],[1543,1593],[1543,1585],[1570,1585],[1570,1578],[1588,1578],[1588,1547],[1597,1547],[1597,1532],[1616,1524],[1616,1478],[1607,1478],[1607,1463],[1597,1463],[1597,1425],[1588,1425],[1588,1402],[1579,1402],[1579,1372],[1597,1364],[1597,1280],[1607,1280],[1607,1265],[1625,1257],[1625,1219],[1634,1219],[1634,1204],[1670,1196],[1670,1188],[1679,1188],[1679,1173],[1698,1173],[1698,1165],[1734,1158],[1734,1150],[1743,1150],[1743,1143],[1789,1143],[1789,1150],[1816,1150],[1816,1143],[1852,1143],[1852,1135],[1889,1135],[1889,1143],[1925,1143],[1925,1150],[1980,1150],[1980,1143],[1989,1143],[1989,1150],[2025,1150],[2025,1158],[2043,1165],[2043,1181],[2062,1188],[2062,1204],[2071,1204],[2071,1249],[2080,1249],[2080,1280],[2107,1280],[2107,1272],[2171,1272],[2171,1280],[2235,1280],[2235,1288],[2289,1288],[2289,1280],[2298,1280],[2298,1257],[2280,1249],[2280,1234],[2262,1227],[2253,1211],[2235,1211],[2235,1204],[2225,1204],[2225,1196],[2216,1196],[2216,1181],[2225,1181],[2225,1173],[2216,1173],[2216,1135],[2225,1135],[2225,1127],[2235,1127],[2235,1120],[2271,1120],[2271,1127],[2280,1127],[2280,1120],[2298,1120],[2298,1074],[2317,1066],[2317,1058],[2326,1058],[2326,1051],[2335,1051],[2335,1036],[2344,1036],[2344,1013],[2362,1005],[2362,997],[2344,990],[2344,982],[2326,982],[2326,974],[2317,974],[2317,967],[2307,967],[2307,959],[2298,959],[2298,844],[2307,844],[2307,829],[2326,821],[2326,791],[2335,791],[2335,783],[2344,783],[2344,776],[2380,768],[2380,760],[2453,760],[2453,753],[2480,753],[2480,745],[2499,745],[2499,737],[2508,737],[2508,730],[2517,730],[2517,722],[2526,722],[2526,714],[2535,714],[2535,668],[2526,668],[2526,646],[2535,646],[2535,630],[2553,630],[2553,623],[2562,623],[2562,615],[2580,615],[2580,492],[2571,492],[2571,462],[2562,462],[2562,446],[2553,446],[2553,439],[2535,439],[2535,446],[2526,446],[2526,546],[2517,546],[2517,561],[2508,561],[2508,577],[2499,577],[2499,592],[2480,600],[2480,615],[2471,615],[2471,623],[2435,630],[2435,638],[2426,638],[2426,630],[2326,630],[2326,623],[2307,623],[2307,615],[2289,615],[2289,607],[2262,607],[2262,600],[2244,600],[2244,592],[2235,592],[2235,577],[2225,577],[2225,554],[2216,554],[2216,500],[2225,500],[2225,477],[2235,477],[2235,462],[2244,462],[2244,446],[2253,446],[2253,416],[2262,416],[2262,401],[2271,401],[2271,385],[2280,385],[2280,355],[2289,355],[2289,309],[2280,309],[2280,286],[2289,286],[2289,270],[2298,270],[2298,255],[2307,255],[2307,247],[2326,240],[2335,224],[2380,224],[2380,217],[2389,217],[2389,209],[2398,209],[2398,201],[2417,209],[2417,201],[2426,201],[2426,194],[2435,194],[2435,201],[2471,201],[2471,209],[2489,209],[2489,217],[2508,217],[2508,224],[2535,224],[2535,232],[2562,232],[2562,240],[2580,240],[2580,247],[2590,247],[2590,255],[2599,255],[2599,263],[2608,263],[2608,278],[2626,278],[2626,270],[2672,270],[2672,263],[2699,263],[2699,255],[2717,263],[2717,255],[2735,255],[2735,247],[2753,247],[2753,240],[2763,240],[2763,232],[2790,232],[2790,224],[2808,224],[2808,217],[2926,224],[2926,232],[2963,232],[2963,240],[3017,240],[3017,247],[3045,247],[3045,255],[3072,255],[3072,247],[3127,247],[3127,255],[3172,255],[3172,247],[3181,247],[3181,240],[3199,240],[3199,232],[3236,232],[3236,240],[3263,240],[3263,247],[3309,247],[3309,255],[3318,255],[3318,270],[3300,278],[3300,301],[3290,301],[3290,339],[3300,339],[3300,378],[3272,378],[3272,393],[3263,393],[3263,446],[3272,446],[3272,469],[3281,469],[3281,485],[3290,485],[3290,508],[3300,508],[3300,523],[3309,523],[3309,531],[3363,531],[3363,523],[3409,523],[3409,515],[3482,515],[3482,508],[3509,508],[3509,515],[3527,515],[3527,523],[3545,523],[3545,531],[3564,531],[3564,523],[3582,523],[3582,531],[3591,531],[3591,538],[3618,538],[3618,531],[3627,531],[3627,508],[3618,508],[3618,500],[3609,500],[3609,492],[3600,492],[3600,485],[3564,485],[3564,462],[3554,462],[3554,416],[3564,416],[3564,378],[3554,378],[3554,362],[3545,362],[3545,347],[3536,347],[3536,339],[3518,339],[3518,332],[3500,332],[3500,324],[3454,324],[3454,309],[3445,309],[3445,293],[3436,293],[3436,263],[3427,263],[3427,247],[3372,240],[3372,224],[3381,224],[3381,217],[3372,217],[3372,163],[3391,163],[3391,171],[3418,171],[3418,163],[3427,163],[3427,148],[3436,148],[3436,125],[3454,117],[3454,109],[3463,109],[3463,94],[3500,94],[3500,102],[3509,102],[3509,109],[3527,109],[3527,117],[3545,117],[3545,109],[3582,109],[3591,125],[3609,132],[3609,148],[3618,148],[3618,171],[3636,171],[3636,178],[3645,178],[3645,194],[3664,201],[3664,209],[3700,209],[3700,217],[3736,224],[3736,232],[3746,232],[3746,240],[3755,240],[3755,247],[3764,247],[3764,255],[3773,255],[3773,263],[3782,263],[3782,278],[3791,278],[3791,286],[3809,293],[3809,316],[3818,316],[3818,332],[3827,332],[3827,347],[3837,347],[3837,355],[3855,362],[3864,378],[3873,378],[3873,401],[3882,401],[3882,424],[3891,424],[3891,439],[3900,439],[3900,462],[3909,462],[3909,477],[3919,477],[3919,515],[3928,515],[3928,554],[3946,554],[3946,561],[3955,561],[3955,569],[3982,569],[3982,561],[4037,561],[4037,546],[4046,546],[4046,531],[4064,523],[4064,485],[4073,485],[4073,469],[4091,462],[4091,431],[4101,431],[4101,416],[4116,416],[4116,676],[4110,676],[4110,684],[4101,684],[4101,691],[4091,691],[4091,684],[4046,684],[4046,699],[4037,699],[4037,730],[4019,737],[4019,753],[4010,753],[4010,776],[4000,776],[4000,814],[3982,821],[3973,837],[3964,837],[3964,852],[3955,852],[3955,875],[3946,875],[3946,929],[3955,929],[3955,959],[3964,959],[3964,982],[4028,982],[4028,974],[4037,974],[4037,967],[4073,967],[4073,959],[4101,959],[4101,967],[4116,973],[4116,1417],[4110,1417],[4110,1425],[4116,1425],[4116,1532],[4101,1532],[4101,1539],[4082,1539],[4082,1570],[4091,1570],[4091,1593],[4101,1593],[4101,1608],[4116,1615],[4116,1937],[4101,1943],[4101,1974],[4091,1974],[4091,1982],[4082,1982],[4082,1989],[4055,1989],[4055,1982],[4037,1982],[4037,1989],[4028,1989],[4028,1982],[4019,1982],[4019,1959],[4010,1959],[4010,1951],[4000,1951],[4000,1943],[3991,1943],[3991,1936],[3973,1936],[3973,1928],[3955,1928],[3955,1921],[3946,1921],[3946,1913],[3937,1913],[3937,1898],[3928,1898],[3928,1882],[3919,1882],[3919,1875],[3909,1875],[3909,1867],[3900,1867],[3900,1852],[3855,1852],[3855,1860],[3846,1860],[3846,1867],[3809,1867],[3809,1875],[3791,1867],[3791,1875],[3782,1875],[3782,1882],[3791,1882],[3791,1898],[3782,1898],[3782,1905],[3773,1905],[3773,1913],[3764,1913],[3764,1936],[3773,1936],[3773,1951],[3782,1951],[3782,1959],[3800,1966],[3800,1982],[3773,1982],[3773,1974],[3755,1974]], 3 | [[3837,1097],[3809,1097],[3809,1104],[3791,1104],[3791,1120],[3782,1120],[3782,1143],[3773,1143],[3773,1181],[3764,1181],[3764,1242],[3755,1242],[3755,1257],[3746,1257],[3746,1272],[3736,1272],[3736,1280],[3709,1280],[3709,1288],[3700,1288],[3700,1303],[3682,1311],[3682,1425],[3673,1425],[3673,1471],[3691,1478],[3691,1486],[3700,1486],[3700,1494],[3709,1494],[3709,1501],[3755,1501],[3755,1517],[3764,1517],[3764,1532],[3773,1532],[3773,1539],[3800,1539],[3800,1547],[3809,1547],[3809,1539],[3827,1532],[3827,1524],[3837,1524],[3837,1509],[3827,1509],[3827,1494],[3818,1494],[3818,1478],[3800,1471],[3800,1463],[3782,1463],[3782,1456],[3746,1456],[3746,1463],[3727,1463],[3727,1448],[3736,1448],[3736,1440],[3755,1440],[3755,1433],[3764,1433],[3764,1417],[3773,1417],[3773,1394],[3782,1394],[3782,1387],[3773,1387],[3773,1379],[3764,1379],[3764,1333],[3755,1333],[3755,1318],[3746,1318],[3746,1295],[3782,1295],[3782,1303],[3800,1303],[3800,1295],[3809,1295],[3809,1280],[3818,1280],[3818,1265],[3827,1265],[3827,1249],[3837,1249],[3837,1234],[3855,1227],[3855,1188],[3864,1188],[3864,1173],[3873,1173],[3873,1150],[3882,1150],[3882,1112],[3873,1112],[3873,1097],[3864,1097],[3864,1089],[3837,1089],[3837,1097]], 4 | [[3272,1905],[3272,1898],[3290,1890],[3290,1898],[3309,1905],[3309,1921],[3345,1921],[3345,1890],[3336,1890],[3336,1867],[3327,1867],[3327,1822],[3309,1814],[3309,1799],[3300,1799],[3300,1791],[3290,1791],[3290,1783],[3281,1783],[3281,1776],[3272,1776],[3272,1768],[3254,1761],[3254,1745],[3245,1745],[3245,1738],[3236,1738],[3236,1730],[3227,1730],[3227,1722],[3218,1722],[3218,1707],[3199,1707],[3199,1700],[3190,1700],[3190,1684],[3136,1684],[3136,1715],[3145,1715],[3145,1722],[3154,1722],[3154,1738],[3172,1745],[3172,1761],[3181,1761],[3181,1768],[3172,1768],[3172,1776],[3181,1776],[3181,1814],[3190,1814],[3190,1822],[3181,1822],[3181,1860],[3190,1860],[3190,1875],[3199,1875],[3199,1882],[3218,1882],[3218,1890],[3245,1890],[3245,1898],[3254,1898],[3254,1905],[3272,1905]], 5 | [[3081,1722],[3072,1722],[3072,1761],[3127,1761],[3127,1753],[3145,1753],[3145,1730],[3136,1730],[3136,1715],[3108,1715],[3108,1707],[3081,1707],[3081,1722]], 6 | [[3400,1905],[3391,1905],[3391,1898],[3381,1898],[3381,1890],[3372,1890],[3372,1905],[3381,1905],[3381,1921],[3372,1921],[3372,1936],[3381,1936],[3381,1951],[3409,1951],[3409,1905],[3418,1905],[3418,1890],[3400,1890],[3400,1905]], 7 | [[3172,1959],[3181,1959],[3181,1943],[3172,1943],[3172,1959]], 8 | [[3755,1974],[3755,1966],[3736,1959],[3736,1966],[3746,1966],[3746,1974],[3755,1974]], 9 | [[3837,1402],[3846,1402],[3846,1394],[3837,1394],[3837,1402]] 10 | ] 11 | -------------------------------------------------------------------------------- /test/fixtures/self-touching.json: -------------------------------------------------------------------------------- 1 | [[[160.40671875,11.3976701817587],[160.396875,11.3935345987524],[160.39828125,11.4018057045896],[160.39265625,11.4004272036667],[160.38984375,11.3811274888866],[160.3940625,11.3838846711709],[160.3771875,11.3521754635814],[160.33921875,11.3590690696413],[160.35046875,11.3645838345287],[160.3575,11.3645838345287],[160.3575,11.3756130442004],[160.29421875,11.3507967223837],[160.2928125,11.3480392200086],[160.28859375,11.3480392200086],[160.295625,11.3287359579628],[160.26328125,11.3080524456288],[160.295625,11.1866791818427],[160.31671875,11.1811610026871],[160.318125,11.1770222993774],[160.31390625,11.1687447155658],[160.3125,11.1494294353899],[160.2703125,11.1107950268865],[160.2421875,11.1149346728405],[160.23796875,11.0997556838987],[160.25625,11.095615822671],[160.21828125,11.0735355725517],[160.21546875,11.0652550492086],[160.2084375,11.0762956949617],[160.20140625,11.0638749392263],[160.19015625,11.0528338254202],[160.18453125,11.0528338254202],[160.183125,11.0486933005675],[160.24640625,11.0583544343014],[160.26890625,11.0555941428523],[160.250625,11.0804358297701],[160.28015625,11.0942358558913],[160.295625,11.0845759059922],[160.2928125,11.0721555015877],[160.318125,11.0790557913426],[160.31953125,11.0942358558913],[160.33359375,11.1038954864431],[160.34484375,11.0900959164515],[160.35609375,11.1038954864431],[160.363125,11.0969957829326],[160.36453125,11.1052754075802],[160.36171875,11.1121749153987],[160.37578125,11.1149346728405],[160.39828125,11.1080352302834],[160.36734375,11.1756427184796],[160.48125,11.1852996469051],[160.48546875,11.1825405573266],[160.5121875,11.1852996469051],[160.5459375,11.1342522433585],[160.56421875,11.1301128717933],[160.55578125,11.1204541093718],[160.56140625,11.1135547973836],[160.588125,11.1314926688534],[160.62328125,11.1121749153987],[160.633125,11.1135547973836],[160.6471875,11.1025155587833],[160.64296875,11.1176944041669],[160.63734375,11.1190742600349],[160.62328125,11.1342522433585],[160.62046875,11.128733068196],[160.6078125,11.1480497233847],[160.61203125,11.1480497233847],[160.6134375,11.1563278971795],[160.5909375,11.1425308098987],[160.576875,11.1480497233847],[160.57125,11.1549482179223],[160.57125,11.1494294353899],[160.57828125,11.1452902797332],[160.57265625,11.1425308098987],[160.57125,11.1494294353899],[160.54875,11.1577075698847],[160.554375,11.179781441482],[160.54875,11.1770222993774],[160.5628125,11.2087508469621],[160.5234375,11.2059919808933],[160.52203125,11.2032330885061],[160.50515625,11.2184066708578],[160.49390625,11.2032330885061],[160.46296875,11.2046125379891],[160.46296875,11.201853632445],[160.4165625,11.2115096867066],[160.41796875,11.2211654184183],[160.39546875,11.2266828344767],[160.35609375,11.2225447823168],[160.35328125,11.2363380587922],[160.3659375,11.2473722050633],[160.351875,11.2915045605453],[160.32375,11.2721974885629],[160.32234375,11.2846093266964],[160.35328125,11.3080524456288],[160.351875,11.3149471157772],[160.3659375,11.3204627323768],[160.36171875,11.2997786224589],[160.3828125,11.3011576095711],[160.37859375,11.3080524456288],[160.38140625,11.3094313929343],[160.3828125,11.3011576095711],[160.408125,11.3039155638972],[160.408125,11.2997786224589],[160.425,11.3094313929343],[160.41234375,11.3411453475587],[160.3996875,11.3301148056307],[160.40953125,11.3700984927314],[160.39265625,11.3618264654176],[160.396875,11.3797488877286],[160.4053125,11.3893989555911],[160.40953125,11.3866418267411],[160.419375,11.4004272036667],[160.41515625,11.4059411672242],[160.419375,11.4114550237293],[160.425,11.412833471123],[160.42359375,11.422482415387],[160.40671875,11.3976701817587]],[[160.363125,11.1425308098987],[160.3603125,11.1383915560672],[160.3603125,11.1439105480884],[160.363125,11.1425308098987]],[[160.35046875,11.1397713138873],[160.34625,11.1383915560672],[160.34203125,11.1480497233847],[160.35046875,11.1397713138873]]] -------------------------------------------------------------------------------- /test/fixtures/shared-points.json: -------------------------------------------------------------------------------- 1 | [[[4136,1016],[4112,1016],[4104,976],[4136,1016],[4144,984],[4104,976],[4144,968],[4144,984],[4168,992],[4152,1064]]] 2 | -------------------------------------------------------------------------------- /test/fixtures/simplified-us-border.json: -------------------------------------------------------------------------------- 1 | [[[1130,1713],[1131,1710],[1137,1731],[1133,1752],[1125,1753],[1118,1742],[1110,1717],[1105,1718],[1108,1704],[1096,1691],[1077,1694],[1067,1683],[1019,1687],[1031,1689],[1031,1704],[1022,1696],[1022,1702],[1010,1700],[1003,1692],[998,1696],[980,1690],[970,1698],[966,1694],[966,1702],[938,1718],[943,1742],[920,1736],[916,1721],[894,1693],[884,1691],[872,1703],[837,1667],[785,1672],[743,1654],[715,1656],[699,1636],[676,1628],[654,1587],[656,1583],[660,1588],[657,1579],[649,1580],[633,1547],[637,1529],[631,1507],[638,1454],[647,1454],[637,1452],[639,1441],[635,1442],[629,1417],[651,1421],[647,1434],[655,1428],[650,1440],[656,1434],[654,1423],[651,1420],[653,1419],[651,1407],[965,1407],[966,1400],[972,1411],[1008,1423],[1043,1419],[1083,1442],[1086,1450],[1091,1448],[1109,1468],[1114,1496],[1102,1520],[1107,1525],[1149,1508],[1147,1498],[1152,1495],[1174,1495],[1195,1474],[1242,1470],[1260,1433],[1277,1440],[1277,1462],[1286,1476],[1274,1484],[1265,1480],[1243,1503],[1240,1516],[1252,1526],[1238,1529],[1236,1523],[1234,1530],[1218,1531],[1206,1540],[1205,1554],[1195,1567],[1188,1556],[1194,1574],[1185,1590],[1187,1581],[1179,1567],[1185,1557],[1176,1562],[1180,1579],[1179,1585],[1170,1577],[1180,1593],[1169,1590],[1183,1596],[1186,1607],[1175,1605],[1183,1613],[1182,1618],[1171,1615],[1179,1624],[1167,1626],[1145,1650],[1132,1659],[1128,1656],[1121,1675],[1131,1708],[1129,1710],[1130,1713]],[[654,1419],[653,1419],[654,1423],[656,1425],[654,1419]]] 2 | -------------------------------------------------------------------------------- /test/fixtures/steiner.json: -------------------------------------------------------------------------------- 1 | [ 2 | [[0,0],[100,0],[100,100],[0,100]], 3 | [[50,50]], 4 | [[30,40]], 5 | [[70,60]], 6 | [[20,70]] 7 | ] 8 | -------------------------------------------------------------------------------- /test/fixtures/touching-holes.json: -------------------------------------------------------------------------------- 1 | [[[3694,2061],[3794,2035],[3812,2123],[3784,2123],[3708,2139],[3694,2061]],[[3752,2109],[3740,2102],[3712,2109],[3715,2125],[3723,2128],[3740,2124],[3742,2112],[3752,2109]],[[3797,2101],[3787,2096],[3780,2106],[3788,2114],[3797,2101]],[[3734,2099],[3732,2091],[3719,2094],[3721,2102],[3734,2099]],[[3777,2082],[3774,2071],[3772,2086],[3765,2091],[3748,2088],[3749,2062],[3738,2081],[3745,2095],[3761,2099],[3777,2082]],[[3719,2079],[3712,2079],[3706,2091],[3712,2097],[3721,2080],[3719,2079]],[[3773,2067],[3761,2053],[3753,2061],[3753,2071],[3756,2075],[3773,2067]],[[3708,2079],[3712,2079],[3714,2076],[3719,2079],[3722,2079],[3718,2088],[3723,2089],[3734,2075],[3730,2068],[3717,2065],[3708,2079]]] 2 | -------------------------------------------------------------------------------- /test/fixtures/touching-holes2.json: -------------------------------------------------------------------------------- 1 | [[[0,0],[20,0],[20,25],[0,25],[0,0]],[[3,3],[2,12],[9,15],[3,3]],[[9,21],[2,12],[7,22],[9,21]]] -------------------------------------------------------------------------------- /test/fixtures/touching-holes3.json: -------------------------------------------------------------------------------- 1 | [[[0,0],[20,0],[20,25],[0,25],[0,0]],[[2,12],[4,23],[5,23],[2,12]],[[2,12],[6,23],[7,23],[2,12]],[[2,12],[8,23],[9,23],[2,12]],[[2,12],[10,23],[11,23],[2,12]],[[2,12],[12,23],[13,23],[2,12]],[[2,12],[14,23],[15,23],[2,12]],[[2,12],[16,23],[17,23],[2,12]],[[2,12],[18,23],[18,22],[2,12]],[[2,12],[18,21],[18,20],[2,12]],[[2,12],[18,19],[18,18],[2,12]],[[2,12],[18,17],[18,16],[2,12]],[[2,12],[18,15],[18,14],[2,12]],[[2,12],[18,13],[18,12],[2,12]],[[2,12],[18,11],[18,10],[2,12]],[[2,12],[18,9],[18,8],[2,12]],[[2,12],[18,7],[18,6],[2,12]],[[2,12],[18,5],[18,4],[2,12]],[[2,12],[18,3],[18,2],[2,12]],[[2,12],[18,1],[17,1],[2,12]],[[2,12],[16,1],[15,1],[2,12]],[[2,12],[14,1],[13,1],[2,12]],[[2,12],[12,1],[11,1],[2,12]],[[2,12],[10,1],[9,1],[2,12]],[[2,12],[8,1],[7,1],[2,12]],[[2,12],[6,1],[5,1],[2,12]],[[2,12],[4,1],[3,1],[2,12]]] -------------------------------------------------------------------------------- /test/fixtures/touching-holes4.json: -------------------------------------------------------------------------------- 1 | [[[-20,0],[20,0],[20,25],[-20,25],[-20,0]],[[2,12],[-1,23],[0,23],[2,12]],[[2,12],[-3,23],[-2,23],[2,12]],[[2,12],[-5,23],[-4,23],[2,12]],[[2,12],[-7,23],[-6,23],[2,12]],[[2,12],[-9,23],[-8,23],[2,12]],[[2,12],[-11,23],[-10,23],[2,12]],[[2,12],[-13,23],[-12,23],[2,12]],[[2,12],[-14,22],[-14,23],[2,12]],[[2,12],[-14,20],[-14,21],[2,12]],[[2,12],[-14,18],[-14,19],[2,12]],[[2,12],[-14,16],[-14,17],[2,12]],[[2,12],[-14,14],[-14,15],[2,12]],[[2,12],[-14,12],[-14,13],[2,12]],[[2,12],[-14,10],[-14,11],[2,12]],[[2,12],[-14,8],[-14,9],[2,12]],[[2,12],[-14,6],[-14,7],[2,12]],[[2,12],[-14,4],[-14,5],[2,12]],[[2,12],[-14,2],[-14,3],[2,12]],[[2,12],[-13,1],[-14,1],[2,12]],[[2,12],[-11,1],[-12,1],[2,12]],[[2,12],[-9,1],[-10,1],[2,12]],[[2,12],[-7,1],[-8,1],[2,12]],[[2,12],[-5,1],[-6,1],[2,12]],[[2,12],[-3,1],[-4,1],[2,12]],[[2,12],[-1,1],[-2,1],[2,12]],[[2,12],[1,1],[0,1],[2,12]]] -------------------------------------------------------------------------------- /test/fixtures/touching-holes5.json: -------------------------------------------------------------------------------- 1 | [[[-20,0],[20,0],[20,25],[-20,25],[-20,0]],[[2,12],[4,23],[5,23],[2,12]],[[2,12],[6,23],[7,23],[2,12]],[[2,12],[8,23],[9,23],[2,12]],[[2,12],[10,23],[11,23],[2,12]],[[2,12],[12,23],[13,23],[2,12]],[[2,12],[14,23],[15,23],[2,12]],[[2,12],[16,23],[17,23],[2,12]],[[2,12],[18,23],[18,22],[2,12]],[[2,12],[18,21],[18,20],[2,12]],[[2,12],[18,19],[18,18],[2,12]],[[2,12],[18,17],[18,16],[2,12]],[[2,12],[18,15],[18,14],[2,12]],[[2,12],[18,13],[18,12],[2,12]],[[2,12],[18,11],[18,10],[2,12]],[[2,12],[18,9],[18,8],[2,12]],[[2,12],[18,7],[18,6],[2,12]],[[2,12],[18,5],[18,4],[2,12]],[[2,12],[18,3],[18,2],[2,12]],[[2,12],[18,1],[17,1],[2,12]],[[2,12],[16,1],[15,1],[2,12]],[[2,12],[14,1],[13,1],[2,12]],[[2,12],[12,1],[11,1],[2,12]],[[2,12],[10,1],[9,1],[2,12]],[[2,12],[8,1],[7,1],[2,12]],[[2,12],[6,1],[5,1],[2,12]],[[2,12],[4,1],[3,1],[2,12]],[[2,12],[-1,23],[0,23],[2,12]],[[2,12],[-3,23],[-2,23],[2,12]],[[2,12],[-5,23],[-4,23],[2,12]],[[2,12],[-7,23],[-6,23],[2,12]],[[2,12],[-9,23],[-8,23],[2,12]],[[2,12],[-11,23],[-10,23],[2,12]],[[2,12],[-13,23],[-12,23],[2,12]],[[2,12],[-14,22],[-14,23],[2,12]],[[2,12],[-14,20],[-14,21],[2,12]],[[2,12],[-14,18],[-14,19],[2,12]],[[2,12],[-14,16],[-14,17],[2,12]],[[2,12],[-14,14],[-14,15],[2,12]],[[2,12],[-14,12],[-14,13],[2,12]],[[2,12],[-14,10],[-14,11],[2,12]],[[2,12],[-14,8],[-14,9],[2,12]],[[2,12],[-14,6],[-14,7],[2,12]],[[2,12],[-14,4],[-14,5],[2,12]],[[2,12],[-14,2],[-14,3],[2,12]],[[2,12],[-13,1],[-14,1],[2,12]],[[2,12],[-11,1],[-12,1],[2,12]],[[2,12],[-9,1],[-10,1],[2,12]],[[2,12],[-7,1],[-8,1],[2,12]],[[2,12],[-5,1],[-6,1],[2,12]],[[2,12],[-3,1],[-4,1],[2,12]],[[2,12],[-1,1],[-2,1],[2,12]],[[2,12],[1,1],[0,1],[2,12]]] -------------------------------------------------------------------------------- /test/fixtures/touching2.json: -------------------------------------------------------------------------------- 1 | [ 2 | [[120,2031],[92,2368],[94,2200],[33,2119],[42,2112],[53,2068]], 3 | [[44,2104],[79,2132],[88,2115],[44,2104]] 4 | ] 5 | -------------------------------------------------------------------------------- /test/fixtures/touching3.json: -------------------------------------------------------------------------------- 1 | [ 2 | [[1241,887],[1257,891],[1248,904],[1232,911],[1212,911],[1207,911],[1209,900],[1219,898],[1225,907],[1241,887]], 3 | [[1212,902],[1212,911],[1219,909],[1212,902]], 4 | [[1248,891],[1239,896],[1246,898],[1248,891]] 5 | ] 6 | -------------------------------------------------------------------------------- /test/fixtures/touching4.json: -------------------------------------------------------------------------------- 1 | [[[11,10],[0,10],[0,0],[11,0]],[[7,6],[7,9],[10,9]],[[7,5],[10,2],[10,5]],[[6,9],[1,4],[1,9]],[[1,1],[1,4],[4,1]]] 2 | -------------------------------------------------------------------------------- /test/fixtures/water.json: -------------------------------------------------------------------------------- 1 | [ 2 | [[2293,4224],[2294,4219],[2280,4180],[2288,4172],[2283,4189],[2301,4218],[2299,4224],[2347,4224],[2344,4215],[2351,4224],[2371,4224],[2379,4224],[2375,4206],[2363,4202],[2346,4194],[2371,4195],[2376,4180],[2383,4202],[2429,4176],[2431,4163],[2439,4161],[2438,4144],[2464,4124],[2457,4111],[2467,4102],[2473,4060],[2482,4053],[2488,4031],[2467,3982],[2456,3991],[2456,4005],[2451,3998],[2451,4014],[2432,4011],[2433,4025],[2427,4012],[2415,4009],[2438,4003],[2419,3990],[2411,3987],[2391,4000],[2391,3989],[2374,3991],[2382,3995],[2363,4028],[2364,4042],[2380,4041],[2389,4029],[2387,4053],[2412,4055],[2376,4059],[2389,4085],[2381,4093],[2371,4076],[2363,4082],[2372,4067],[2362,4059],[2347,4054],[2349,4040],[2344,4057],[2325,4063],[2322,4073],[2332,4078],[2325,4086],[2317,4082],[2308,4065],[2321,4063],[2299,4051],[2312,4056],[2326,4055],[2325,4044],[2302,4021],[2315,4029],[2324,4023],[2333,4040],[2335,4026],[2349,4016],[2333,3999],[2318,4002],[2333,3991],[2321,3985],[2350,4000],[2350,3962],[2331,3964],[2340,3949],[2332,3946],[2341,3943],[2345,3952],[2358,3947],[2350,3922],[2362,3931],[2363,3922],[2368,3946],[2377,3946],[2388,3933],[2378,3908],[2389,3920],[2393,3948],[2401,3924],[2400,3911],[2382,3899],[2388,3875],[2366,3885],[2350,3878],[2340,3896],[2327,3880],[2323,3900],[2313,3894],[2300,3871],[2307,3890],[2331,3872],[2317,3867],[2345,3852],[2343,3840],[2351,3843],[2348,3823],[2339,3821],[2341,3805],[2350,3828],[2379,3853],[2385,3844],[2368,3823],[2370,3809],[2362,3809],[2361,3793],[2372,3804],[2379,3795],[2376,3823],[2388,3815],[2402,3822],[2393,3832],[2384,3824],[2404,3860],[2407,3876],[2416,3872],[2418,3852],[2427,3876],[2409,3893],[2429,3921],[2484,3863],[2478,3792],[2440,3820],[2439,3834],[2438,3820],[2426,3809],[2435,3801],[2421,3794],[2429,3786],[2406,3752],[2424,3748],[2440,3762],[2431,3732],[2415,3735],[2412,3721],[2391,3707],[2381,3720],[2382,3732],[2370,3724],[2382,3716],[2372,3705],[2380,3708],[2378,3687],[2368,3685],[2349,3710],[2338,3694],[2337,3708],[2324,3706],[2327,3717],[2316,3729],[2323,3715],[2309,3714],[2318,3713],[2311,3699],[2332,3698],[2334,3678],[2356,3670],[2343,3651],[2332,3649],[2335,3658],[2324,3655],[2323,3670],[2324,3661],[2311,3661],[2332,3640],[2316,3633],[2286,3655],[2302,3631],[2277,3610],[2269,3619],[2250,3619],[2250,3630],[2239,3635],[2244,3650],[2228,3660],[2236,3679],[2226,3666],[2207,3677],[2199,3672],[2235,3648],[2232,3621],[2240,3624],[2249,3605],[2229,3607],[2219,3593],[2209,3597],[2218,3587],[2202,3586],[2201,3576],[2180,3583],[2177,3598],[2178,3573],[2165,3548],[2153,3544],[2148,3519],[2154,3506],[2139,3492],[2141,3484],[2149,3492],[2186,3568],[2207,3567],[2233,3585],[2231,3533],[2248,3519],[2248,3532],[2238,3536],[2247,3547],[2238,3549],[2237,3574],[2260,3602],[2261,3586],[2272,3598],[2294,3599],[2288,3559],[2300,3578],[2303,3610],[2324,3615],[2341,3612],[2342,3596],[2330,3591],[2342,3588],[2346,3561],[2348,3612],[2363,3604],[2365,3582],[2374,3590],[2376,3576],[2386,3591],[2403,3596],[2387,3598],[2370,3598],[2364,3636],[2379,3621],[2387,3653],[2400,3620],[2414,3623],[2402,3632],[2397,3650],[2411,3667],[2410,3682],[2427,3678],[2420,3667],[2425,3649],[2443,3653],[2426,3651],[2433,3664],[2429,3672],[2440,3671],[2440,3681],[2426,3688],[2454,3700],[2457,3689],[2462,3698],[2456,3717],[2499,3696],[2488,3686],[2498,3690],[2499,3682],[2520,3700],[2503,3702],[2499,3713],[2510,3706],[2518,3708],[2513,3730],[2530,3746],[2521,3746],[2546,3760],[2549,3777],[2574,3779],[2550,3768],[2536,3721],[2551,3725],[2555,3750],[2578,3746],[2564,3704],[2554,3709],[2542,3694],[2563,3704],[2571,3682],[2602,3652],[2577,3623],[2568,3629],[2581,3639],[2576,3655],[2561,3636],[2560,3648],[2549,3634],[2524,3637],[2531,3625],[2564,3627],[2537,3582],[2530,3591],[2534,3554],[2522,3558],[2519,3574],[2506,3576],[2504,3595],[2493,3598],[2502,3592],[2505,3572],[2513,3563],[2502,3559],[2517,3548],[2527,3551],[2533,3539],[2518,3523],[2503,3538],[2485,3535],[2479,3545],[2478,3535],[2467,3540],[2466,3555],[2454,3547],[2443,3562],[2450,3547],[2437,3543],[2462,3542],[2459,3532],[2470,3535],[2477,3525],[2500,3530],[2496,3515],[2515,3515],[2527,3502],[2503,3482],[2481,3486],[2453,3506],[2462,3496],[2461,3485],[2496,3481],[2490,3464],[2467,3463],[2479,3445],[2458,3437],[2430,3471],[2391,3471],[2403,3470],[2410,3460],[2428,3464],[2450,3428],[2435,3418],[2426,3429],[2437,3412],[2418,3406],[2415,3415],[2388,3419],[2411,3403],[2395,3399],[2404,3392],[2385,3384],[2366,3406],[2347,3410],[2384,3376],[2370,3365],[2347,3376],[2327,3371],[2376,3358],[2372,3347],[2357,3342],[2331,3350],[2334,3342],[2361,3335],[2363,3326],[2321,3317],[2303,3328],[2312,3311],[2320,3316],[2270,3302],[2257,3308],[2263,3321],[2248,3330],[2257,3316],[2246,3300],[2238,3323],[2227,3318],[2227,3304],[2243,3294],[2253,3297],[2249,3282],[2232,3278],[2242,3274],[2242,3266],[2258,3264],[2257,3255],[2269,3248],[2292,3263],[2278,3245],[2259,3239],[2278,3244],[2281,3231],[2266,3217],[2252,3217],[2250,3196],[2228,3218],[2220,3219],[2237,3199],[2215,3194],[2243,3196],[2237,3177],[2209,3171],[2189,3154],[2157,3144],[2144,3152],[2151,3141],[2139,3130],[2122,3148],[2113,3127],[2125,3142],[2130,3117],[2147,3119],[2149,3128],[2167,3120],[2169,3146],[2187,3143],[2212,3166],[2224,3161],[2225,3173],[2243,3145],[2244,3156],[2235,3162],[2254,3175],[2272,3176],[2289,3165],[2286,3182],[2274,3178],[2268,3195],[2304,3196],[2310,3180],[2323,3209],[2339,3214],[2349,3249],[2359,3249],[2357,3295],[2359,3287],[2385,3284],[2368,3300],[2393,3315],[2388,3339],[2401,3357],[2414,3352],[2410,3342],[2422,3334],[2417,3348],[2435,3354],[2416,3357],[2420,3376],[2436,3385],[2452,3381],[2444,3384],[2447,3396],[2466,3394],[2479,3417],[2490,3400],[2499,3452],[2529,3469],[2531,3481],[2547,3497],[2554,3488],[2565,3503],[2579,3490],[2569,3465],[2591,3499],[2589,3527],[2600,3518],[2606,3498],[2604,3456],[2589,3465],[2591,3456],[2572,3442],[2583,3440],[2582,3430],[2571,3419],[2557,3420],[2570,3415],[2580,3423],[2580,3409],[2530,3373],[2587,3402],[2595,3447],[2604,3413],[2598,3436],[2609,3432],[2601,3446],[2614,3451],[2635,3442],[2644,3447],[2655,3434],[2646,3429],[2646,3411],[2632,3413],[2650,3405],[2646,3393],[2610,3389],[2619,3383],[2603,3373],[2616,3372],[2623,3384],[2646,3388],[2650,3359],[2612,3347],[2641,3355],[2643,3345],[2654,3359],[2648,3382],[2662,3381],[2654,3413],[2659,3426],[2673,3429],[2673,3417],[2685,3418],[2679,3396],[2695,3397],[2684,3405],[2693,3416],[2686,3425],[2676,3422],[2684,3439],[2669,3471],[2676,3482],[2688,3472],[2684,3453],[2711,3444],[2698,3444],[2710,3426],[2702,3424],[2716,3422],[2737,3403],[2731,3374],[2746,3381],[2744,3399],[2765,3387],[2745,3326],[2735,3313],[2715,3318],[2724,3314],[2739,3307],[2666,3259],[2658,3286],[2668,3292],[2656,3294],[2655,3312],[2642,3304],[2656,3286],[2645,3286],[2653,3278],[2644,3273],[2662,3259],[2637,3234],[2591,3240],[2555,3270],[2578,3246],[2574,3238],[2585,3239],[2596,3228],[2583,3210],[2576,3218],[2580,3208],[2545,3209],[2529,3198],[2517,3209],[2513,3182],[2491,3203],[2495,3222],[2488,3230],[2483,3213],[2491,3208],[2476,3207],[2486,3201],[2483,3187],[2471,3185],[2460,3193],[2466,3183],[2452,3158],[2426,3163],[2418,3175],[2434,3195],[2435,3211],[2424,3200],[2426,3185],[2413,3177],[2403,3190],[2405,3205],[2395,3210],[2398,3198],[2383,3205],[2384,3194],[2400,3195],[2414,3172],[2393,3157],[2362,3192],[2364,3183],[2356,3180],[2371,3170],[2364,3166],[2379,3166],[2360,3150],[2394,3153],[2398,3135],[2401,3147],[2408,3128],[2395,3126],[2386,3114],[2377,3117],[2371,3106],[2351,3105],[2343,3109],[2360,3098],[2380,3105],[2376,3090],[2355,3081],[2362,3073],[2358,3041],[2339,3025],[2334,3010],[2314,3000],[2335,3006],[2349,3032],[2359,3025],[2370,3073],[2384,3089],[2388,3072],[2411,3063],[2422,3047],[2417,3063],[2394,3072],[2384,3101],[2400,3113],[2418,3094],[2412,3108],[2423,3106],[2426,3117],[2446,3119],[2446,3141],[2466,3128],[2456,3108],[2460,3097],[2471,3117],[2487,3107],[2470,3122],[2479,3137],[2485,3127],[2499,3130],[2506,3106],[2528,3101],[2529,3109],[2515,3113],[2529,3135],[2526,3114],[2541,3130],[2558,3114],[2561,3101],[2548,3102],[2535,3087],[2555,3094],[2544,3073],[2562,3099],[2576,3101],[2585,3096],[2580,3079],[2588,3073],[2605,3065],[2615,3073],[2632,3084],[2628,3071],[2620,3067],[2600,3039],[2612,3046],[2634,3071],[2642,3082],[2646,3073],[2646,3083],[2672,3093],[2677,3106],[2670,3071],[2652,3011],[2659,2936],[2636,2937],[2629,2961],[2636,2973],[2617,2976],[2629,2992],[2618,2988],[2599,2996],[2613,2989],[2613,2967],[2604,2973],[2609,2958],[2598,2962],[2586,2962],[2583,2975],[2581,2965],[2565,2975],[2574,2963],[2537,2964],[2536,2984],[2535,2961],[2512,2973],[2501,2962],[2531,2959],[2530,2951],[2538,2957],[2553,2954],[2578,2954],[2604,2944],[2618,2953],[2610,2939],[2574,2946],[2541,2926],[2576,2938],[2618,2927],[2634,2921],[2552,2863],[2521,2805],[2498,2823],[2494,2838],[2503,2847],[2493,2842],[2455,2853],[2485,2877],[2459,2862],[2443,2871],[2449,2888],[2429,2873],[2430,2861],[2416,2880],[2421,2900],[2408,2887],[2388,2915],[2420,2868],[2412,2855],[2441,2851],[2455,2834],[2447,2809],[2421,2784],[2423,2796],[2395,2818],[2400,2827],[2387,2823],[2384,2844],[2376,2841],[2367,2847],[2371,2858],[2348,2865],[2347,2879],[2325,2871],[2326,2891],[2308,2884],[2298,2898],[2297,2888],[2283,2893],[2283,2884],[2312,2880],[2294,2859],[2316,2872],[2315,2862],[2349,2857],[2333,2848],[2360,2850],[2358,2840],[2369,2834],[2339,2821],[2309,2824],[2310,2815],[2328,2816],[2342,2814],[2340,2804],[2357,2819],[2360,2798],[2365,2818],[2379,2820],[2391,2793],[2409,2789],[2392,2771],[2392,2782],[2384,2779],[2370,2792],[2368,2783],[2356,2785],[2366,2775],[2375,2783],[2373,2774],[2389,2773],[2360,2717],[2360,2707],[2377,2698],[2356,2669],[2364,2645],[2355,2642],[2360,2633],[2339,2644],[2342,2629],[2324,2645],[2312,2639],[2310,2616],[2275,2627],[2229,2610],[2219,2563],[2234,2585],[2252,2578],[2270,2589],[2286,2553],[2266,2527],[2255,2528],[2235,2496],[2221,2505],[2230,2489],[2220,2497],[2225,2486],[2210,2479],[2185,2482],[2190,2517],[2171,2513],[2171,2500],[2162,2517],[2144,2518],[2121,2472],[2096,2474],[2076,2458],[2094,2427],[2087,2410],[2095,2408],[2104,2408],[2105,2444],[2126,2453],[2136,2471],[2152,2458],[2142,2448],[2159,2433],[2196,2452],[2216,2442],[2225,2451],[2232,2441],[2223,2420],[2217,2428],[2223,2416],[2215,2425],[2219,2412],[2210,2420],[2213,2409],[2207,2417],[2197,2397],[2170,2407],[2154,2398],[2150,2376],[2132,2372],[2132,2360],[2143,2364],[2143,2356],[2158,2373],[2176,2372],[2166,2375],[2167,2385],[2192,2374],[2202,2384],[2199,2373],[2208,2368],[2225,2380],[2228,2392],[2250,2393],[2253,2411],[2257,2423],[2246,2426],[2257,2428],[2246,2431],[2257,2438],[2248,2447],[2257,2459],[2268,2456],[2269,2469],[2276,2452],[2286,2468],[2285,2451],[2294,2450],[2295,2465],[2304,2453],[2304,2464],[2340,2491],[2352,2462],[2339,2446],[2342,2433],[2357,2470],[2345,2510],[2362,2534],[2389,2522],[2408,2524],[2409,2559],[2418,2574],[2398,2596],[2450,2560],[2456,2541],[2445,2541],[2461,2531],[2440,2529],[2437,2519],[2467,2522],[2474,2513],[2460,2501],[2437,2505],[2447,2498],[2433,2476],[2447,2493],[2439,2469],[2449,2475],[2456,2497],[2462,2489],[2477,2501],[2489,2493],[2488,2485],[2468,2477],[2473,2460],[2461,2455],[2462,2446],[2486,2477],[2507,2485],[2509,2472],[2518,2469],[2505,2458],[2514,2462],[2522,2451],[2512,2414],[2493,2409],[2505,2409],[2516,2401],[2517,2412],[2533,2405],[2519,2414],[2522,2438],[2554,2449],[2525,2453],[2527,2462],[2541,2463],[2529,2465],[2524,2475],[2542,2492],[2521,2481],[2517,2490],[2527,2501],[2492,2499],[2494,2516],[2475,2543],[2487,2578],[2466,2581],[2461,2594],[2470,2601],[2458,2602],[2471,2608],[2458,2609],[2470,2612],[2468,2625],[2455,2633],[2475,2634],[2454,2640],[2456,2652],[2468,2652],[2462,2661],[2481,2677],[2481,2671],[2499,2671],[2501,2639],[2527,2635],[2513,2645],[2511,2676],[2515,2664],[2565,2659],[2565,2614],[2563,2589],[2571,2569],[2587,2575],[2604,2570],[2572,2584],[2572,2592],[2587,2588],[2584,2594],[2594,2594],[2578,2606],[2594,2613],[2626,2608],[2630,2590],[2619,2589],[2633,2586],[2634,2572],[2642,2572],[2638,2598],[2635,2613],[2642,2605],[2618,2624],[2622,2642],[2604,2675],[2611,2691],[2626,2699],[2643,2671],[2620,2670],[2642,2663],[2624,2659],[2628,2645],[2640,2649],[2635,2637],[2645,2638],[2653,2625],[2660,2639],[2647,2655],[2655,2662],[2676,2660],[2684,2667],[2676,2657],[2698,2605],[2754,2571],[2743,2564],[2753,2537],[2723,2564],[2687,2563],[2673,2544],[2627,2520],[2633,2509],[2617,2501],[2613,2511],[2594,2512],[2615,2487],[2591,2457],[2597,2444],[2587,2421],[2599,2423],[2602,2413],[2570,2381],[2538,2365],[2525,2340],[2498,2347],[2511,2334],[2508,2322],[2495,2321],[2485,2302],[2459,2293],[2458,2281],[2468,2271],[2483,2280],[2486,2262],[2498,2265],[2487,2288],[2503,2296],[2517,2291],[2528,2304],[2551,2311],[2558,2335],[2562,2313],[2552,2307],[2548,2290],[2562,2302],[2567,2322],[2591,2296],[2574,2321],[2565,2332],[2589,2352],[2601,2338],[2593,2353],[2600,2361],[2636,2366],[2638,2355],[2646,2352],[2643,2336],[2651,2352],[2658,2343],[2653,2354],[2661,2363],[2644,2361],[2642,2371],[2651,2375],[2635,2374],[2639,2413],[2650,2416],[2631,2451],[2641,2454],[2642,2479],[2671,2475],[2702,2501],[2717,2497],[2726,2504],[2731,2491],[2721,2477],[2735,2496],[2746,2498],[2734,2473],[2764,2425],[2742,2435],[2741,2419],[2752,2418],[2756,2407],[2743,2403],[2756,2396],[2745,2389],[2756,2389],[2761,2380],[2763,2397],[2787,2379],[2794,2397],[2800,2387],[2792,2370],[2803,2363],[2795,2356],[2764,2357],[2762,2344],[2761,2363],[2753,2361],[2742,2372],[2750,2359],[2741,2357],[2715,2378],[2719,2360],[2702,2371],[2709,2361],[2695,2343],[2713,2354],[2722,2350],[2714,2327],[2722,2329],[2731,2352],[2740,2346],[2732,2334],[2750,2346],[2752,2318],[2744,2320],[2736,2307],[2723,2306],[2725,2316],[2723,2301],[2714,2290],[2710,2304],[2702,2304],[2702,2313],[2693,2318],[2685,2320],[2686,2310],[2704,2299],[2703,2289],[2683,2300],[2675,2294],[2673,2303],[2665,2298],[2653,2304],[2662,2298],[2657,2289],[2669,2293],[2668,2283],[2678,2289],[2677,2277],[2683,2285],[2694,2282],[2693,2266],[2677,2264],[2675,2254],[2653,2260],[2654,2270],[2642,2269],[2647,2259],[2635,2266],[2620,2242],[2636,2256],[2652,2253],[2629,2228],[2623,2204],[2645,2235],[2669,2245],[2658,2225],[2646,2205],[2660,2213],[2677,2198],[2668,2223],[2680,2227],[2677,2236],[2717,2275],[2695,2228],[2713,2238],[2722,2259],[2737,2242],[2740,2218],[2722,2199],[2719,2182],[2727,2191],[2730,2177],[2742,2169],[2733,2198],[2738,2208],[2744,2188],[2756,2187],[2748,2188],[2743,2208],[2755,2209],[2747,2236],[2750,2247],[2760,2245],[2743,2262],[2742,2274],[2755,2270],[2766,2291],[2770,2261],[2783,2253],[2783,2274],[2797,2272],[2797,2262],[2806,2267],[2808,2290],[2796,2294],[2795,2305],[2809,2309],[2833,2291],[2851,2258],[2836,2266],[2826,2257],[2845,2248],[2833,2244],[2833,2235],[2813,2245],[2805,2227],[2787,2242],[2773,2224],[2789,2229],[2797,2219],[2781,2202],[2798,2214],[2808,2209],[2809,2220],[2825,2230],[2834,2227],[2830,2215],[2839,2207],[2840,2218],[2849,2223],[2860,2203],[2848,2185],[2836,2195],[2819,2192],[2836,2189],[2837,2179],[2825,2164],[2824,2156],[2794,2148],[2799,2140],[2790,2130],[2813,2149],[2822,2147],[2821,2133],[2835,2159],[2877,2174],[2870,2160],[2875,2149],[2856,2150],[2846,2131],[2838,2134],[2829,2109],[2841,2122],[2848,2110],[2858,2117],[2865,2103],[2851,2093],[2860,2092],[2858,2083],[2869,2100],[2867,2110],[2876,2110],[2868,2121],[2874,2135],[2886,2133],[2895,2116],[2890,2138],[2896,2157],[2909,2148],[2932,2155],[2940,2177],[2952,2172],[2908,2089],[2923,2075],[2923,2049],[2929,2028],[2895,2023],[2885,2002],[2871,1999],[2861,2014],[2837,2011],[2832,2021],[2851,2042],[2828,2033],[2831,2049],[2828,2049],[2814,2049],[2826,2029],[2811,2019],[2795,2032],[2801,2018],[2755,2011],[2757,1995],[2749,1996],[2750,2007],[2732,2008],[2733,1998],[2704,1994],[2715,1985],[2695,1987],[2713,1981],[2753,1987],[2772,2002],[2788,1999],[2788,1988],[2792,2001],[2828,1999],[2856,1952],[2837,1954],[2828,1933],[2815,1928],[2860,1933],[2854,1971],[2863,1959],[2872,1966],[2874,1936],[2882,1933],[2892,1956],[2896,1943],[2905,1942],[2911,1961],[2954,1975],[2966,1967],[2992,1968],[3021,1984],[3036,2021],[3030,2047],[3022,2078],[2973,2093],[3007,2095],[3051,2113],[3055,2128],[3044,2153],[3043,2189],[3066,2238],[3069,2269],[3049,2299],[3073,2303],[3094,2306],[3103,2225],[3136,2196],[3135,2188],[3126,2194],[3168,2163],[3157,2149],[3163,2130],[3141,2120],[3137,2109],[3141,2083],[3120,2077],[3119,2109],[3115,2078],[3104,2078],[3115,2074],[3112,2064],[3088,2062],[3078,2047],[3083,2035],[3092,2042],[3094,2033],[3106,2038],[3122,2017],[3115,2006],[3103,2008],[3105,1998],[3132,1971],[3125,1979],[3107,1972],[3107,1956],[3093,1963],[3081,1966],[3101,1952],[3089,1939],[3101,1935],[3121,1953],[3124,1964],[3142,1956],[3131,1919],[3111,1905],[3105,1918],[3103,1908],[3086,1912],[3099,1897],[3092,1887],[3077,1887],[3093,1881],[3103,1894],[3102,1874],[3093,1869],[3105,1870],[3111,1858],[3110,1895],[3124,1899],[3131,1881],[3144,1877],[3133,1886],[3146,1889],[3133,1891],[3168,1888],[3172,1866],[3183,1858],[3187,1826],[3176,1824],[3194,1797],[3178,1774],[3162,1766],[3156,1779],[3117,1761],[3119,1775],[3097,1784],[3092,1795],[3097,1783],[3096,1772],[3082,1774],[3110,1736],[3127,1740],[3138,1756],[3159,1740],[3187,1737],[3203,1725],[3210,1699],[3190,1698],[3192,1690],[3205,1682],[3235,1684],[3241,1675],[3262,1675],[3272,1637],[3286,1633],[3260,1692],[3238,1703],[3239,1732],[3231,1767],[3217,1783],[3258,1823],[3270,1815],[3249,1859],[3209,1900],[3211,1916],[3183,1980],[3196,1975],[3194,1987],[3203,1997],[3195,1995],[3175,2017],[3194,2030],[3207,2029],[3194,2046],[3179,2049],[3186,2075],[3215,2074],[3232,2105],[3250,2117],[3273,2089],[3330,2061],[3341,2049],[3370,2001],[3344,1990],[3321,2016],[3321,1997],[3311,1995],[3307,2006],[3305,1984],[3291,1993],[3294,1972],[3287,1985],[3266,1991],[3272,1999],[3262,1999],[3268,2009],[3258,2004],[3247,2014],[3239,1990],[3232,2003],[3235,1987],[3248,1976],[3232,1931],[3249,1880],[3283,1873],[3280,1883],[3254,1882],[3246,1919],[3237,1925],[3256,1964],[3266,1955],[3266,1968],[3288,1957],[3277,1953],[3281,1942],[3293,1948],[3316,1916],[3298,1954],[3313,1970],[3339,1952],[3324,1969],[3332,1984],[3347,1968],[3364,1980],[3375,1976],[3387,1964],[3378,1953],[3389,1962],[3399,1946],[3408,1946],[3396,1937],[3412,1943],[3429,1933],[3390,1971],[3390,2008],[3402,1974],[3451,1903],[3477,1909],[3508,1895],[3556,1852],[3573,1824],[3616,1797],[3610,1781],[3599,1780],[3601,1795],[3581,1797],[3584,1806],[3575,1800],[3573,1783],[3573,1772],[3579,1792],[3577,1762],[3585,1760],[3584,1783],[3601,1792],[3595,1778],[3608,1779],[3609,1771],[3602,1756],[3619,1769],[3630,1746],[3609,1734],[3622,1726],[3633,1673],[3625,1656],[3616,1662],[3603,1637],[3627,1651],[3604,1630],[3588,1604],[3564,1640],[3570,1625],[3553,1620],[3541,1601],[3527,1597],[3525,1569],[3523,1539],[3534,1502],[3533,1531],[3544,1544],[3542,1553],[3556,1554],[3546,1571],[3558,1578],[3555,1596],[3587,1546],[3603,1473],[3627,1443],[3625,1422],[3667,1400],[3667,1370],[3651,1351],[3682,1339],[3722,1374],[3778,1376],[3760,1362],[3748,1337],[3784,1353],[3807,1317],[3809,1292],[3822,1285],[3817,1297],[3825,1325],[3807,1354],[3832,1359],[3824,1361],[3827,1369],[3864,1376],[3877,1401],[3897,1405],[3907,1393],[3894,1372],[3903,1353],[3897,1343],[3906,1344],[3916,1320],[3943,1312],[3974,1284],[3993,1285],[4015,1251],[4016,1224],[4038,1198],[4057,1198],[4055,1187],[4073,1191],[4062,1199],[4074,1200],[4069,1208],[4070,1220],[4065,1247],[4057,1255],[4067,1262],[4057,1256],[4042,1296],[4022,1317],[4034,1330],[4024,1334],[4005,1320],[4005,1344],[4009,1369],[4025,1379],[4012,1378],[4004,1394],[4028,1418],[4017,1429],[3987,1431],[3971,1442],[3972,1476],[3957,1504],[3952,1553],[3942,1580],[3928,1593],[3932,1638],[3923,1673],[3881,1719],[3880,1735],[3894,1743],[3926,1726],[3923,1713],[3952,1698],[3956,1664],[3976,1664],[3979,1651],[4000,1650],[4003,1622],[4022,1623],[4023,1611],[4040,1604],[4036,1592],[4062,1588],[4062,1573],[4087,1555],[4095,1555],[4111,1553],[4115,1537],[4127,1533],[4121,1502],[4104,1505],[4096,1492],[4112,1499],[4112,1478],[4140,1496],[4160,1481],[4200,1507],[4224,1474],[4224,1532],[4190,1541],[4159,1541],[4133,1596],[4137,1606],[4178,1607],[4218,1604],[4224,1600],[4224,1660],[4208,1675],[4211,1663],[4203,1664],[4222,1658],[4194,1643],[4175,1662],[4175,1679],[4156,1678],[4161,1687],[4140,1688],[4138,1680],[4148,1682],[4128,1651],[4097,1650],[4070,1649],[4043,1687],[4056,1707],[4095,1718],[4082,1720],[4076,1739],[4078,1727],[4057,1724],[4052,1713],[4030,1710],[4030,1698],[4011,1694],[3982,1748],[3976,1783],[3959,1802],[3925,1812],[3906,1845],[3899,1878],[3908,1864],[3920,1880],[3920,1871],[3945,1880],[3949,1887],[3935,1887],[3939,1900],[3911,1900],[3906,1910],[3908,1885],[3893,1900],[3894,1887],[3884,1881],[3807,1927],[3795,1949],[3802,1978],[3593,2033],[3585,2049],[3571,2080],[3524,2110],[3517,2123],[3516,2140],[3532,2163],[3529,2177],[3536,2167],[3561,2172],[3575,2164],[3577,2174],[3549,2180],[3565,2191],[3571,2211],[3624,2208],[3642,2181],[3633,2209],[3658,2215],[3666,2233],[3650,2240],[3649,2226],[3620,2230],[3610,2225],[3611,2215],[3582,2225],[3572,2218],[3556,2222],[3544,2213],[3550,2197],[3538,2180],[3515,2183],[3492,2211],[3514,2208],[3529,2215],[3538,2235],[3573,2263],[3551,2256],[3551,2247],[3508,2218],[3497,2225],[3499,2240],[3489,2242],[3495,2251],[3478,2222],[3482,2204],[3496,2201],[3492,2177],[3473,2183],[3469,2173],[3449,2171],[3416,2188],[3408,2213],[3373,2236],[3372,2260],[3392,2266],[3397,2277],[3395,2310],[3412,2312],[3424,2326],[3422,2345],[3461,2323],[3458,2334],[3435,2347],[3420,2377],[3423,2387],[3439,2383],[3453,2390],[3454,2406],[3446,2397],[3429,2391],[3416,2421],[3429,2428],[3404,2425],[3421,2404],[3412,2398],[3409,2362],[3424,2364],[3386,2337],[3358,2377],[3330,2383],[3327,2413],[3317,2430],[3319,2451],[3328,2475],[3341,2479],[3353,2469],[3345,2477],[3350,2495],[3358,2493],[3369,2510],[3390,2502],[3389,2510],[3411,2510],[3370,2515],[3382,2540],[3391,2541],[3380,2550],[3356,2506],[3334,2492],[3318,2495],[3324,2515],[3318,2503],[3310,2498],[3315,2488],[3299,2467],[3305,2435],[3296,2430],[3299,2420],[3289,2427],[3269,2463],[3277,2460],[3282,2481],[3268,2466],[3259,2491],[3248,2537],[3260,2547],[3251,2543],[3247,2555],[3245,2543],[3231,2579],[3214,2595],[3197,2630],[3206,2627],[3203,2639],[3177,2701],[3135,2759],[3116,2805],[3104,2876],[3111,2884],[3138,2885],[3148,2820],[3144,2798],[3154,2834],[3141,2892],[3154,2875],[3169,2870],[3157,2851],[3165,2826],[3177,2824],[3170,2813],[3178,2799],[3202,2789],[3213,2794],[3189,2797],[3178,2816],[3193,2826],[3175,2830],[3171,2848],[3186,2880],[3193,2859],[3205,2853],[3193,2869],[3203,2878],[3201,2904],[3188,2906],[3175,2883],[3165,2900],[3154,2884],[3150,2905],[3183,2933],[3193,2924],[3216,2933],[3202,2943],[3200,2962],[3207,2972],[3205,2988],[3223,3007],[3194,2987],[3195,2998],[3229,3061],[3243,3129],[3240,3182],[3258,3195],[3250,3204],[3241,3199],[3247,3212],[3215,3281],[3073,3283],[3071,3283],[3032,3283],[3004,3303],[2976,3371],[2979,3405],[2970,3445],[2943,3481],[2943,3494],[2922,3493],[2951,3507],[2939,3508],[2932,3528],[2947,3520],[2931,3530],[2940,3549],[2920,3528],[2880,3594],[2860,3665],[2858,3698],[2867,3707],[2847,3750],[2857,3750],[2848,3751],[2853,3863],[2876,3855],[2854,3866],[2849,3917],[2820,3998],[2821,4035],[2842,4044],[2856,3991],[2890,3967],[2918,3973],[2908,3941],[2912,3906],[2919,3946],[2924,3926],[2930,3937],[2923,3962],[2932,3957],[2923,3972],[2951,3940],[2928,3836],[2933,3820],[2922,3857],[2923,3835],[2907,3828],[2904,3812],[2922,3826],[2936,3790],[2926,3778],[2918,3784],[2914,3758],[2900,3761],[2915,3749],[2907,3715],[2914,3700],[2922,3762],[2935,3749],[2929,3727],[2956,3736],[2955,3712],[2969,3763],[2988,3763],[2992,3722],[2979,3716],[2979,3701],[2998,3681],[2975,3653],[2959,3649],[2946,3662],[2958,3641],[2953,3631],[2933,3642],[2929,3631],[2939,3625],[2934,3609],[2945,3617],[2918,3606],[2932,3599],[2923,3593],[2938,3593],[2941,3601],[2952,3594],[2955,3613],[2963,3616],[2954,3620],[2969,3621],[2980,3627],[2979,3638],[2985,3630],[3000,3642],[3000,3622],[2983,3621],[2994,3612],[2975,3584],[2985,3592],[2984,3572],[2995,3591],[3002,3551],[2993,3527],[3007,3553],[3006,3601],[3016,3595],[3040,3577],[3017,3529],[3032,3527],[3036,3554],[3058,3554],[3047,3564],[3045,3587],[3036,3598],[3019,3614],[3026,3645],[3036,3653],[3034,3663],[3025,3658],[3027,3687],[3019,3682],[3007,3691],[3014,3715],[3033,3724],[3043,3800],[3059,3796],[3041,3737],[3057,3689],[3051,3680],[3059,3680],[3067,3675],[3061,3654],[3073,3642],[3073,3663],[3077,3637],[3073,3628],[3065,3625],[3064,3605],[3073,3622],[3081,3621],[3085,3612],[3090,3571],[3093,3607],[3075,3651],[3079,3671],[3102,3651],[3086,3674],[3097,3669],[3123,3640],[3124,3651],[3138,3647],[3125,3661],[3152,3732],[3161,3721],[3169,3736],[3171,3723],[3188,3727],[3186,3706],[3159,3700],[3148,3665],[3161,3677],[3165,3664],[3176,3660],[3173,3649],[3181,3644],[3170,3634],[3181,3632],[3181,3622],[3172,3625],[3176,3598],[3161,3609],[3148,3604],[3144,3623],[3132,3611],[3109,3614],[3120,3605],[3113,3574],[3121,3580],[3125,3606],[3141,3601],[3139,3592],[3158,3598],[3153,3573],[3143,3572],[3139,3563],[3158,3566],[3161,3576],[3175,3567],[3183,3546],[3194,3557],[3190,3545],[3179,3542],[3190,3543],[3191,3533],[3177,3532],[3191,3531],[3191,3513],[3204,3506],[3211,3538],[3206,3526],[3197,3546],[3205,3561],[3217,3558],[3224,3568],[3212,3573],[3222,3576],[3230,3566],[3250,3562],[3251,3576],[3260,3569],[3265,3578],[3264,3589],[3255,3590],[3259,3600],[3270,3601],[3274,3592],[3293,3596],[3278,3596],[3269,3609],[3273,3620],[3261,3620],[3264,3611],[3248,3614],[3230,3590],[3230,3648],[3253,3651],[3258,3631],[3268,3627],[3277,3626],[3294,3644],[3302,3633],[3308,3658],[3296,3662],[3295,3683],[3318,3690],[3318,3675],[3318,3685],[3331,3685],[3318,3691],[3326,3713],[3318,3749],[3322,3774],[3320,3830],[3332,3821],[3331,3794],[3341,3772],[3340,3814],[3348,3806],[3367,3807],[3374,3794],[3368,3767],[3378,3753],[3370,3729],[3382,3741],[3388,3718],[3385,3692],[3392,3701],[3394,3688],[3396,3736],[3378,3764],[3377,3804],[3370,3816],[3341,3823],[3313,3975],[3340,4009],[3347,4053],[3375,4064],[3358,4069],[3352,4090],[3363,4085],[3363,4095],[3363,4097],[3351,4097],[3336,4132],[3339,4140],[3347,4136],[3338,4143],[3333,4172],[3343,4187],[3350,4178],[3342,4153],[3358,4157],[3364,4144],[3376,4143],[3370,4133],[3382,4134],[3382,4126],[3397,4133],[3412,4121],[3411,4107],[3426,4095],[3447,4079],[3434,4095],[3422,4108],[3430,4116],[3415,4123],[3432,4132],[3381,4147],[3388,4166],[3375,4160],[3354,4196],[3357,4209],[3374,4204],[3370,4224],[3394,4224],[3407,4205],[3415,4210],[3423,4197],[3440,4196],[3436,4184],[3446,4195],[3462,4189],[3471,4195],[3431,4202],[3426,4213],[3407,4224],[3492,4224],[3492,4214],[3504,4219],[3519,4197],[3519,4205],[3534,4208],[3540,4194],[3554,4190],[3555,4177],[3543,4181],[3542,4146],[3532,4145],[3547,4138],[3541,4097],[3542,4085],[3529,4075],[3539,4068],[3538,4079],[3546,4082],[3571,4062],[3595,4025],[3604,4025],[3622,3995],[3611,4014],[3613,4022],[3593,4031],[3578,4058],[3585,4067],[3577,4064],[3550,4085],[3555,4097],[3563,4098],[3556,4120],[3574,4111],[3556,4126],[3558,4139],[3550,4148],[3563,4173],[3586,4157],[3586,4140],[3593,4151],[3603,4135],[3609,4145],[3635,4134],[3588,4160],[3565,4189],[3570,4199],[3645,4193],[3605,4203],[3608,4214],[3591,4201],[3586,4215],[3573,4206],[3563,4209],[3563,4201],[3553,4204],[3540,4221],[3546,4224],[3275,4224],[3266,4212],[3279,4218],[3289,4199],[3274,4194],[3279,4180],[3261,4189],[3271,4177],[3266,4168],[3263,4158],[3287,4177],[3299,4162],[3252,4108],[3248,4128],[3238,4106],[3246,4101],[3220,4105],[3228,4123],[3206,4134],[3212,4120],[3194,4119],[3201,4110],[3191,4095],[3179,4089],[3186,4069],[3171,4059],[3165,4072],[3161,4085],[3159,4075],[3149,4081],[3145,4068],[3157,4065],[3148,4061],[3167,4049],[3164,4029],[3156,4017],[3151,4027],[3152,4035],[3137,4038],[3137,4057],[3132,4040],[3124,4037],[3136,4030],[3128,4014],[3140,4016],[3140,3987],[3180,3967],[3175,3949],[3100,4026],[3096,4037],[3108,4063],[3091,4065],[3079,4085],[3071,4081],[3056,4084],[3047,4074],[3033,4097],[3018,4123],[3013,4192],[2988,4224],[3027,4224],[3044,4223],[3040,4206],[3046,4219],[3051,4224],[3074,4224],[3074,4216],[3076,4224],[3116,4224],[3111,4198],[3098,4192],[3094,4178],[3075,4180],[3069,4127],[3080,4145],[3084,4173],[3089,4165],[3100,4169],[3124,4202],[3132,4190],[3125,4181],[3134,4185],[3139,4173],[3127,4143],[3138,4148],[3157,4136],[3154,4122],[3144,4124],[3155,4117],[3153,4109],[3166,4134],[3140,4155],[3146,4172],[3131,4214],[3133,4224],[3161,4224],[3164,4180],[3176,4203],[3203,4177],[3199,4162],[3213,4155],[3207,4166],[3216,4186],[3208,4187],[3205,4199],[3189,4197],[3188,4215],[3170,4221],[3169,4224],[4224,4224],[4224,4224],[4224,-128],[4224,-128],[4224,4224],[2293,4224]], 3 | [[2681,3125],[2665,3123],[2657,3113],[2655,3124],[2640,3119],[2663,3099],[2642,3105],[2640,3089],[2618,3108],[2622,3138],[2622,3153],[2653,3192],[2652,3210],[2685,3144],[2681,3125],[2681,3125]], 4 | [[3189,3788],[3205,3783],[3206,3763],[3193,3756],[3189,3788],[3189,3788]], 5 | [[2264,3287],[2274,3283],[2269,3270],[2264,3287],[2264,3287]], 6 | [[2436,3801],[2448,3809],[2446,3798],[2462,3796],[2473,3772],[2449,3781],[2436,3801],[2436,3801]], 7 | [[3142,2365],[3155,2362],[3162,2350],[3157,2333],[3137,2341],[3122,2401],[3142,2382],[3142,2365],[3142,2365]], 8 | [[2761,2561],[2769,2563],[2780,2549],[2761,2561],[2761,2561]], 9 | [[2923,2209],[2910,2200],[2893,2208],[2898,2222],[2888,2211],[2896,2176],[2880,2194],[2862,2195],[2864,2218],[2876,2232],[2865,2227],[2886,2247],[2879,2258],[2884,2266],[2892,2260],[2894,2239],[2912,2246],[2917,2236],[2916,2251],[2907,2248],[2924,2290],[2934,2286],[2922,2272],[2928,2254],[2955,2248],[2946,2241],[2942,2214],[2923,2209],[2923,2209]], 10 | [[2823,2539],[2896,2498],[2911,2465],[2876,2449],[2805,2496],[2788,2496],[2792,2523],[2823,2539],[2823,2539]], 11 | [[3675,1790],[3740,1742],[3708,1651],[3683,1646],[3674,1634],[3638,1646],[3652,1647],[3661,1664],[3670,1660],[3649,1717],[3641,1722],[3647,1736],[3635,1756],[3653,1759],[3655,1741],[3666,1743],[3674,1731],[3662,1730],[3661,1711],[3670,1711],[3674,1691],[3678,1695],[3678,1649],[3688,1650],[3692,1665],[3684,1671],[3686,1698],[3696,1689],[3696,1708],[3707,1709],[3696,1719],[3707,1731],[3719,1729],[3702,1729],[3696,1741],[3688,1759],[3676,1769],[3675,1790],[3675,1790]] 12 | ] 13 | -------------------------------------------------------------------------------- /test/fixtures/water2.json: -------------------------------------------------------------------------------- 1 | [ 2 | [[-128,-128],[-128,-128],[-128,-128],[-128,1998],[-119,1978],[-127,2036],[-128,2037],[-128,2050],[-107,2044],[-77,2056],[-61,2076],[-57,2112],[-59,2198],[-49,2208],[-29,2196],[-21,2178],[33,2132],[23,2018],[69,1948],[75,1932],[65,1912],[13,1888],[-13,1862],[-29,1834],[-67,1832],[-107,1816],[-128,1817],[-128,962],[-128,962],[-128,1583],[-121,1578],[-93,1578],[-55,1586],[-23,1598],[37,1598],[169,1466],[45,1606],[65,1672],[91,1692],[83,1864],[101,1886],[139,1872],[175,1810],[177,1786],[185,1808],[163,1846],[153,1876],[185,1882],[219,1874],[269,1846],[293,1842],[317,1846],[329,1866],[361,1888],[395,1908],[415,1910],[431,1886],[441,1864],[465,1842],[491,1828],[519,1800],[537,1758],[547,1698],[549,1626],[579,1580],[595,1528],[593,1470],[585,1428],[555,1356],[509,1302],[481,1262],[441,1236],[419,1232],[393,1248],[375,1228],[397,1238],[417,1222],[441,1224],[491,1264],[501,1230],[501,1206],[511,1236],[497,1272],[531,1312],[571,1350],[583,1382],[603,1422],[651,1386],[661,1352],[655,1390],[633,1414],[607,1430],[615,1476],[615,1590],[657,1568],[703,1522],[667,1570],[637,1596],[667,1590],[693,1612],[663,1600],[641,1604],[621,1616],[607,1736],[629,1718],[653,1710],[671,1710],[703,1726],[737,1726],[699,1734],[677,1722],[657,1718],[637,1722],[619,1738],[603,1766],[585,1828],[571,1854],[555,1874],[513,1880],[483,1876],[465,1888],[443,1888],[433,1914],[431,1926],[437,1946],[461,1942],[483,1918],[481,1934],[459,1954],[485,1960],[509,1960],[539,1968],[569,1970],[597,1980],[617,1980],[643,1976],[667,1958],[719,1900],[699,1934],[671,1972],[743,1978],[765,1984],[735,1988],[697,1982],[661,1990],[645,1998],[665,2042],[695,2098],[705,2140],[719,2162],[757,2190],[853,2186],[865,2214],[881,2242],[915,2252],[925,2264],[925,2286],[917,2316],[907,2376],[941,2382],[903,2392],[895,2444],[883,2470],[877,2566],[871,2596],[947,2648],[1011,2686],[1017,2706],[1029,2708],[1041,2700],[1099,2724],[1167,2768],[1427,2832],[1447,2826],[1467,2810],[1481,2792],[1487,2766],[1489,2742],[1480,2705],[1466,2683],[1429,2654],[1270,2561],[1243,2565],[1260,2552],[1209,2524],[1190,2506],[1187,2482],[1195,2431],[1215,2397],[1222,2368],[1210,2357],[1174,2343],[1126,2305],[1114,2281],[1099,2136],[1135,2096],[1174,2060],[1179,2040],[1173,2020],[1175,2008],[1170,1976],[1136,1924],[1121,1897],[1129,1863],[1157,1815],[1175,1800],[1205,1791],[1227,1771],[1243,1737],[1236,1776],[1218,1800],[1198,1805],[1178,1818],[1160,1839],[1140,1887],[1147,1915],[1170,1942],[1191,1948],[1211,1962],[1259,1977],[1301,2020],[1369,2046],[1385,2048],[1379,2063],[1409,2125],[1425,2141],[1444,2188],[1459,2197],[1549,2188],[1579,2180],[1592,2165],[1601,2136],[1595,2110],[1579,2086],[1556,2073],[1529,2070],[1485,2071],[1444,2053],[1423,2036],[1453,2042],[1483,2056],[1511,2058],[1529,2055],[1560,2061],[1597,2085],[1636,2120],[1653,2115],[1681,2098],[1693,2072],[1696,2048],[1696,2016],[1713,2003],[1702,1986],[1705,1966],[1675,1931],[1659,1920],[1626,1915],[1571,1885],[1554,1857],[1573,1877],[1627,1907],[1665,1912],[1686,1925],[1711,1953],[1739,1963],[1731,1945],[1707,1909],[1661,1846],[1631,1839],[1575,1842],[1602,1839],[1618,1827],[1642,1824],[1671,1834],[1703,1862],[1755,1893],[1774,1896],[1798,1891],[1823,1878],[1843,1862],[1857,1814],[1835,1738],[1871,1804],[1890,1811],[1903,1824],[1911,1841],[1937,1864],[1974,1888],[2001,1894],[2026,1906],[2047,1921],[2062,1952],[2076,2007],[2092,1995],[2091,1910],[2081,1879],[2085,1853],[2127,1818],[2134,1801],[2127,1787],[2102,1764],[2099,1746],[2103,1728],[1649,1232],[1587,1151],[1616,1180],[1651,1226],[2110,1719],[2122,1720],[2153,1755],[2175,1772],[2202,1775],[2214,1750],[2218,1728],[2205,1715],[2186,1704],[2179,1689],[2186,1674],[2203,1672],[2236,1679],[2247,1666],[2251,1648],[2231,1615],[2226,1573],[2218,1565],[2200,1574],[2178,1572],[2166,1561],[2165,1549],[2179,1538],[2198,1513],[2192,1477],[2166,1483],[2141,1480],[2121,1442],[2116,1427],[2100,1420],[2077,1420],[2059,1409],[2061,1378],[2079,1319],[2095,1305],[2117,1303],[2135,1314],[2147,1330],[2171,1325],[2183,1312],[2183,1290],[2163,1260],[2143,1238],[2107,1221],[2101,1206],[2104,1191],[2122,1176],[2143,1160],[2151,1143],[2147,1126],[2135,1114],[2115,1111],[2095,1101],[2084,1086],[2087,1067],[2111,1023],[2109,1010],[2095,1002],[2081,984],[2081,962],[2095,945],[2115,937],[2137,939],[2157,929],[2161,889],[2153,869],[2127,869],[2101,859],[2091,829],[2093,801],[2121,783],[2151,783],[2167,799],[2189,791],[2197,771],[2191,741],[2199,729],[2231,713],[2237,699],[2209,681],[2191,659],[2189,635],[2207,591],[2233,553],[2231,519],[2239,495],[2255,483],[2271,443],[2299,437],[2341,439],[2371,421],[2419,399],[2443,397],[2457,405],[2483,393],[2515,371],[2545,361],[2597,359],[2631,321],[2665,317],[2705,319],[2679,327],[2678,327],[2645,327],[2636,332],[2615,361],[2591,371],[2541,373],[2507,389],[2469,415],[2453,415],[2429,405],[2401,415],[2363,445],[2337,457],[2303,453],[2283,457],[2271,477],[2247,507],[2239,531],[2245,555],[2213,605],[2201,641],[2201,655],[2247,687],[2257,707],[2217,733],[2203,747],[2209,775],[2197,801],[2171,811],[2153,805],[2141,797],[2117,801],[2103,819],[2107,839],[2129,851],[2165,857],[2177,873],[2175,897],[2167,923],[2153,949],[2107,957],[2095,969],[2097,985],[2121,1003],[2135,1021],[2127,1041],[2105,1065],[2107,1075],[2121,1089],[2145,1103],[2163,1125],[2167,1143],[2157,1163],[2125,1191],[2119,1203],[2135,1221],[2161,1233],[2199,1287],[2201,1299],[2195,1323],[2175,1339],[2147,1341],[2129,1337],[2125,1319],[2113,1317],[2095,1335],[2087,1353],[2077,1397],[2079,1411],[2117,1407],[2135,1415],[2149,1457],[2165,1467],[2415,1383],[2205,1467],[2213,1487],[2211,1523],[2201,1545],[2183,1557],[2223,1553],[2233,1563],[2243,1579],[2241,1597],[2255,1617],[2273,1625],[2477,1599],[2263,1639],[2261,1671],[2251,1687],[2237,1697],[2223,1701],[2199,1695],[2227,1713],[2237,1733],[2233,1761],[2219,1781],[2207,1791],[2225,1811],[2245,1827],[2281,1839],[2315,1839],[2377,1855],[2313,1849],[2277,1853],[2251,1843],[2223,1825],[2207,1807],[2193,1799],[2173,1797],[2159,1799],[2153,1821],[2141,1839],[2115,1853],[2105,1871],[2113,2025],[2117,2057],[2113,2077],[2101,2097],[2095,2119],[2101,2135],[2121,2151],[2133,2169],[2127,2193],[2129,2211],[2145,2221],[2167,2215],[2195,2199],[2219,2191],[2265,2189],[2293,2169],[2317,2143],[2355,2137],[2377,2141],[2427,1971],[2387,2147],[2401,2165],[2535,2167],[2405,2179],[2421,2205],[2441,2227],[2445,2255],[2427,2287],[2391,2325],[2365,2357],[2361,2381],[2349,2397],[2327,2419],[2291,2413],[2263,2453],[2229,2473],[2251,2491],[2265,2555],[2263,2583],[2253,2613],[2285,2623],[2331,2645],[2319,2617],[2319,2583],[2335,2565],[2359,2565],[2389,2603],[2401,2627],[2447,2639],[2475,2631],[2493,2619],[2515,2615],[2561,2633],[2603,2635],[2636,2627],[2661,2571],[2687,2569],[2678,2561],[2655,2537],[2636,2546],[2621,2553],[2581,2555],[2549,2539],[2523,2509],[2571,2537],[2611,2545],[2636,2533],[2653,2525],[2637,2503],[2701,2565],[2737,2561],[2679,2583],[2669,2599],[2667,2619],[2659,2637],[2673,2651],[2677,2679],[2665,2697],[2641,2719],[2609,2733],[2601,2759],[2599,2787],[2633,2785],[2671,2787],[2701,2725],[2725,2715],[2779,2717],[2725,2723],[2705,2739],[2689,2771],[2683,2791],[2693,2793],[2737,2831],[2687,2797],[2678,2795],[2667,2793],[2599,2797],[2589,2819],[2575,2839],[2581,2881],[2607,2901],[2611,2927],[2623,2951],[2636,2968],[2647,2997],[2649,3019],[2671,3031],[2687,3029],[2733,3053],[2747,3067],[2753,3089],[2741,3117],[2709,3139],[2757,3151],[2791,3129],[2837,3093],[2865,3063],[2877,3041],[2871,3019],[2823,2963],[2885,3017],[2909,2993],[2951,2975],[2909,3007],[2887,3027],[2885,3053],[2867,3081],[2833,3109],[2805,3139],[2817,3153],[2973,3125],[2983,3135],[2995,3157],[2971,3135],[2939,3135],[2809,3165],[2795,3177],[2801,3191],[2795,3207],[2783,3221],[2785,3239],[2801,3251],[2823,3253],[2847,3239],[2879,3245],[2901,3257],[2921,3273],[2931,3303],[2947,3277],[2967,3273],[3013,3297],[3027,3315],[3179,3419],[3227,3457],[3257,3455],[3275,3441],[3265,3417],[3283,3351],[3277,3327],[3293,3293],[3119,3119],[3297,3283],[3305,3303],[3295,3323],[3309,3333],[3327,3321],[3331,3293],[3383,3241],[3387,3211],[3351,3187],[3321,3153],[3289,3091],[3279,3051],[3263,3047],[3217,3077],[3179,3083],[3147,3067],[3199,3071],[3235,3055],[3261,3039],[3217,2997],[3115,2953],[3169,2955],[3219,2977],[3261,3019],[3289,3039],[3303,3081],[3313,3121],[3351,3171],[3395,3195],[3415,3153],[3433,3131],[3435,3055],[3403,3049],[3373,3033],[3303,2931],[3281,2915],[3213,2909],[3287,2907],[3311,2925],[3381,3027],[3417,3043],[3443,3045],[3449,3061],[3443,3123],[3475,3115],[3493,3091],[3485,3113],[3521,3107],[3545,3085],[3577,2981],[3567,2961],[3519,2943],[3515,2933],[3491,2937],[3447,2913],[3363,2899],[3449,2901],[3497,2923],[3527,2921],[3533,2895],[3557,2881],[3585,2875],[3635,2839],[3615,2817],[3589,2797],[3603,2777],[3609,2743],[3591,2723],[3587,2709],[3453,2701],[3435,2695],[3411,2719],[3179,2655],[3409,2707],[3439,2685],[3467,2691],[3585,2695],[3607,2639],[3597,2605],[3609,2567],[3601,2557],[3539,2551],[3531,2531],[3551,2515],[3593,2505],[3629,2463],[3617,2419],[3605,2389],[3583,2365],[3581,2341],[3553,2347],[3477,2343],[3465,2315],[3479,2289],[3473,2265],[3453,2283],[3431,2289],[3407,2285],[3381,2267],[3377,2245],[3405,2213],[3397,2195],[3361,2197],[3337,2209],[3313,2213],[3305,2235],[3319,2261],[3321,2287],[3305,2335],[3311,2287],[3305,2259],[3289,2235],[3301,2215],[3321,2199],[3347,2195],[3371,2181],[3395,2187],[3407,2139],[3391,2121],[3379,2083],[3375,2019],[3367,1959],[3373,1913],[3371,1893],[3313,1855],[3299,1829],[3305,1797],[3305,1781],[3289,1769],[3243,1759],[3209,1737],[3183,1699],[3155,1687],[3141,1673],[3151,1627],[3151,1603],[3189,1555],[3201,1533],[3181,1483],[3189,1465],[3225,1463],[3239,1441],[3269,1439],[3287,1421],[3307,1411],[3329,1417],[3349,1403],[3355,1373],[3385,1341],[3389,1313],[3377,1269],[3387,1253],[3399,1211],[3409,1197],[3403,1183],[3407,1169],[3439,1145],[3445,1101],[3439,1063],[3455,1047],[3459,1025],[3471,1007],[3483,981],[3505,961],[3569,935],[3639,895],[3569,945],[3509,971],[3489,985],[3479,1007],[3463,1031],[3465,1049],[3449,1065],[3453,1101],[3449,1143],[3431,1165],[3411,1179],[3423,1197],[3411,1211],[3389,1273],[3395,1317],[3393,1339],[3373,1371],[3363,1379],[3359,1405],[3337,1427],[3305,1425],[3277,1441],[3259,1459],[3243,1455],[3227,1475],[3197,1481],[3209,1511],[3213,1541],[3173,1595],[3161,1623],[3157,1657],[3165,1671],[3197,1689],[3221,1729],[3263,1751],[3291,1751],[3319,1767],[3325,1795],[3319,1817],[3331,1847],[3363,1865],[3383,1883],[3395,1909],[3387,1985],[3397,2027],[3399,2071],[3415,2097],[3423,2117],[3423,2141],[3415,2185],[3429,2211],[3473,2235],[3497,2257],[3501,2287],[3489,2309],[3495,2325],[3531,2331],[3565,2321],[3593,2327],[3605,2353],[3603,2367],[3631,2387],[3729,2143],[3771,2119],[3735,2149],[3635,2407],[3649,2459],[3737,2519],[3733,2477],[3747,2447],[3811,2361],[3749,2461],[3739,2487],[3745,2531],[3741,2557],[3729,2583],[3699,2625],[3695,2649],[3707,2671],[3753,2731],[3791,2773],[3805,2811],[3823,2847],[3855,2803],[3853,2771],[3837,2759],[3829,2737],[3797,2695],[3785,2689],[3801,2653],[3831,2651],[3835,2623],[3851,2621],[3857,2593],[3867,2569],[3865,2547],[3879,2529],[3873,2553],[3875,2577],[3861,2625],[3845,2633],[3841,2659],[3807,2661],[3799,2681],[3843,2737],[3847,2753],[3865,2765],[3865,2807],[3837,2847],[3845,2865],[3869,2899],[3889,2945],[3911,3021],[3951,3069],[3959,3097],[3955,3129],[3975,3143],[4017,3147],[4051,3169],[4075,3188],[4087,3197],[4117,3198],[4145,3199],[4177,3223],[4215,3245],[4213,3279],[4199,3331],[4224,3350],[4224,3661],[4117,3663],[4081,3664],[3963,3670],[3937,3690],[3941,3736],[3949,3798],[3965,3816],[3987,3852],[4045,3858],[4075,3832],[4089,3820],[4155,3788],[4215,3782],[4224,3785],[4224,4062],[4195,4066],[4179,4088],[4189,4112],[4224,4129],[4224,4145],[4177,4122],[4101,4200],[4082,4224],[4224,4224],[4224,4224],[-128,4224],[-128,-128]], 3 | [[4117,4162],[4161,4115],[4165,4091],[4177,4067],[4203,4053],[4224,4047],[4224,3801],[4181,3801],[4157,3801],[4127,3819],[4081,3857],[4041,3877],[3997,3875],[3969,3851],[3941,3831],[3933,3769],[3911,3717],[3925,3665],[3929,3639],[3879,3619],[3849,3581],[3823,3601],[3815,3629],[3829,3669],[3861,3699],[3883,3737],[3883,3775],[3881,3827],[3867,3869],[3839,3907],[3787,3959],[3783,3989],[3801,4005],[3797,4027],[3799,4061],[3813,4093],[3805,4141],[3795,4191],[3789,4221],[3801,4224],[3907,4224],[4033,4217],[4049,4224],[4059,4224],[4117,4162],[4117,4162]], 4 | [[3857,2915],[3833,2925],[3817,2921],[3807,2913],[3773,2913],[3761,2927],[3765,2957],[3757,2979],[3773,2991],[3791,2995],[3789,3013],[3817,3017],[3835,3027],[3839,3039],[3827,3047],[3817,3055],[3811,3077],[3789,3085],[3765,3079],[3739,3093],[3711,3107],[3705,3115],[3707,3135],[3689,3161],[3705,3167],[3695,3197],[3705,3205],[3723,3211],[3723,3231],[3751,3229],[3749,3217],[3767,3203],[3799,3167],[3793,3131],[3809,3117],[3869,3085],[3911,3057],[3891,3035],[3887,3001],[3871,2959],[3857,2915],[3857,2915]], 5 | [[3653,2641],[3665,2621],[3681,2615],[3693,2613],[3731,2567],[3737,2541],[3727,2521],[3649,2473],[3625,2503],[3599,2519],[3573,2525],[3555,2531],[3555,2543],[3603,2541],[3631,2553],[3625,2579],[3615,2607],[3625,2643],[3653,2641],[3653,2641]], 6 | [[3413,2227],[3395,2243],[3393,2261],[3413,2273],[3433,2277],[3473,2259],[3413,2227],[3413,2227]], 7 | [[1991,2570],[2223,2614],[2239,2600],[2247,2570],[2237,2542],[2235,2516],[2223,2504],[2207,2490],[2213,2464],[2225,2446],[2249,2440],[2255,2424],[2263,2406],[2283,2394],[2307,2388],[2333,2394],[2343,2386],[2343,2364],[2351,2340],[2373,2318],[2403,2298],[2417,2272],[2421,2256],[2411,2234],[2397,2200],[2379,2172],[2349,2158],[2333,2156],[2315,2166],[2303,2192],[2279,2208],[2241,2208],[2221,2212],[2197,2218],[2181,2228],[2159,2246],[2139,2256],[2127,2260],[2111,2266],[2127,2332],[2251,2288],[2121,2348],[2099,2358],[2081,2378],[2055,2388],[2015,2410],[1973,2430],[1951,2442],[1945,2456],[1947,2476],[1963,2484],[2095,2432],[1969,2494],[1965,2510],[1971,2524],[1983,2538],[1989,2552],[1991,2570],[1991,2570]], 8 | [[850,2552],[858,2452],[790,2436],[778,2380],[806,2416],[870,2428],[910,2276],[870,2256],[838,2204],[762,2212],[706,2164],[686,2128],[634,2016],[582,1996],[510,1976],[422,1964],[370,1928],[314,1884],[270,1884],[218,1908],[130,1924],[134,1988],[106,2028],[86,2064],[114,2108],[114,2152],[-22,2292],[-102,2272],[-128,2252],[-128,2319],[-106,2328],[-102,2364],[-10,2400],[98,2400],[234,2408],[338,2432],[450,2448],[606,2488],[734,2536],[850,2552],[850,2552]], 9 | [[-128,1781],[-118,1780],[-54,1808],[-2,1820],[30,1860],[58,1860],[74,1708],[46,1692],[18,1620],[-54,1608],[-114,1608],[-128,1615],[-128,1781]] 10 | ] 11 | -------------------------------------------------------------------------------- /test/fixtures/water3.json: -------------------------------------------------------------------------------- 1 | [ 2 | [[-128,4224],[-128,-128],[4224,-128],[4224,4224],[-128,4224]], 3 | [[3030,-21],[3019,7],[3025,21],[3045,65],[3054,114],[3041,189],[3000,219],[3017,257],[2966,338],[2938,340],[2934,541],[2973,618],[2979,752],[3026,803],[3052,938],[3083,1030],[3034,1175],[3041,1264],[3083,1311],[3088,1348],[3067,1399],[3139,1435],[3209,1412],[3220,1378],[3242,1316],[3276,1335],[3314,1367],[3369,1529],[3436,1563],[3464,1681],[3512,1732],[3521,1811],[3508,1883],[3591,1939],[3724,2088],[3828,2171],[3867,2238],[3905,2344],[3939,2443],[3892,2498],[3889,2521],[3884,2560],[3942,2624],[3986,2681],[3999,2831],[4089,3008],[4117,3130],[4104,3172],[4023,3205],[3969,3283],[3991,3347],[4091,3365],[4146,3411],[4136,3456],[4068,3467],[3999,3412],[3978,3373],[3935,3350],[3937,3401],[4001,3465],[4036,3503],[3941,3459],[3907,3533],[3939,3655],[3867,3574],[3867,3663],[3796,3614],[3773,3730],[3880,4118],[3854,4159],[3891,4224],[4084,4224],[4106,4103],[4213,4062],[4224,4060],[4224,2439],[4155,2244],[4020,2282],[3978,2233],[3976,2146],[3927,2103],[3937,2060],[3910,1930],[3933,1862],[3893,1781],[3850,1774],[3803,1712],[3824,1651],[3794,1572],[3820,1535],[3835,1493],[3920,1550],[3957,1520],[3948,1444],[3973,1459],[3982,1508],[4016,1520],[4012,1471],[4042,1426],[4068,1422],[4198,1390],[4224,1368],[4224,969],[4214,1019],[4177,1095],[4142,1070],[4176,978],[4202,843],[4213,653],[4181,656],[4181,804],[4155,796],[4138,673],[4114,600],[4050,622],[4050,573],[4100,551],[4050,379],[4015,274],[3986,208],[3972,175],[3965,158],[3953,131],[3921,99],[3885,60],[3853,29],[3807,-4],[3755,-27],[3692,-53],[3639,-58],[3595,-34],[3573,-11],[3519,-4],[3488,17],[3467,6],[3426,4],[3384,25],[3308,28],[3263,-93],[3126,-83],[3041,-46],[3030,-21],[3030,-21]], 4 | [[3832,-21],[3840,-17],[3877,21],[3895,39],[3961,-21],[3893,-98],[3855,-128],[3688,-128],[3742,-81],[3793,-41],[3832,-21],[3832,-21]], 5 | [[4205,596],[4224,572],[4224,248],[4166,163],[4119,50],[4020,36],[4004,21],[3969,21],[3936,62],[3982,117],[4088,293],[4152,419],[4185,544],[4205,596],[4205,596]], 6 | [[3228,2459],[3243,2459],[3248,2434],[3273,2429],[3218,2186],[3255,2102],[3285,2094],[3314,1972],[3198,1969],[3192,1943],[3223,1943],[3222,1913],[3177,1928],[3187,1979],[3180,2171],[3134,2187],[3212,2399],[3243,2398],[3228,2459],[3228,2459]], 7 | [[4224,1574],[4212,1572],[4175,1600],[4152,1647],[4131,1689],[4106,1736],[4101,1785],[4115,1851],[4149,1885],[4169,1920],[4204,1908],[4224,1875],[4214,1844],[4199,1798],[4215,1763],[4224,1767],[4224,1574]] 8 | ] 9 | -------------------------------------------------------------------------------- /test/fixtures/water3b.json: -------------------------------------------------------------------------------- 1 | [ 2 | [[-128,4224],[-128,-128],[4224,-128],[4224,4224],[-128,4224]], 3 | [[3832,-21],[3840,-17],[3877,21],[3895,39],[3961,-21],[3893,-98],[3855,-128],[3688,-128],[3742,-81],[3793,-41],[3832,-21],[3832,-21]], 4 | [[4205,596],[4224,572],[4224,248],[4166,163],[4119,50],[4020,36],[4004,21],[3969,21],[3936,62],[3982,117],[4088,293],[4152,419],[4185,544],[4205,596],[4205,596]] 5 | ] 6 | -------------------------------------------------------------------------------- /test/fixtures/water4.json: -------------------------------------------------------------------------------- 1 | [ 2 | [[3911,4075],[3910,4075],[3926,4114],[3950,4132],[3965,4126],[3978,4139],[3986,4131],[3979,4119],[3986,4084],[3991,4075],[4020,4020],[4027,4012],[4030,4022],[4047,4033],[4058,4030],[4067,4022],[4120,4003],[4118,3993],[4135,3995],[4130,4032],[4121,4038],[4118,4056],[4107,4050],[4095,4060],[4086,4062],[4070,4075],[4027,4111],[4042,4140],[4058,4139],[4067,4135],[4078,4138],[4067,4151],[4067,4166],[4077,4180],[4088,4191],[4047,4172],[4031,4161],[4020,4165],[4000,4147],[4013,4171],[4000,4224],[3836,4224],[3828,4224],[3071,4224],[3070,4212],[3158,4140],[3202,4158],[3171,4117],[3161,4104],[3136,4131],[3122,4117],[3105,4099],[3122,4075],[3136,4055],[3156,4075],[3178,4097],[3205,4082],[3176,4036],[3187,3979],[3105,3947],[3084,3920],[3036,3976],[2980,3982],[2993,4043],[2956,3964],[3020,3960],[3050,3921],[3032,3880],[3069,3902],[3093,3894],[3188,3961],[3236,3917],[3222,3893],[3191,3891],[3173,3863],[3187,3818],[3225,3775],[3292,3774],[3239,3798],[3197,3845],[3211,3873],[3249,3877],[3442,3801],[3567,3769],[3587,3798],[3632,3777],[3607,3820],[3644,3880],[3707,3851],[3726,3899],[3766,3951],[3770,3977],[3778,3985],[3772,4012],[3763,3998],[3745,3990],[3747,3977],[3738,3974],[3735,3985],[3725,3995],[3745,4010],[3758,4024],[3763,4048],[3772,4067],[3762,4074],[3754,4093],[3763,4094],[3779,4083],[3779,4074],[3784,4066],[3792,4060],[3794,4043],[3795,4029],[3798,4016],[3807,4006],[3799,3933],[3849,3871],[3838,3840],[3885,3818],[3913,3778],[3958,3687],[4056,3501],[4109,3301],[3956,3259],[3876,3277],[3775,3251],[3705,3225],[3659,3243],[3613,3232],[3614,3310],[3606,3266],[3552,3297],[3494,3235],[3440,3221],[3402,3190],[3344,3177],[3264,3142],[3279,3201],[3248,3256],[3229,3197],[3200,3194],[3191,3246],[3159,3244],[3125,3282],[3097,3296],[3068,3279],[3013,3393],[3002,3486],[2994,3383],[2917,3406],[2985,3359],[3073,3239],[3106,3270],[3139,3238],[3156,3166],[3156,3101],[3106,3069],[3095,3021],[3060,3025],[3100,2967],[3058,2920],[3115,2933],[3138,2891],[3168,2877],[3217,2892],[3207,2847],[3143,2821],[3192,2691],[3239,2686],[3176,2615],[3191,2615],[3191,2600],[3240,2590],[3189,2544],[3161,2570],[3112,2769],[3087,2798],[3045,2878],[3028,2890],[2992,3118],[2905,3266],[2880,3271],[2860,3342],[2820,3348],[2800,3419],[2775,3424],[2756,3495],[2731,3501],[2711,3572],[2686,3577],[2642,3729],[2612,3730],[2628,3805],[2628,3821],[2579,3968],[2554,3973],[2554,4004],[2524,4004],[2534,4029],[2479,4050],[2470,4075],[2457,4111],[2442,4117],[2419,4126],[2414,4197],[2390,4218],[2388,4224],[-128,4224],[-128,-128],[-128,-128],[4224,-128],[4224,-128],[4224,3063],[4156,3260],[4172,3284],[4147,3288],[4125,3375],[4092,3462],[4080,3524],[3983,3692],[3965,3786],[3984,3816],[3943,3891],[3973,3902],[3978,3917],[3976,3929],[3964,3953],[3957,3968],[3941,3983],[3925,4009],[3923,4024],[3924,4033],[3922,4046],[3920,4055],[3911,4075],[3911,4075]], 3 | [[3364,4097],[3383,4108],[3398,4124],[3406,4144],[3413,4155],[3426,4156],[3442,4162],[3446,4176],[3465,4185],[3488,4189],[3502,4192],[3517,4205],[3520,4224],[3549,4224],[3557,4208],[3540,4198],[3528,4191],[3523,4183],[3510,4184],[3498,4178],[3485,4184],[3479,4173],[3480,4136],[3489,4120],[3475,4116],[3460,4105],[3471,4103],[3469,4083],[3444,4074],[3444,4056],[3455,4070],[3470,4074],[3478,4083],[3488,4079],[3477,4089],[3483,4100],[3475,4107],[3483,4113],[3506,4102],[3502,4092],[3527,4107],[3513,4106],[3512,4117],[3504,4125],[3490,4136],[3487,4146],[3486,4172],[3501,4173],[3510,4178],[3523,4177],[3532,4185],[3568,4199],[3582,4198],[3600,4183],[3579,4144],[3580,4123],[3586,4114],[3586,4104],[3594,4099],[3573,4090],[3581,4103],[3578,4114],[3565,4110],[3565,4101],[3562,4092],[3542,4081],[3540,4067],[3553,4052],[3538,4041],[3529,4040],[3532,4027],[3538,4019],[3551,4018],[3565,4011],[3567,3999],[3576,3996],[3595,3992],[3588,3958],[3573,3922],[3578,3885],[3559,3878],[3553,3866],[3558,3790],[3529,3795],[3468,3809],[3395,3836],[3247,3891],[3246,3922],[3246,3948],[3274,3976],[3335,3983],[3387,3980],[3383,4036],[3387,4052],[3364,4097],[3364,4097]], 4 | [[2976,2176],[2953,2237],[2969,2285],[3011,2301],[3046,2297],[3091,2255],[3133,2276],[3155,2245],[3145,2194],[3171,2157],[3148,2085],[3109,2097],[3096,2079],[3073,2080],[3056,2136],[3008,2171],[3032,2134],[3042,2085],[3064,2068],[3067,2028],[3099,1984],[3126,1980],[3146,1951],[3158,1893],[3207,1857],[3240,1826],[3321,1842],[3238,1848],[3213,1885],[3177,1917],[3163,1968],[3138,2017],[3180,2004],[3206,1958],[3272,1951],[3346,1944],[3360,1988],[3402,2001],[3437,2053],[3460,2054],[3468,2089],[3455,2140],[3425,2187],[3486,2135],[3505,2080],[3506,2038],[3516,1985],[3559,1955],[3556,1887],[3548,1857],[3520,1881],[3482,1895],[3473,1860],[3448,1842],[3449,1791],[3480,1773],[3532,1750],[3510,1789],[3463,1808],[3475,1835],[3509,1874],[3542,1836],[3579,1847],[3579,1891],[3580,1936],[3601,1954],[3630,1924],[3699,1930],[3720,1966],[3708,1994],[3695,1943],[3629,1945],[3611,1975],[3581,1966],[3556,1993],[3548,2073],[3517,2148],[3475,2199],[3486,2254],[3456,2300],[3410,2293],[3384,2219],[3346,2189],[3270,2185],[3214,2148],[3183,2217],[3231,2271],[3301,2317],[3296,2369],[3282,2441],[3230,2488],[3242,2507],[3233,2539],[3275,2568],[3272,2646],[3301,2638],[3312,2583],[3359,2662],[3350,2602],[3374,2555],[3413,2549],[3444,2550],[3459,2526],[3481,2534],[3464,2556],[3506,2588],[3536,2535],[3555,2549],[3518,2625],[3491,2600],[3463,2623],[3451,2583],[3398,2637],[3437,2690],[3378,2678],[3354,2693],[3301,2701],[3301,2767],[3266,2712],[3235,2713],[3195,2731],[3203,2761],[3224,2792],[3291,2804],[3341,2802],[3357,2780],[3363,2753],[3388,2724],[3415,2726],[3445,2736],[3460,2779],[3516,2736],[3537,2741],[3579,2749],[3608,2715],[3645,2709],[3659,2727],[3691,2712],[3734,2691],[3745,2648],[3731,2635],[3687,2679],[3654,2685],[3633,2662],[3598,2658],[3584,2630],[3596,2597],[3594,2557],[3613,2518],[3640,2517],[3636,2486],[3658,2444],[3647,2409],[3686,2446],[3652,2488],[3651,2525],[3626,2560],[3655,2597],[3630,2629],[3667,2669],[3727,2616],[3758,2623],[3817,2628],[3823,2593],[3791,2551],[3753,2515],[3754,2484],[3775,2484],[3795,2454],[3831,2471],[3893,2485],[3927,2485],[3953,2458],[3998,2422],[4046,2383],[4022,2355],[4020,2296],[3946,2285],[3902,2357],[3920,2295],[3894,2249],[3839,2250],[3898,2235],[3927,2187],[3916,2149],[3887,2161],[3822,2135],[3883,2132],[3922,2040],[3909,2109],[3937,2104],[3949,2152],[3998,2135],[4080,2138],[4119,2083],[4101,2020],[4106,1978],[4164,1986],[4163,1952],[4203,1992],[4210,2013],[4200,2031],[4224,2021],[4224,1949],[4216,1915],[4199,1891],[4199,1876],[4183,1816],[4097,1796],[4059,1748],[4030,1713],[3989,1696],[3955,1681],[3926,1657],[3869,1646],[3824,1612],[3788,1591],[3561,1609],[3546,1624],[3515,1624],[3510,1649],[3350,1732],[3335,1732],[3274,1748],[3259,1763],[3108,1795],[3049,1887],[3015,2080],[2976,2176],[2976,2176]], 5 | [[3183,-128],[3192,-118],[3253,-36],[3313,26],[3357,31],[3406,103],[3514,134],[3541,271],[3547,344],[3664,311],[3669,216],[3565,168],[3662,150],[3655,88],[3528,39],[3581,26],[3608,-21],[3675,-87],[3637,-128],[3183,-128]], 6 | [[3205,-15],[3114,-30],[3065,-59],[3017,-29],[3047,7],[3013,118],[2971,183],[2978,281],[3026,305],[3081,298],[3107,369],[3157,360],[3191,397],[3312,393],[3350,371],[3363,294],[3419,236],[3334,298],[3306,338],[3305,290],[3261,235],[3253,140],[3254,86],[3335,51],[3273,34],[3227,26],[3199,49],[3232,96],[3223,166],[3224,247],[3242,268],[3224,281],[3202,244],[3173,266],[3187,328],[3158,328],[3136,258],[3184,231],[3177,169],[3149,144],[3133,188],[3078,155],[3058,183],[3102,221],[3074,236],[3048,198],[3011,180],[3043,144],[3111,74],[3120,37],[3098,19],[3100,-1],[3201,8],[3205,-15],[3205,-15]], 7 | [[4224,2296],[4180,2330],[4198,2362],[4203,2411],[4224,2415],[4224,2482],[4212,2474],[4198,2509],[4197,2541],[4177,2531],[4124,2533],[4101,2514],[4023,2555],[4029,2506],[4055,2468],[4029,2422],[3955,2489],[3928,2532],[3913,2515],[3857,2512],[3804,2481],[3789,2511],[3844,2590],[3830,2643],[3767,2641],[3761,2730],[3704,2728],[3675,2737],[3670,2764],[3651,2765],[3651,2741],[3626,2729],[3607,2761],[3552,2763],[3551,2781],[3513,2781],[3505,2817],[3477,2800],[3459,2831],[3422,2852],[3420,2901],[3399,2855],[3428,2807],[3428,2770],[3402,2751],[3378,2764],[3400,2817],[3363,2833],[3319,2849],[3299,2895],[3313,2925],[3283,2942],[3286,2853],[3237,2904],[3230,2941],[3254,2952],[3267,2985],[3302,3016],[3346,2995],[3379,3004],[3384,3070],[3416,3072],[3456,3069],[3459,3042],[3478,2986],[3481,3022],[3496,3023],[3512,3072],[3486,3080],[3488,3150],[3508,3174],[3535,3195],[3553,3174],[3571,3206],[3605,3179],[3639,3213],[3701,3204],[3881,3256],[3964,3239],[4113,3273],[4168,3133],[4224,2979],[4224,2296]] 8 | ] 9 | -------------------------------------------------------------------------------- /test/test.js: -------------------------------------------------------------------------------- 1 | 2 | import test from 'node:test'; 3 | import assert from 'node:assert/strict'; 4 | import earcut, {flatten, deviation} from '../src/earcut.js'; 5 | import fs from 'fs'; 6 | 7 | const expected = JSON.parse(fs.readFileSync(new URL('expected.json', import.meta.url))); 8 | 9 | test('indices-2d', () => { 10 | const indices = earcut([10, 0, 0, 50, 60, 60, 70, 10]); 11 | assert.deepEqual(indices, [1, 0, 3, 3, 2, 1]); 12 | }); 13 | 14 | test('indices-3d', () => { 15 | const indices = earcut([10, 0, 0, 0, 50, 0, 60, 60, 0, 70, 10, 0], null, 3); 16 | assert.deepEqual(indices, [1, 0, 3, 3, 2, 1]); 17 | }); 18 | 19 | test('empty', () => { 20 | assert.deepEqual(earcut([]), []); 21 | }); 22 | 23 | for (const id of Object.keys(expected.triangles)) { 24 | 25 | for (const rotation of [0, 90, 180, 270]) { 26 | test(`${id} rotation ${rotation}`, () => { 27 | const coords = JSON.parse(fs.readFileSync(new URL(`fixtures/${id}.json`, import.meta.url))); 28 | const theta = rotation * Math.PI / 180; 29 | const xx = Math.round(Math.cos(theta)); 30 | const xy = Math.round(-Math.sin(theta)); 31 | const yx = Math.round(Math.sin(theta)); 32 | const yy = Math.round(Math.cos(theta)); 33 | if (rotation) { 34 | for (const ring of coords) { 35 | for (const coord of ring) { 36 | const [x, y] = coord; 37 | coord[0] = xx * x + xy * y; 38 | coord[1] = yx * x + yy * y; 39 | } 40 | } 41 | } 42 | const data = flatten(coords), 43 | indices = earcut(data.vertices, data.holes, data.dimensions), 44 | err = deviation(data.vertices, data.holes, data.dimensions, indices), 45 | expectedTriangles = expected.triangles[id], 46 | expectedDeviation = (rotation !== 0 && expected['errors-with-rotation'][id]) || expected.errors[id] || 0; 47 | 48 | const numTriangles = indices.length / 3; 49 | if (rotation === 0) { 50 | assert.ok(numTriangles === expectedTriangles, `${numTriangles} triangles when expected ${expectedTriangles}`); 51 | } 52 | 53 | if (expectedTriangles > 0) { 54 | assert.ok(err <= expectedDeviation, `deviation ${err} <= ${expectedDeviation}`); 55 | } 56 | }); 57 | } 58 | } 59 | 60 | test('infinite-loop', () => { 61 | earcut([1, 2, 2, 2, 1, 2, 1, 1, 1, 2, 4, 1, 5, 1, 3, 2, 4, 2, 4, 1], [5], 2); 62 | }); 63 | -------------------------------------------------------------------------------- /viz/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 |