├── .gitattributes ├── .gitignore ├── LICENSE ├── README.md ├── example ├── .gitignore ├── generate.js ├── index.html ├── package.json ├── public │ └── vite.svg ├── src │ ├── App.css │ ├── App.tsx │ ├── data │ │ └── polys.json │ ├── index.css │ ├── main.tsx │ └── vite-env.d.ts ├── tsconfig.json ├── tsconfig.node.json └── vite.config.ts ├── package.json ├── packages └── polyclip-js │ ├── README.md │ ├── demo.svg │ ├── jest.config.js │ ├── package.json │ ├── size.mjs │ ├── src │ ├── Edge.ts │ ├── EdgeIterator.ts │ ├── Point.ts │ ├── Polygon.ts │ ├── Vertex.ts │ ├── VertexIterator.ts │ ├── constants.ts │ ├── index.ts │ ├── steps │ │ ├── 1_computeIntersections.ts │ │ ├── 2_labelIntersections.ts │ │ ├── 3_createResult.ts │ │ └── 4_cleanupResult.ts │ ├── types.ts │ └── utils.ts │ ├── test │ ├── data │ │ ├── Fig14-P.poly │ │ ├── Fig14-Q.poly │ │ ├── Fig14-clip-u.poly │ │ ├── Fig14-clip.poly │ │ ├── Fig15-P.poly │ │ ├── Fig15-Q.poly │ │ ├── Fig15-clip-u.poly │ │ ├── Fig15-clip.poly │ │ ├── Fig16-P.poly │ │ ├── Fig16-Q.poly │ │ ├── Fig16-clip-u.poly │ │ ├── Fig16-clip.poly │ │ ├── Fig17-P.poly │ │ ├── Fig17-Q.poly │ │ ├── Fig17-clip-u.poly │ │ ├── Fig17-clip.poly │ │ ├── Fig18-P.poly │ │ ├── Fig18-Q.poly │ │ ├── Fig18-clip.poly │ │ ├── Fig19-P.poly │ │ ├── Fig19-Q.poly │ │ ├── Fig19-clip.poly │ │ ├── Fig20-E1.poly │ │ ├── Fig20-E2.poly │ │ ├── Fig20-E3.poly │ │ ├── Fig20-E4.poly │ │ ├── Fig20-E5.poly │ │ ├── Fig20-H1.poly │ │ ├── Fig20-H2.poly │ │ ├── Fig20-M1.poly │ │ ├── Fig20-M2.poly │ │ ├── Fig20-M3.poly │ │ ├── Fig8-P.poly │ │ ├── Fig8-Q.poly │ │ ├── Fig8-clip-u.poly │ │ └── Fig8-clip.poly │ ├── helpers.ts │ └── polyclip.test.ts │ ├── tsconfig.build.json │ ├── tsconfig.json │ └── yarn.lock ├── turbo.json └── yarn.lock /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | lerna-debug.log* 8 | .pnpm-debug.log* 9 | 10 | # Diagnostic reports (https://nodejs.org/api/report.html) 11 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 12 | 13 | # Runtime data 14 | pids 15 | *.pid 16 | *.seed 17 | *.pid.lock 18 | 19 | # Directory for instrumented libs generated by jscoverage/JSCover 20 | lib-cov 21 | 22 | # Coverage directory used by tools like istanbul 23 | coverage 24 | *.lcov 25 | 26 | # nyc test coverage 27 | .nyc_output 28 | 29 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 30 | .grunt 31 | 32 | # Bower dependency directory (https://bower.io/) 33 | bower_components 34 | 35 | # node-waf configuration 36 | .lock-wscript 37 | 38 | # Compiled binary addons (https://nodejs.org/api/addons.html) 39 | build/Release 40 | 41 | # Dependency directories 42 | node_modules/ 43 | jspm_packages/ 44 | 45 | # Snowpack dependency directory (https://snowpack.dev/) 46 | web_modules/ 47 | 48 | # TypeScript cache 49 | *.tsbuildinfo 50 | 51 | # Optional npm cache directory 52 | .npm 53 | 54 | # Optional eslint cache 55 | .eslintcache 56 | 57 | # Optional stylelint cache 58 | .stylelintcache 59 | 60 | # Microbundle cache 61 | .rpt2_cache/ 62 | .rts2_cache_cjs/ 63 | .rts2_cache_es/ 64 | .rts2_cache_umd/ 65 | 66 | # Optional REPL history 67 | .node_repl_history 68 | 69 | # Output of 'npm pack' 70 | *.tgz 71 | 72 | # Yarn Integrity file 73 | .yarn-integrity 74 | 75 | # dotenv environment variable files 76 | .env 77 | .env.development.local 78 | .env.test.local 79 | .env.production.local 80 | .env.local 81 | 82 | # parcel-bundler cache (https://parceljs.org/) 83 | .cache 84 | .parcel-cache 85 | 86 | # Next.js build output 87 | .next 88 | out 89 | 90 | # Nuxt.js build / generate output 91 | .nuxt 92 | dist 93 | 94 | # Gatsby files 95 | .cache/ 96 | # Comment in the public line in if your project uses Gatsby and not Next.js 97 | # https://nextjs.org/blog/next-9-1#public-directory-support 98 | # public 99 | 100 | # vuepress build output 101 | .vuepress/dist 102 | 103 | # vuepress v2.x temp and cache directory 104 | .temp 105 | .cache 106 | 107 | # Serverless directories 108 | .serverless/ 109 | 110 | # FuseBox cache 111 | .fusebox/ 112 | 113 | # DynamoDB Local files 114 | .dynamodb/ 115 | 116 | # TernJS port file 117 | .tern-port 118 | 119 | # Stores VSCode versions used for testing VSCode extensions 120 | .vscode-test 121 | 122 | # yarn v2 123 | .yarn/cache 124 | .yarn/unplugged 125 | .yarn/build-state.yml 126 | .yarn/install-state.gz 127 | .pnp.* 128 | 129 | .turbo -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Steve Ruiz 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # polyclip-js 2 | 3 | A JavaScript implementation of the Greiner-Hormann clipping algorithm. 4 | 5 | [Click here](./packages/polyclip-js) for the `polyclip-js` readme. 6 | -------------------------------------------------------------------------------- /example/.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | pnpm-debug.log* 8 | lerna-debug.log* 9 | 10 | node_modules 11 | dist 12 | dist-ssr 13 | *.local 14 | 15 | # Editor directories and files 16 | .vscode/* 17 | !.vscode/extensions.json 18 | .idea 19 | .DS_Store 20 | *.suo 21 | *.ntvs* 22 | *.njsproj 23 | *.sln 24 | *.sw? 25 | -------------------------------------------------------------------------------- /example/generate.js: -------------------------------------------------------------------------------- 1 | import fs from 'fs' 2 | import { clipXY } from '../packages/polyclip-js/dist/index.js' 3 | 4 | const allPolygons = {} 5 | 6 | function createPolygonFromFile(name) { 7 | const data = fs.readFileSync( 8 | `../packages/polyclip-js/test/data/${name}.poly`, 9 | 'utf8' 10 | ) 11 | 12 | let result = [] 13 | 14 | data 15 | .trim() 16 | .split(';') 17 | .forEach((polygon) => { 18 | const P = [] 19 | 20 | polygon 21 | .trim() 22 | .split(',') 23 | .forEach((pair) => { 24 | const points = pair 25 | .trim() 26 | .split(' ') 27 | .map((point) => parseFloat(point)) 28 | 29 | if (Number.isFinite(points[0]) && Number.isFinite(points[1])) { 30 | P.push({ x: points[0], y: points[1] }) 31 | } 32 | }) 33 | 34 | if (P.length > 0) { 35 | result.push(P) 36 | } 37 | }) 38 | 39 | allPolygons[name] = result 40 | } 41 | 42 | // make data directory in src 43 | if (!fs.existsSync('./src/data')) { 44 | fs.mkdirSync('./src/data') 45 | } 46 | 47 | createPolygonFromFile('Fig8-P') 48 | createPolygonFromFile('Fig8-Q') 49 | createPolygonFromFile('Fig8-clip') 50 | createPolygonFromFile('Fig8-clip-u') 51 | 52 | createPolygonFromFile('Fig14-P') 53 | createPolygonFromFile('Fig14-Q') 54 | createPolygonFromFile('Fig14-clip') 55 | createPolygonFromFile('Fig14-clip-u') 56 | 57 | createPolygonFromFile('Fig15-P') 58 | createPolygonFromFile('Fig15-Q') 59 | createPolygonFromFile('Fig15-clip') 60 | createPolygonFromFile('Fig15-clip-u') 61 | 62 | createPolygonFromFile('Fig16-P') 63 | createPolygonFromFile('Fig16-Q') 64 | createPolygonFromFile('Fig16-clip') 65 | createPolygonFromFile('Fig16-clip-u') 66 | 67 | createPolygonFromFile('Fig17-P') 68 | createPolygonFromFile('Fig17-Q') 69 | createPolygonFromFile('Fig17-clip') 70 | createPolygonFromFile('Fig17-clip-u') 71 | 72 | createPolygonFromFile('Fig18-P') 73 | createPolygonFromFile('Fig18-Q') 74 | createPolygonFromFile('Fig18-clip') 75 | 76 | createPolygonFromFile('Fig19-P') 77 | createPolygonFromFile('Fig19-Q') 78 | createPolygonFromFile('Fig19-clip') 79 | 80 | createPolygonFromFile('Fig20-E1') 81 | createPolygonFromFile('Fig20-E2') 82 | createPolygonFromFile('Fig20-E3') 83 | createPolygonFromFile('Fig20-E4') 84 | createPolygonFromFile('Fig20-E5') 85 | 86 | createPolygonFromFile('Fig20-M1') 87 | createPolygonFromFile('Fig20-M2') 88 | createPolygonFromFile('Fig20-M3') 89 | 90 | // write to json file 91 | fs.writeFileSync(`./src/data/polys.json`, JSON.stringify(allPolygons, null, 2)) 92 | -------------------------------------------------------------------------------- /example/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Vite + React + TS 8 | 9 | 10 |
11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /example/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "polyclip-js-example", 3 | "author": "Steve Ruiz", 4 | "license": "MIT", 5 | "version": "0.0.1", 6 | "private": true, 7 | "type": "module", 8 | "scripts": { 9 | "dev": "vite", 10 | "build": "tsc && vite build", 11 | "preview": "vite preview" 12 | }, 13 | "dependencies": { 14 | "react": "^18.2.0", 15 | "react-dom": "^18.2.0", 16 | "polyclip-js": "*" 17 | }, 18 | "devDependencies": { 19 | "@types/react": "^18.0.26", 20 | "@types/react-dom": "^18.0.9", 21 | "@vitejs/plugin-react-swc": "^3.0.0", 22 | "typescript": "^4.9.3", 23 | "vite": "^4.0.0" 24 | } 25 | } -------------------------------------------------------------------------------- /example/public/vite.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /example/src/App.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/steveruizok/polyclip-js/1b902dfaa50d1df3ffdbdbbcba7d0e709196c107/example/src/App.css -------------------------------------------------------------------------------- /example/src/App.tsx: -------------------------------------------------------------------------------- 1 | import './App.css' 2 | import { clipXY } from 'polyclip-js' 3 | import polys from './data/polys.json' 4 | 5 | function App() { 6 | return ( 7 |
8 |

Examples

9 |

10 | Figures from{' '} 11 | 12 | Clipping simple polygons with degenerate intersections 13 | 14 | . 15 |

16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
30 |
37 |
44 |
45 | ) 46 | } 47 | 48 | export default App 49 | 50 | function Figure({ 51 | title, 52 | a, 53 | b, 54 | union, 55 | scale, 56 | }: { 57 | title: string 58 | a: keyof typeof polys 59 | b: keyof typeof polys 60 | union: boolean 61 | scale: number 62 | }) { 63 | const PP = polys[a] 64 | const QQ = polys[b] 65 | const RR = clipXY(PP, QQ, union) 66 | 67 | const { minX, minY, maxX, maxY } = minmax(PP, QQ) 68 | 69 | console.log(minmax(PP, QQ), `${minX},${minY},${maxX - minX},${maxY - minY}`) 70 | 71 | return ( 72 |
73 |

{title}

74 | 79 | 80 | {RR.map((p, i) => ( 81 | `${x},${y}`).join(' ')} 84 | fill="grey" 85 | /> 86 | ))} 87 | 88 | 89 | {PP.map((p, i) => ( 90 | `${x},${y}`).join(' ')} 93 | fill="none" 94 | strokeWidth={2 / scale} 95 | stroke="blue" 96 | opacity={0.5} 97 | /> 98 | ))} 99 | 100 | 101 | {QQ.map((p, i) => ( 102 | `${x},${y}`).join(' ')} 105 | fill="none" 106 | strokeWidth={2 / scale} 107 | stroke="red" 108 | opacity={0.5} 109 | /> 110 | ))} 111 | 112 | 113 |
114 | ) 115 | } 116 | 117 | function minmax( 118 | a: { x: number; y: number }[][], 119 | b: { x: number; y: number }[][] 120 | ) { 121 | let minX = Infinity 122 | let minY = Infinity 123 | let maxX = -Infinity 124 | let maxY = -Infinity 125 | 126 | for (let i = 0; i < a.length; i++) { 127 | for (let j = 0; j < a[i].length; j++) { 128 | minX = Math.min(minX, a[i][j].x) 129 | minY = Math.min(minY, a[i][j].y) 130 | maxX = Math.max(maxX, a[i][j].x) 131 | maxY = Math.max(maxY, a[i][j].y) 132 | } 133 | } 134 | 135 | for (let i = 0; i < b.length; i++) { 136 | for (let j = 0; j < b[i].length; j++) { 137 | minX = Math.min(minX, b[i][j].x) 138 | minY = Math.min(minY, b[i][j].y) 139 | maxX = Math.max(maxX, b[i][j].x) 140 | maxY = Math.max(maxY, b[i][j].y) 141 | } 142 | } 143 | 144 | return { minX, minY, maxX, maxY } 145 | } 146 | -------------------------------------------------------------------------------- /example/src/index.css: -------------------------------------------------------------------------------- 1 | :root { 2 | font-family: Inter, Avenir, Helvetica, Arial, sans-serif; 3 | font-size: 16px; 4 | line-height: 24px; 5 | font-weight: 400; 6 | 7 | font-synthesis: none; 8 | text-rendering: optimizeLegibility; 9 | -webkit-font-smoothing: antialiased; 10 | -moz-osx-font-smoothing: grayscale; 11 | -webkit-text-size-adjust: 100%; 12 | } 13 | -------------------------------------------------------------------------------- /example/src/main.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import ReactDOM from 'react-dom/client' 3 | import App from './App' 4 | import './index.css' 5 | 6 | ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render( 7 | 8 | 9 | , 10 | ) 11 | -------------------------------------------------------------------------------- /example/src/vite-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /example/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ESNext", 4 | "useDefineForClassFields": true, 5 | "lib": ["DOM", "DOM.Iterable", "ESNext"], 6 | "allowJs": false, 7 | "skipLibCheck": true, 8 | "esModuleInterop": false, 9 | "allowSyntheticDefaultImports": true, 10 | "strict": true, 11 | "forceConsistentCasingInFileNames": true, 12 | "module": "ESNext", 13 | "moduleResolution": "Node", 14 | "resolveJsonModule": true, 15 | "isolatedModules": true, 16 | "noEmit": true, 17 | "jsx": "react-jsx" 18 | }, 19 | "include": ["src"], 20 | "references": [ 21 | { "path": "./tsconfig.node.json" }, 22 | { "path": "../packages/polyclip-js" } 23 | ] 24 | } 25 | -------------------------------------------------------------------------------- /example/tsconfig.node.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "composite": true, 4 | "module": "ESNext", 5 | "moduleResolution": "Node", 6 | "allowSyntheticDefaultImports": true 7 | }, 8 | "include": ["vite.config.ts"] 9 | } 10 | -------------------------------------------------------------------------------- /example/vite.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite' 2 | import react from '@vitejs/plugin-react-swc' 3 | 4 | // https://vitejs.dev/config/ 5 | export default defineConfig({ 6 | plugins: [react()], 7 | }) 8 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "name": "polyclip-js-monorepo", 4 | "author": "Steve Ruiz", 5 | "license": "MIT", 6 | "version": "0.0.1", 7 | "workspaces": [ 8 | "example", 9 | "packages/*" 10 | ], 11 | "devDependencies": { 12 | "turbo": "^1.6.3" 13 | } 14 | } -------------------------------------------------------------------------------- /packages/polyclip-js/README.md: -------------------------------------------------------------------------------- 1 | ## Introduction 2 | 3 | This is a TypeScript implementation of "polyclip" by the authors of 4 | [Clipping simple polygons with degenerate intersections](https://www.sciencedirect.com/science/article/pii/S259014861930007X): Erich L. Foster, Kai Hormann, and Romeo Traian Popa. 5 | 6 | It comes in at **2.82kb minified and gzipped**. 7 | 8 | Polyclip was a c++ implementation of their extension of the 9 | Greiner-Hormann clipping algorithm, which **computes the 10 | intersection (or union) of two non-self-intersecting complex 11 | polygons**, with possibly multiple and nested components, even in 12 | case of degenerate intersections (vertex on edge, overlapping 13 | edges, etc.). 14 | 15 | 16 | 17 | ## Installation 18 | 19 | ```bash 20 | npm install polyclip-js 21 | 22 | # or 23 | 24 | yarn add polyclip-js 25 | ``` 26 | 27 | ## Usage 28 | 29 | The library exports two functions: `clipXY` and `clipArray`. They both produce the same output but take different input types. 30 | 31 | ### `clipXY` 32 | 33 | Accepts two arrays of polygons, where each polygon is an array of points, and each point is an object with `x` and `y` properties. Returns a new polygon in the same format that describes the intersection of the two input polygons. 34 | 35 | ```ts 36 | import { clipXY } from 'polyclip-js' 37 | 38 | clipXY( 39 | [ 40 | [ 41 | { x: 0, y: 0 }, 42 | { x: 10, y: 0 }, 43 | { x: 10, y: 10 }, 44 | { x: 0, y: 10 }, 45 | ], 46 | ], 47 | [ 48 | [ 49 | { x: 5, y: 5 }, 50 | { x: 15, y: 5 }, 51 | { x: 15, y: 15 }, 52 | { x: 5, y: 15 }, 53 | ], 54 | ] 55 | ) 56 | 57 | // returns 58 | // [ 59 | // [ 60 | // { x: 5, y: 5 }, 61 | // { x: 10, y: 5 }, 62 | // { x: 10, y: 10 }, 63 | // { x: 5, y: 10 }, 64 | // ], 65 | // ] 66 | ``` 67 | 68 | ### `clipArray` 69 | 70 | Accepts two arrays of polygons, where each polygon is an array of points, and each point is an object with `x` and `y` properties. Returns a new polygon in the same format that describes the intersection of the two input polygons. 71 | 72 | ```ts 73 | import { clipArray } from 'polyclip-js' 74 | 75 | clipArray( 76 | [ 77 | [ 78 | [0, 0], 79 | [10, 0], 80 | [10, 10], 81 | [0, 10], 82 | ], 83 | ], 84 | [ 85 | [ 86 | [5, 5], 87 | [15, 5], 88 | [15, 15], 89 | [5, 15], 90 | ], 91 | ] 92 | ) 93 | 94 | // returns 95 | // [ 96 | // [ 97 | // [5, 5], 98 | // [10, 5], 99 | // [10, 0], 100 | // [5, 0], 101 | // ], 102 | // ] 103 | ``` 104 | 105 | ## Test File Format 106 | 107 | The library's tests rely on the original `.poly` files from the 108 | paper's supplementary material. 109 | 110 | The "\*.poly" file must have the following structure. Each line 111 | contains two numbers (int or double), the x and the y coordinates 112 | of a vertex, followed by a "," or a ";", where the "," is used to 113 | separate the vertices of a polygon component and ";" marks the end 114 | of the component. For example, the following 7 lines: 115 | 116 | ```text 117 | 0 0, 118 | 1 0, 119 | 0 1; 120 | -0.5 -0.5, 121 | 1.5 -0.5, 122 | 1.5 1.5, 123 | -0.5 1.5; 124 | ``` 125 | 126 | describe a polygon with 2 components, a right triangle inside a 127 | square. All vertices in one file must be different from each 128 | other. 129 | 130 | ## Admitted Input 131 | 132 | The following features are allowed in the input polygons: 133 | 134 | - the vertex order in each component can be CW or CCW 135 | - components can be nested (AKA holes) 136 | - the two input polygons are allowed to have degenerate 137 | intersections (vertex on edge, overlapping edges, etc.) 138 | with each other 139 | 140 | The following features are not allowed in the input polygons: 141 | 142 | - the polygons should not self-intersect (including degenerate 143 | self-intersections like vertex on vertex, vertex on edge), 144 | although the result will be correct as long as the self- 145 | intersection does not lie on the other polygon 146 | 147 | ## Robustness 148 | 149 | The implementation is based on floating point numbers with 150 | double precision and therefore not robust. The EPSILON parameter 151 | (set to 0.000000001) is used as a tolerance for equality checks, 152 | and two numbers are considered equal if their difference is less 153 | than EPSILON. 154 | 155 | ## License 156 | 157 | This library is offered under the MIT license. The original was offered under the [CC BY 4.0 license](https://creativecommons.org/licenses/by/4.0/). 158 | -------------------------------------------------------------------------------- /packages/polyclip-js/demo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /packages/polyclip-js/jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | transform: { 3 | '^.+\\.(t|j)sx?$': ['@swc/jest'], 4 | }, 5 | } 6 | -------------------------------------------------------------------------------- /packages/polyclip-js/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "polyclip-js", 3 | "author": "Steve Ruiz", 4 | "license": "MIT", 5 | "version": "1.0.1", 6 | "description": "A JavaScript port of the polyclip library", 7 | "main": "dist/index.js", 8 | "module": "dist/index.mjs", 9 | "types": "dist/index.d.ts", 10 | "repository": { 11 | "type": "git", 12 | "url": "https://github.com/steveruizok/polyclip-js" 13 | }, 14 | "keywords": [ 15 | "polyclip", 16 | "polygon", 17 | "clip", 18 | "intersection", 19 | "union", 20 | "difference", 21 | "xor" 22 | ], 23 | "engines": { 24 | "node": ">=12.0.0" 25 | }, 26 | "scripts": { 27 | "postbuild": "node ./size.mjs", 28 | "dev": "tsup ./src/index.ts --watch --dts --sourcemap --format esm,cjs", 29 | "build": "tsup ./src/index.ts --tsconfig ./tsconfig.build.json --dts --sourcemap --format esm,cjs --minify", 30 | "test": "jest" 31 | }, 32 | "devDependencies": { 33 | "@swc/core": "^1.3.24", 34 | "@swc/jest": "^0.2.24", 35 | "@types/jest": "^29.2.5", 36 | "gzip-size": "^7.0.0", 37 | "jest": "^29.3.1", 38 | "tsup": "^6.5.0" 39 | } 40 | } -------------------------------------------------------------------------------- /packages/polyclip-js/size.mjs: -------------------------------------------------------------------------------- 1 | import fs from 'fs' 2 | import { gzipSizeSync } from 'gzip-size' 3 | import path, { dirname } from 'path' 4 | import { fileURLToPath } from 'url' 5 | 6 | const __dirname = dirname(fileURLToPath(import.meta.url)) 7 | 8 | const file = path.join(__dirname, 'dist', 'index.js') 9 | const size = fs.statSync(file).size 10 | const gzipped = gzipSizeSync(fs.readFileSync(file, 'utf8')) 11 | 12 | const inKb = (bytes) => (bytes / 1024).toFixed(2) 13 | 14 | const { log } = console 15 | log(`✅ Built: ${inKb(size)}kb / ${inKb(gzipped)}kb gzipped`) 16 | -------------------------------------------------------------------------------- /packages/polyclip-js/src/Edge.ts: -------------------------------------------------------------------------------- 1 | import { EPSILON } from './constants' 2 | import { Point } from './Point' 3 | import { IntersectionType } from './types' 4 | import { Vertex } from './Vertex' 5 | 6 | export class Edge { 7 | one: Vertex 8 | two: Vertex 9 | 10 | constructor(P: Vertex, Q: Vertex) { 11 | this.one = P 12 | this.two = Q 13 | } 14 | 15 | insertVertex(V: Vertex) { 16 | const alpha = V.alpha 17 | let curr = this.one 18 | 19 | if (alpha > -1.0) { 20 | do { 21 | curr = curr.next 22 | } while (!curr.source && curr.alpha < alpha) 23 | } else { 24 | curr = curr.next 25 | } 26 | 27 | curr.prev.next = V 28 | V.prev = curr.prev 29 | V.next = curr 30 | curr.prev = V 31 | } 32 | 33 | intersectEdge(edgeQ: Edge): { 34 | alpha: number 35 | beta: number 36 | intersection: IntersectionType 37 | } { 38 | const P1 = this.one.p 39 | const P2 = this.two.p 40 | const Q1 = edgeQ.one.p 41 | const Q2 = edgeQ.two.p 42 | 43 | const AP1 = P1.A(Q1, Q2) 44 | const AP2 = P2.A(Q1, Q2) 45 | 46 | let alpha = -1 47 | let beta = -1 48 | let intersection = IntersectionType.NO_INTERSECTION 49 | 50 | if (Math.abs(AP1 - AP2) > EPSILON) { 51 | // from here: [P1,P2] and [Q1,Q2] are not parallel 52 | 53 | // analyse potential intersection 54 | 55 | const AQ1 = Q1.A(P1, P2) 56 | const AQ2 = Q2.A(P1, P2) 57 | 58 | // compute alpha and beta 59 | alpha = AP1 / (AP1 - AP2) 60 | beta = AQ1 / (AQ1 - AQ2) 61 | 62 | // classify alpha 63 | let alpha_is_0 = false 64 | let alpha_in_0_1 = false 65 | 66 | if (alpha > EPSILON && alpha < 1.0 - EPSILON) alpha_in_0_1 = true 67 | else if (Math.abs(alpha) <= EPSILON) alpha_is_0 = true 68 | 69 | // classify beta 70 | let beta_is_0 = false 71 | let beta_in_0_1 = false 72 | 73 | if (beta > EPSILON && beta < 1.0 - EPSILON) beta_in_0_1 = true 74 | else if (Math.abs(beta) <= EPSILON) beta_is_0 = true 75 | 76 | // distinguish intersection types 77 | 78 | if (alpha_in_0_1 && beta_in_0_1) { 79 | intersection = IntersectionType.X_INTERSECTION 80 | } else if (alpha_is_0 && beta_in_0_1) { 81 | intersection = IntersectionType.T_INTERSECTION_Q 82 | } else if (beta_is_0 && alpha_in_0_1) { 83 | intersection = IntersectionType.T_INTERSECTION_P 84 | } else if (alpha_is_0 && beta_is_0) { 85 | intersection = IntersectionType.V_INTERSECTION 86 | } 87 | } else if (Math.abs(AP1) < EPSILON) { 88 | // from here: [P1,P2] and [Q1,Q2] are collinear 89 | 90 | // analyse potential overlap 91 | 92 | const dP = P2.sub(P1) 93 | const dQ = Q2.sub(Q1) 94 | const PQ = Q1.sub(P1) 95 | 96 | // compute alpha and beta 97 | alpha = PQ.dot(dP) / dP.dot(dP) 98 | beta = -(PQ.dot(dQ) / dQ.dot(dQ)) 99 | 100 | // classify alpha 101 | let alpha_is_0 = false 102 | let alpha_in_0_1 = false 103 | let alpha_not_in_0_1 = false 104 | 105 | if (alpha > EPSILON && alpha < 1.0 - EPSILON) alpha_in_0_1 = true 106 | else if (Math.abs(alpha) <= EPSILON) alpha_is_0 = true 107 | else alpha_not_in_0_1 = true 108 | 109 | // classify beta 110 | let beta_is_0 = false 111 | let beta_in_0_1 = false 112 | let beta_not_in_0_1 = false 113 | 114 | if (beta > EPSILON && beta < 1.0 - EPSILON) beta_in_0_1 = true 115 | else if (Math.abs(alpha) <= EPSILON) beta_is_0 = true 116 | else beta_not_in_0_1 = true 117 | 118 | // distinguish intersection types 119 | 120 | if (alpha_in_0_1 && beta_in_0_1) { 121 | intersection = IntersectionType.X_OVERLAP 122 | } else if (alpha_not_in_0_1 && beta_in_0_1) { 123 | intersection = IntersectionType.T_OVERLAP_Q 124 | } else if (beta_not_in_0_1 && alpha_in_0_1) { 125 | intersection = IntersectionType.T_OVERLAP_P 126 | } else if (alpha_is_0 && beta_is_0) { 127 | intersection = IntersectionType.V_OVERLAP 128 | } 129 | } 130 | 131 | return { alpha, beta, intersection } 132 | } 133 | } 134 | -------------------------------------------------------------------------------- /packages/polyclip-js/src/EdgeIterator.ts: -------------------------------------------------------------------------------- 1 | import { Polygon } from './Polygon' 2 | import { IteratorType } from './types' 3 | import { Edge } from './Edge' 4 | import { Vertex } from './Vertex' 5 | 6 | export class EdgeIterator implements Iterator { 7 | root: Vertex | null 8 | one: Vertex | null = null 9 | two: Vertex | null = null 10 | 11 | constructor(public polygon: Polygon, public iterType: IteratorType) { 12 | this.root = polygon.root 13 | 14 | if (this.root === null) { 15 | return 16 | } 17 | 18 | // if (this.nextEdge() === null) { 19 | // this.root = null 20 | // this.one = null 21 | // this.two = null 22 | // } 23 | } 24 | 25 | nextVertex(curr: Vertex | null) { 26 | if (curr === null) { 27 | return null 28 | } 29 | 30 | switch (this.iterType) { 31 | case IteratorType.ALL: { 32 | curr = curr.next 33 | break 34 | } 35 | case IteratorType.SOURCE: { 36 | do { 37 | curr = curr.next 38 | } while (!curr.source) 39 | break 40 | } 41 | } 42 | 43 | return curr 44 | } 45 | 46 | nextEdge(): Vertex | null { 47 | if (this.root === null) { 48 | // empty polygon 49 | return null 50 | } 51 | 52 | if (this.one === null) { 53 | // find one (source) vertex 54 | // note: root is always a (source) vertex 55 | this.one = this.root 56 | this.two = this.nextVertex(this.one) 57 | if (this.two === this.one) { 58 | // just one (source) vertex 59 | // -> no (source) edges 60 | return null 61 | } 62 | return this.one 63 | } 64 | 65 | if (this.two === this.root) { 66 | // back at the root vertex? 67 | // -> mark iterator as "end" 68 | this.two = null 69 | this.one = null 70 | this.root = null 71 | return null 72 | } 73 | 74 | this.one = this.two 75 | this.two = this.nextVertex(this.one) 76 | 77 | return this.one 78 | } 79 | 80 | next(): IteratorResult { 81 | const res = this.nextEdge() 82 | return { done: res === null, value: new Edge(this.one!, this.two!) } 83 | } 84 | } 85 | 86 | export class EdgeIterable implements Iterable { 87 | constructor(public polygon: Polygon, public iterType: IteratorType) {} 88 | 89 | [Symbol.iterator](): EdgeIterator { 90 | return new EdgeIterator(this.polygon, this.iterType) 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /packages/polyclip-js/src/Point.ts: -------------------------------------------------------------------------------- 1 | import { toPrecision } from './utils' 2 | 3 | export class Point { 4 | x: number 5 | y: number 6 | 7 | constructor(x: number, y: number) { 8 | this.x = toPrecision(x) 9 | this.y = toPrecision(y) 10 | } 11 | 12 | add(point: Point) { 13 | return new Point(this.x + point.x, this.y + point.y) 14 | } 15 | 16 | sub(point: Point) { 17 | return new Point(this.x - point.x, this.y - point.y) 18 | } 19 | 20 | mulScalar(scalar: number) { 21 | return new Point(this.x * scalar, this.y * scalar) 22 | } 23 | 24 | dot(point: Point) { 25 | return this.x * point.x + this.y * point.y 26 | } 27 | 28 | A(Q: Point, R: Point) { 29 | return (Q.x - this.x) * (R.y - this.y) - (Q.y - this.y) * (R.x - this.x) 30 | } 31 | 32 | static From(point: Point) { 33 | return new Point(point.x, point.y) 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /packages/polyclip-js/src/Polygon.ts: -------------------------------------------------------------------------------- 1 | import { Edge } from './Edge' 2 | import { EdgeIterable } from './EdgeIterator' 3 | import { Point } from './Point' 4 | import { IntersectionLabel, IteratorType } from './types' 5 | import { Vertex } from './Vertex' 6 | import { VertexIterable } from './VertexIterator' 7 | 8 | export class Polygon { 9 | root: Vertex | null = null 10 | 11 | newVertex(V: Point, source = false): void { 12 | const vertex = new Vertex(V) 13 | vertex.source = source 14 | 15 | if (this.root === null) { 16 | vertex.next = vertex 17 | vertex.prev = vertex 18 | this.root = vertex 19 | } else { 20 | vertex.prev = this.root.prev 21 | vertex.next = this.root 22 | this.root.prev.next = vertex 23 | this.root.prev = vertex 24 | } 25 | } 26 | 27 | removeVertex(V: Vertex): void { 28 | if (this.root === V) { 29 | this.root = V.next 30 | if (this.root.next === this.root) { 31 | this.root = null 32 | } 33 | } 34 | V.prev.next = V.next 35 | V.next.prev = V.prev 36 | } 37 | 38 | pointInPolygon(R: Point): boolean { 39 | const { root } = this 40 | let w = 0 41 | let V = root 42 | if (V === null) return false 43 | 44 | let P0: Point 45 | let P1: Point 46 | 47 | for (const edge of this.edges(IteratorType.ALL)) { 48 | P0 = edge.one.p 49 | P1 = edge.two.p 50 | 51 | if (P0.y < R.y != P1.y < R.y) { 52 | if (P0.x >= R.x) { 53 | if (P1.x > R.x) { 54 | w = w + 2 * (P1.y > P0.y ? 1 : 0) - 1 55 | } else if (P0.A(P1, R) > 0 == P1.y > P0.y) { 56 | w = w + 2 * (P1.y > P0.y ? 1 : 0) - 1 57 | } 58 | } else if (P1.x > R.x) { 59 | if (P0.A(P1, R) > 0 == P1.y > P0.y) { 60 | w = w + 2 * (P1.y > P0.y ? 1 : 0) - 1 61 | } 62 | } 63 | } 64 | } 65 | 66 | return w % 2 != 0 67 | } 68 | 69 | allOnOn(): boolean { 70 | for (const V of this.vertices(IteratorType.ALL)) { 71 | if (V.label !== IntersectionLabel.ON_ON) { 72 | return false 73 | } 74 | } 75 | 76 | return true 77 | } 78 | 79 | noCrossingVertex(union = false) { 80 | for (const V of this.vertices(IteratorType.ALL)) { 81 | if (V.intersection) { 82 | if ( 83 | V.label === IntersectionLabel.CROSSING || 84 | V.label === IntersectionLabel.DELAYED_CROSSING 85 | ) { 86 | return false 87 | } 88 | if ( 89 | union && 90 | (V.label === IntersectionLabel.BOUNCING || 91 | V.label === IntersectionLabel.DELAYED_BOUNCING) 92 | ) { 93 | return false 94 | } 95 | } 96 | } 97 | return true 98 | } 99 | 100 | getIntersectionPoint() { 101 | for (const V of this.vertices(IteratorType.ALL)) { 102 | if (!V.intersection) { 103 | return V.p 104 | } 105 | } 106 | 107 | for (const V of this.vertices(IteratorType.ALL)) { 108 | if ( 109 | V.next.neighbour !== V.neighbour.prev && 110 | V.next.neighbour !== V.neighbour.next 111 | ) { 112 | return V.p.add(V.next.p).mulScalar(0.5) 113 | } 114 | } 115 | 116 | return null 117 | } 118 | 119 | getNonIntersectionPoint() { 120 | for (const V of this.vertices(IteratorType.ALL)) { 121 | if (!V.intersection) { 122 | return V.p 123 | } 124 | } 125 | 126 | for (const V of this.vertices(IteratorType.ALL)) { 127 | if ( 128 | V.next.neighbour !== V.neighbour.prev && 129 | V.next.neighbour !== V.neighbour.next 130 | ) { 131 | return V.p.add(V.next.p).mulScalar(0.5) 132 | } 133 | } 134 | 135 | return 136 | } 137 | 138 | getNonIntersectionVertex() { 139 | for (const V of this.vertices(IteratorType.ALL)) { 140 | if (!V.intersection) { 141 | return V 142 | } 143 | } 144 | 145 | for (const V of this.vertices(IteratorType.ALL)) { 146 | if ( 147 | V.next.neighbour !== V.neighbour.prev && 148 | V.next.neighbour !== V.neighbour.next 149 | ) { 150 | const p = V.p.add(V.next.p).mulScalar(0.5) 151 | const T = new Vertex(p) 152 | T.insertVertex(V) 153 | return T 154 | } 155 | } 156 | 157 | return null 158 | } 159 | 160 | vertices( 161 | iterType: IteratorType, 162 | first: Vertex | null = null 163 | ): Iterable { 164 | return new VertexIterable(this, iterType, first) 165 | } 166 | 167 | edges(iterType: IteratorType): Iterable { 168 | return new EdgeIterable(this, iterType) 169 | } 170 | 171 | static From(points: { x: number; y: number }[]) { 172 | const polygon = new Polygon() 173 | 174 | for (let i = 0; i < points.length; i++) { 175 | polygon.newVertex(new Point(points[i].x, points[i].y), true) 176 | } 177 | 178 | return polygon 179 | } 180 | } 181 | -------------------------------------------------------------------------------- /packages/polyclip-js/src/Vertex.ts: -------------------------------------------------------------------------------- 1 | import { Point } from './Point' 2 | import { 3 | EntryExitLabel, 4 | IntersectionLabel, 5 | RelativePositionType, 6 | } from './types' 7 | 8 | export class Vertex { 9 | p: Point // coordinates of the vertex 10 | prev = {} as Vertex // pointer to previous vertex 11 | next = {} as Vertex // pointer to next vertex 12 | neighbour = {} as Vertex // pointer to neighbouring vertex for intersection vertices 13 | source = false // to mark source vertices of the polygon 14 | intersection = false // to mark intersection vertices 15 | alpha = -1 // to describe relative edge position of an intersection vertex 16 | label = IntersectionLabel.NONE // type of intersection vertex 17 | enex = EntryExitLabel.NEITHER // entry/exit "flag" 18 | 19 | constructor(q: Point, alpha = -1) { 20 | this.p = Point.From(q) 21 | this.alpha = alpha 22 | } 23 | 24 | insertVertex(curr: Vertex, alpha = -1) { 25 | if (alpha > -1.0) 26 | do { 27 | curr = curr.next 28 | } while (!curr.source && curr.alpha < alpha) 29 | else curr = curr.next 30 | 31 | curr.prev.next = this 32 | this.prev = curr.prev 33 | this.next = curr 34 | curr.prev = this 35 | } 36 | 37 | getRelativePositionType( 38 | P1: Vertex, 39 | P2: Vertex, 40 | P3: Vertex 41 | ): RelativePositionType { 42 | // is Q linked to P1 ? 43 | if (P1.intersection !== undefined && P1.neighbour === this) 44 | return RelativePositionType.IS_P_m 45 | 46 | // is Q linked to P2 ? 47 | if (P3.intersection && P3.neighbour === this) 48 | return RelativePositionType.IS_P_p 49 | 50 | // check relative position of Q with respect to chain (P1,P2,P3) 51 | const s1 = this.p.A(P1.p, P2.p) 52 | const s2 = this.p.A(P2.p, P3.p) 53 | const s3 = P1.p.A(P2.p, P3.p) 54 | 55 | if (s3 > 0) { 56 | // chain makes a left turn 57 | if (s1 > 0 && s2 > 0) return RelativePositionType.LEFT 58 | else return RelativePositionType.RIGHT 59 | } else { 60 | // chain makes a right turn (or is straight) 61 | if (s1 < 0 && s2 < 0) return RelativePositionType.RIGHT 62 | else return RelativePositionType.LEFT 63 | } 64 | } 65 | 66 | link(Q: Vertex) { 67 | this.neighbour = Q 68 | Q.neighbour = this 69 | this.intersection = true 70 | Q.intersection = true 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /packages/polyclip-js/src/VertexIterator.ts: -------------------------------------------------------------------------------- 1 | import { Polygon } from './Polygon' 2 | import { IntersectionLabel, IteratorType } from './types' 3 | import { Vertex } from './Vertex' 4 | 5 | export class VertexIterator implements Iterator { 6 | root: Vertex 7 | V: Vertex | null = null 8 | 9 | constructor( 10 | public polygon: Polygon, 11 | public iterType: IteratorType, 12 | public first: Vertex | null = null 13 | ) { 14 | if (first === null) { 15 | this.root = polygon.root! 16 | } else { 17 | this.root = first 18 | } 19 | } 20 | 21 | next(): IteratorResult { 22 | let nextFound = false 23 | 24 | if (this.V === null) { 25 | this.V = this.root 26 | 27 | switch (this.iterType) { 28 | case IteratorType.ALL: { 29 | nextFound = true 30 | break 31 | } 32 | case IteratorType.SOURCE: { 33 | if (this.V.source) { 34 | nextFound = true 35 | } 36 | break 37 | } 38 | case IteratorType.INTERSECTION: { 39 | if (this.V.intersection) { 40 | nextFound = true 41 | } 42 | break 43 | } 44 | case IteratorType.CROSSING_INTERSECTION: { 45 | if ( 46 | this.V.intersection && 47 | this.V.label === IntersectionLabel.CROSSING 48 | ) { 49 | nextFound = true 50 | } 51 | break 52 | } 53 | } 54 | } 55 | 56 | while (!nextFound) { 57 | switch (this.iterType) { 58 | case IteratorType.ALL: { 59 | this.V = this.V.next 60 | break 61 | } 62 | case IteratorType.SOURCE: { 63 | do { 64 | this.V = this.V.next 65 | } while (!this.V.source && this.V !== this.root) 66 | break 67 | } 68 | case IteratorType.INTERSECTION: { 69 | do { 70 | this.V = this.V.next 71 | } while (!this.V.intersection && this.V !== this.root) 72 | break 73 | } 74 | case IteratorType.CROSSING_INTERSECTION: { 75 | do { 76 | this.V = this.V.next 77 | } while ( 78 | (!this.V.intersection || 79 | this.V.label !== IntersectionLabel.CROSSING) && 80 | this.V !== this.root 81 | ) 82 | break 83 | } 84 | } 85 | 86 | if (this.V === this.root) { 87 | this.V = null 88 | return { done: true, value: this.V } 89 | } 90 | 91 | switch (this.iterType) { 92 | case IteratorType.ALL: { 93 | nextFound = true 94 | break 95 | } 96 | case IteratorType.SOURCE: { 97 | if (this.V.source) { 98 | nextFound = true 99 | } 100 | break 101 | } 102 | case IteratorType.INTERSECTION: { 103 | if (this.V.intersection) { 104 | nextFound = true 105 | } 106 | break 107 | } 108 | case IteratorType.CROSSING_INTERSECTION: { 109 | if ( 110 | this.V.intersection && 111 | this.V.label === IntersectionLabel.CROSSING 112 | ) { 113 | nextFound = true 114 | } 115 | break 116 | } 117 | } 118 | } 119 | 120 | return { done: false, value: this.V } 121 | } 122 | } 123 | 124 | export class VertexIterable implements Iterable { 125 | constructor( 126 | public polygon: Polygon, 127 | public iterType: IteratorType, 128 | public first: Vertex | null = null 129 | ) {} 130 | 131 | [Symbol.iterator](): VertexIterator { 132 | return new VertexIterator(this.polygon, this.iterType, this.first) 133 | } 134 | } 135 | -------------------------------------------------------------------------------- /packages/polyclip-js/src/constants.ts: -------------------------------------------------------------------------------- 1 | export const EPSILON = 0.000000001 2 | 3 | export const PRECISION = 1000 4 | -------------------------------------------------------------------------------- /packages/polyclip-js/src/index.ts: -------------------------------------------------------------------------------- 1 | import { cleanupResult } from './steps/4_cleanupResult' 2 | import { computeIntersections } from './steps/1_computeIntersections' 3 | import { createResult } from './steps/3_createResult' 4 | import { labelIntersections } from './steps/2_labelIntersections' 5 | import { Polygon } from './Polygon' 6 | import { IntersectionType, IteratorType, PolygonClipDebugging } from './types' 7 | import { Point } from './Point' 8 | 9 | export function clipXY( 10 | PP: { x: number; y: number }[][], 11 | QQ: { x: number; y: number }[][], 12 | union = false, 13 | debug = false 14 | ) { 15 | const pp: Polygon[] = [] 16 | PP.forEach((polygon) => { 17 | const P = new Polygon() 18 | polygon.forEach((pair) => P.newVertex(new Point(pair.x, pair.y), true)) 19 | if (P.root !== null) pp.push(P) 20 | }) 21 | 22 | const qq: Polygon[] = [] 23 | QQ.forEach((polygon) => { 24 | const Q = new Polygon() 25 | polygon.forEach((pair) => Q.newVertex(new Point(pair.x, pair.y), true)) 26 | if (Q.root !== null) qq.push(Q) 27 | }) 28 | 29 | const result = clipPolygons(pp, qq, union, debug) 30 | 31 | const out: { x: number; y: number }[][] = [] 32 | 33 | result.forEach((polygon) => { 34 | const points: { x: number; y: number }[] = [] 35 | for (const vertex of polygon.vertices(IteratorType.ALL)) { 36 | points.push({ x: vertex.p.x, y: vertex.p.y }) 37 | } 38 | out.push(points) 39 | }) 40 | 41 | return out 42 | } 43 | 44 | export function clipArray( 45 | PP: number[][][], 46 | QQ: number[][][], 47 | union = false, 48 | debug = false 49 | ) { 50 | const pp: Polygon[] = [] 51 | PP.forEach((polygon) => { 52 | const P = new Polygon() 53 | polygon.forEach((pair) => P.newVertex(new Point(pair[0], pair[1]), true)) 54 | if (P.root !== null) pp.push(P) 55 | }) 56 | 57 | const qq: Polygon[] = [] 58 | QQ.forEach((polygon) => { 59 | const Q = new Polygon() 60 | polygon.forEach((pair) => Q.newVertex(new Point(pair[0], pair[1]), true)) 61 | if (Q.root !== null) qq.push(Q) 62 | }) 63 | 64 | const out: number[][][] = [] 65 | const result = clipPolygons(pp, qq, union, debug) 66 | result.forEach((polygon) => { 67 | const points: number[][] = [] 68 | for (const vertex of polygon.vertices(IteratorType.ALL)) { 69 | points.push([vertex.p.x, vertex.p.y]) 70 | } 71 | out.push(points) 72 | }) 73 | 74 | return out 75 | } 76 | 77 | /** 78 | * Clip two polygons and log out debugging information. 79 | * @param PP The first set of polygons. 80 | * @param QQ The second set of polygons. 81 | * @param union Whether to compute the union or the intersection. 82 | * @param debug Whether to log out debugging information. 83 | */ 84 | export function clipPolygons( 85 | PP: Polygon[], 86 | QQ: Polygon[], 87 | union = false, 88 | debug = false 89 | ): Polygon[] { 90 | if (debug) { 91 | return clipWithDebugging(PP, QQ, union) 92 | } 93 | 94 | const RR: Polygon[] = [] 95 | 96 | computeIntersections(PP, QQ) 97 | labelIntersections(PP, QQ, RR, union) 98 | createResult(PP, RR, union) 99 | cleanupResult(RR) 100 | 101 | return RR 102 | } 103 | 104 | /** 105 | * Clip two polygons and log out debugging information. 106 | * @param PP The first set of polygons. 107 | * @param QQ The second set of polygons. 108 | * @param union Whether to compute the union or the intersection. 109 | */ 110 | export function clipWithDebugging(PP: Polygon[], QQ: Polygon[], union = false) { 111 | const debug: PolygonClipDebugging = { 112 | intersections: { 113 | [IntersectionType.NO_INTERSECTION]: 0, 114 | [IntersectionType.X_INTERSECTION]: 0, 115 | [IntersectionType.T_INTERSECTION_Q]: 0, 116 | [IntersectionType.T_INTERSECTION_P]: 0, 117 | [IntersectionType.V_INTERSECTION]: 0, 118 | [IntersectionType.X_OVERLAP]: 0, 119 | [IntersectionType.T_OVERLAP_Q]: 0, 120 | [IntersectionType.T_OVERLAP_P]: 0, 121 | [IntersectionType.V_OVERLAP]: 0, 122 | }, 123 | crossingIntersectionVertices: 0, 124 | bouncingIntersectionVertices: 0, 125 | delayedBouncings: 0, 126 | delayedCrossings: 0, 127 | interiorComponents: 0, 128 | identicalComponents: 0, 129 | bouncingVertexPairsSplit: 0, 130 | verticesRemoved: 0, 131 | components: 0, 132 | vertices: 0, 133 | } 134 | 135 | const RR: Polygon[] = [] 136 | computeIntersections(PP, QQ, debug) 137 | labelIntersections(PP, QQ, RR, union, debug) 138 | createResult(PP, RR, union) 139 | cleanupResult(RR, debug) 140 | logDebugging(debug) 141 | return RR 142 | } 143 | 144 | function logDebugging(debug: PolygonClipDebugging) { 145 | const { intersections: i } = debug 146 | 147 | const nonDegenerateIntersections = i[IntersectionType.X_INTERSECTION] 148 | const degenerateIntersections = 149 | i[IntersectionType.X_INTERSECTION] + 150 | i[IntersectionType.T_INTERSECTION_Q] + 151 | i[IntersectionType.T_INTERSECTION_P] + 152 | i[IntersectionType.V_INTERSECTION] + 153 | i[IntersectionType.X_OVERLAP] + 154 | i[IntersectionType.T_OVERLAP_Q] + 155 | i[IntersectionType.T_OVERLAP_P] 156 | const XOverlaps = i[IntersectionType.X_OVERLAP] 157 | const TIntersections = 158 | i[IntersectionType.T_INTERSECTION_Q] + i[IntersectionType.T_INTERSECTION_P] 159 | const VIntersections = i[IntersectionType.V_INTERSECTION] 160 | const TOverlaps = 161 | i[IntersectionType.T_OVERLAP_Q] + i[IntersectionType.T_OVERLAP_P] 162 | const VOverlaps = i[IntersectionType.V_OVERLAP] 163 | const verticesAddedToP = 164 | i[IntersectionType.X_INTERSECTION] + 165 | i[IntersectionType.X_OVERLAP] + 166 | i[IntersectionType.T_OVERLAP_P] + 167 | i[IntersectionType.T_INTERSECTION_P] 168 | const verticesAddedToQ = 169 | i[IntersectionType.X_INTERSECTION] + 170 | i[IntersectionType.X_OVERLAP] + 171 | i[IntersectionType.T_OVERLAP_Q] + 172 | i[IntersectionType.T_INTERSECTION_Q] 173 | 174 | console.log(` 175 | Computing intersections... 176 | 177 | ... ${nonDegenerateIntersections} non-degenerate and ${degenerateIntersections} degenerate intersections found. 178 | (${TIntersections} T-intersections, ${VIntersections} V-intersections, 179 | ${XOverlaps} X-overlaps, ${TOverlaps} T-overlaps, ${VOverlaps} V-overlaps) 180 | ... ${verticesAddedToP} vertices added to P 181 | ... ${verticesAddedToQ} vertices added to Q 182 | 183 | Labelling intersections... 184 | 185 | ... ${debug.crossingIntersectionVertices} crossing and ${debug.bouncingIntersectionVertices} bouncing intersection vertices 186 | ... ${debug.delayedCrossings} delayed crossings and ${debug.delayedBouncings} delayed bouncings 187 | ... ${debug.interiorComponents} interior and ${debug.identicalComponents} identical components added to result 188 | ... ${debug.bouncingVertexPairsSplit} bouncing vertex pairs split 189 | 190 | Creating result... 191 | 192 | Post-processing... 193 | 194 | ... ${debug.verticesRemoved} vertices removed 195 | 196 | R has ${debug.components} component with ${debug.vertices} vertices. 197 | `) 198 | } 199 | -------------------------------------------------------------------------------- /packages/polyclip-js/src/steps/1_computeIntersections.ts: -------------------------------------------------------------------------------- 1 | import { Point } from '../Point' 2 | import { Polygon } from '../Polygon' 3 | import { IntersectionType, IteratorType, PolygonClipDebugging } from '../types' 4 | import { Vertex } from '../Vertex' 5 | 6 | export function computeIntersections( 7 | PP: Polygon[], 8 | PQ: Polygon[], 9 | debug?: PolygonClipDebugging 10 | ) { 11 | let I: Point 12 | let I_P: Vertex 13 | let I_Q: Vertex 14 | let P1: Vertex 15 | let Q1: Vertex 16 | 17 | // loop over the source edges of P and Q 18 | for (const P of PP) { 19 | for (const edgeP of P.edges(IteratorType.SOURCE)) { 20 | for (const Q of PQ) { 21 | for (const edgeQ of Q.edges(IteratorType.SOURCE)) { 22 | // determine intersection or overlap type 23 | const { intersection, alpha, beta } = edgeP.intersectEdge(edgeQ) 24 | 25 | P1 = edgeP.one 26 | Q1 = edgeQ.one 27 | 28 | if (debug) { 29 | debug.intersections[intersection]++ 30 | } 31 | 32 | switch (intersection) { 33 | // X-intersection 34 | case IntersectionType.X_INTERSECTION: { 35 | I = edgeP.one.p 36 | .mulScalar(1.0 - alpha) 37 | .add(edgeP.two.p.mulScalar(alpha)) 38 | 39 | I_P = new Vertex(I, alpha) 40 | I_Q = new Vertex(I, beta) 41 | edgeP.insertVertex(I_P) 42 | edgeQ.insertVertex(I_Q) 43 | I_P.link(I_Q) 44 | break 45 | } 46 | 47 | // X-overlap 48 | case IntersectionType.X_OVERLAP: { 49 | I_Q = new Vertex(P1.p, beta) 50 | edgeQ.insertVertex(I_Q) 51 | P1.link(I_Q) 52 | 53 | I_P = new Vertex(Q1.p, alpha) 54 | edgeP.insertVertex(I_P) 55 | I_P.link(Q1) 56 | break 57 | } 58 | 59 | // T-intersection or T_overlap on Q 60 | case IntersectionType.T_INTERSECTION_Q: 61 | case IntersectionType.T_OVERLAP_Q: { 62 | I_Q = new Vertex(P1.p, beta) 63 | edgeQ.insertVertex(I_Q) 64 | P1.link(I_Q) 65 | break 66 | } 67 | 68 | // T-intersection or T-overlap on P 69 | case IntersectionType.T_INTERSECTION_P: 70 | case IntersectionType.T_OVERLAP_P: { 71 | I_P = new Vertex(Q1.p, alpha) 72 | edgeP.insertVertex(I_P) 73 | I_P.link(Q1) 74 | break 75 | } 76 | 77 | // V-intersection or V-overlap 78 | case IntersectionType.V_INTERSECTION: 79 | case IntersectionType.V_OVERLAP: { 80 | P1.link(Q1) 81 | break 82 | } 83 | } 84 | } 85 | } 86 | } 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /packages/polyclip-js/src/steps/2_labelIntersections.ts: -------------------------------------------------------------------------------- 1 | import { insert, toggleStatus, xor } from '../utils' 2 | import { Point } from '../Point' 3 | import { Polygon } from '../Polygon' 4 | import { 5 | EntryExitLabel, 6 | IntersectionLabel, 7 | IteratorType, 8 | PolygonClipDebugging, 9 | RelativePositionType, 10 | } from '../types' 11 | import { Vertex } from '../Vertex' 12 | 13 | export function labelIntersections( 14 | PP: Polygon[], 15 | QQ: Polygon[], 16 | RR: Polygon[], 17 | UNION = false, 18 | debug?: PolygonClipDebugging 19 | ) { 20 | let P_m: Vertex 21 | let P_p: Vertex 22 | let Q_m: Vertex 23 | let Q_p: Vertex 24 | let Q_m_type: RelativePositionType 25 | let Q_p_type: RelativePositionType 26 | let X: Vertex 27 | 28 | // let result = `` 29 | 30 | // loop over intersection vertices of P 31 | for (const P of PP) { 32 | for (const I of P.vertices(IteratorType.INTERSECTION)) { 33 | // determine local configuration at this intersection vertex 34 | P_m = I.prev // P-, predecessor of I on P 35 | P_p = I.next // P+, successor of I on P 36 | Q_m = I.neighbour.prev // Q-, predecessor of I on Q 37 | Q_p = I.neighbour.next // Q+, successor of I on P 38 | 39 | // check positions of Q- and Q+ relative to (P-, I, P+) 40 | Q_m_type = Q_m.getRelativePositionType(P_m, I, P_p) 41 | Q_p_type = Q_p.getRelativePositionType(P_m, I, P_p) 42 | 43 | // result += `${I.p.x} ${I.p.y} ${P_m.p.x} ${P_m.p.y}\n` 44 | 45 | // check non-overlapping cases 46 | if ( 47 | (Q_m_type === RelativePositionType.LEFT && 48 | Q_p_type === RelativePositionType.RIGHT) || 49 | (Q_m_type === RelativePositionType.RIGHT && 50 | Q_p_type === RelativePositionType.LEFT) 51 | ) { 52 | I.label = IntersectionLabel.CROSSING 53 | if (debug) { 54 | debug.crossingIntersectionVertices++ 55 | } 56 | } 57 | 58 | if ( 59 | (Q_m_type === RelativePositionType.LEFT && 60 | Q_p_type === RelativePositionType.LEFT) || 61 | (Q_m_type === RelativePositionType.RIGHT && 62 | Q_p_type === RelativePositionType.RIGHT) 63 | ) { 64 | I.label = IntersectionLabel.BOUNCING 65 | if (debug) { 66 | debug.bouncingIntersectionVertices++ 67 | } 68 | } 69 | 70 | // check overlapping cases 71 | if ( 72 | (Q_p_type === RelativePositionType.IS_P_p && 73 | Q_m_type === RelativePositionType.RIGHT) || 74 | (Q_m_type === RelativePositionType.IS_P_p && 75 | Q_p_type === RelativePositionType.RIGHT) 76 | ) { 77 | I.label = IntersectionLabel.LEFT_ON 78 | } 79 | 80 | if ( 81 | (Q_p_type === RelativePositionType.IS_P_p && 82 | Q_m_type === RelativePositionType.LEFT) || 83 | (Q_m_type === RelativePositionType.IS_P_p && 84 | Q_p_type === RelativePositionType.LEFT) 85 | ) { 86 | I.label = IntersectionLabel.RIGHT_ON 87 | } 88 | 89 | if ( 90 | (Q_p_type === RelativePositionType.IS_P_p && 91 | Q_m_type === RelativePositionType.IS_P_m) || 92 | (Q_m_type === RelativePositionType.IS_P_p && 93 | Q_p_type === RelativePositionType.IS_P_m) 94 | ) { 95 | I.label = IntersectionLabel.ON_ON 96 | } 97 | 98 | if ( 99 | (Q_m_type === RelativePositionType.IS_P_m && 100 | Q_p_type === RelativePositionType.RIGHT) || 101 | (Q_p_type === RelativePositionType.IS_P_m && 102 | Q_m_type === RelativePositionType.RIGHT) 103 | ) { 104 | I.label = IntersectionLabel.ON_LEFT 105 | } 106 | 107 | if ( 108 | (Q_m_type === RelativePositionType.IS_P_m && 109 | Q_p_type === RelativePositionType.LEFT) || 110 | (Q_p_type === RelativePositionType.IS_P_m && 111 | Q_m_type === RelativePositionType.LEFT) 112 | ) { 113 | I.label = IntersectionLabel.ON_RIGHT 114 | } 115 | } 116 | } 117 | 118 | // 2) classify intersection chains 119 | 120 | // loop over intersection vertices of P 121 | for (const P of PP) { 122 | for (let I of P.vertices(IteratorType.INTERSECTION)) { 123 | // start of an intersection chain ? 124 | if ( 125 | I.label === IntersectionLabel.LEFT_ON || 126 | I.label === IntersectionLabel.RIGHT_ON 127 | ) { 128 | let x: RelativePositionType 129 | // remember status of the first chain vertex and vertex itself 130 | if (I.label === IntersectionLabel.LEFT_ON) { 131 | x = RelativePositionType.LEFT 132 | } else { 133 | x = RelativePositionType.RIGHT 134 | } 135 | 136 | X = I 137 | 138 | // proceed to end of intersection chain and mark all visited vertices as NONE 139 | do { 140 | I.label = IntersectionLabel.NONE 141 | I = I.next 142 | } while (I.label === IntersectionLabel.ON_ON) 143 | 144 | let y: RelativePositionType 145 | if (I.label === IntersectionLabel.ON_LEFT) { 146 | y = RelativePositionType.LEFT 147 | } else { 148 | y = RelativePositionType.RIGHT 149 | } 150 | 151 | // determine type of intersection chain 152 | let chainType: IntersectionLabel 153 | if (x !== y) { 154 | chainType = IntersectionLabel.DELAYED_CROSSING 155 | if (debug) { 156 | debug.delayedCrossings++ 157 | } 158 | } else { 159 | chainType = IntersectionLabel.DELAYED_BOUNCING 160 | if (debug) { 161 | debug.delayedBouncings++ 162 | } 163 | } 164 | 165 | // mark both ends of an intersection chain with chainType (i.e., as DELAYED_*) 166 | X.label = chainType 167 | I.label = chainType 168 | } 169 | } 170 | } 171 | 172 | // 3) copy labels from P to Q 173 | 174 | // loop over intersection vertices of P 175 | for (const P of PP) { 176 | for (const I of P.vertices(IteratorType.INTERSECTION)) { 177 | I.neighbour.label = I.label 178 | } 179 | } 180 | 181 | // 3.5) check for special cases 182 | 183 | let noIntersection: Polygon[][] = [[], []] 184 | let identical: Polygon[][] = [[], []] 185 | let P_or_Q: Polygon[] 186 | let Q_or_P: Polygon[] 187 | 188 | for (let i = 0; i < 2; i++) { 189 | P_or_Q = PP // if i=0, then do it for P w.r.t. Q 190 | Q_or_P = QQ 191 | 192 | if (i === 1) { 193 | // if i=1, then do it for Q w.r.t. P 194 | P_or_Q = QQ 195 | Q_or_P = PP 196 | } 197 | 198 | // loop over all components of P (or Q) 199 | for (const P of P_or_Q) { 200 | if (P.noCrossingVertex(UNION)) { 201 | // P_ has no crossing vertex (but may have bounces or delayed bounces, except for UNION), 202 | // hence it does not intersect with Q_or_P 203 | insert(noIntersection, i, P) // remember component, and ignore it later in step 4 204 | 205 | // is P identical to some component of and Q_or_P? 206 | if (P.allOnOn()) { 207 | insert(identical, i, P) // remember for further processing below 208 | } else { 209 | // is P inside Q_or_P? 210 | let isInside = false 211 | const p = P.getNonIntersectionPoint() 212 | for (const Q of Q_or_P) { 213 | if (Q.pointInPolygon(p!)) { 214 | isInside = !isInside 215 | } 216 | } 217 | 218 | if (xor(isInside, UNION)) { 219 | RR.push(P) // add P to the result 220 | if (debug) { 221 | debug.interiorComponents++ 222 | } 223 | } 224 | } 225 | } 226 | } 227 | } 228 | 229 | // handle components of P that are identical to some component of Q 230 | for (const P of identical[0]) { 231 | // is P a hole? 232 | let P_isHole = false 233 | 234 | for (const P_ of PP) { 235 | if (P_.root !== P.root && P_.pointInPolygon(P.root!.p)) { 236 | P_isHole = !P_isHole 237 | } 238 | } 239 | 240 | pqholes: for (const Q of identical[1]) { 241 | for (const V of Q.vertices(IteratorType.ALL)) { 242 | if (V === P.root!.neighbour) { 243 | // found Q that matches P 244 | // is Q a hole? 245 | let Q_isHole = false 246 | for (const Q_ of QQ) { 247 | if (Q_.root != Q.root && Q_.pointInPolygon(Q.root!.p)) { 248 | Q_isHole = !Q_isHole 249 | } 250 | } 251 | // if P and Q are both holes or both are not holes 252 | if (P_isHole === Q_isHole) { 253 | RR.push(P) // . add P to the result 254 | if (debug) { 255 | debug.identicalComponents++ 256 | } 257 | } 258 | break pqholes 259 | } 260 | } 261 | } 262 | } 263 | 264 | // 4) set entry/exit flags 265 | 266 | const split: Vertex[][] = [[], []] // split vertex candidates for P and Q 267 | const crossing: Vertex[][] = [[], []] // CROSSING vertex candidates for P and Q 268 | let status: EntryExitLabel 269 | 270 | for (let i = 0; i < 2; ++i) { 271 | P_or_Q = PP // if i=0, then do it for P w.r.t. Q 272 | Q_or_P = QQ 273 | 274 | if (i === 1) { 275 | // if i=1, then do it for Q w.r.t. P 276 | P_or_Q = QQ 277 | Q_or_P = PP 278 | } 279 | 280 | // loop over all components of P (or Q) 281 | for (const P of P_or_Q) { 282 | // ignore P if it does not intersect with Q_or_P (detected in step 3.5 above) 283 | if (noIntersection[i].includes(P)) { 284 | continue 285 | } 286 | 287 | // start at a non-intersection vertex of P 288 | const V = P.getNonIntersectionVertex() 289 | 290 | // check if it is inside or outside Q (or P) 291 | // and set ENTRY/EXIT status accordingly 292 | status = EntryExitLabel.ENTRY 293 | 294 | for (const Q of Q_or_P) { 295 | if (Q.pointInPolygon(V!.p)) { 296 | status = toggleStatus(status) 297 | } 298 | } 299 | 300 | // starting at V, loop over those vertices of P, that are either 301 | // a crossing intersection or marked as ends of an intersection chain 302 | 303 | let first_chain_vertex = true // needed for dealing with crossing chains 304 | for (const I of P.vertices(IteratorType.INTERSECTION, V)) { 305 | // in the case of normal crossings, we... 306 | if (I.label === IntersectionLabel.CROSSING) { 307 | // mark vertex with current ENTRY/EXIT status 308 | I.enex = status 309 | // toggle status from ENTRY to EXIT or vice versa 310 | status = toggleStatus(status) 311 | } 312 | 313 | // identify split vertex candidates (INTERIOR bouncing vertices) 314 | if ( 315 | I.label === IntersectionLabel.BOUNCING && 316 | xor(status === EntryExitLabel.EXIT, UNION) 317 | ) { 318 | insert(split, i, I) 319 | } 320 | 321 | // in the case of a delayed crossing chain, we 322 | // mark both end points of the chain with the current ENTRY/EXIT status, 323 | // toggling the status only at the end last chain vertex, 324 | // and, in case of a delayed EXIT crossing, the first vertex 325 | // or, in case of a delayed ENTRY crossing, the last vertex, 326 | // of the chain as CROSSING 327 | if (I.label === IntersectionLabel.DELAYED_CROSSING) { 328 | // mark vertex with current ENTRY/EXIT status 329 | I.enex = status 330 | 331 | if (first_chain_vertex) { 332 | // are we at the first vertex of a delayed crossing chain? 333 | if (xor(status === EntryExitLabel.EXIT, UNION)) { 334 | I.label = IntersectionLabel.CROSSING // mark first vertex as CROSSING 335 | } 336 | first_chain_vertex = false 337 | } else { 338 | // here we are at the last vertex of a delayed crossing chain 339 | if (xor(status === EntryExitLabel.ENTRY, UNION)) { 340 | I.label = IntersectionLabel.CROSSING // mark last vertex as CROSSING 341 | } 342 | first_chain_vertex = true 343 | // toggle status from ENTRY to EXIT or vice versa (only for last chain vertex) 344 | status = toggleStatus(status) 345 | } 346 | } 347 | 348 | // 349 | // in the case of a delayed bouncing chain, we 350 | // mark both end points of the chain with the current ENTRY/EXIT status 351 | // toggling the status at both end points of the chain, 352 | // and, in case of a delayed INTERIOR bouncing, both end points 353 | // of the chain as CROSSING candidates 354 | // 355 | if (I.label === IntersectionLabel.DELAYED_BOUNCING) { 356 | // mark vertex with current ENTRY/EXIT status 357 | I.enex = status 358 | 359 | if (first_chain_vertex) { 360 | // are we at the first vertex of a delayed crossing chain? 361 | if (xor(status === EntryExitLabel.EXIT, UNION)) { 362 | insert(crossing, i, I) // mark first EXIT vertex as CROSSING candidate 363 | } 364 | first_chain_vertex = false 365 | } else { 366 | // here we are at the last vertex of a delayed crossing chain 367 | if (xor(status === EntryExitLabel.ENTRY, UNION)) { 368 | insert(crossing, i, I) // mark last ENTRY vertex as CROSSING candidate 369 | } 370 | first_chain_vertex = true 371 | } 372 | // toggle status from ENTRY to EXIT or vice versa (for first AND last chain vertex) 373 | status = toggleStatus(status) 374 | } 375 | } 376 | } 377 | } 378 | 379 | // 5) handle split vertex pairs 380 | 381 | // loop over P's split candidates 382 | for (const I_P of split[0]) { 383 | const I_Q = I_P.neighbour 384 | 385 | // check if the neighbour on Q is also a split candidate 386 | if (split[1].includes(I_Q)) { 387 | // split vertex pair 388 | if (debug) { 389 | debug.bouncingVertexPairsSplit++ 390 | } 391 | 392 | // duplicate vertices 393 | const V_P = new Vertex(I_P.p) 394 | const V_Q = new Vertex(I_Q.p) 395 | 396 | // compute areas to compare local orientation 397 | const sP = I_P.prev.p.A(I_P.p, I_P.next.p) 398 | const sQ = I_Q.prev.p.A(I_Q.p, I_Q.next.p) 399 | 400 | // link vertices correctly 401 | if (sP * sQ > 0) { 402 | // same local orientation 403 | I_P.link(V_Q) 404 | I_Q.link(V_P) 405 | } else { 406 | // different local orientation 407 | V_P.link(V_Q) 408 | } 409 | 410 | // add duplicate vertices to P and Q 411 | V_P.insertVertex(I_P) 412 | V_Q.insertVertex(I_Q) 413 | 414 | // mark all four vertices correctly 415 | if (!UNION) { 416 | I_P.enex = EntryExitLabel.EXIT 417 | V_P.enex = EntryExitLabel.ENTRY 418 | I_Q.enex = EntryExitLabel.EXIT 419 | V_Q.enex = EntryExitLabel.ENTRY 420 | } else { 421 | I_P.enex = EntryExitLabel.ENTRY 422 | V_P.enex = EntryExitLabel.EXIT 423 | I_Q.enex = EntryExitLabel.ENTRY 424 | V_Q.enex = EntryExitLabel.EXIT 425 | } 426 | 427 | I_P.label = IntersectionLabel.CROSSING 428 | V_P.label = IntersectionLabel.CROSSING 429 | I_Q.label = IntersectionLabel.CROSSING 430 | V_Q.label = IntersectionLabel.CROSSING 431 | } 432 | } 433 | 434 | // 6) handle CROSSING vertex candidates 435 | 436 | // loop over P's CROSSING candidates 437 | for (const I_P of crossing[0]) { 438 | const I_Q = I_P.neighbour 439 | 440 | // check if the neighbour on Q is also a CROSSING candidate 441 | if (crossing[1].includes(I_Q)) { 442 | // mark CROSSING candidate pair as such 443 | I_P.label = IntersectionLabel.CROSSING 444 | I_Q.label = IntersectionLabel.CROSSING 445 | } 446 | } 447 | 448 | return RR 449 | } 450 | -------------------------------------------------------------------------------- /packages/polyclip-js/src/steps/3_createResult.ts: -------------------------------------------------------------------------------- 1 | import { Polygon } from '../Polygon' 2 | import { EntryExitLabel, IteratorType } from '../types' 3 | import { toggleStatus, xor } from '../utils' 4 | 5 | export function createResult(PP: Polygon[], RR: Polygon[], UNION = false) { 6 | // for all crossing vertices 7 | for (const P of PP) { 8 | for (const I of P.vertices(IteratorType.CROSSING_INTERSECTION)) { 9 | const R = new Polygon() 10 | 11 | let V = I // start traversal at I 12 | V.intersection = false // mark visited vertices 13 | 14 | do { 15 | let status = V.enex 16 | status = toggleStatus(status) 17 | 18 | do { 19 | // traverse P (or Q) and add vertices to R, until... 20 | if (xor(status === EntryExitLabel.EXIT, UNION)) { 21 | V = V.next // move forward from an ENTRY vertex to the next EXIT vertex 22 | } else { 23 | V = V.prev // move backward from an EXIT vertex to the next ENTRY vertex 24 | } 25 | 26 | V.intersection = false // mark visited vertices 27 | 28 | // add vertex to result polygon 29 | R.newVertex(V.p) 30 | } while ( 31 | V.enex !== status && // ... we arrive at a vertex with opposite entry/exit flag, or 32 | V !== I // at the initial vertex I) 33 | ) 34 | 35 | if (V !== I) { 36 | V = V.neighbour // switch from P to Q or vice versa 37 | V.intersection = false // mark visited vertices 38 | } 39 | } while (V !== I) // the result polygon component is complete, 40 | // if we are back to the initial vertex I 41 | RR.push(R) 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /packages/polyclip-js/src/steps/4_cleanupResult.ts: -------------------------------------------------------------------------------- 1 | import { EPSILON } from '../constants' 2 | import { Point } from '../Point' 3 | import { Polygon } from '../Polygon' 4 | import { IteratorType, PolygonClipDebugging } from '../types' 5 | 6 | export function cleanupResult(RR: Polygon[], debug?: PolygonClipDebugging) { 7 | let i = 0 8 | // for all crossing vertices 9 | for (const R of RR) { 10 | while ( 11 | R.root !== null && 12 | Math.abs(R.root.prev.p.A(R.root.p, R.root.next.p)) < EPSILON 13 | ) { 14 | if (i > 1000) throw new Error('cleanupResult: infinite loop') 15 | i++ 16 | R.removeVertex(R.root) 17 | if (debug) debug.verticesRemoved++ 18 | } 19 | 20 | if (R.root !== null) { 21 | for (const V of R.vertices(IteratorType.ALL)) { 22 | if (Math.abs(V.prev.p.A(V.p, V.next.p)) < EPSILON) { 23 | R.removeVertex(V) 24 | if (debug) debug.verticesRemoved++ 25 | } 26 | } 27 | } 28 | } 29 | 30 | if (debug) { 31 | debug.components = RR.length 32 | debug.vertices = RR.reduce((acc, r) => { 33 | if (r.root === null) return acc 34 | return acc + Array.from(r.vertices(IteratorType.ALL)).length 35 | }, 0) 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /packages/polyclip-js/src/types.ts: -------------------------------------------------------------------------------- 1 | // types of intersections between edges in the first phase 2 | export enum IntersectionType { 3 | NO_INTERSECTION, 4 | X_INTERSECTION, 5 | T_INTERSECTION_Q, 6 | T_INTERSECTION_P, 7 | V_INTERSECTION, 8 | X_OVERLAP, 9 | T_OVERLAP_Q, 10 | T_OVERLAP_P, 11 | V_OVERLAP, 12 | } 13 | 14 | // for the classification of intersection vertices in the second phase 15 | export enum IntersectionLabel { 16 | NONE, 17 | CROSSING, 18 | BOUNCING, 19 | LEFT_ON, 20 | RIGHT_ON, 21 | ON_ON, 22 | ON_LEFT, 23 | ON_RIGHT, 24 | DELAYED_CROSSING, 25 | DELAYED_BOUNCING, 26 | } 27 | 28 | // for marking intersection vertices as "entry" or "exit" 29 | export enum EntryExitLabel { 30 | EXIT, 31 | ENTRY, 32 | NEITHER, 33 | } 34 | 35 | // types of relative positions of Q w.r.t. (P1,P2,P3) 36 | export enum RelativePositionType { 37 | LEFT, 38 | RIGHT, 39 | IS_P_m, 40 | IS_P_p, 41 | } 42 | 43 | // types passed into custom vertex / edge iterators 44 | export enum IteratorType { 45 | SOURCE, 46 | INTERSECTION, 47 | CROSSING_INTERSECTION, 48 | ALL, 49 | } 50 | 51 | // An object used to record debugging information 52 | export type PolygonClipDebugging = { 53 | intersections: Record 54 | delayedCrossings: number 55 | delayedBouncings: number 56 | interiorComponents: number 57 | identicalComponents: number 58 | crossingIntersectionVertices: number 59 | bouncingIntersectionVertices: number 60 | bouncingVertexPairsSplit: number 61 | verticesRemoved: number 62 | components: number 63 | vertices: number 64 | } 65 | -------------------------------------------------------------------------------- /packages/polyclip-js/src/utils.ts: -------------------------------------------------------------------------------- 1 | import { PRECISION } from './constants' 2 | import { EntryExitLabel } from './types' 3 | 4 | export function insert(arr: T[][], index: number, item: T) { 5 | if (arr[index] === undefined) { 6 | arr[index] = [item] 7 | } else { 8 | arr[index].push(item) 9 | } 10 | } 11 | 12 | export function xor(a: boolean, b: boolean) { 13 | return (a && !b) || (!a && b) 14 | } 15 | 16 | export function toggleStatus(status: EntryExitLabel) { 17 | if (status === EntryExitLabel.ENTRY) { 18 | return EntryExitLabel.EXIT 19 | } else if (status === EntryExitLabel.EXIT) { 20 | return EntryExitLabel.ENTRY 21 | } 22 | 23 | return status 24 | } 25 | 26 | export function toPrecision(x: number) { 27 | return Math.round(x * PRECISION) / PRECISION 28 | } 29 | -------------------------------------------------------------------------------- /packages/polyclip-js/test/data/Fig14-P.poly: -------------------------------------------------------------------------------- 1 | 0 0, 2 | 6 0, 3 | 3 3, 4 | 6 6, 5 | 3 9, 6 | 1 11, 7 | 3 13, 8 | 0 13; 9 | -------------------------------------------------------------------------------- /packages/polyclip-js/test/data/Fig14-Q.poly: -------------------------------------------------------------------------------- 1 | 0 0, 2 | 3 3, 3 | 0 6, 4 | 3 9, 5 | 5 11, 6 | 3 13, 7 | 6 13, 8 | 6 0; 9 | -------------------------------------------------------------------------------- /packages/polyclip-js/test/data/Fig14-clip-u.poly: -------------------------------------------------------------------------------- 1 | 0 13, 2 | 6 13, 3 | 6 0, 4 | 0 0; 5 | 1 11, 6 | 3 13, 7 | 5 11, 8 | 3 9; 9 | -------------------------------------------------------------------------------- /packages/polyclip-js/test/data/Fig14-clip.poly: -------------------------------------------------------------------------------- 1 | 3 3, 2 | 0 0, 3 | 6 0; 4 | 6 6, 5 | 3 9, 6 | 0 6, 7 | 3 3; 8 | -------------------------------------------------------------------------------- /packages/polyclip-js/test/data/Fig15-P.poly: -------------------------------------------------------------------------------- 1 | 0 0, 2 | 4 0, 3 | 4 2, 4 | 3 1, 5 | 1 1, 6 | 0 2; -------------------------------------------------------------------------------- /packages/polyclip-js/test/data/Fig15-Q.poly: -------------------------------------------------------------------------------- 1 | 4 0, 2 | 3 1, 3 | 1 1, 4 | 0 0, 5 | 0 2, 6 | 4 2; -------------------------------------------------------------------------------- /packages/polyclip-js/test/data/Fig15-clip-u.poly: -------------------------------------------------------------------------------- 1 | 4 0, 2 | 4 2, 3 | 0 2, 4 | 0 0; 5 | -------------------------------------------------------------------------------- /packages/polyclip-js/test/data/Fig15-clip.poly: -------------------------------------------------------------------------------- 1 | 3 1, 2 | 4 0, 3 | 4 2; 4 | 0 2, 5 | 0 0, 6 | 1 1; 7 | -------------------------------------------------------------------------------- /packages/polyclip-js/test/data/Fig16-P.poly: -------------------------------------------------------------------------------- 1 | 0 0, 2 | 4 0, 3 | 4 4, 4 | 0 4; 5 | -------------------------------------------------------------------------------- /packages/polyclip-js/test/data/Fig16-Q.poly: -------------------------------------------------------------------------------- 1 | 2 2, 2 | 2 0, 3 | 6 0, 4 | 6 -2, 5 | -2 -2, 6 | -2 0; -------------------------------------------------------------------------------- /packages/polyclip-js/test/data/Fig16-clip-u.poly: -------------------------------------------------------------------------------- 1 | 4 4, 2 | 0 4, 3 | 0 1, 4 | -2 0, 5 | -2 -2, 6 | 6 -2, 7 | 6 0, 8 | 4 0; 9 | -------------------------------------------------------------------------------- /packages/polyclip-js/test/data/Fig16-clip.poly: -------------------------------------------------------------------------------- 1 | 0 0, 2 | 0 1, 3 | 2 2, 4 | 2 0; 5 | -------------------------------------------------------------------------------- /packages/polyclip-js/test/data/Fig17-P.poly: -------------------------------------------------------------------------------- 1 | 0 1, 2 | 2 1, 3 | 2 2, 4 | 1 2, 5 | 1 4, 6 | 2 4, 7 | 2 3, 8 | 3 3, 9 | 3 4, 10 | 4 4, 11 | 4 2, 12 | 3 2, 13 | 3 1, 14 | 5 1, 15 | 5 2, 16 | 6 2, 17 | 6 1, 18 | 8 1, 19 | 8 2, 20 | 7 2, 21 | 7 3, 22 | 8 3, 23 | 8 4, 24 | 6 4, 25 | 6 3, 26 | 5 3, 27 | 5 6, 28 | 6 6, 29 | 6 5, 30 | 8 5, 31 | 8 6, 32 | 7 6, 33 | 7 7, 34 | 8 7, 35 | 8 8, 36 | 6 8, 37 | 6 7, 38 | 5 7, 39 | 5 8, 40 | 3 8, 41 | 3 7, 42 | 4 7, 43 | 4 5, 44 | 3 5, 45 | 3 6, 46 | 2 6, 47 | 2 5, 48 | 1 5, 49 | 1 7, 50 | 2 7, 51 | 2 8, 52 | 1 8, 53 | 1 10, 54 | 2 10, 55 | 2 9, 56 | 4 9, 57 | 4 10, 58 | 3 10, 59 | 3 11, 60 | 4 11, 61 | 4 12, 62 | 2 12, 63 | 2 11, 64 | 1 11, 65 | 1 13, 66 | 2 13, 67 | 2 14, 68 | 1 14, 69 | 1 16, 70 | 2 16, 71 | 2 15, 72 | 3 15, 73 | 3 16, 74 | 4 16, 75 | 4 14, 76 | 3 14, 77 | 3 13, 78 | 6 13, 79 | 6 14, 80 | 5 14, 81 | 5 16, 82 | 6 16, 83 | 6 15, 84 | 7 15, 85 | 7 16, 86 | 8 16, 87 | 8 14, 88 | 7 14, 89 | 7 13, 90 | 8 13, 91 | 8 11, 92 | 7 11, 93 | 7 12, 94 | 5 12, 95 | 5 11, 96 | 6 11, 97 | 6 10, 98 | 5 10, 99 | 5 9, 100 | 7 9, 101 | 7 10, 102 | 8 10, 103 | 8 9, 104 | 9 9, 105 | 9 10, 106 | 10 10, 107 | 10 9, 108 | 12 9, 109 | 12 10, 110 | 11 10, 111 | 11 11, 112 | 12 11, 113 | 12 12, 114 | 10 12, 115 | 10 11, 116 | 9 11, 117 | 9 13, 118 | 10 13, 119 | 10 14, 120 | 9 14, 121 | 9 16, 122 | 10 16, 123 | 10 15, 124 | 11 15, 125 | 11 16, 126 | 12 16, 127 | 12 14, 128 | 11 14, 129 | 11 13, 130 | 14 13, 131 | 14 14, 132 | 13 14, 133 | 13 16, 134 | 14 16, 135 | 14 15, 136 | 15 15, 137 | 15 16, 138 | 16 16, 139 | 16 14, 140 | 15 14, 141 | 15 13, 142 | 16 13, 143 | 16 11, 144 | 15 11, 145 | 15 12, 146 | 13 12, 147 | 13 11, 148 | 14 11, 149 | 14 10, 150 | 13 10, 151 | 13 9, 152 | 15 9, 153 | 15 10, 154 | 16 10, 155 | 16 8, 156 | 15 8, 157 | 15 7, 158 | 16 7, 159 | 16 5, 160 | 15 5, 161 | 15 6, 162 | 14 6, 163 | 14 5, 164 | 13 5, 165 | 13 7, 166 | 14 7, 167 | 14 8, 168 | 12 8, 169 | 12 7, 170 | 11 7, 171 | 11 8, 172 | 9 8, 173 | 9 7, 174 | 10 7, 175 | 10 6, 176 | 9 6, 177 | 9 5, 178 | 11 5, 179 | 11 6, 180 | 12 6, 181 | 12 3, 182 | 11 3, 183 | 11 4, 184 | 9 4, 185 | 9 3, 186 | 10 3, 187 | 10 2, 188 | 9 2, 189 | 9 1, 190 | 11 1, 191 | 11 2, 192 | 12 2, 193 | 12 1, 194 | 14 1, 195 | 14 2, 196 | 13 2, 197 | 13 4, 198 | 14 4, 199 | 14 3, 200 | 15 3, 201 | 15 4, 202 | 16 4, 203 | 16 2, 204 | 15 2, 205 | 15 1, 206 | 17 1, 207 | 17 2, 208 | 18 2, 209 | 18 1, 210 | 20 1, 211 | 20 2, 212 | 19 2, 213 | 19 3, 214 | 20 3, 215 | 20 4, 216 | 18 4, 217 | 18 3, 218 | 17 3, 219 | 17 5, 220 | 18 5, 221 | 18 6, 222 | 17 6, 223 | 17 8, 224 | 18 8, 225 | 18 7, 226 | 19 7, 227 | 19 8, 228 | 20 8, 229 | 20 6, 230 | 19 6, 231 | 19 5, 232 | 22 5, 233 | 22 6, 234 | 21 6, 235 | 21 8, 236 | 22 8, 237 | 22 7, 238 | 23 7, 239 | 23 8, 240 | 24 8, 241 | 24 6, 242 | 23 6, 243 | 23 5, 244 | 24 5, 245 | 24 3, 246 | 23 3, 247 | 23 4, 248 | 21 4, 249 | 21 3, 250 | 22 3, 251 | 22 2, 252 | 21 2, 253 | 21 1, 254 | 23 1, 255 | 23 2, 256 | 24 2, 257 | 24 1, 258 | 26 1, 259 | 26 2, 260 | 25 2, 261 | 25 4, 262 | 26 4, 263 | 26 3, 264 | 27 3, 265 | 27 4, 266 | 28 4, 267 | 28 2, 268 | 27 2, 269 | 27 1, 270 | 29 1, 271 | 29 2, 272 | 30 2, 273 | 30 1, 274 | 32 1, 275 | 32 2, 276 | 31 2, 277 | 31 3, 278 | 32 3, 279 | 32 4, 280 | 30 4, 281 | 30 3, 282 | 29 3, 283 | 29 6, 284 | 30 6, 285 | 30 5, 286 | 32 5, 287 | 32 6, 288 | 31 6, 289 | 31 7, 290 | 32 7, 291 | 32 8, 292 | 30 8, 293 | 30 7, 294 | 29 7, 295 | 29 8, 296 | 27 8, 297 | 27 7, 298 | 28 7, 299 | 28 5, 300 | 27 5, 301 | 27 6, 302 | 26 6, 303 | 26 5, 304 | 25 5, 305 | 25 7, 306 | 26 7, 307 | 26 8, 308 | 25 8, 309 | 25 9, 310 | 26 9, 311 | 26 10, 312 | 25 10, 313 | 25 12, 314 | 26 12, 315 | 26 11, 316 | 27 11, 317 | 27 12, 318 | 28 12, 319 | 28 10, 320 | 27 10, 321 | 27 9, 322 | 29 9, 323 | 29 10, 324 | 30 10, 325 | 30 9, 326 | 32 9, 327 | 32 10, 328 | 31 10, 329 | 31 11, 330 | 32 11, 331 | 32 12, 332 | 30 12, 333 | 30 11, 334 | 29 11, 335 | 29 14, 336 | 30 14, 337 | 30 13, 338 | 32 13, 339 | 32 14, 340 | 31 14, 341 | 31 15, 342 | 32 15, 343 | 32 16, 344 | 30 16, 345 | 30 15, 346 | 29 15, 347 | 29 16, 348 | 27 16, 349 | 27 15, 350 | 28 15, 351 | 28 13, 352 | 27 13, 353 | 27 14, 354 | 26 14, 355 | 26 13, 356 | 25 13, 357 | 25 15, 358 | 26 15, 359 | 26 16, 360 | 24 16, 361 | 24 15, 362 | 23 15, 363 | 23 16, 364 | 21 16, 365 | 21 15, 366 | 22 15, 367 | 22 14, 368 | 21 14, 369 | 21 13, 370 | 23 13, 371 | 23 14, 372 | 24 14, 373 | 24 12, 374 | 23 12, 375 | 23 11, 376 | 24 11, 377 | 24 9, 378 | 23 9, 379 | 23 10, 380 | 22 10, 381 | 22 9, 382 | 21 9, 383 | 21 11, 384 | 22 11, 385 | 22 12, 386 | 19 12, 387 | 19 11, 388 | 20 11, 389 | 20 9, 390 | 19 9, 391 | 19 10, 392 | 18 10, 393 | 18 9, 394 | 17 9, 395 | 17 11, 396 | 18 11, 397 | 18 12, 398 | 17 12, 399 | 17 14, 400 | 18 14, 401 | 18 13, 402 | 20 13, 403 | 20 14, 404 | 19 14, 405 | 19 15, 406 | 20 15, 407 | 20 16, 408 | 18 16, 409 | 18 15, 410 | 17 15, 411 | 17 18, 412 | 18 18, 413 | 18 17, 414 | 20 17, 415 | 20 18, 416 | 19 18, 417 | 19 19, 418 | 20 19, 419 | 20 20, 420 | 18 20, 421 | 18 19, 422 | 17 19, 423 | 17 21, 424 | 18 21, 425 | 18 22, 426 | 17 22, 427 | 17 24, 428 | 18 24, 429 | 18 23, 430 | 19 23, 431 | 19 24, 432 | 20 24, 433 | 20 22, 434 | 19 22, 435 | 19 21, 436 | 22 21, 437 | 22 22, 438 | 21 22, 439 | 21 24, 440 | 22 24, 441 | 22 23, 442 | 23 23, 443 | 23 24, 444 | 24 24, 445 | 24 22, 446 | 23 22, 447 | 23 21, 448 | 24 21, 449 | 24 19, 450 | 23 19, 451 | 23 20, 452 | 21 20, 453 | 21 19, 454 | 22 19, 455 | 22 18, 456 | 21 18, 457 | 21 17, 458 | 23 17, 459 | 23 18, 460 | 24 18, 461 | 24 17, 462 | 26 17, 463 | 26 18, 464 | 25 18, 465 | 25 20, 466 | 26 20, 467 | 26 19, 468 | 27 19, 469 | 27 20, 470 | 28 20, 471 | 28 18, 472 | 27 18, 473 | 27 17, 474 | 29 17, 475 | 29 18, 476 | 30 18, 477 | 30 17, 478 | 32 17, 479 | 32 18, 480 | 31 18, 481 | 31 19, 482 | 32 19, 483 | 32 20, 484 | 30 20, 485 | 30 19, 486 | 29 19, 487 | 29 22, 488 | 30 22, 489 | 30 21, 490 | 32 21, 491 | 32 22, 492 | 31 22, 493 | 31 23, 494 | 32 23, 495 | 32 24, 496 | 30 24, 497 | 30 23, 498 | 29 23, 499 | 29 24, 500 | 27 24, 501 | 27 23, 502 | 28 23, 503 | 28 21, 504 | 27 21, 505 | 27 22, 506 | 26 22, 507 | 26 21, 508 | 25 21, 509 | 25 23, 510 | 26 23, 511 | 26 24, 512 | 25 24, 513 | 25 25, 514 | 26 25, 515 | 26 26, 516 | 25 26, 517 | 25 28, 518 | 26 28, 519 | 26 27, 520 | 27 27, 521 | 27 28, 522 | 28 28, 523 | 28 26, 524 | 27 26, 525 | 27 25, 526 | 29 25, 527 | 29 26, 528 | 30 26, 529 | 30 25, 530 | 32 25, 531 | 32 26, 532 | 31 26, 533 | 31 27, 534 | 32 27, 535 | 32 28, 536 | 30 28, 537 | 30 27, 538 | 29 27, 539 | 29 30, 540 | 30 30, 541 | 30 29, 542 | 32 29, 543 | 32 30, 544 | 31 30, 545 | 31 31, 546 | 32 31, 547 | 32 32, 548 | 30 32, 549 | 30 31, 550 | 29 31, 551 | 29 32, 552 | 27 32, 553 | 27 31, 554 | 28 31, 555 | 28 29, 556 | 27 29, 557 | 27 30, 558 | 26 30, 559 | 26 29, 560 | 25 29, 561 | 25 31, 562 | 26 31, 563 | 26 32, 564 | 24 32, 565 | 24 31, 566 | 23 31, 567 | 23 32, 568 | 21 32, 569 | 21 31, 570 | 22 31, 571 | 22 30, 572 | 21 30, 573 | 21 29, 574 | 23 29, 575 | 23 30, 576 | 24 30, 577 | 24 28, 578 | 23 28, 579 | 23 27, 580 | 24 27, 581 | 24 25, 582 | 23 25, 583 | 23 26, 584 | 22 26, 585 | 22 25, 586 | 21 25, 587 | 21 27, 588 | 22 27, 589 | 22 28, 590 | 19 28, 591 | 19 27, 592 | 20 27, 593 | 20 25, 594 | 19 25, 595 | 19 26, 596 | 18 26, 597 | 18 25, 598 | 17 25, 599 | 17 27, 600 | 18 27, 601 | 18 28, 602 | 17 28, 603 | 17 30, 604 | 18 30, 605 | 18 29, 606 | 20 29, 607 | 20 30, 608 | 19 30, 609 | 19 31, 610 | 20 31, 611 | 20 32, 612 | 18 32, 613 | 18 31, 614 | 17 31, 615 | 17 32, 616 | 15 32, 617 | 15 31, 618 | 16 31, 619 | 16 29, 620 | 15 29, 621 | 15 30, 622 | 14 30, 623 | 14 29, 624 | 13 29, 625 | 13 31, 626 | 14 31, 627 | 14 32, 628 | 12 32, 629 | 12 31, 630 | 11 31, 631 | 11 32, 632 | 9 32, 633 | 9 31, 634 | 10 31, 635 | 10 30, 636 | 9 30, 637 | 9 29, 638 | 11 29, 639 | 11 30, 640 | 12 30, 641 | 12 27, 642 | 11 27, 643 | 11 28, 644 | 9 28, 645 | 9 27, 646 | 10 27, 647 | 10 26, 648 | 9 26, 649 | 9 25, 650 | 11 25, 651 | 11 26, 652 | 12 26, 653 | 12 25, 654 | 14 25, 655 | 14 26, 656 | 13 26, 657 | 13 28, 658 | 14 28, 659 | 14 27, 660 | 15 27, 661 | 15 28, 662 | 16 28, 663 | 16 26, 664 | 15 26, 665 | 15 25, 666 | 16 25, 667 | 16 23, 668 | 15 23, 669 | 15 24, 670 | 13 24, 671 | 13 23, 672 | 14 23, 673 | 14 22, 674 | 13 22, 675 | 13 21, 676 | 15 21, 677 | 15 22, 678 | 16 22, 679 | 16 20, 680 | 15 20, 681 | 15 19, 682 | 16 19, 683 | 16 17, 684 | 15 17, 685 | 15 18, 686 | 14 18, 687 | 14 17, 688 | 13 17, 689 | 13 19, 690 | 14 19, 691 | 14 20, 692 | 11 20, 693 | 11 19, 694 | 12 19, 695 | 12 17, 696 | 11 17, 697 | 11 18, 698 | 10 18, 699 | 10 17, 700 | 9 17, 701 | 9 19, 702 | 10 19, 703 | 10 20, 704 | 9 20, 705 | 9 22, 706 | 10 22, 707 | 10 21, 708 | 12 21, 709 | 12 22, 710 | 11 22, 711 | 11 23, 712 | 12 23, 713 | 12 24, 714 | 10 24, 715 | 10 23, 716 | 9 23, 717 | 9 24, 718 | 8 24, 719 | 8 23, 720 | 7 23, 721 | 7 24, 722 | 5 24, 723 | 5 23, 724 | 6 23, 725 | 6 22, 726 | 5 22, 727 | 5 21, 728 | 7 21, 729 | 7 22, 730 | 8 22, 731 | 8 20, 732 | 7 20, 733 | 7 19, 734 | 8 19, 735 | 8 17, 736 | 7 17, 737 | 7 18, 738 | 6 18, 739 | 6 17, 740 | 5 17, 741 | 5 19, 742 | 6 19, 743 | 6 20, 744 | 3 20, 745 | 3 19, 746 | 4 19, 747 | 4 17, 748 | 3 17, 749 | 3 18, 750 | 2 18, 751 | 2 17, 752 | 1 17, 753 | 1 19, 754 | 2 19, 755 | 2 20, 756 | 1 20, 757 | 1 22, 758 | 2 22, 759 | 2 21, 760 | 4 21, 761 | 4 22, 762 | 3 22, 763 | 3 23, 764 | 4 23, 765 | 4 24, 766 | 2 24, 767 | 2 23, 768 | 1 23, 769 | 1 25, 770 | 2 25, 771 | 2 26, 772 | 1 26, 773 | 1 28, 774 | 2 28, 775 | 2 27, 776 | 3 27, 777 | 3 28, 778 | 4 28, 779 | 4 26, 780 | 3 26, 781 | 3 25, 782 | 5 25, 783 | 5 26, 784 | 6 26, 785 | 6 25, 786 | 8 25, 787 | 8 26, 788 | 7 26, 789 | 7 27, 790 | 8 27, 791 | 8 28, 792 | 6 28, 793 | 6 27, 794 | 5 27, 795 | 5 30, 796 | 6 30, 797 | 6 29, 798 | 8 29, 799 | 8 30, 800 | 7 30, 801 | 7 31, 802 | 8 31, 803 | 8 32, 804 | 6 32, 805 | 6 31, 806 | 5 31, 807 | 5 32, 808 | 3 32, 809 | 3 31, 810 | 4 31, 811 | 4 29, 812 | 3 29, 813 | 3 30, 814 | 2 30, 815 | 2 29, 816 | 1 29, 817 | 1 31, 818 | 2 31, 819 | 2 32, 820 | 0 32; 821 | -------------------------------------------------------------------------------- /packages/polyclip-js/test/data/Fig17-Q.poly: -------------------------------------------------------------------------------- 1 | 1 0, 2 | 1 2, 3 | 2 2, 4 | 2 1, 5 | 4 1, 6 | 4 2, 7 | 3 2, 8 | 3 3, 9 | 4 3, 10 | 4 4, 11 | 2 4, 12 | 2 3, 13 | 1 3, 14 | 1 5, 15 | 2 5, 16 | 2 6, 17 | 1 6, 18 | 1 8, 19 | 2 8, 20 | 2 7, 21 | 3 7, 22 | 3 8, 23 | 4 8, 24 | 4 6, 25 | 3 6, 26 | 3 5, 27 | 6 5, 28 | 6 6, 29 | 5 6, 30 | 5 8, 31 | 6 8, 32 | 6 7, 33 | 7 7, 34 | 7 8, 35 | 8 8, 36 | 8 6, 37 | 7 6, 38 | 7 5, 39 | 8 5, 40 | 8 3, 41 | 7 3, 42 | 7 4, 43 | 5 4, 44 | 5 3, 45 | 6 3, 46 | 6 2, 47 | 5 2, 48 | 5 1, 49 | 7 1, 50 | 7 2, 51 | 8 2, 52 | 8 1, 53 | 10 1, 54 | 10 2, 55 | 9 2, 56 | 9 4, 57 | 10 4, 58 | 10 3, 59 | 11 3, 60 | 11 4, 61 | 12 4, 62 | 12 2, 63 | 11 2, 64 | 11 1, 65 | 13 1, 66 | 13 2, 67 | 14 2, 68 | 14 1, 69 | 16 1, 70 | 16 2, 71 | 15 2, 72 | 15 3, 73 | 16 3, 74 | 16 4, 75 | 14 4, 76 | 14 3, 77 | 13 3, 78 | 13 6, 79 | 14 6, 80 | 14 5, 81 | 16 5, 82 | 16 6, 83 | 15 6, 84 | 15 7, 85 | 16 7, 86 | 16 8, 87 | 14 8, 88 | 14 7, 89 | 13 7, 90 | 13 8, 91 | 11 8, 92 | 11 7, 93 | 12 7, 94 | 12 5, 95 | 11 5, 96 | 11 6, 97 | 10 6, 98 | 10 5, 99 | 9 5, 100 | 9 7, 101 | 10 7, 102 | 10 8, 103 | 9 8, 104 | 9 9, 105 | 10 9, 106 | 10 10, 107 | 9 10, 108 | 9 12, 109 | 10 12, 110 | 10 11, 111 | 11 11, 112 | 11 12, 113 | 12 12, 114 | 12 10, 115 | 11 10, 116 | 11 9, 117 | 13 9, 118 | 13 10, 119 | 14 10, 120 | 14 9, 121 | 16 9, 122 | 16 10, 123 | 15 10, 124 | 15 11, 125 | 16 11, 126 | 16 12, 127 | 14 12, 128 | 14 11, 129 | 13 11, 130 | 13 14, 131 | 14 14, 132 | 14 13, 133 | 16 13, 134 | 16 14, 135 | 15 14, 136 | 15 15, 137 | 16 15, 138 | 16 16, 139 | 14 16, 140 | 14 15, 141 | 13 15, 142 | 13 16, 143 | 11 16, 144 | 11 15, 145 | 12 15, 146 | 12 13, 147 | 11 13, 148 | 11 14, 149 | 10 14, 150 | 10 13, 151 | 9 13, 152 | 9 15, 153 | 10 15, 154 | 10 16, 155 | 8 16, 156 | 8 15, 157 | 7 15, 158 | 7 16, 159 | 5 16, 160 | 5 15, 161 | 6 15, 162 | 6 14, 163 | 5 14, 164 | 5 13, 165 | 7 13, 166 | 7 14, 167 | 8 14, 168 | 8 12, 169 | 7 12, 170 | 7 11, 171 | 8 11, 172 | 8 9, 173 | 7 9, 174 | 7 10, 175 | 6 10, 176 | 6 9, 177 | 5 9, 178 | 5 11, 179 | 6 11, 180 | 6 12, 181 | 3 12, 182 | 3 11, 183 | 4 11, 184 | 4 9, 185 | 3 9, 186 | 3 10, 187 | 2 10, 188 | 2 9, 189 | 1 9, 190 | 1 11, 191 | 2 11, 192 | 2 12, 193 | 1 12, 194 | 1 14, 195 | 2 14, 196 | 2 13, 197 | 4 13, 198 | 4 14, 199 | 3 14, 200 | 3 15, 201 | 4 15, 202 | 4 16, 203 | 2 16, 204 | 2 15, 205 | 1 15, 206 | 1 17, 207 | 2 17, 208 | 2 18, 209 | 1 18, 210 | 1 20, 211 | 2 20, 212 | 2 19, 213 | 3 19, 214 | 3 20, 215 | 4 20, 216 | 4 18, 217 | 3 18, 218 | 3 17, 219 | 5 17, 220 | 5 18, 221 | 6 18, 222 | 6 17, 223 | 8 17, 224 | 8 18, 225 | 7 18, 226 | 7 19, 227 | 8 19, 228 | 8 20, 229 | 6 20, 230 | 6 19, 231 | 5 19, 232 | 5 22, 233 | 6 22, 234 | 6 21, 235 | 8 21, 236 | 8 22, 237 | 7 22, 238 | 7 23, 239 | 8 23, 240 | 8 24, 241 | 6 24, 242 | 6 23, 243 | 5 23, 244 | 5 24, 245 | 3 24, 246 | 3 23, 247 | 4 23, 248 | 4 21, 249 | 3 21, 250 | 3 22, 251 | 2 22, 252 | 2 21, 253 | 1 21, 254 | 1 23, 255 | 2 23, 256 | 2 24, 257 | 1 24, 258 | 1 26, 259 | 2 26, 260 | 2 25, 261 | 4 25, 262 | 4 26, 263 | 3 26, 264 | 3 27, 265 | 4 27, 266 | 4 28, 267 | 2 28, 268 | 2 27, 269 | 1 27, 270 | 1 29, 271 | 2 29, 272 | 2 30, 273 | 1 30, 274 | 1 32, 275 | 2 32, 276 | 2 31, 277 | 3 31, 278 | 3 32, 279 | 4 32, 280 | 4 30, 281 | 3 30, 282 | 3 29, 283 | 6 29, 284 | 6 30, 285 | 5 30, 286 | 5 32, 287 | 6 32, 288 | 6 31, 289 | 7 31, 290 | 7 32, 291 | 8 32, 292 | 8 30, 293 | 7 30, 294 | 7 29, 295 | 8 29, 296 | 8 27, 297 | 7 27, 298 | 7 28, 299 | 5 28, 300 | 5 27, 301 | 6 27, 302 | 6 26, 303 | 5 26, 304 | 5 25, 305 | 7 25, 306 | 7 26, 307 | 8 26, 308 | 8 25, 309 | 9 25, 310 | 9 26, 311 | 10 26, 312 | 10 25, 313 | 12 25, 314 | 12 26, 315 | 11 26, 316 | 11 27, 317 | 12 27, 318 | 12 28, 319 | 10 28, 320 | 10 27, 321 | 9 27, 322 | 9 29, 323 | 10 29, 324 | 10 30, 325 | 9 30, 326 | 9 32, 327 | 10 32, 328 | 10 31, 329 | 11 31, 330 | 11 32, 331 | 12 32, 332 | 12 30, 333 | 11 30, 334 | 11 29, 335 | 14 29, 336 | 14 30, 337 | 13 30, 338 | 13 32, 339 | 14 32, 340 | 14 31, 341 | 15 31, 342 | 15 32, 343 | 16 32, 344 | 16 30, 345 | 15 30, 346 | 15 29, 347 | 16 29, 348 | 16 27, 349 | 15 27, 350 | 15 28, 351 | 13 28, 352 | 13 27, 353 | 14 27, 354 | 14 26, 355 | 13 26, 356 | 13 25, 357 | 15 25, 358 | 15 26, 359 | 16 26, 360 | 16 24, 361 | 15 24, 362 | 15 23, 363 | 16 23, 364 | 16 21, 365 | 15 21, 366 | 15 22, 367 | 14 22, 368 | 14 21, 369 | 13 21, 370 | 13 23, 371 | 14 23, 372 | 14 24, 373 | 12 24, 374 | 12 23, 375 | 11 23, 376 | 11 24, 377 | 9 24, 378 | 9 23, 379 | 10 23, 380 | 10 22, 381 | 9 22, 382 | 9 21, 383 | 11 21, 384 | 11 22, 385 | 12 22, 386 | 12 19, 387 | 11 19, 388 | 11 20, 389 | 9 20, 390 | 9 19, 391 | 10 19, 392 | 10 18, 393 | 9 18, 394 | 9 17, 395 | 11 17, 396 | 11 18, 397 | 12 18, 398 | 12 17, 399 | 14 17, 400 | 14 18, 401 | 13 18, 402 | 13 20, 403 | 14 20, 404 | 14 19, 405 | 15 19, 406 | 15 20, 407 | 16 20, 408 | 16 18, 409 | 15 18, 410 | 15 17, 411 | 18 17, 412 | 18 18, 413 | 17 18, 414 | 17 20, 415 | 18 20, 416 | 18 19, 417 | 19 19, 418 | 19 20, 419 | 20 20, 420 | 20 18, 421 | 19 18, 422 | 19 17, 423 | 21 17, 424 | 21 18, 425 | 22 18, 426 | 22 17, 427 | 24 17, 428 | 24 18, 429 | 23 18, 430 | 23 19, 431 | 24 19, 432 | 24 20, 433 | 22 20, 434 | 22 19, 435 | 21 19, 436 | 21 22, 437 | 22 22, 438 | 22 21, 439 | 24 21, 440 | 24 22, 441 | 23 22, 442 | 23 23, 443 | 24 23, 444 | 24 24, 445 | 22 24, 446 | 22 23, 447 | 21 23, 448 | 21 24, 449 | 19 24, 450 | 19 23, 451 | 20 23, 452 | 20 21, 453 | 19 21, 454 | 19 22, 455 | 18 22, 456 | 18 21, 457 | 17 21, 458 | 17 23, 459 | 18 23, 460 | 18 24, 461 | 17 24, 462 | 17 26, 463 | 18 26, 464 | 18 25, 465 | 20 25, 466 | 20 26, 467 | 19 26, 468 | 19 27, 469 | 20 27, 470 | 20 28, 471 | 18 28, 472 | 18 27, 473 | 17 27, 474 | 17 29, 475 | 18 29, 476 | 18 30, 477 | 17 30, 478 | 17 32, 479 | 18 32, 480 | 18 31, 481 | 19 31, 482 | 19 32, 483 | 20 32, 484 | 20 30, 485 | 19 30, 486 | 19 29, 487 | 22 29, 488 | 22 30, 489 | 21 30, 490 | 21 32, 491 | 22 32, 492 | 22 31, 493 | 23 31, 494 | 23 32, 495 | 24 32, 496 | 24 30, 497 | 23 30, 498 | 23 29, 499 | 24 29, 500 | 24 27, 501 | 23 27, 502 | 23 28, 503 | 21 28, 504 | 21 27, 505 | 22 27, 506 | 22 26, 507 | 21 26, 508 | 21 25, 509 | 23 25, 510 | 23 26, 511 | 24 26, 512 | 24 25, 513 | 25 25, 514 | 25 26, 515 | 26 26, 516 | 26 25, 517 | 28 25, 518 | 28 26, 519 | 27 26, 520 | 27 27, 521 | 28 27, 522 | 28 28, 523 | 26 28, 524 | 26 27, 525 | 25 27, 526 | 25 29, 527 | 26 29, 528 | 26 30, 529 | 25 30, 530 | 25 32, 531 | 26 32, 532 | 26 31, 533 | 27 31, 534 | 27 32, 535 | 28 32, 536 | 28 30, 537 | 27 30, 538 | 27 29, 539 | 30 29, 540 | 30 30, 541 | 29 30, 542 | 29 32, 543 | 30 32, 544 | 30 31, 545 | 31 31, 546 | 31 32, 547 | 32 32, 548 | 32 30, 549 | 31 30, 550 | 31 29, 551 | 32 29, 552 | 32 27, 553 | 31 27, 554 | 31 28, 555 | 29 28, 556 | 29 27, 557 | 30 27, 558 | 30 26, 559 | 29 26, 560 | 29 25, 561 | 31 25, 562 | 31 26, 563 | 32 26, 564 | 32 24, 565 | 31 24, 566 | 31 23, 567 | 32 23, 568 | 32 21, 569 | 31 21, 570 | 31 22, 571 | 30 22, 572 | 30 21, 573 | 29 21, 574 | 29 23, 575 | 30 23, 576 | 30 24, 577 | 28 24, 578 | 28 23, 579 | 27 23, 580 | 27 24, 581 | 25 24, 582 | 25 23, 583 | 26 23, 584 | 26 22, 585 | 25 22, 586 | 25 21, 587 | 27 21, 588 | 27 22, 589 | 28 22, 590 | 28 19, 591 | 27 19, 592 | 27 20, 593 | 25 20, 594 | 25 19, 595 | 26 19, 596 | 26 18, 597 | 25 18, 598 | 25 17, 599 | 27 17, 600 | 27 18, 601 | 28 18, 602 | 28 17, 603 | 30 17, 604 | 30 18, 605 | 29 18, 606 | 29 20, 607 | 30 20, 608 | 30 19, 609 | 31 19, 610 | 31 20, 611 | 32 20, 612 | 32 18, 613 | 31 18, 614 | 31 17, 615 | 32 17, 616 | 32 15, 617 | 31 15, 618 | 31 16, 619 | 29 16, 620 | 29 15, 621 | 30 15, 622 | 30 14, 623 | 29 14, 624 | 29 13, 625 | 31 13, 626 | 31 14, 627 | 32 14, 628 | 32 12, 629 | 31 12, 630 | 31 11, 631 | 32 11, 632 | 32 9, 633 | 31 9, 634 | 31 10, 635 | 30 10, 636 | 30 9, 637 | 29 9, 638 | 29 11, 639 | 30 11, 640 | 30 12, 641 | 27 12, 642 | 27 11, 643 | 28 11, 644 | 28 9, 645 | 27 9, 646 | 27 10, 647 | 26 10, 648 | 26 9, 649 | 25 9, 650 | 25 11, 651 | 26 11, 652 | 26 12, 653 | 25 12, 654 | 25 14, 655 | 26 14, 656 | 26 13, 657 | 28 13, 658 | 28 14, 659 | 27 14, 660 | 27 15, 661 | 28 15, 662 | 28 16, 663 | 26 16, 664 | 26 15, 665 | 25 15, 666 | 25 16, 667 | 23 16, 668 | 23 15, 669 | 24 15, 670 | 24 13, 671 | 23 13, 672 | 23 14, 673 | 22 14, 674 | 22 13, 675 | 21 13, 676 | 21 15, 677 | 22 15, 678 | 22 16, 679 | 20 16, 680 | 20 15, 681 | 19 15, 682 | 19 16, 683 | 17 16, 684 | 17 15, 685 | 18 15, 686 | 18 14, 687 | 17 14, 688 | 17 13, 689 | 19 13, 690 | 19 14, 691 | 20 14, 692 | 20 11, 693 | 19 11, 694 | 19 12, 695 | 17 12, 696 | 17 11, 697 | 18 11, 698 | 18 10, 699 | 17 10, 700 | 17 9, 701 | 19 9, 702 | 19 10, 703 | 20 10, 704 | 20 9, 705 | 22 9, 706 | 22 10, 707 | 21 10, 708 | 21 12, 709 | 22 12, 710 | 22 11, 711 | 23 11, 712 | 23 12, 713 | 24 12, 714 | 24 10, 715 | 23 10, 716 | 23 9, 717 | 24 9, 718 | 24 8, 719 | 23 8, 720 | 23 7, 721 | 24 7, 722 | 24 5, 723 | 23 5, 724 | 23 6, 725 | 22 6, 726 | 22 5, 727 | 21 5, 728 | 21 7, 729 | 22 7, 730 | 22 8, 731 | 20 8, 732 | 20 7, 733 | 19 7, 734 | 19 8, 735 | 17 8, 736 | 17 7, 737 | 18 7, 738 | 18 6, 739 | 17 6, 740 | 17 5, 741 | 19 5, 742 | 19 6, 743 | 20 6, 744 | 20 3, 745 | 19 3, 746 | 19 4, 747 | 17 4, 748 | 17 3, 749 | 18 3, 750 | 18 2, 751 | 17 2, 752 | 17 1, 753 | 19 1, 754 | 19 2, 755 | 20 2, 756 | 20 1, 757 | 22 1, 758 | 22 2, 759 | 21 2, 760 | 21 4, 761 | 22 4, 762 | 22 3, 763 | 23 3, 764 | 23 4, 765 | 24 4, 766 | 24 2, 767 | 23 2, 768 | 23 1, 769 | 25 1, 770 | 25 2, 771 | 26 2, 772 | 26 1, 773 | 28 1, 774 | 28 2, 775 | 27 2, 776 | 27 3, 777 | 28 3, 778 | 28 4, 779 | 26 4, 780 | 26 3, 781 | 25 3, 782 | 25 5, 783 | 26 5, 784 | 26 6, 785 | 25 6, 786 | 25 8, 787 | 26 8, 788 | 26 7, 789 | 27 7, 790 | 27 8, 791 | 28 8, 792 | 28 6, 793 | 27 6, 794 | 27 5, 795 | 30 5, 796 | 30 6, 797 | 29 6, 798 | 29 8, 799 | 30 8, 800 | 30 7, 801 | 31 7, 802 | 31 8, 803 | 32 8, 804 | 32 6, 805 | 31 6, 806 | 31 5, 807 | 32 5, 808 | 32 3, 809 | 31 3, 810 | 31 4, 811 | 29 4, 812 | 29 3, 813 | 30 3, 814 | 30 2, 815 | 29 2, 816 | 29 1, 817 | 31 1, 818 | 31 2, 819 | 32 2, 820 | 32 0; 821 | -------------------------------------------------------------------------------- /packages/polyclip-js/test/data/Fig17-clip-u.poly: -------------------------------------------------------------------------------- 1 | 0 1, 2 | 0 32, 3 | 2 32, 4 | 2 31, 5 | 3 31, 6 | 3 32, 7 | 8 32, 8 | 8 27, 9 | 7 27, 10 | 7 26, 11 | 8 26, 12 | 8 25, 13 | 9 25, 14 | 9 26, 15 | 10 26, 16 | 10 27, 17 | 9 27, 18 | 9 32, 19 | 14 32, 20 | 14 31, 21 | 15 31, 22 | 15 32, 23 | 20 32, 24 | 20 29, 25 | 21 29, 26 | 21 32, 27 | 26 32, 28 | 26 31, 29 | 27 31, 30 | 27 32, 31 | 32 32, 32 | 32 27, 33 | 31 27, 34 | 31 26, 35 | 32 26, 36 | 32 21, 37 | 29 21, 38 | 29 20, 39 | 32 20, 40 | 32 15, 41 | 31 15, 42 | 31 14, 43 | 32 14, 44 | 32 9, 45 | 27 9, 46 | 27 10, 47 | 26 10, 48 | 26 9, 49 | 25 9, 50 | 25 8, 51 | 26 8, 52 | 26 7, 53 | 27 7, 54 | 27 8, 55 | 32 8, 56 | 32 3, 57 | 31 3, 58 | 31 2, 59 | 32 2, 60 | 32 0, 61 | 1 0, 62 | 1 1; 63 | 1 3, 64 | 3 3, 65 | 3 1, 66 | 2 1, 67 | 2 2, 68 | 1 2; 69 | 3 4, 70 | 4 4, 71 | 4 3, 72 | 3 3; 73 | 6 1, 74 | 5 1, 75 | 5 2, 76 | 6 2; 77 | 7 3, 78 | 8 3, 79 | 8 8, 80 | 3 8, 81 | 3 7, 82 | 2 7, 83 | 2 8, 84 | 1 8, 85 | 1 9, 86 | 4 9, 87 | 4 12, 88 | 5 12, 89 | 5 9, 90 | 9 9, 91 | 9 5, 92 | 12 5, 93 | 12 4, 94 | 9 4, 95 | 9 1, 96 | 8 1, 97 | 8 2, 98 | 7 2; 99 | 6 3, 100 | 5 3, 101 | 5 4, 102 | 6 4; 103 | 5 6, 104 | 6 6, 105 | 6 5, 106 | 5 5; 107 | 4 5, 108 | 3 5, 109 | 3 6, 110 | 4 6; 111 | 1 6, 112 | 2 6, 113 | 2 5, 114 | 1 5; 115 | 1 12, 116 | 2 12, 117 | 2 11, 118 | 1 11; 119 | 1 15, 120 | 3 15, 121 | 3 13, 122 | 2 13, 123 | 2 14, 124 | 1 14; 125 | 3 16, 126 | 4 16, 127 | 4 15, 128 | 3 15; 129 | 6 15, 130 | 8 15, 131 | 8 14, 132 | 7 14, 133 | 7 13, 134 | 6 13; 135 | 6 15, 136 | 5 15, 137 | 5 16, 138 | 6 16; 139 | 8 11, 140 | 7 11, 141 | 7 12, 142 | 8 12; 143 | 9 10, 144 | 10 10, 145 | 10 9, 146 | 9 9; 147 | 12 12, 148 | 9 12, 149 | 9 13, 150 | 10 13, 151 | 10 14, 152 | 11 14, 153 | 11 13, 154 | 13 13, 155 | 13 11, 156 | 14 11, 157 | 14 10, 158 | 13 10, 159 | 13 9, 160 | 12 9; 161 | 9 16, 162 | 10 16, 163 | 10 15, 164 | 9 15; 165 | 12 15, 166 | 11 15, 167 | 11 16, 168 | 12 16; 169 | 13 15, 170 | 15 15, 171 | 15 13, 172 | 14 13, 173 | 14 14, 174 | 13 14; 175 | 15 16, 176 | 16 16, 177 | 16 15, 178 | 15 15; 179 | 15 12, 180 | 16 12, 181 | 16 11, 182 | 15 11; 183 | 15 10, 184 | 16 10, 185 | 16 9, 186 | 15 9; 187 | 15 6, 188 | 13 6, 189 | 13 7, 190 | 14 7, 191 | 14 8, 192 | 15 8; 193 | 15 6, 194 | 16 6, 195 | 16 5, 196 | 15 5; 197 | 12 7, 198 | 11 7, 199 | 11 8, 200 | 12 8; 201 | 12 1, 202 | 11 1, 203 | 11 2, 204 | 12 2; 205 | 13 3, 206 | 15 3, 207 | 15 1, 208 | 14 1, 209 | 14 2, 210 | 13 2; 211 | 15 4, 212 | 16 4, 213 | 16 3, 214 | 15 3; 215 | 18 1, 216 | 17 1, 217 | 17 2, 218 | 18 2; 219 | 19 3, 220 | 20 3, 221 | 20 5, 222 | 22 5, 223 | 22 6, 224 | 23 6, 225 | 23 5, 226 | 24 5, 227 | 24 4, 228 | 21 4, 229 | 21 1, 230 | 20 1, 231 | 20 2, 232 | 19 2; 233 | 18 3, 234 | 17 3, 235 | 17 4, 236 | 18 4; 237 | 18 7, 238 | 20 7, 239 | 20 6, 240 | 19 6, 241 | 19 5, 242 | 18 5; 243 | 18 7, 244 | 17 7, 245 | 17 8, 246 | 18 8; 247 | 21 8, 248 | 22 8, 249 | 22 7, 250 | 21 7; 251 | 24 7, 252 | 23 7, 253 | 23 8, 254 | 24 8; 255 | 24 1, 256 | 23 1, 257 | 23 2, 258 | 24 2; 259 | 25 3, 260 | 27 3, 261 | 27 1, 262 | 26 1, 263 | 26 2, 264 | 25 2; 265 | 27 4, 266 | 28 4, 267 | 28 3, 268 | 27 3; 269 | 30 1, 270 | 29 1, 271 | 29 2, 272 | 30 2; 273 | 30 3, 274 | 29 3, 275 | 29 4, 276 | 30 4; 277 | 29 6, 278 | 30 6, 279 | 30 5, 280 | 29 5; 281 | 28 5, 282 | 27 5, 283 | 27 6, 284 | 28 6; 285 | 25 6, 286 | 26 6, 287 | 26 5, 288 | 25 5; 289 | 25 12, 290 | 26 12, 291 | 26 11, 292 | 25 11; 293 | 28 11, 294 | 27 11, 295 | 27 12, 296 | 28 12; 297 | 29 12, 298 | 30 12, 299 | 30 11, 300 | 29 11; 301 | 30 13, 302 | 29 13, 303 | 29 14, 304 | 30 14; 305 | 30 15, 306 | 29 15, 307 | 29 16, 308 | 30 16; 309 | 27 14, 310 | 25 14, 311 | 25 15, 312 | 26 15, 313 | 26 16, 314 | 27 16; 315 | 27 14, 316 | 28 14, 317 | 28 13, 318 | 27 13; 319 | 24 15, 320 | 23 15, 321 | 23 16, 322 | 24 16; 323 | 21 13, 324 | 24 13, 325 | 24 12, 326 | 23 12, 327 | 23 11, 328 | 22 11, 329 | 22 12, 330 | 20 12, 331 | 20 14, 332 | 19 14, 333 | 19 15, 334 | 20 15, 335 | 20 16, 336 | 21 16; 337 | 24 9, 338 | 23 9, 339 | 23 10, 340 | 24 10; 341 | 21 10, 342 | 22 10, 343 | 22 9, 344 | 21 9; 345 | 20 10, 346 | 18 10, 347 | 18 12, 348 | 19 12, 349 | 19 11, 350 | 20 11; 351 | 18 9, 352 | 17 9, 353 | 17 10, 354 | 18 10; 355 | 18 13, 356 | 17 13, 357 | 17 14, 358 | 18 14; 359 | 18 15, 360 | 17 15, 361 | 17 16, 362 | 18 16; 363 | 17 18, 364 | 18 18, 365 | 18 17, 366 | 17 17; 367 | 20 20, 368 | 17 20, 369 | 17 21, 370 | 18 21, 371 | 18 22, 372 | 19 22, 373 | 19 21, 374 | 21 21, 375 | 21 19, 376 | 22 19, 377 | 22 18, 378 | 21 18, 379 | 21 17, 380 | 20 17; 381 | 17 24, 382 | 18 24, 383 | 18 23, 384 | 17 23; 385 | 20 23, 386 | 19 23, 387 | 19 24, 388 | 20 24; 389 | 21 23, 390 | 23 23, 391 | 23 21, 392 | 22 21, 393 | 22 22, 394 | 21 22; 395 | 23 24, 396 | 24 24, 397 | 24 23, 398 | 23 23; 399 | 23 20, 400 | 24 20, 401 | 24 19, 402 | 23 19; 403 | 23 18, 404 | 24 18, 405 | 24 17, 406 | 23 17; 407 | 26 19, 408 | 28 19, 409 | 28 18, 410 | 27 18, 411 | 27 17, 412 | 26 17; 413 | 26 19, 414 | 25 19, 415 | 25 20, 416 | 26 20; 417 | 29 18, 418 | 30 18, 419 | 30 17, 420 | 29 17; 421 | 29 24, 422 | 30 24, 423 | 30 23, 424 | 29 23; 425 | 28 22, 426 | 26 22, 427 | 26 24, 428 | 27 24, 429 | 27 23, 430 | 28 23; 431 | 26 21, 432 | 25 21, 433 | 25 22, 434 | 26 22; 435 | 25 27, 436 | 27 27, 437 | 27 25, 438 | 26 25, 439 | 26 26, 440 | 25 26; 441 | 27 28, 442 | 28 28, 443 | 28 27, 444 | 27 27; 445 | 30 25, 446 | 29 25, 447 | 29 26, 448 | 30 26; 449 | 30 27, 450 | 29 27, 451 | 29 28, 452 | 30 28; 453 | 29 30, 454 | 30 30, 455 | 30 29, 456 | 29 29; 457 | 28 29, 458 | 27 29, 459 | 27 30, 460 | 28 30; 461 | 25 30, 462 | 26 30, 463 | 26 29, 464 | 25 29; 465 | 24 29, 466 | 23 29, 467 | 23 30, 468 | 24 30; 469 | 24 26, 470 | 22 26, 471 | 22 28, 472 | 23 28, 473 | 23 27, 474 | 24 27; 475 | 22 25, 476 | 21 25, 477 | 21 26, 478 | 22 26; 479 | 19 26, 480 | 17 26, 481 | 17 27, 482 | 18 27, 483 | 18 28, 484 | 19 28; 485 | 19 26, 486 | 20 26, 487 | 20 25, 488 | 19 25; 489 | 17 30, 490 | 18 30, 491 | 18 29, 492 | 17 29; 493 | 16 29, 494 | 15 29, 495 | 15 30, 496 | 16 30; 497 | 13 30, 498 | 14 30, 499 | 14 29, 500 | 13 29; 501 | 12 29, 502 | 11 29, 503 | 11 30, 504 | 12 30; 505 | 11 28, 506 | 12 28, 507 | 12 27, 508 | 11 27; 509 | 11 26, 510 | 12 26, 511 | 12 25, 512 | 11 25; 513 | 14 27, 514 | 16 27, 515 | 16 26, 516 | 15 26, 517 | 15 25, 518 | 14 25; 519 | 14 27, 520 | 13 27, 521 | 13 28, 522 | 14 28; 523 | 16 23, 524 | 15 23, 525 | 15 24, 526 | 16 24; 527 | 13 21, 528 | 16 21, 529 | 16 20, 530 | 15 20, 531 | 15 19, 532 | 14 19, 533 | 14 20, 534 | 12 20, 535 | 12 22, 536 | 11 22, 537 | 11 23, 538 | 12 23, 539 | 12 24, 540 | 13 24; 541 | 16 17, 542 | 15 17, 543 | 15 18, 544 | 16 18; 545 | 13 18, 546 | 14 18, 547 | 14 17, 548 | 13 17; 549 | 12 18, 550 | 10 18, 551 | 10 20, 552 | 11 20, 553 | 11 19, 554 | 12 19; 555 | 10 17, 556 | 9 17, 557 | 9 18, 558 | 10 18; 559 | 10 21, 560 | 9 21, 561 | 9 22, 562 | 10 22; 563 | 10 23, 564 | 9 23, 565 | 9 24, 566 | 10 24; 567 | 7 24, 568 | 8 24, 569 | 8 23, 570 | 7 23; 571 | 6 22, 572 | 5 22, 573 | 5 20, 574 | 3 20, 575 | 3 19, 576 | 2 19, 577 | 2 20, 578 | 1 20, 579 | 1 21, 580 | 4 21, 581 | 4 24, 582 | 5 24, 583 | 5 23, 584 | 6 23; 585 | 7 22, 586 | 8 22, 587 | 8 21, 588 | 7 21; 589 | 7 18, 590 | 5 18, 591 | 5 19, 592 | 6 19, 593 | 6 20, 594 | 7 20; 595 | 7 18, 596 | 8 18, 597 | 8 17, 598 | 7 17; 599 | 4 17, 600 | 3 17, 601 | 3 18, 602 | 4 18; 603 | 1 18, 604 | 2 18, 605 | 2 17, 606 | 1 17; 607 | 1 24, 608 | 2 24, 609 | 2 23, 610 | 1 23; 611 | 1 27, 612 | 3 27, 613 | 3 25, 614 | 2 25, 615 | 2 26, 616 | 1 26; 617 | 3 28, 618 | 4 28, 619 | 4 27, 620 | 3 27; 621 | 6 25, 622 | 5 25, 623 | 5 26, 624 | 6 26; 625 | 6 27, 626 | 5 27, 627 | 5 28, 628 | 6 28; 629 | 5 30, 630 | 6 30, 631 | 6 29, 632 | 5 29; 633 | 4 29, 634 | 3 29, 635 | 3 30, 636 | 4 30; 637 | 1 30, 638 | 2 30, 639 | 2 29, 640 | 1 29; 641 | -------------------------------------------------------------------------------- /packages/polyclip-js/test/data/Fig17-clip.poly: -------------------------------------------------------------------------------- 1 | 2 1, 2 | 2 2, 3 | 1 2, 4 | 1 1; 5 | 4 4, 6 | 4 1, 7 | 5 1, 8 | 5 2, 9 | 6 2, 10 | 6 3, 11 | 5 3, 12 | 5 5, 13 | 3 5, 14 | 3 6, 15 | 2 6, 16 | 2 5, 17 | 1 5, 18 | 1 4; 19 | 8 1, 20 | 8 2, 21 | 7 2, 22 | 7 1; 23 | 7 4, 24 | 7 3, 25 | 8 3, 26 | 8 4; 27 | 7 5, 28 | 7 7, 29 | 5 7, 30 | 5 6, 31 | 6 6, 32 | 6 5; 33 | 8 7, 34 | 8 8, 35 | 7 8, 36 | 7 7; 37 | 4 7, 38 | 4 8, 39 | 3 8, 40 | 3 7; 41 | 2 7, 42 | 2 8, 43 | 1 8, 44 | 1 7; 45 | 3 10, 46 | 3 12, 47 | 2 12, 48 | 2 11, 49 | 1 11, 50 | 1 10; 51 | 3 10, 52 | 3 9, 53 | 4 9, 54 | 4 10; 55 | 2 13, 56 | 2 14, 57 | 1 14, 58 | 1 13; 59 | 4 16, 60 | 4 13, 61 | 5 13, 62 | 5 16, 63 | 10 16, 64 | 10 15, 65 | 11 15, 66 | 11 16, 67 | 16 16, 68 | 16 11, 69 | 15 11, 70 | 15 10, 71 | 16 10, 72 | 16 5, 73 | 13 5, 74 | 13 4, 75 | 16 4, 76 | 16 1, 77 | 17 1, 78 | 17 2, 79 | 18 2, 80 | 18 3, 81 | 17 3, 82 | 17 8, 83 | 22 8, 84 | 22 7, 85 | 23 7, 86 | 23 8, 87 | 24 8, 88 | 24 9, 89 | 23 9, 90 | 23 10, 91 | 22 10, 92 | 22 9, 93 | 17 9, 94 | 17 14, 95 | 18 14, 96 | 18 15, 97 | 17 15, 98 | 17 17, 99 | 15 17, 100 | 15 18, 101 | 14 18, 102 | 14 17, 103 | 9 17, 104 | 9 22, 105 | 10 22, 106 | 10 23, 107 | 9 23, 108 | 9 24, 109 | 8 24, 110 | 8 23, 111 | 7 23, 112 | 7 22, 113 | 8 22, 114 | 8 17, 115 | 3 17, 116 | 3 18, 117 | 2 18, 118 | 2 17, 119 | 1 17, 120 | 1 16; 121 | 8 13, 122 | 8 14, 123 | 7 14, 124 | 7 13; 125 | 6 12, 126 | 6 10, 127 | 8 10, 128 | 8 11, 129 | 7 11, 130 | 7 12; 131 | 5 10, 132 | 5 9, 133 | 6 9, 134 | 6 10; 135 | 11 9, 136 | 11 11, 137 | 9 11, 138 | 9 10, 139 | 10 10, 140 | 10 9; 141 | 12 11, 142 | 12 12, 143 | 11 12, 144 | 11 11; 145 | 9 14, 146 | 9 13, 147 | 10 13, 148 | 10 14; 149 | 11 14, 150 | 11 13, 151 | 12 13, 152 | 12 14; 153 | 14 13, 154 | 14 14, 155 | 13 14, 156 | 13 13; 157 | 13 12, 158 | 13 11, 159 | 14 11, 160 | 14 12; 161 | 14 9, 162 | 14 10, 163 | 13 10, 164 | 13 9; 165 | 13 8, 166 | 13 7, 167 | 14 7, 168 | 14 8; 169 | 10 8, 170 | 10 6, 171 | 12 6, 172 | 12 7, 173 | 11 7, 174 | 11 8; 175 | 9 6, 176 | 9 5, 177 | 10 5, 178 | 10 6; 179 | 10 3, 180 | 10 1, 181 | 11 1, 182 | 11 2, 183 | 12 2, 184 | 12 3; 185 | 10 3, 186 | 10 4, 187 | 9 4, 188 | 9 3; 189 | 14 1, 190 | 14 2, 191 | 13 2, 192 | 13 1; 193 | 20 1, 194 | 20 2, 195 | 19 2, 196 | 19 1; 197 | 19 4, 198 | 19 3, 199 | 20 3, 200 | 20 4; 201 | 20 5, 202 | 20 6, 203 | 19 6, 204 | 19 5; 205 | 21 6, 206 | 21 5, 207 | 22 5, 208 | 22 6; 209 | 23 6, 210 | 23 5, 211 | 24 5, 212 | 24 6; 213 | 22 3, 214 | 22 1, 215 | 23 1, 216 | 23 2, 217 | 24 2, 218 | 24 3; 219 | 22 3, 220 | 22 4, 221 | 21 4, 222 | 21 3; 223 | 26 1, 224 | 26 2, 225 | 25 2, 226 | 25 1; 227 | 28 4, 228 | 28 1, 229 | 29 1, 230 | 29 2, 231 | 30 2, 232 | 30 3, 233 | 29 3, 234 | 29 5, 235 | 27 5, 236 | 27 6, 237 | 26 6, 238 | 26 5, 239 | 25 5, 240 | 25 4; 241 | 32 1, 242 | 32 2, 243 | 31 2, 244 | 31 1; 245 | 31 4, 246 | 31 3, 247 | 32 3, 248 | 32 4; 249 | 31 5, 250 | 31 7, 251 | 29 7, 252 | 29 6, 253 | 30 6, 254 | 30 5; 255 | 32 7, 256 | 32 8, 257 | 31 8, 258 | 31 7; 259 | 28 7, 260 | 28 8, 261 | 27 8, 262 | 27 7; 263 | 26 7, 264 | 26 8, 265 | 25 8, 266 | 25 7; 267 | 25 10, 268 | 25 9, 269 | 26 9, 270 | 26 10; 271 | 27 11, 272 | 27 12, 273 | 29 12, 274 | 29 14, 275 | 30 14, 276 | 30 15, 277 | 29 15, 278 | 29 16, 279 | 28 16, 280 | 28 13, 281 | 25 13, 282 | 25 12, 283 | 26 12, 284 | 26 11; 285 | 27 10, 286 | 27 9, 287 | 28 9, 288 | 28 10; 289 | 31 10, 290 | 31 12, 291 | 30 12, 292 | 30 11, 293 | 29 11, 294 | 29 10; 295 | 31 10, 296 | 31 9, 297 | 32 9, 298 | 32 10; 299 | 32 13, 300 | 32 14, 301 | 31 14, 302 | 31 13; 303 | 31 16, 304 | 31 15, 305 | 32 15, 306 | 32 16; 307 | 25 16, 308 | 25 15, 309 | 26 15, 310 | 26 16; 311 | 22 16, 312 | 22 14, 313 | 24 14, 314 | 24 15, 315 | 23 15, 316 | 23 16; 317 | 21 14, 318 | 21 13, 319 | 22 13, 320 | 22 14; 321 | 24 11, 322 | 24 12, 323 | 23 12, 324 | 23 11; 325 | 22 11, 326 | 22 12, 327 | 21 12, 328 | 21 11; 329 | 19 12, 330 | 19 11, 331 | 20 11, 332 | 20 12; 333 | 20 13, 334 | 20 14, 335 | 19 14, 336 | 19 13; 337 | 19 16, 338 | 19 15, 339 | 20 15, 340 | 20 16; 341 | 19 17, 342 | 19 19, 343 | 17 19, 344 | 17 18, 345 | 18 18, 346 | 18 17; 347 | 20 19, 348 | 20 20, 349 | 19 20, 350 | 19 19; 351 | 17 22, 352 | 17 21, 353 | 18 21, 354 | 18 22; 355 | 19 23, 356 | 19 24, 357 | 24 24, 358 | 24 19, 359 | 23 19, 360 | 23 18, 361 | 24 18, 362 | 24 17, 363 | 25 17, 364 | 25 20, 365 | 28 20, 366 | 28 21, 367 | 25 21, 368 | 25 25, 369 | 21 25, 370 | 21 28, 371 | 20 28, 372 | 20 25, 373 | 17 25, 374 | 17 24, 375 | 18 24, 376 | 18 23; 377 | 19 22, 378 | 19 21, 379 | 20 21, 380 | 20 22; 381 | 22 21, 382 | 22 22, 383 | 21 22, 384 | 21 21; 385 | 21 20, 386 | 21 19, 387 | 22 19, 388 | 22 20; 389 | 22 17, 390 | 22 18, 391 | 21 18, 392 | 21 17; 393 | 28 17, 394 | 28 18, 395 | 27 18, 396 | 27 17; 397 | 31 17, 398 | 31 19, 399 | 29 19, 400 | 29 18, 401 | 30 18, 402 | 30 17; 403 | 32 19, 404 | 32 20, 405 | 31 20, 406 | 31 19; 407 | 31 22, 408 | 31 24, 409 | 30 24, 410 | 30 23, 411 | 29 23, 412 | 29 22; 413 | 31 22, 414 | 31 21, 415 | 32 21, 416 | 32 22; 417 | 27 24, 418 | 27 23, 419 | 28 23, 420 | 28 24; 421 | 26 25, 422 | 26 26, 423 | 25 26, 424 | 25 25; 425 | 28 28, 426 | 28 25, 427 | 29 25, 428 | 29 26, 429 | 30 26, 430 | 30 27, 431 | 29 27, 432 | 29 29, 433 | 27 29, 434 | 27 30, 435 | 26 30, 436 | 26 29, 437 | 25 29, 438 | 25 28; 439 | 32 25, 440 | 32 26, 441 | 31 26, 442 | 31 25; 443 | 31 28, 444 | 31 27, 445 | 32 27, 446 | 32 28; 447 | 31 29, 448 | 31 31, 449 | 29 31, 450 | 29 30, 451 | 30 30, 452 | 30 29; 453 | 32 31, 454 | 32 32, 455 | 31 32, 456 | 31 31; 457 | 28 31, 458 | 28 32, 459 | 27 32, 460 | 27 31; 461 | 26 31, 462 | 26 32, 463 | 25 32, 464 | 25 31; 465 | 22 31, 466 | 22 29, 467 | 23 29, 468 | 23 30, 469 | 24 30, 470 | 24 31; 471 | 22 31, 472 | 22 32, 473 | 21 32, 474 | 21 31; 475 | 23 28, 476 | 23 27, 477 | 24 27, 478 | 24 28; 479 | 17 28, 480 | 17 27, 481 | 18 27, 482 | 18 28; 483 | 19 29, 484 | 19 31, 485 | 17 31, 486 | 17 30, 487 | 18 30, 488 | 18 29; 489 | 20 31, 490 | 20 32, 491 | 19 32, 492 | 19 31; 493 | 16 31, 494 | 16 32, 495 | 15 32, 496 | 15 31; 497 | 14 30, 498 | 14 29, 499 | 12 29, 500 | 12 27, 501 | 11 27, 502 | 11 26, 503 | 12 26, 504 | 12 25, 505 | 13 25, 506 | 13 28, 507 | 16 28, 508 | 16 29, 509 | 15 29, 510 | 15 30; 511 | 14 31, 512 | 14 32, 513 | 13 32, 514 | 13 31; 515 | 10 31, 516 | 10 29, 517 | 11 29, 518 | 11 30, 519 | 12 30, 520 | 12 31; 521 | 10 31, 522 | 10 32, 523 | 9 32, 524 | 9 31; 525 | 9 28, 526 | 9 27, 527 | 10 27, 528 | 10 28; 529 | 10 25, 530 | 10 26, 531 | 9 26, 532 | 9 25; 533 | 16 25, 534 | 16 26, 535 | 15 26, 536 | 15 25; 537 | 14 24, 538 | 14 22, 539 | 16 22, 540 | 16 23, 541 | 15 23, 542 | 15 24; 543 | 13 22, 544 | 13 21, 545 | 14 21, 546 | 14 22; 547 | 16 19, 548 | 16 20, 549 | 15 20, 550 | 15 19; 551 | 14 19, 552 | 14 20, 553 | 13 20, 554 | 13 19; 555 | 11 20, 556 | 11 19, 557 | 12 19, 558 | 12 20; 559 | 12 21, 560 | 12 22, 561 | 11 22, 562 | 11 21; 563 | 11 24, 564 | 11 23, 565 | 12 23, 566 | 12 24; 567 | 5 24, 568 | 5 23, 569 | 6 23, 570 | 6 24; 571 | 6 21, 572 | 6 22, 573 | 5 22, 574 | 5 21; 575 | 5 20, 576 | 5 19, 577 | 6 19, 578 | 6 20; 579 | 4 19, 580 | 4 20, 581 | 3 20, 582 | 3 19; 583 | 2 19, 584 | 2 20, 585 | 1 20, 586 | 1 19; 587 | 3 22, 588 | 3 24, 589 | 2 24, 590 | 2 23, 591 | 1 23, 592 | 1 22; 593 | 3 22, 594 | 3 21, 595 | 4 21, 596 | 4 22; 597 | 2 25, 598 | 2 26, 599 | 1 26, 600 | 1 25; 601 | 4 28, 602 | 4 25, 603 | 5 25, 604 | 5 26, 605 | 6 26, 606 | 6 27, 607 | 5 27, 608 | 5 29, 609 | 3 29, 610 | 3 30, 611 | 2 30, 612 | 2 29, 613 | 1 29, 614 | 1 28; 615 | 8 25, 616 | 8 26, 617 | 7 26, 618 | 7 25; 619 | 7 28, 620 | 7 27, 621 | 8 27, 622 | 8 28; 623 | 7 29, 624 | 7 31, 625 | 5 31, 626 | 5 30, 627 | 6 30, 628 | 6 29; 629 | 8 31, 630 | 8 32, 631 | 7 32, 632 | 7 31; 633 | 4 31, 634 | 4 32, 635 | 3 32, 636 | 3 31; 637 | 2 31, 638 | 2 32, 639 | 1 32, 640 | 1 31; 641 | -------------------------------------------------------------------------------- /packages/polyclip-js/test/data/Fig18-P.poly: -------------------------------------------------------------------------------- 1 | -10 -10, 2 | 10 -10, 3 | 10 10, 4 | -10 10; 5 | -8 -8, 6 | 8 -8, 7 | 8 8, 8 | -8 8; 9 | -6 6, 10 | -6 -6, 11 | 6 -6, 12 | 6 6; 13 | 4 4, 14 | 4 -4, 15 | -4 -4, 16 | -4 4; 17 | 20 -8, 18 | 20 8, 19 | 12 8, 20 | 12 -8; 21 | 14 -6, 22 | 14 6, 23 | 18 6, 24 | 18 -6; 25 | -------------------------------------------------------------------------------- /packages/polyclip-js/test/data/Fig18-Q.poly: -------------------------------------------------------------------------------- 1 | -2 -2, 2 | -2 -12, 3 | -12 -12, 4 | -12 -2; 5 | 0 0, 6 | -14 0, 7 | -14 -14, 8 | 0 -14; 9 | 2 2, 10 | -16 2, 11 | -16 -16, 12 | 2 -16; 13 | -4 4, 14 | -18 4, 15 | -18 18, 16 | -4 18; 17 | -6 6, 18 | -16 6, 19 | -16 16, 20 | -6 16; 21 | -8 8, 22 | -14 8, 23 | -14 14, 24 | -8 14; 25 | -10 10, 26 | -12 10, 27 | -12 12, 28 | -10 12; 29 | 6 -8, 30 | 6 8, 31 | 20 8, 32 | 20 -8; 33 | 8 -6, 34 | 8 6, 35 | 18 6, 36 | 18 -6; 37 | 16 -4, 38 | 16 4, 39 | 10 4, 40 | 10 -4; 41 | -------------------------------------------------------------------------------- /packages/polyclip-js/test/data/Fig18-clip.poly: -------------------------------------------------------------------------------- 1 | -10 -10, 2 | -10 -2, 3 | -8 -2, 4 | -8 -8, 5 | -2 -8, 6 | -2 -10; 7 | 2 -10, 8 | 2 -8, 9 | 0 -8, 10 | 0 -10; 11 | 10 -6, 12 | 8 -6, 13 | 8 -8, 14 | 10 -8; 15 | 10 8, 16 | 8 8, 17 | 8 6, 18 | 10 6; 19 | -6 10, 20 | -6 8, 21 | -4 8, 22 | -4 10; 23 | -10 10, 24 | -10 8, 25 | -8 8, 26 | -8 10; 27 | -10 4, 28 | -8 4, 29 | -8 6, 30 | -10 6; 31 | -10 0, 32 | -8 0, 33 | -8 2, 34 | -10 2; 35 | -6 6, 36 | -4 6, 37 | -4 4, 38 | -6 4; 39 | -6 0, 40 | -4 0, 41 | -4 2, 42 | -6 2; 43 | -6 -6, 44 | -2 -6, 45 | -2 -4, 46 | -4 -4, 47 | -4 -2, 48 | -6 -2; 49 | 2 -6, 50 | 2 -4, 51 | 0 -4, 52 | 0 -6; 53 | 12 8, 54 | 20 8, 55 | 20 -8, 56 | 12 -8, 57 | 12 -6, 58 | 18 -6, 59 | 18 6, 60 | 12 6; 61 | 12 -4, 62 | 14 -4, 63 | 14 4, 64 | 12 4; 65 | -------------------------------------------------------------------------------- /packages/polyclip-js/test/data/Fig19-P.poly: -------------------------------------------------------------------------------- 1 | 173.16 80.51, 2 | 175.25 82.06, 3 | 177.59 82.12, 4 | 176.4 83.19, 5 | 175.07 83.81, 6 | 174.14 84.79, 7 | 173.09 85.67, 8 | 172.27 87.04, 9 | 171.35 87.99, 10 | 169.94 87.46, 11 | 168.47 87.3, 12 | 167.62 86.37, 13 | 167.82 84.99, 14 | 167.15 85.06, 15 | 165.86 85.04, 16 | 164.71 85.46, 17 | 163.54 86.05, 18 | 164.86 86.24, 19 | 166.17 86.38, 20 | 165.17 87.37, 21 | 163.4 88.52, 22 | 162.63 89.81, 23 | 161.59 90.65, 24 | 160.32 90.94, 25 | 158.92 92.01, 26 | 157.67 93.59, 27 | 157.53 96.47, 28 | 158.78 95.99, 29 | 160.09 96.89, 30 | 159.42 98.03, 31 | 160.73 98.29, 32 | 161.24 99.48, 33 | 162 100.78, 34 | 161.35 102.11, 35 | 160.23 103.09, 36 | 159.77 104.44, 37 | 158.67 105.03, 38 | 157.71 105.94, 39 | 156.92 107.03, 40 | 156.25 108.19, 41 | 155.57 109.34, 42 | 154.88 110.71, 43 | 154.4 111.84, 44 | 153.57 112.8, 45 | 152.43 113.33, 46 | 150.68 115.99, 47 | 149.61 117.42, 48 | 148.67 119.25, 49 | 147.02 118.29, 50 | 146 120.21, 51 | 144.91 119.34, 52 | 143.97 117.98, 53 | 142.69 117.77, 54 | 142.03 116.49, 55 | 142.31 115.23, 56 | 143.42 114.6, 57 | 144.4 113.39, 58 | 144.04 112.18, 59 | 145.16 111.43, 60 | 146.55 110.84, 61 | 147.04 109.71, 62 | 145.64 109.03, 63 | 142.98 106.58, 64 | 142.96 105.22, 65 | 143.28 104.01, 66 | 143.96 102.72, 67 | 144.63 101.56, 68 | 144.59 100.25, 69 | 143.48 99.08, 70 | 142.19 99.26, 71 | 140.57 98.68, 72 | 138.29 98.5, 73 | 136.82 96.57, 74 | 135.95 95.69, 75 | 135.69 96.93, 76 | 135.54 98.25, 77 | 134.12 98.56, 78 | 132.98 99.38, 79 | 132.23 100.49, 80 | 130.81 100.74, 81 | 129.29 100.57, 82 | 128.04 100.11, 83 | 127.06 99.08, 84 | 125.75 97.53, 85 | 127.84 94.61, 86 | 130.42 92.29, 87 | 131.59 91.42, 88 | 132.67 89.9, 89 | 129.29 86.48, 90 | 126.4 83.75, 91 | 124.85 82.13, 92 | 124.03 81.05, 93 | 123.06 80.04, 94 | 121.94 79.06, 95 | 121.25 77.75, 96 | 119.2 75.7, 97 | 120.77 73.91, 98 | 119.49 72.79, 99 | 122.21 69.59, 100 | 121.56 68.26, 101 | 119.93 67.31, 102 | 118.25 66.49, 103 | 116.95 66.43, 104 | 115.89 67.53, 105 | 114.61 67.48, 106 | 113.81 66.51, 107 | 112.78 65.83, 108 | 111.56 65.26, 109 | 109.93 63.09, 110 | 94.14 45.5, 111 | 78.75 64.59, 112 | 90.75 78.36, 113 | 91.84 79.71, 114 | 93.1 81.27, 115 | 94.22 81.92, 116 | 94.54 83.19, 117 | 93.6 84.04, 118 | 92.63 84.9, 119 | 91.89 85.93, 120 | 92.56 87.04, 121 | 93.86 87.29, 122 | 95.23 87.34, 123 | 96.75 88.3, 124 | 97.71 90.05, 125 | 98.83 89.23, 126 | 99.41 90.67, 127 | 100.02 91.73, 128 | 100.34 92.96, 129 | 101.34 93.77, 130 | 102.68 94.85, 131 | 103.17 95.97, 132 | 104.04 96.97, 133 | 105.06 97.71, 134 | 105.52 98.94, 135 | 106.52 99.85, 136 | 107.48 101.75, 137 | 109.23 102.13, 138 | 110.53 104.47, 139 | 111.45 106.35, 140 | 113.62 104.99, 141 | 112.51 103.2, 142 | 111.54 101.45, 143 | 110.16 98.07, 144 | 108.9 97.33, 145 | 108.23 95.17, 146 | 109.41 94.45, 147 | 110.09 93.36, 148 | 111.96 93.59, 149 | 114.4 92.63, 150 | 115.67 91.09, 151 | 116.33 92.17, 152 | 116.93 93.34, 153 | 118.12 93.94, 154 | 118.94 94.91, 155 | 120.78 97.67, 156 | 121.55 98.78, 157 | 122.33 99.83, 158 | 122.16 101.52, 159 | 120.43 104.12, 160 | 119.38 105.14, 161 | 118.28 106.08, 162 | 117.31 109.34, 163 | 118.92 111.48, 164 | 117.6 113.61, 165 | 118.32 114.79, 166 | 117.49 116.2, 167 | 118.86 118.3, 168 | 119.35 120.05, 169 | 120.75 119.35, 170 | 121.97 120.85, 171 | 122.17 122.08, 172 | 121.5 123.97, 173 | 120.11 124.14, 174 | 121.61 125.52, 175 | 121.78 126.75, 176 | 122.37 128.08, 177 | 124.07 128.65, 178 | 124.71 129.72, 179 | 124.23 130.94, 180 | 123.33 132.1, 181 | 123.19 133.32, 182 | 122.45 134.34, 183 | 121.52 135.24, 184 | 121.02 136.51, 185 | 119.72 136.41, 186 | 118.46 135.98, 187 | 117.09 135.93, 188 | 115.76 135.09, 189 | 114.38 135.1, 190 | 113.66 134.05, 191 | 112.93 132.99, 192 | 111.68 132.52, 193 | 110.68 133.64, 194 | 109.65 135.18, 195 | 109.14 136.5, 196 | 108.48 137.99, 197 | 108.77 139.26, 198 | 108.17 140.56, 199 | 107.62 141.72, 200 | 108.24 142.78, 201 | 108.1 144.03, 202 | 108.95 145.14, 203 | 109.74 146.23, 204 | 110.64 147.11, 205 | 110.82 148.77, 206 | 112.31 149.98, 207 | 111.68 151.28, 208 | 110.61 152.02, 209 | 109.31 153.49, 210 | 108.54 154.6, 211 | 107.69 155.51, 212 | 107.45 156.81, 213 | 107.71 158.1, 214 | 107.84 159.43, 215 | 106.67 161.12, 216 | 105.19 162.07, 217 | 104.67 163.24, 218 | 103.52 163.7, 219 | 102.39 162.58, 220 | 101 162.95, 221 | 99.66 164.53, 222 | 98.71 165.47, 223 | 98.18 166.64, 224 | 96.85 168.1, 225 | 95.65 168.93, 226 | 95.51 170.94, 227 | 96.82 170.85, 228 | 96.59 172.14, 229 | 95.43 172.98, 230 | 94.67 173.97, 231 | 93.78 175.1, 232 | 93.05 176.19, 233 | 92.11 177.39, 234 | 90.2 179.73, 235 | 88.76 178.84, 236 | 87.52 177.75, 237 | 86.47 178.6, 238 | 85 180.49, 239 | 85.69 182.39, 240 | 85.08 183.66, 241 | 86.55 183.61, 242 | 87.65 184.32, 243 | 88.57 183.38, 244 | 89.39 184.38, 245 | 90.16 185.68, 246 | 91.66 185.12, 247 | 93.01 184.56, 248 | 94.09 183.98, 249 | 95.33 183.77, 250 | 96.08 184.96, 251 | 97.02 185.83, 252 | 98.64 186.9, 253 | 98.99 188.27, 254 | 99.48 189.56, 255 | 100.01 190.78, 256 | 99.51 192.06, 257 | 98.61 193.56, 258 | 97.95 194.65, 259 | 97.31 196.38, 260 | 98.07 197.41, 261 | 97.04 198.68, 262 | 95.12 200.35, 263 | 93.96 201.75, 264 | 92.44 203.57, 265 | 91.35 204.72, 266 | 90.57 206.15, 267 | 89.47 207.41, 268 | 88.13 207.86, 269 | 86.06 208.87, 270 | 84.97 210.06, 271 | 83.99 211, 272 | 82.79 211.47, 273 | 81.13 213.38, 274 | 80.19 214.61, 275 | 79.46 215.91, 276 | 77.98 217.44, 277 | 76.99 219.47, 278 | 77.97 220.4, 279 | 76.62 223.06, 280 | 76.26 224.48, 281 | 75.37 225.45, 282 | 74.26 226.18, 283 | 72.88 228.24, 284 | 71.63 228.18, 285 | 68.88 231.82, 286 | 67.84 232.87, 287 | 66.69 231.79, 288 | 65.59 231.2, 289 | 64.65 232, 290 | 64.04 233.26, 291 | 62.91 234.46, 292 | 63.19 235.79, 293 | 63.5 237.31, 294 | 64.65 238.23, 295 | 65.86 238.61, 296 | 67.15 239.83, 297 | 66.35 240.78, 298 | 65.58 241.87, 299 | 64.98 242.98, 300 | 63.67 245.74, 301 | 65.55 246.98, 302 | 65.39 248.51, 303 | 64.37 249.78, 304 | 63.01 250.17, 305 | 61.66 249.27, 306 | 60.47 249.99, 307 | 59.62 251.18, 308 | 58.72 252.08, 309 | 57.45 251.7, 310 | 55.89 250.82, 311 | 54.54 250.17, 312 | 53.09 249.86, 313 | 54.02 248.47, 314 | 52.76 248.18, 315 | 51.29 247.27, 316 | 50.29 248.03, 317 | 48.92 247.5, 318 | 47.97 249.17, 319 | 46.79 248.66, 320 | 45.5 250.04, 321 | 44.81 251.19, 322 | 44.08 252.71, 323 | 42.98 254.73, 324 | 41.51 256.29, 325 | 41.85 257.5, 326 | 39.98 257.73, 327 | 39.44 256.3, 328 | 38.19 255.71, 329 | 36.9 255.79, 330 | 35.67 255.84, 331 | 34.21 256.66, 332 | 32.54 256.55, 333 | 32.82 257.75, 334 | 34.19 258.65, 335 | 34.84 259.78, 336 | 33.14 262, 337 | 32.53 263.19, 338 | 32.17 265.93, 339 | 31.65 267.25, 340 | 31.87 268.6, 341 | 32.78 269.67, 342 | 33.34 270.93, 343 | 33.89 272.51, 344 | 34.26 274.12, 345 | 34.73 275.92, 346 | 34.27 277.58, 347 | 34.39 278.82, 348 | 34.1 280.32, 349 | 34.49 281.79, 350 | 34.65 283.64, 351 | 34.7 285.71, 352 | 34.41 287.39, 353 | 34.19 288.89, 354 | 33.97 290.13, 355 | 32.25 290.74, 356 | 33.14 295.07, 357 | 33.56 296.47, 358 | 33.07 297.66, 359 | 32.9 298.89, 360 | 32.36 300.15, 361 | 32.6 301.35, 362 | 32.61 302.65, 363 | 32.08 304.01, 364 | 31.19 304.98, 365 | 31.26 306.39, 366 | 30.64 307.54, 367 | 31.74 308.35, 368 | 33.78 308.24, 369 | 34.6 307.02, 370 | 35.36 305.94, 371 | 36.81 306.16, 372 | 38.19 305.22, 373 | 39.33 305.73, 374 | 38.55 304.09, 375 | 39.26 302.17, 376 | 39.75 300.58, 377 | 41.07 301.2, 378 | 42.33 301.54, 379 | 43.13 302.49, 380 | 43.48 303.99, 381 | 43.95 305.13, 382 | 44.66 306.24, 383 | 45.84 305.91, 384 | 46.95 307.01, 385 | 48.93 307.52, 386 | 50.15 307.3, 387 | 51.13 305.8, 388 | 52.08 305.01, 389 | 52.78 303.74, 390 | 53.57 302.63, 391 | 54.79 302.31, 392 | 56.01 302.11, 393 | 57.23 303.71, 394 | 59.44 304, 395 | 60.64 304.41, 396 | 61.76 304.96, 397 | 62.9 305.76, 398 | 64.21 306.4, 399 | 65.24 307.93, 400 | 65.86 309.01, 401 | 66.96 311.13, 402 | 67.46 312.45, 403 | 68.02 313.73, 404 | 68.46 314.91, 405 | 69.69 314.26, 406 | 70.83 313.41, 407 | 71.59 314.5, 408 | 73.25 316.99, 409 | 74.37 315.98, 410 | 74.38 314.36, 411 | 74.99 313.01, 412 | 76.39 312.99, 413 | 77.79 312.23, 414 | 79.39 311.21, 415 | 80.95 311.49, 416 | 80.85 313.02, 417 | 80.58 314.32, 418 | 80.46 315.92, 419 | 81.71 317.37, 420 | 80.55 318.3, 421 | 79.33 318.11, 422 | 78.06 318.98, 423 | 76.75 319.33, 424 | 75.64 319.91, 425 | 74.42 320.36, 426 | 73.41 321.99, 427 | 72.22 323.37, 428 | 71.36 324.32, 429 | 70.52 325.32, 430 | 69.85 326.53, 431 | 68.85 327.54, 432 | 67.79 328.18, 433 | 66.77 329.28, 434 | 65.89 330.45, 435 | 64.85 331.59, 436 | 63.95 332.89, 437 | 63.41 334.52, 438 | 62.59 336.68, 439 | 62.5 338.34, 440 | 61.08 338.49, 441 | 61.2 337.16, 442 | 61.35 335.64, 443 | 60.59 334.59, 444 | 60.06 333.44, 445 | 59.27 332.18, 446 | 58.18 331.1, 447 | 54.17 332.89, 448 | 52.91 333.29, 449 | 51.51 333.28, 450 | 50.33 333.76, 451 | 49.09 333.65, 452 | 47.44 333.94, 453 | 46.15 333.66, 454 | 45.02 333.1, 455 | 45.39 331.45, 456 | 46.15 330.3, 457 | 44.87 330.78, 458 | 44.06 331.79, 459 | 43.21 332.8, 460 | 42.51 333.9, 461 | 41.75 334.96, 462 | 41.65 336.28, 463 | 41.12 337.54, 464 | 40.7 338.78, 465 | 39.96 339.82, 466 | 39.34 340.93, 467 | 38.62 342.01, 468 | 38.76 343.23, 469 | 39.78 344.21, 470 | 40.6 345.94, 471 | 41.6 348.42, 472 | 42.97 349.43, 473 | 43.92 350.6, 474 | 44.97 351.45, 475 | 46.27 351.49, 476 | 47.5 351.34, 477 | 47.79 352.57, 478 | 48.32 354.72, 479 | 48.41 356.08, 480 | 49.67 358.24, 481 | 51.01 360.19, 482 | 52.64 361.87, 483 | 54.23 362.03, 484 | 55.35 363.22, 485 | 56.28 364.42, 486 | 58.67 364.49, 487 | 60.27 364.64, 488 | 62.37 364.28, 489 | 63.44 362.26, 490 | 63.81 360.86, 491 | 64.57 359.29, 492 | 66.06 358.27, 493 | 67.47 356.85, 494 | 68.37 355.43, 495 | 69.28 354.33, 496 | 70.14 353.3, 497 | 71.84 351.19, 498 | 74.16 349.5, 499 | 76.48 347.83, 500 | 77.49 347.14, 501 | 78.68 346.07, 502 | 79.22 347.33, 503 | 79.23 348.79, 504 | 79.05 350.23, 505 | 78.61 351.64, 506 | 78.22 353.06, 507 | 78.56 354.47, 508 | 79.46 353.29, 509 | 80.55 352.37, 510 | 81.28 351.28, 511 | 82.59 350.68, 512 | 84.21 351.15, 513 | 85.65 351.14, 514 | 86.8 352.05, 515 | 88.02 352.71, 516 | 89.28 353.19, 517 | 90.74 353.94, 518 | 92.52 354.5, 519 | 93.23 355.74, 520 | 94.08 356.69, 521 | 95.47 356.64, 522 | 96.3 357.54, 523 | 97.85 359.1, 524 | 99.36 358.92, 525 | 100.56 358.37, 526 | 101.67 358.96, 527 | 103.4 358.9, 528 | 104.56 358.02, 529 | 105.76 358.33, 530 | 106.84 359.15, 531 | 107.48 360.23, 532 | 108.69 360.9, 533 | 109.95 361.75, 534 | 110.79 362.79, 535 | 111.45 364, 536 | 112.58 364.96, 537 | 113.61 365.65, 538 | 114.99 365.96, 539 | 115.59 367.16, 540 | 115.34 368.41, 541 | 115.07 369.69, 542 | 115.62 371.35, 543 | 115.72 372.63, 544 | 116.35 374, 545 | 117.16 375.14, 546 | 118.57 376.43, 547 | 118.41 377.8, 548 | 117.77 378.95, 549 | 118.19 380.28, 550 | 117.83 381.68, 551 | 118.21 383.44, 552 | 118.14 384.84, 553 | 118.21 386.49, 554 | 118.71 387.68, 555 | 119.92 388.17, 556 | 120.78 389.64, 557 | 122.4 391.38, 558 | 123.32 392.37, 559 | 123.96 393.83, 560 | 124.46 395.1, 561 | 123.51 396.63, 562 | 122.61 398.52, 563 | 121.52 399.96, 564 | 120.68 401.44, 565 | 120.98 402.71, 566 | 122.25 402.69, 567 | 124.8 402.04, 568 | 125.94 401.44, 569 | 127.08 400.56, 570 | 128.08 399.81, 571 | 129.19 399.21, 572 | 131.25 398.13, 573 | 132.62 397.45, 574 | 134 396.73, 575 | 136.4 395.79, 576 | 137.26 394.06, 577 | 137.64 392.58, 578 | 138.07 389.97, 579 | 138.3 388.41, 580 | 138.67 386.67, 581 | 140.04 385.14, 582 | 141.08 384.28, 583 | 141.75 382.73, 584 | 146.54 377.55, 585 | 148.22 376.34, 586 | 149.99 375.15, 587 | 150.93 374.33, 588 | 151.83 372.97, 589 | 154.11 371.72, 590 | 156.33 370.01, 591 | 157.13 368.76, 592 | 159.54 367.37, 593 | 161.54 368.79, 594 | 165.14 367.51, 595 | 167.44 368.24, 596 | 169.6 368.23, 597 | 172.35 368.45, 598 | 174.86 367.8, 599 | 175.98 368.78, 600 | 177.23 368.18, 601 | 178.35 367.17, 602 | 178.81 365.79, 603 | 179.83 364.73, 604 | 180.63 363.38, 605 | 181.82 363, 606 | 184.4 361.48, 607 | 186.63 360.69, 608 | 188.44 357.87, 609 | 190.52 356.56, 610 | 193.03 353.83, 611 | 193.41 350.74, 612 | 194.84 348.11, 613 | 195.06 346.71, 614 | 195.59 345.46, 615 | 196.57 342.67, 616 | 197.33 341.1, 617 | 198.78 340.1, 618 | 199.94 340.54, 619 | 201.31 340.9, 620 | 202.86 341.11, 621 | 204.16 340.98, 622 | 205.18 340.3, 623 | 206.38 339.57, 624 | 207.49 338.52, 625 | 209.01 337.53, 626 | 210.08 336.78, 627 | 211.49 335.81, 628 | 212.37 334.91, 629 | 213.5 334.13, 630 | 214.56 333.39, 631 | 217.33 330.31, 632 | 218.91 328.72, 633 | 219.64 327.56, 634 | 223.75 330.93, 635 | 225.12 334.13, 636 | 227.01 337.01, 637 | 228.09 336.15, 638 | 229.02 334.92, 639 | 229.64 333.83, 640 | 230.59 332.88, 641 | 231.4 331.77, 642 | 231.98 330.65, 643 | 232.77 329.68, 644 | 233.69 328.79, 645 | 234.17 327.52, 646 | 234.85 326.49, 647 | 235.82 325.58, 648 | 236.99 324.94, 649 | 238.06 324.29, 650 | 239.25 323.76, 651 | 240.93 322.73, 652 | 242.79 322.35, 653 | 244.26 321.75, 654 | 246.01 320.79, 655 | 247.34 319.82, 656 | 248.62 319.07, 657 | 249.81 318.23, 658 | 251.16 316.84, 659 | 252.18 315.38, 660 | 253.66 313.22, 661 | 254.32 311.73, 662 | 255.46 309.74, 663 | 256.29 308.49, 664 | 257.58 306.47, 665 | 258.45 305.48, 666 | 259.66 304.68, 667 | 260.48 303.41, 668 | 261.77 302.11, 669 | 263.08 301.95, 670 | 265.59 303.39, 671 | 266.78 303.84, 672 | 268.4 304.39, 673 | 269.51 304.95, 674 | 270.9 304.97, 675 | 272.54 304.73, 676 | 274.69 303.66, 677 | 275.99 300.81, 678 | 276.82 298.22, 679 | 278.06 297.37, 680 | 280.71 296.38, 681 | 277.9 290.43, 682 | 278.56 284.23, 683 | 279.54 279.53, 684 | 279.32 277.86, 685 | 276.62 275.68, 686 | 276.65 273.88, 687 | 276.79 269.6, 688 | 277.4 265.49, 689 | 278.69 265.11, 690 | 280.01 265.23, 691 | 281.73 264.85, 692 | 283.93 263.32, 693 | 285.02 261.8, 694 | 283.78 258.28, 695 | 283.02 256.88, 696 | 282.38 255.76, 697 | 281.73 254.58, 698 | 280.87 252.83, 699 | 282.38 252.61, 700 | 284 252.64, 701 | 285.71 252.44, 702 | 287.08 252.79, 703 | 290.47 252.26, 704 | 292.21 252.26, 705 | 293.14 253.38, 706 | 294.07 254.24, 707 | 294.88 255.5, 708 | 294.82 256.83, 709 | 295.79 258.08, 710 | 297.03 258.67, 711 | 297.25 260.23, 712 | 297.19 261.66, 713 | 298.31 263.03, 714 | 298.53 261.25, 715 | 299.01 259.95, 716 | 299.96 258.97, 717 | 300.52 257.5, 718 | 302.33 256.76, 719 | 306.64 252.8, 720 | 307.4 251.69, 721 | 303.89 252.15, 722 | 303.98 250.87, 723 | 304.69 249.77, 724 | 304.6 248.53, 725 | 305.1 247.16, 726 | 305.13 245.41, 727 | 305.4 243.87, 728 | 304.72 242.59, 729 | 305.67 241.09, 730 | 306.6 239.6, 731 | 306.98 237.9, 732 | 306.1 236.37, 733 | 305.66 234.97, 734 | 306.69 233.75, 735 | 307.9 232.76, 736 | 307 230.76, 737 | 307.47 229.28, 738 | 309.1 228.17, 739 | 307.51 226.41, 740 | 306.1 226.77, 741 | 303.55 226.46, 742 | 301.79 224.79, 743 | 300.7 221.86, 744 | 299.76 222.67, 745 | 298.47 222.65, 746 | 297.05 222.46, 747 | 292.59 221.86, 748 | 292.74 220.61, 749 | 293.39 219.28, 750 | 294.1 218.11, 751 | 294.42 216.86, 752 | 294.85 215.28, 753 | 294.77 213.58, 754 | 293.85 212.52, 755 | 291.47 212, 756 | 290.22 211.18, 757 | 288.73 211.43, 758 | 286.47 211, 759 | 285.04 210.14, 760 | 283.77 209.83, 761 | 282.35 209.66, 762 | 280.08 209.3, 763 | 278.45 209.05, 764 | 276.9 209.07, 765 | 275.68 208.74, 766 | 274.04 208.77, 767 | 273.03 207.99, 768 | 272.13 207.09, 769 | 270.88 205.74, 770 | 270.16 204.46, 771 | 269.36 202.34, 772 | 269.14 200.14, 773 | 269.28 198.55, 774 | 269.37 196.6, 775 | 269.78 194.51, 776 | 270.24 193.1, 777 | 271.32 191.67, 778 | 272.11 190.28, 779 | 272.73 189, 780 | 273.04 187.62, 781 | 273.06 186.28, 782 | 272.34 184.81, 783 | 272.5 183.04, 784 | 272.47 181.5, 785 | 272.35 179.61, 786 | 271.5 178.53, 787 | 270.82 177.06, 788 | 270.13 175.9, 789 | 268.72 175.52, 790 | 268.02 174.32, 791 | 267.53 173.02, 792 | 267.51 171.64, 793 | 266.48 170.91, 794 | 267.45 169.82, 795 | 268.94 168.56, 796 | 269.74 167.47, 797 | 271.28 166.42, 798 | 271.43 164.83, 799 | 273.02 162.88, 800 | 272.05 160.77, 801 | 272.57 159.59, 802 | 271.86 158.25, 803 | 272.06 156.24, 804 | 273.21 154.95, 805 | 274.39 152.74, 806 | 274.61 151.52, 807 | 275.27 149.82, 808 | 275.2 148.46, 809 | 275.71 146.7, 810 | 276.28 145.57, 811 | 277.38 144.63, 812 | 278.21 143.19, 813 | 279.21 142.22, 814 | 280.65 140.98, 815 | 280.06 139.84, 816 | 280.77 137.87, 817 | 280.7 135.79, 818 | 280.33 134.37, 819 | 281.09 132.99, 820 | 283.02 132.45, 821 | 285.27 131.21, 822 | 285.68 129.04, 823 | 284.95 127.29, 824 | 284 126.49, 825 | 283.17 125.56, 826 | 282.35 124.42, 827 | 281.34 123.26, 828 | 279.65 122.26, 829 | 278.51 121.48, 830 | 276.95 120.81, 831 | 275.84 120.16, 832 | 274.52 119.13, 833 | 274.09 117.75, 834 | 273.13 116.62, 835 | 272 115.61, 836 | 273.27 114.95, 837 | 274.42 114.48, 838 | 275.4 113.61, 839 | 276.65 113.2, 840 | 276.51 111.84, 841 | 277.21 110.47, 842 | 277.7 109.14, 843 | 278.73 108.32, 844 | 279.2 109.71, 845 | 281.12 109.21, 846 | 282.45 109.65, 847 | 283.77 110.11, 848 | 284.64 111.06, 849 | 284.74 112.32, 850 | 283.18 112.36, 851 | 282.13 113.32, 852 | 282.63 114.66, 853 | 283.3 115.96, 854 | 284.68 116.24, 855 | 286.05 116.26, 856 | 286.94 115.36, 857 | 287.76 116.34, 858 | 288.77 117.31, 859 | 289.94 116.61, 860 | 291.21 115.93, 861 | 292.43 115.44, 862 | 294.4 114.8, 863 | 295.5 113.61, 864 | 296.32 112.21, 865 | 296.82 111.02, 866 | 298.38 109.7, 867 | 299.11 107.99, 868 | 298.49 106.58, 869 | 298.7 104.02, 870 | 297.78 102.78, 871 | 296.55 102.28, 872 | 295.85 98.86, 873 | 296.17 95.61, 874 | 296.15 91.22, 875 | 294.43 89.95, 876 | 293.27 89.48, 877 | 290.04 88.71, 878 | 283.59 86.73, 879 | 282.29 86.75, 880 | 276.31 88.14, 881 | 274.46 88.16, 882 | 271.26 87.49, 883 | 268.68 86.59, 884 | 265.86 86.65, 885 | 264.44 87.4, 886 | 262.24 89.56, 887 | 260.76 89.29, 888 | 257.49 87.42, 889 | 255.4 87, 890 | 254.08 86.04, 891 | 252.08 83.95, 892 | 250.37 83.51, 893 | 247.04 82.96, 894 | 244.43 82.05, 895 | 243.86 83.76, 896 | 242.6 83.76, 897 | 241.19 83.69, 898 | 239.96 82.8, 899 | 238.57 82.1, 900 | 238.03 80.63, 901 | 236.96 79.79, 902 | 235.39 79.99, 903 | 234.04 80.79, 904 | 233.2 81.96, 905 | 231.61 84.06, 906 | 229.25 81.1, 907 | 227.52 80.49, 908 | 226.04 80.72, 909 | 224.77 80.85, 910 | 223.31 80.59, 911 | 222.15 81.35, 912 | 221.38 82.38, 913 | 220.06 82.66, 914 | 217.46 82, 915 | 218.95 81.2, 916 | 220.07 80.61, 917 | 221.2 80.11, 918 | 222.77 79.68, 919 | 224.15 78.65, 920 | 225.41 77.91, 921 | 225.86 76.55, 922 | 226.73 75.24, 923 | 226.25 73.38, 924 | 226.1 72.01, 925 | 226.72 70.82, 926 | 226.47 69.41, 927 | 226.03 68.12, 928 | 226.56 66.84, 929 | 226.94 64.87, 930 | 228.19 64.77, 931 | 228.64 63.48, 932 | 229.4 62.47, 933 | 228.33 60.66, 934 | 227.3 59.06, 935 | 226.34 57.37, 936 | 224.79 56.27, 937 | 224.47 54.86, 938 | 225.63 54.1, 939 | 226.67 53.4, 940 | 227.9 53.1, 941 | 228.24 51.62, 942 | 228.22 50.27, 943 | 228.19 48.96, 944 | 227.07 47.94, 945 | 227.3 46.67, 946 | 227.44 45.23, 947 | 228.02 44.11, 948 | 228.63 42.89, 949 | 227.61 42.14, 950 | 227.23 40.93, 951 | 225.83 40.64, 952 | 224.49 40.8, 953 | 223.24 40.94, 954 | 221.98 39.95, 955 | 220.65 39.04, 956 | 221.63 37.92, 957 | 223.04 37.82, 958 | 226.75 36.63, 959 | 226.92 35.23, 960 | 230.14 35.64, 961 | 230.08 33.98, 962 | 230.8 32.74, 963 | 231.4 31.6, 964 | 233.26 30.81, 965 | 233.67 29.62, 966 | 235.1 28.72, 967 | 237.01 27.46, 968 | 237.93 26.2, 969 | 238.48 25.01, 970 | 240.33 23.3, 971 | 239.97 21.8, 972 | 238.42 20.17, 973 | 236.46 18.52, 974 | 235.16 17.66, 975 | 234.59 16.48, 976 | 235.96 14.67, 977 | 235.64 13.15, 978 | 234.39 13.86, 979 | 233.82 12.33, 980 | 233.25 10.71, 981 | 232.56 9.47, 982 | 231.85 8.07, 983 | 230.79 8.87, 984 | 229.57 7.79, 985 | 228.26 9.79, 986 | 225.81 8.17, 987 | 223.09 11.7, 988 | 221.76 11.79, 989 | 220.88 12.67, 990 | 217.35 14.52, 991 | 213.21 16.7, 992 | 209.64 18.56, 993 | 206.71 20.15, 994 | 204.42 21.33, 995 | 202.48 22.28, 996 | 201.26 22.11, 997 | 199.82 22.5, 998 | 197.94 23.08, 999 | 193.82 24.06, 1000 | 170.97 28.84, 1001 | 169.13 29.09, 1002 | 162.6 28.89, 1003 | 155.67 28.68, 1004 | 152.76 28.19, 1005 | 147.38 26.65, 1006 | 151.6 28.06, 1007 | 152.99 28.53, 1008 | 154.92 30.11, 1009 | 156.25 30.82, 1010 | 158.18 32.73, 1011 | 156.84 34.38, 1012 | 157.35 35.75, 1013 | 155.73 36.7, 1014 | 156.55 38.32, 1015 | 156.25 40.33, 1016 | 155.9 41.7, 1017 | 156.54 43.39, 1018 | 155.09 43.75, 1019 | 156.07 44.74, 1020 | 156.35 46.15, 1021 | 156.92 47.67, 1022 | 157.03 49.36, 1023 | 157.29 50.58, 1024 | 157.33 52.83, 1025 | 156.69 53.96, 1026 | 155.82 55.24, 1027 | 156.65 56.8, 1028 | 162.51 65.07, 1029 | 168.21 73.12, 1030 | 169.44 75.09, 1031 | 171.01 76.92, 1032 | 172.62 78.25, 1033 | 171.38 79.16, 1034 | 171.41 79.62, 1035 | 172.07 79.94; 1036 | 182.06 74.94, 1037 | 183.65 76.89, 1038 | 184.87 78.38, 1039 | 184.64 79.73, 1040 | 184.93 81.37, 1041 | 186.72 82.16, 1042 | 187.4 80.37, 1043 | 188.73 79.19, 1044 | 189.92 78.37, 1045 | 191.36 77.79, 1046 | 192.34 77.05, 1047 | 194.05 77.04, 1048 | 193.21 75.26, 1049 | 192.81 74.09, 1050 | 192.86 71.71, 1051 | 192.76 70.42, 1052 | 192.32 68.96, 1053 | 191.08 68.98, 1054 | 189.1 69.59, 1055 | 187.78 69.08, 1056 | 186.31 69.86, 1057 | 184.87 70.31, 1058 | 183.49 70.92, 1059 | 182.82 71.27, 1060 | 182.5 73.28; 1061 | 34.92 104.24, 1062 | 23.46 115.26, 1063 | 5.5 132.79, 1064 | 17.45 145.86, 1065 | 18.88 147.23, 1066 | 19.97 148.27, 1067 | 21.92 150.14, 1068 | 22.87 151.49, 1069 | 25.37 149.71, 1070 | 26.91 152.15, 1071 | 25.91 153.29, 1072 | 24.7 154.33, 1073 | 22.76 156.14, 1074 | 21.84 158.46, 1075 | 23.55 157.9, 1076 | 24.61 156.74, 1077 | 25.98 158.04, 1078 | 26.98 158.86, 1079 | 27.93 159.78, 1080 | 28.76 160.78, 1081 | 29.66 161.85, 1082 | 31.08 163.12, 1083 | 32.5 163.22, 1084 | 34.67 162.24, 1085 | 36.32 162.78, 1086 | 38.33 164.54, 1087 | 39.35 165.62, 1088 | 39.15 166.97, 1089 | 40.67 167.24, 1090 | 42.01 167.63, 1091 | 43.09 168.35, 1092 | 44.04 169.17, 1093 | 44.59 170.29, 1094 | 45.86 168.94, 1095 | 47.17 168.76, 1096 | 48.69 169.63, 1097 | 49.76 168.8, 1098 | 50.64 167.11, 1099 | 51.37 166.04, 1100 | 53.22 166.44, 1101 | 54.79 165.97, 1102 | 55.77 165.19, 1103 | 56.98 164.22, 1104 | 56.38 163.04, 1105 | 57.28 162.03, 1106 | 58.88 161.73, 1107 | 60.44 160.7, 1108 | 62.15 161.41, 1109 | 63.32 162.18, 1110 | 62.61 163.39, 1111 | 62.97 164.71, 1112 | 64.36 165.54, 1113 | 65.45 166.13, 1114 | 67.12 167.14, 1115 | 68.36 167.72, 1116 | 69.7 168.68, 1117 | 72.36 168.14, 1118 | 74.89 167.05, 1119 | 77.78 167.73, 1120 | 78.17 166.47, 1121 | 79.5 166.29, 1122 | 80.12 164.74, 1123 | 82.2 164.52, 1124 | 83.35 164, 1125 | 84.75 163.4, 1126 | 85 165.07, 1127 | 85.77 166.06, 1128 | 86.34 164.91, 1129 | 87.58 163.9, 1130 | 88.62 162.69, 1131 | 88.49 161.1, 1132 | 88.46 159.63, 1133 | 89.33 158.36, 1134 | 89.77 156.99, 1135 | 90.45 155.57, 1136 | 90.59 154.16, 1137 | 92.65 153.16, 1138 | 93.31 151.52, 1139 | 94.18 150.43, 1140 | 95.3 149.48, 1141 | 95.57 148.23, 1142 | 94.28 146.98, 1143 | 93.6 145.9, 1144 | 91.24 145.9, 1145 | 90.06 144.59, 1146 | 88.75 145.5, 1147 | 87.59 146.78, 1148 | 86.91 148.48, 1149 | 85.94 149.75, 1150 | 83.96 148.44, 1151 | 82.88 147.42, 1152 | 83.9 146.33, 1153 | 84.63 145.04, 1154 | 85.25 143.95, 1155 | 85.33 142.64, 1156 | 84.73 141.21, 1157 | 85.13 139.77, 1158 | 84.55 138.4, 1159 | 83.56 136.3, 1160 | 82.85 134.43, 1161 | 83.12 133.05, 1162 | 83.85 132.03, 1163 | 84.06 128.12, 1164 | 84.67 126.82, 1165 | 85.56 125.08, 1166 | 89.74 119.14, 1167 | 95.11 114.87, 1168 | 94.26 113.69, 1169 | 93.03 112.77, 1170 | 92.56 111.61, 1171 | 91.21 110.83, 1172 | 90.76 109.63, 1173 | 89.42 108.71, 1174 | 88.53 107.8, 1175 | 87.11 106.74, 1176 | 82.63 107.77, 1177 | 78.85 109.3, 1178 | 77.77 108.35, 1179 | 76.67 106.71, 1180 | 78.57 106.1, 1181 | 79.81 105.25, 1182 | 82.24 104.95, 1183 | 83.28 104.12, 1184 | 85.08 103.53, 1185 | 86.15 105.17, 1186 | 88.43 104.04, 1187 | 89.34 102.91, 1188 | 90.55 102.26, 1189 | 86.71 97.13, 1190 | 85.69 95.79, 1191 | 83.86 97.18, 1192 | 83.09 95.99, 1193 | 81.06 94.74, 1194 | 80.18 93.87, 1195 | 78.85 94.11, 1196 | 78.02 92.9, 1197 | 76.76 91.68, 1198 | 75.8 90.51, 1199 | 71.84 85.26, 1200 | 64.29 75.7, 1201 | 54.29 85.38; 1202 | 39.61 200.46, 1203 | 40.53 199.38, 1204 | 41.29 198.25, 1205 | 42.91 197.69, 1206 | 44.75 197.26, 1207 | 46.4 196.75, 1208 | 47.8 197.15, 1209 | 49.02 197.74, 1210 | 50.43 198.25, 1211 | 53.5 200.71, 1212 | 55.03 202.3, 1213 | 57.55 202.95, 1214 | 58.95 203.22, 1215 | 60.2 203.31, 1216 | 61.44 203.68, 1217 | 62.82 203.47, 1218 | 64.1 203.27, 1219 | 65 202.41, 1220 | 64.6 201.21, 1221 | 64.79 199.93, 1222 | 64.63 198.55, 1223 | 70.54 189.06, 1224 | 72.04 186.77, 1225 | 71.12 185.5, 1226 | 69.03 183.93, 1227 | 69.64 182.6, 1228 | 68.44 181.56, 1229 | 67.07 181.12, 1230 | 65.96 180.6, 1231 | 65.19 179.59, 1232 | 64.1 177.9, 1233 | 63.05 177.18, 1234 | 61.89 177.63, 1235 | 61.04 178.59, 1236 | 61.34 177.07, 1237 | 61.55 175.4, 1238 | 60.6 174.48, 1239 | 59.78 173.47, 1240 | 58.93 171.57, 1241 | 57.63 171.24, 1242 | 57.68 169.96, 1243 | 56.77 169.09, 1244 | 55.67 170.52, 1245 | 55.28 171.76, 1246 | 55.71 173.03, 1247 | 54.73 174.93, 1248 | 54.05 176.16, 1249 | 52.85 177.17, 1250 | 51.78 178.19, 1251 | 50.43 178.96, 1252 | 49.6 179.87, 1253 | 48.7 181.01, 1254 | 47.78 181.86, 1255 | 46.75 182.77, 1256 | 47.42 183.87, 1257 | 46.62 184.86, 1258 | 45.49 185.74, 1259 | 45.13 187.08, 1260 | 44.23 187.94, 1261 | 43.33 189.1, 1262 | 43.01 190.48, 1263 | 41.61 191.95, 1264 | 40.45 193.02, 1265 | 40.78 194.53, 1266 | 39.93 195.46, 1267 | 38.62 195.18, 1268 | 37.57 195.85, 1269 | 36.43 196.55, 1270 | 35.01 195.88, 1271 | 33.58 196.96, 1272 | 32.37 197.55, 1273 | 31.44 196.46, 1274 | 30.01 196.53, 1275 | 29.55 197.88, 1276 | 28.66 199.3, 1277 | 28.16 200.49, 1278 | 27.29 201.49, 1279 | 28.37 202.31, 1280 | 29.16 203.33, 1281 | 30.81 203.4, 1282 | 32.25 203.06, 1283 | 33.78 203.1, 1284 | 35.11 202.34, 1285 | 36.48 202.62, 1286 | 37.76 202.16, 1287 | 38.34 201.99; 1288 | 22.7 186.27, 1289 | 24.82 187.48, 1290 | 26.43 188.3, 1291 | 25.75 189.33, 1292 | 25.67 190.58, 1293 | 25.59 192.02, 1294 | 25.41 194.4, 1295 | 25.03 196.39, 1296 | 24.77 197.86, 1297 | 24.08 198.99, 1298 | 23.15 199.79, 1299 | 22.29 200.69, 1300 | 22.18 202.2, 1301 | 21.65 203.79, 1302 | 19 207.02, 1303 | 17.06 208.28, 1304 | 15.07 209.3, 1305 | 14.22 207.84, 1306 | 13.58 206.66, 1307 | 13.9 205.43, 1308 | 13.57 204.04, 1309 | 11.95 202.69, 1310 | 9.98 201.77, 1311 | 9.07 200.56, 1312 | 8.54 199.28, 1313 | 9.23 198.2, 1314 | 9.82 197.07, 1315 | 10.42 195.98, 1316 | 12.82 195.41, 1317 | 13.76 194.3, 1318 | 16.44 191.48, 1319 | 17.86 190.47, 1320 | 18.76 188.48, 1321 | 20.11 185.69, 1322 | 21.59 187.06; 1323 | -------------------------------------------------------------------------------- /packages/polyclip-js/test/data/Fig19-clip.poly: -------------------------------------------------------------------------------- 1 | 117.77 378.95, 2 | 118.19 380.28, 3 | 117.83 381.68, 4 | 118.21 383.44, 5 | 118.14 384.84, 6 | 118.21 386.49, 7 | 118.71 387.68, 8 | 119.92 388.17, 9 | 120.78 389.64, 10 | 122.4 391.38, 11 | 123.32 392.37, 12 | 123.96 393.83, 13 | 124.46 395.1, 14 | 123.51 396.63, 15 | 122.61 398.52, 16 | 121.52 399.96, 17 | 120.68 401.44, 18 | 120.98 402.71, 19 | 122.25 402.69, 20 | 124.8 402.04, 21 | 125.94 401.44, 22 | 127.08 400.56, 23 | 128.08 399.81, 24 | 129.19 399.21, 25 | 131.25 398.13, 26 | 132.62 397.45, 27 | 134 396.73, 28 | 136.4 395.79, 29 | 137.26 394.06, 30 | 137.64 392.58, 31 | 138.07 389.97, 32 | 138.3 388.41, 33 | 138.67 386.67, 34 | 140.04 385.14, 35 | 141.08 384.28, 36 | 141.75 382.73, 37 | 146.54 377.55, 38 | 148.22 376.34, 39 | 149.99 375.15, 40 | 150.93 374.33, 41 | 151.83 372.97, 42 | 154.11 371.72, 43 | 156.33 370.01, 44 | 157.13 368.76, 45 | 159.54 367.37, 46 | 161.54 368.79, 47 | 165.14 367.51, 48 | 167.44 368.24, 49 | 169.6 368.23, 50 | 172.35 368.45, 51 | 174.86 367.8, 52 | 175.98 368.78, 53 | 177.23 368.18, 54 | 178.35 367.17, 55 | 178.81 365.79, 56 | 179.83 364.73, 57 | 180.63 363.38, 58 | 181.82 363, 59 | 184.4 361.48, 60 | 186.63 360.69, 61 | 188.44 357.87, 62 | 190.52 356.56, 63 | 193.03 353.83, 64 | 193.41 350.74, 65 | 194.84 348.11, 66 | 195.06 346.71, 67 | 195.59 345.46, 68 | 196.57 342.67, 69 | 197.33 341.1, 70 | 198.78 340.1, 71 | 199.94 340.54, 72 | 201.31 340.9, 73 | 202.86 341.11, 74 | 204.16 340.98, 75 | 205.18 340.3, 76 | 206.38 339.57, 77 | 207.49 338.52, 78 | 209.01 337.53, 79 | 210.08 336.78, 80 | 211.49 335.81, 81 | 212.37 334.91, 82 | 213.5 334.13, 83 | 214.56 333.39, 84 | 217.33 330.31, 85 | 218.91 328.72, 86 | 219.64 327.56, 87 | 223.75 330.93, 88 | 225.12 334.13, 89 | 227.01 337.01, 90 | 228.09 336.15, 91 | 229.02 334.92, 92 | 229.64 333.83, 93 | 230.59 332.88, 94 | 231.4 331.77, 95 | 231.98 330.65, 96 | 232.77 329.68, 97 | 233.69 328.79, 98 | 234.17 327.52, 99 | 234.85 326.49, 100 | 235.82 325.58, 101 | 236.99 324.94, 102 | 238.06 324.29, 103 | 239.25 323.76, 104 | 240.93 322.73, 105 | 242.79 322.35, 106 | 244.26 321.75, 107 | 246.01 320.79, 108 | 247.34 319.82, 109 | 248.62 319.07, 110 | 249.81 318.23, 111 | 251.16 316.84, 112 | 251.67 316.11, 113 | 250.15 315.44, 114 | 247.06 314.23, 115 | 245.79 313.66, 116 | 244.13 312.84, 117 | 243.83 312.73, 118 | 242.96 312.28, 119 | 242.65 312, 120 | 242.06 311.37, 121 | 240.07 309.44, 122 | 239.96 309.2, 123 | 239.63 308.92, 124 | 239.31 308.58, 125 | 238.44 308.6, 126 | 238.13 308.58, 127 | 237.91 308.47, 128 | 237.79 308.31, 129 | 237.57 307.95, 130 | 237.58 307.31, 131 | 237.64 307.14, 132 | 237.75 307.03, 133 | 237.84 306.86, 134 | 237.85 306.69, 135 | 238.22 306.07, 136 | 238.02 305.77, 137 | 237.91 305.79, 138 | 237.6 306.05, 139 | 236.2 306.57, 140 | 235.94 306.57, 141 | 235.61 306.61, 142 | 235.35 306.7, 143 | 235.15 306.73, 144 | 234.99 306.62, 145 | 234.74 306.62, 146 | 234.42 306.73, 147 | 233.41 307.22, 148 | 232.99 307.35, 149 | 232.8 307.55, 150 | 232.4 308.24, 151 | 231.64 309.23, 152 | 232.01 309.45, 153 | 231.22 309.78, 154 | 231 310.19, 155 | 230.72 310.58, 156 | 230.42 310.9, 157 | 230.13 311.37, 158 | 229.64 312.03, 159 | 229.27 312.65, 160 | 229 312.98, 161 | 228.71 313.48, 162 | 228.41 313.84, 163 | 222.35 314.29, 164 | 221.06 314.42, 165 | 221.18 314.06, 166 | 221.17 313.94, 167 | 220.89 313.44, 168 | 220.93 313.28, 169 | 221.21 312.91, 170 | 221.3 312.7, 171 | 221.3 312.61, 172 | 221.21 312.39, 173 | 221.21 312.3, 174 | 221.29 312.01, 175 | 221.26 311.85, 176 | 221.3 311.58, 177 | 221.29 311.44, 178 | 221.1 311.19, 179 | 221.23 310.54, 180 | 221.22 310.45, 181 | 221.16 310.37, 182 | 221.05 310.3, 183 | 220.96 309.85, 184 | 220.92 309.76, 185 | 220.75 309.62, 186 | 220.74 309.5, 187 | 220.6 309.08, 188 | 220.52 308.68, 189 | 220.53 308.48, 190 | 220.58 308.32, 191 | 220.55 307.88, 192 | 220.61 306.96, 193 | 220.61 306.48, 194 | 220.53 306.26, 195 | 220.52 306.02, 196 | 220.67 305.57, 197 | 220.95 305.29, 198 | 221.01 305.08, 199 | 221.01 304.94, 200 | 220.82 304.26, 201 | 220.57 303.77, 202 | 220.61 303.51, 203 | 220.5 303.3, 204 | 220.6 302.88, 205 | 220.68 302.72, 206 | 220.77 302.64, 207 | 221.14 302.64, 208 | 221.28 302.7, 209 | 221.4 302.72, 210 | 221.57 302.66, 211 | 221.76 302.36, 212 | 221.85 302.3, 213 | 222.08 302.22, 214 | 222.48 301.66, 215 | 222.32 301.49, 216 | 222.37 301.35, 217 | 222.49 301.3, 218 | 222.55 301.18, 219 | 222.55 300.87, 220 | 222.64 300.55, 221 | 222.73 300.39, 222 | 222.77 300.22, 223 | 222.76 299.93, 224 | 222.8 299.62, 225 | 222.74 299.29, 226 | 222.77 299.13, 227 | 222.85 298.97, 228 | 222.86 298.85, 229 | 222.72 298.56, 230 | 222.69 298.19, 231 | 222.64 298.05, 232 | 222.76 297.74, 233 | 222.82 296.9, 234 | 222.96 296.18, 235 | 222.94 295.84, 236 | 223.08 295.55, 237 | 223.15 294.96, 238 | 223.32 294.69, 239 | 223.38 294.22, 240 | 223.5 293.83, 241 | 223.98 293.16, 242 | 224.18 292.66, 243 | 224.21 292.47, 244 | 224.16 291.96, 245 | 224.07 291.46, 246 | 224.09 291.24, 247 | 223.88 290.71, 248 | 223.97 290.19, 249 | 224.09 290.02, 250 | 224.26 289.86, 251 | 224.27 289.7, 252 | 224.64 289.33, 253 | 224.76 289.22, 254 | 224.94 288.97, 255 | 224.82 288.46, 256 | 225.26 288.79, 257 | 225.45 288.87, 258 | 226.26 288.95, 259 | 226.57 289.02, 260 | 227.57 289.39, 261 | 228.11 289.48, 262 | 228.83 289.78, 263 | 229 289.9, 264 | 229.47 290.4, 265 | 229.78 290.59, 266 | 230 290.78, 267 | 230.31 290.16, 268 | 230.48 289.88, 269 | 230.63 289.52, 270 | 230.83 289.27, 271 | 231.87 288.2, 272 | 232.43 287.71, 273 | 232.65 287.3, 274 | 233.16 286.52, 275 | 233.63 286.18, 276 | 234.27 285.59, 277 | 235 285.03, 278 | 235.36 284.67, 279 | 236.2 283.61, 280 | 236.85 282.84, 281 | 237.04 282.56, 282 | 237.92 282.26, 283 | 238.26 282.07, 284 | 238.66 281.96, 285 | 239.53 281.51, 286 | 239.56 281.29, 287 | 239.68 281.01, 288 | 240.08 280.48, 289 | 240.45 280.15, 290 | 240.82 279.95, 291 | 241.56 279.34, 292 | 241.96 279.15, 293 | 242.35 278.92, 294 | 242.83 278.53, 295 | 243.28 278.47, 296 | 243.7 278.52, 297 | 244.2 278.5, 298 | 244.67 278.42, 299 | 245.2 278.45, 300 | 245.98 278.35, 301 | 246.6 278.32, 302 | 246.69 277.96, 303 | 247 277.2, 304 | 247.08 276.55, 305 | 247.5 275.27, 306 | 248.2 275.17, 307 | 248.5 275.2, 308 | 248.69 275.09, 309 | 249.07 274.62, 310 | 250 273.9, 311 | 250.56 273.2, 312 | 251.39 272.96, 313 | 251.7 273.01, 314 | 252.01 273.12, 315 | 252.48 273.2, 316 | 252.8 273.09, 317 | 253.5 272.4, 318 | 253.72 272.34, 319 | 255.24 270.87, 320 | 255.9 270.36, 321 | 256.17 270.23, 322 | 255.98 269.84, 323 | 256.12 269.58, 324 | 255.83 269.09, 325 | 255.76 268.9, 326 | 255.82 268.73, 327 | 256.21 268.65, 328 | 256.27 268.46, 329 | 256.41 268.24, 330 | 256.67 268.04, 331 | 256.98 267.88, 332 | 257.18 267.67, 333 | 257.29 267.51, 334 | 257.38 267.23, 335 | 257.49 266.69, 336 | 257.75 266.1, 337 | 258.73 265.41, 338 | 259.01 265.27, 339 | 259.15 265.08, 340 | 259.14 264.91, 341 | 258.95 264.39, 342 | 259.06 264.22, 343 | 259.33 264.04, 344 | 259.58 263.5, 345 | 259.9 263.14, 346 | 260.57 262.95, 347 | 260.92 262.72, 348 | 261.2 262.48, 349 | 261.6 262.25, 350 | 261.72 261.45, 351 | 262.17 260.98, 352 | 262.2 260.75, 353 | 262.15 260.23, 354 | 262.07 259.95, 355 | 262.14 259.64, 356 | 262.29 259.33, 357 | 262.87 258.63, 358 | 263.43 258.05, 359 | 263.66 257.68, 360 | 263.97 257.39, 361 | 264.33 257.17, 362 | 264.59 257.06, 363 | 264.5 256.84, 364 | 264.56 256.68, 365 | 264.48 256.32, 366 | 264.36 256.15, 367 | 264.43 255.84, 368 | 264.33 254.92, 369 | 264.25 254.65, 370 | 264 254.43, 371 | 263.73 254.29, 372 | 263.6 253.82, 373 | 263.68 253.71, 374 | 263.69 253.52, 375 | 263.66 253.3, 376 | 263.37 252.91, 377 | 263.16 252.91, 378 | 262.94 252.86, 379 | 262.78 252.91, 380 | 262.39 252.7, 381 | 262.23 252.72, 382 | 261.98 252.7, 383 | 261.79 252.58, 384 | 261.74 252.47, 385 | 261.76 252.33, 386 | 261.71 252.22, 387 | 261.71 251.7, 388 | 261.59 251.54, 389 | 261.56 251.25, 390 | 261.61 251, 391 | 262.24 250.76, 392 | 262.4 250.56, 393 | 262.46 250.28, 394 | 262.45 250.04, 395 | 262.11 249.82, 396 | 261.87 249.35, 397 | 261.67 249.12, 398 | 261.33 248.9, 399 | 260.53 248.62, 400 | 260.07 248.46, 401 | 259.54 249.42, 402 | 259.21 249.32, 403 | 258.97 249.34, 404 | 258.74 249.3, 405 | 258.69 249.27, 406 | 258.68 249.14, 407 | 258.54 248.85, 408 | 258.35 248.71, 409 | 258.12 248.39, 410 | 257.98 248.04, 411 | 257.14 247.7, 412 | 256.8 247.72, 413 | 256.46 247.86, 414 | 255.63 247.84, 415 | 255.38 247.76, 416 | 255.06 247.53, 417 | 254.67 247.34, 418 | 254.36 247.09, 419 | 253.77 246.76, 420 | 253.35 246.41, 421 | 253.14 246.32, 422 | 252.86 246.05, 423 | 252.75 245.89, 424 | 252.45 245.58, 425 | 252.31 245.17, 426 | 252.12 245.16, 427 | 251.87 245.24, 428 | 251.7 245.3, 429 | 251.62 245.02, 430 | 251.37 244.92, 431 | 251.38 244.76, 432 | 251.11 244.66, 433 | 251.04 244.45, 434 | 250.89 244.29, 435 | 250.85 243.99, 436 | 250.77 243.83, 437 | 250.46 243.56, 438 | 250.23 243.2, 439 | 250.15 242.82, 440 | 250.02 242.82, 441 | 249.97 242.63, 442 | 249.7 242.48, 443 | 249.65 242.34, 444 | 249.54 242.26, 445 | 249.58 242.14, 446 | 249.5 241.89, 447 | 249.37 241.89, 448 | 249.26 241.65, 449 | 249.19 241.6, 450 | 249.1 241.62, 451 | 249.01 241.41, 452 | 249.03 241.26, 453 | 248.86 240.81, 454 | 248.71 240.76, 455 | 248.41 240.77, 456 | 247.92 240.6, 457 | 247.35 240.34, 458 | 246.6 239.75, 459 | 245.72 238.75, 460 | 245.63 238.28, 461 | 245.69 237.94, 462 | 245.62 237.8, 463 | 245.53 237.76, 464 | 245.36 237.45, 465 | 245.25 236.95, 466 | 245.27 236.8, 467 | 245.2 236.68, 468 | 245.24 236.43, 469 | 245.21 236.22, 470 | 245.22 236.01, 471 | 245.3 235.81, 472 | 245.18 235.51, 473 | 245.27 235.38, 474 | 245.32 235.17, 475 | 245.32 234.99, 476 | 245.43 234.89, 477 | 245.32 234.57, 478 | 245.39 234.37, 479 | 245.27 234.05, 480 | 245.26 233.82, 481 | 245.08 233.53, 482 | 245.18 233.37, 483 | 245.2 233.19, 484 | 245.68 232.7, 485 | 245.78 232.52, 486 | 245.8 232.33, 487 | 245.98 232.12, 488 | 246.07 231.86, 489 | 246.11 231.49, 490 | 246.22 231.21, 491 | 246.36 231.11, 492 | 246.51 231.06, 493 | 246.63 230.95, 494 | 246.67 230.83, 495 | 246.67 230.7, 496 | 246.74 230.55, 497 | 247.08 230.32, 498 | 247.29 229.93, 499 | 247.6 229.48, 500 | 247.72 229.22, 501 | 247.81 228.66, 502 | 247.75 228.53, 503 | 247.43 228.4, 504 | 247.34 228.22, 505 | 247.18 228.05, 506 | 247.18 227.47, 507 | 247.16 227.25, 508 | 247.12 227.11, 509 | 247.03 226.98, 510 | 246.74 226.93, 511 | 246.45 226.77, 512 | 246.44 226.28, 513 | 246.32 226.16, 514 | 246.1 226.1, 515 | 246.04 226.04, 516 | 246.02 225.85, 517 | 245.75 225.35, 518 | 245.72 225.18, 519 | 245.78 224.99, 520 | 245.97 224.71, 521 | 245.97 224.52, 522 | 245.83 224.39, 523 | 245.66 224.38, 524 | 245.52 224.33, 525 | 245.43 224.24, 526 | 245.47 224.05, 527 | 245.4 223.9, 528 | 245.1 223.83, 529 | 244.97 223.76, 530 | 244.98 223.59, 531 | 244.86 223.55, 532 | 244.74 223.32, 533 | 244.71 223.17, 534 | 244.71 223.11, 535 | 244.91 222.79, 536 | 244.93 222.71, 537 | 244.8 222.59, 538 | 244.33 222.59, 539 | 244.29 222.55, 540 | 244.18 222.23, 541 | 244.16 221.83, 542 | 243.99 221.42, 543 | 243.75 221.26, 544 | 243.75 221.08, 545 | 243.85 220.8, 546 | 243.5 220.53, 547 | 243.42 220.38, 548 | 243.17 220.18, 549 | 243.19 219.73, 550 | 243.27 219.29, 551 | 243.23 218.78, 552 | 242.76 218.22, 553 | 242.65 217.75, 554 | 242.21 217.25, 555 | 242.13 216.95, 556 | 242.07 216.41, 557 | 242.07 215.8, 558 | 241.95 215.26, 559 | 241.41 214.62, 560 | 241.15 214.47, 561 | 240.83 214.6, 562 | 240.61 214.75, 563 | 240.08 214.9, 564 | 238.76 215.73, 565 | 238.68 215.91, 566 | 238.11 216.53, 567 | 237.98 216.62, 568 | 237.24 216.78, 569 | 237.17 216.83, 570 | 237.05 217.03, 571 | 236.94 217.11, 572 | 236.81 217.13, 573 | 236.63 217.1, 574 | 236.48 217.03, 575 | 236.35 217.11, 576 | 235.9 217.55, 577 | 235.81 217.68, 578 | 235.69 218.11, 579 | 235.4 218.3, 580 | 235.35 218.38, 581 | 235.35 218.63, 582 | 235.31 218.69, 583 | 234.91 218.89, 584 | 234.63 218.9, 585 | 234.46 218.85, 586 | 234.27 218.91, 587 | 233.97 219.33, 588 | 233.88 219.38, 589 | 233.6 219.31, 590 | 233.43 219.43, 591 | 233.23 219.98, 592 | 233.18 220.1, 593 | 233.05 220.36, 594 | 233.06 220.44, 595 | 232.96 220.74, 596 | 232.23 221.25, 597 | 232.02 221.59, 598 | 232.02 221.8, 599 | 231.98 222, 600 | 232.07 222.77, 601 | 232.04 223.04, 602 | 231.94 223.26, 603 | 231.81 223.43, 604 | 231.59 223.9, 605 | 231.48 224.04, 606 | 231.23 224.36, 607 | 231.18 224.42, 608 | 230.81 224.93, 609 | 230.63 225.37, 610 | 230.6 226.02, 611 | 230.8 227.62, 612 | 230.79 227.82, 613 | 230.4 227.91, 614 | 230.09 228.16, 615 | 229.77 228.21, 616 | 229.43 228.41, 617 | 228.94 228.58, 618 | 228.23 228.67, 619 | 227.44 228.98, 620 | 226.98 228.93, 621 | 225.73 229.34, 622 | 225.18 229.58, 623 | 224.77 229.87, 624 | 224.69 229.97, 625 | 224.46 230.46, 626 | 224.13 230.77, 627 | 224.02 230.92, 628 | 223.43 231.24, 629 | 223.17 231.44, 630 | 223.11 231.54, 631 | 222.95 232.59, 632 | 222.98 232.9, 633 | 222.83 233.28, 634 | 222.87 233.62, 635 | 222.83 233.75, 636 | 220.19 234.61, 637 | 217.47 236.73, 638 | 215.63 238.05, 639 | 214.99 238.6, 640 | 213.56 240.17, 641 | 212.87 240.39, 642 | 212.32 241.07, 643 | 211.95 241.32, 644 | 211.42 242.1, 645 | 211.7 242.59, 646 | 211.73 243.35, 647 | 211.7 243.76, 648 | 211.21 245.45, 649 | 211.18 245.37, 650 | 211.04 245.27, 651 | 210.86 244.95, 652 | 210.7 244.78, 653 | 210.44 244.77, 654 | 210.43 244.79, 655 | 210.34 244.77, 656 | 210.21 244.74, 657 | 209.93 244.64, 658 | 209.86 244.67, 659 | 209.84 244.67, 660 | 209.7 244.71, 661 | 209.52 244.75, 662 | 209.33 244.81, 663 | 209.16 244.88, 664 | 209.15 244.89, 665 | 209.06 244.93, 666 | 208.81 245.04, 667 | 208.69 245.07, 668 | 208.65 245.07, 669 | 208.63 245.08, 670 | 208.42 244.97, 671 | 208.24 244.9, 672 | 208.11 244.69, 673 | 208 244.44, 674 | 207.86 244.32, 675 | 207.71 244.25, 676 | 207.37 244.23, 677 | 207.07 244.28, 678 | 207.2 244.45, 679 | 207.29 244.63, 680 | 207.17 244.84, 681 | 206.93 245.04, 682 | 207.06 244.69, 683 | 207.03 244.72, 684 | 206.99 244.74, 685 | 206.96 244.74, 686 | 206.93 244.72, 687 | 206.9 244.65, 688 | 206.9 244.62, 689 | 206.88 244.59, 690 | 206.8 244.59, 691 | 206.76 244.6, 692 | 206.69 244.6, 693 | 206.64 244.56, 694 | 206.6 244.5, 695 | 206.55 244.45, 696 | 206.5 244.44, 697 | 206.4 244.41, 698 | 206.32 244.36, 699 | 206.24 244.34, 700 | 206.15 244.29, 701 | 206.12 244.31, 702 | 206.1 244.34, 703 | 206.08 244.41, 704 | 206.02 244.46, 705 | 205.99 244.49, 706 | 205.97 244.54, 707 | 205.91 244.59, 708 | 205.81 244.62, 709 | 205.75 244.66, 710 | 205.71 244.66, 711 | 205.66 244.64, 712 | 205.61 244.64, 713 | 205.59 244.63, 714 | 205.54 244.51, 715 | 205.52 244.49, 716 | 205.49 244.49, 717 | 205.4 244.53, 718 | 204.44 244.3, 719 | 203.53 245.98, 720 | 202.38 248.47, 721 | 202.04 248.67, 722 | 201.46 249.23, 723 | 201.02 249.6, 724 | 200.76 249.98, 725 | 200.63 250.07, 726 | 200.59 250.18, 727 | 200.36 250.51, 728 | 200.05 250.6, 729 | 200.1 250.92, 730 | 200.07 251.16, 731 | 200.15 251.52, 732 | 200.15 252.12, 733 | 199.97 252.44, 734 | 199.08 253.3, 735 | 199.05 253.37, 736 | 199.04 253.77, 737 | 198.98 253.9, 738 | 198.74 253.92, 739 | 198.21 254.03, 740 | 197.98 254.29, 741 | 198.03 254.67, 742 | 197.98 255, 743 | 197.66 255.67, 744 | 197.6 255.83, 745 | 197.56 256.07, 746 | 197.41 256.25, 747 | 197.05 256.8, 748 | 198.2 260.09, 749 | 197.91 260.26, 750 | 197.76 260.29, 751 | 197.36 260.29, 752 | 196.89 260.55, 753 | 196.7 260.59, 754 | 196.16 260.91, 755 | 196.07 261, 756 | 195.59 261.14, 757 | 195.39 261.25, 758 | 195.4 262.37, 759 | 195.3 262.57, 760 | 195.03 262.88, 761 | 194.88 263.01, 762 | 193.89 263.57, 763 | 193.13 264.33, 764 | 192.99 264.55, 765 | 192.73 264.8, 766 | 192.47 265.16, 767 | 192.31 265.78, 768 | 192.65 266.84, 769 | 192.57 267.29, 770 | 192.34 267.43, 771 | 192.29 267.74, 772 | 191.31 268.6, 773 | 191.34 269.16, 774 | 191.3 269.62, 775 | 190.8 269.68, 776 | 189.92 270.07, 777 | 188.99 270.57, 778 | 188.56 270.75, 779 | 188.17 271.25, 780 | 188.13 271.54, 781 | 188.17 271.81, 782 | 188.3 272.01, 783 | 188.36 272.2, 784 | 188.26 272.57, 785 | 188.33 273.23, 786 | 188.3 273.29, 787 | 188.29 273.62, 788 | 188.21 273.62, 789 | 188.04 273.7, 790 | 187.77 273.78, 791 | 187.72 273.89, 792 | 187.62 274, 793 | 187.15 274.35, 794 | 186.81 274.7, 795 | 186.28 275.36, 796 | 186.43 275.5, 797 | 186.68 275.6, 798 | 186.89 275.75, 799 | 186.83 275.96, 800 | 186.82 276.13, 801 | 186.58 276.46, 802 | 186.41 276.54, 803 | 186.31 276.71, 804 | 186.56 276.93, 805 | 186.87 277.42, 806 | 186.87 277.6, 807 | 186.7 278.17, 808 | 186.57 278.34, 809 | 186.18 278.63, 810 | 185.92 279.04, 811 | 185.68 279.22, 812 | 185.64 279.31, 813 | 185.49 279.35, 814 | 185.3 279.66, 815 | 185.26 279.69, 816 | 185.19 279.69, 817 | 185.01 279.83, 818 | 184.96 279.91, 819 | 185.02 279.94, 820 | 185.04 280, 821 | 184.95 280.19, 822 | 184.9 280.25, 823 | 184.86 280.25, 824 | 184.83 280.34, 825 | 184.65 280.56, 826 | 184.43 280.62, 827 | 184.15 280.6, 828 | 183.96 280.67, 829 | 183.99 281.03, 830 | 183.86 281.11, 831 | 183.75 281.14, 832 | 183.5 281.13, 833 | 183.51 281.39, 834 | 183.47 281.89, 835 | 183.36 282.13, 836 | 183.65 282.61, 837 | 183.61 282.65, 838 | 183.69 282.73, 839 | 183.75 282.86, 840 | 184.12 282.94, 841 | 184.47 282.85, 842 | 184.61 283.37, 843 | 184.54 283.41, 844 | 184.56 283.45, 845 | 184.67 283.47, 846 | 184.82 283.93, 847 | 184.88 283.99, 848 | 184.68 284.09, 849 | 184.65 284.15, 850 | 184.65 284.23, 851 | 184.87 284.78, 852 | 185.1 284.93, 853 | 185.21 284.88, 854 | 185.38 284.95, 855 | 185.49 284.78, 856 | 185.79 284.66, 857 | 186 284.54, 858 | 186.2 284.49, 859 | 186.52 284.32, 860 | 187.46 284.22, 861 | 187.71 284, 862 | 188.17 284, 863 | 188.5 284.05, 864 | 188.78 283.93, 865 | 189.53 283.52, 866 | 189.63 283.23, 867 | 189.58 282.99, 868 | 189.5 282.97, 869 | 189.48 282.92, 870 | 189.53 282.83, 871 | 189.63 282.5, 872 | 189.74 282.32, 873 | 189.93 282.19, 874 | 190.24 282.05, 875 | 190.62 281.97, 876 | 190.86 282.03, 877 | 191.34 282.19, 878 | 192.67 282.06, 879 | 194.57 282.64, 880 | 195.87 284.28, 881 | 196.35 284.57, 882 | 196.65 285.1, 883 | 196.91 285.26, 884 | 197 285.44, 885 | 197.02 285.6, 886 | 197.13 285.68, 887 | 197.22 285.69, 888 | 197.69 285.85, 889 | 197.76 285.93, 890 | 198.39 285.81, 891 | 198.81 285.99, 892 | 199.07 286.02, 893 | 199.29 286.32, 894 | 199.47 286.3, 895 | 199.7 286.35, 896 | 199.79 286.49, 897 | 199.74 286.73, 898 | 199.82 286.88, 899 | 199.98 287.04, 900 | 200.14 287.07, 901 | 200.16 287.33, 902 | 200.25 287.48, 903 | 200.18 287.68, 904 | 200.2 287.77, 905 | 200.38 287.93, 906 | 200.53 288, 907 | 200.66 287.99, 908 | 200.72 288.06, 909 | 200.72 288.2, 910 | 200.97 288.43, 911 | 201.1 288.5, 912 | 201.23 289.03, 913 | 201.51 289.5, 914 | 201.49 289.64, 915 | 201.55 289.81, 916 | 201.61 289.84, 917 | 201.66 289.86, 918 | 201.82 290.02, 919 | 201.93 290.06, 920 | 201.99 290.13, 921 | 202.12 290.32, 922 | 202.23 290.59, 923 | 202.42 290.84, 924 | 202.47 291.09, 925 | 202.46 291.4, 926 | 202.68 291.65, 927 | 202.74 291.81, 928 | 202.73 291.87, 929 | 202.67 291.96, 930 | 202.53 292.12, 931 | 202.54 292.28, 932 | 202.63 292.4, 933 | 202.95 292.64, 934 | 203.07 293.28, 935 | 203.27 293.51, 936 | 203.3 293.83, 937 | 203.82 294.26, 938 | 203.97 294.53, 939 | 204.05 294.85, 940 | 204.15 295.06, 941 | 204.35 295.29, 942 | 204.46 295.67, 943 | 204.63 295.95, 944 | 204.69 296.15, 945 | 204.75 296.25, 946 | 204.95 296.42, 947 | 204.99 296.61, 948 | 205.18 296.85, 949 | 205.18 296.99, 950 | 204.5 297.36, 951 | 203.44 297.5, 952 | 201.39 298.2, 953 | 200.98 298.61, 954 | 200.72 298.78, 955 | 200.19 298.99, 956 | 199.48 299.38, 957 | 199.08 299.66, 958 | 198.93 299.71, 959 | 198.72 299.9, 960 | 198.64 300.01, 961 | 198.51 300.09, 962 | 198.14 300.05, 963 | 197.99 300.14, 964 | 197.52 300.21, 965 | 196.08 300.64, 966 | 195.71 300.82, 967 | 195.48 301, 968 | 195.1 301.23, 969 | 194.83 301.26, 970 | 194.61 301.2, 971 | 194.04 301.4, 972 | 193.75 301.4, 973 | 193.61 301.35, 974 | 193.46 301.37, 975 | 193.3 301.44, 976 | 193.02 301.65, 977 | 192.67 301.71, 978 | 192.38 301.69, 979 | 191.82 301.63, 980 | 191.49 301.5, 981 | 191.33 301.52, 982 | 191.19 301.48, 983 | 190.51 301.51, 984 | 190.17 301.49, 985 | 190.13 301.44, 986 | 190.02 301.39, 987 | 189.76 301.52, 988 | 189.64 301.65, 989 | 189.18 301.99, 990 | 189.03 302.19, 991 | 188.87 302.26, 992 | 188.46 302.27, 993 | 188.39 302.21, 994 | 188.16 302.11, 995 | 187.21 302.17, 996 | 186.99 302.29, 997 | 186.85 302.46, 998 | 186.65 302.52, 999 | 186.11 302.58, 1000 | 186.03 302.65, 1001 | 185.93 302.68, 1002 | 185.72 302.9, 1003 | 185.47 303.11, 1004 | 184.95 303.11, 1005 | 184.45 303.31, 1006 | 184.08 303.4, 1007 | 183.91 303.4, 1008 | 183.66 303.34, 1009 | 183.47 303.36, 1010 | 183.18 303.48, 1011 | 182.72 303.85, 1012 | 182.13 303.95, 1013 | 182.06 303.98, 1014 | 181.97 304.08, 1015 | 181.76 304.05, 1016 | 181.38 304.15, 1017 | 180.92 304.15, 1018 | 180.51 304.21, 1019 | 180.16 304.48, 1020 | 179.84 304.66, 1021 | 178.94 305.3, 1022 | 178.52 305.68, 1023 | 178.41 305.95, 1024 | 178.19 306.27, 1025 | 178 306.62, 1026 | 177.53 307.25, 1027 | 177 307.54, 1028 | 176.57 307.69, 1029 | 175.94 307.69, 1030 | 175.32 308.01, 1031 | 174.15 308.06, 1032 | 174.13 307.97, 1033 | 174 307.78, 1034 | 173.73 307.78, 1035 | 173.59 307.9, 1036 | 173.59 308.16, 1037 | 173.56 308.29, 1038 | 173.5 308.39, 1039 | 173.03 308.49, 1040 | 172.89 308.69, 1041 | 172.63 309.25, 1042 | 172.09 309.04, 1043 | 169.41 308.45, 1044 | 169.49 307.74, 1045 | 168.43 307.31, 1046 | 168.42 307.33, 1047 | 168.37 307.3, 1048 | 166.93 306.99, 1049 | 166.12 307.81, 1050 | 165.86 307.91, 1051 | 164.82 308.6, 1052 | 164.57 308.62, 1053 | 164.41 308.73, 1054 | 163.97 308.8, 1055 | 163.24 308.73, 1056 | 162.52 309.02, 1057 | 162.06 309.37, 1058 | 161.88 309.17, 1059 | 161.76 308.98, 1060 | 161.42 308.75, 1061 | 161.09 309.21, 1062 | 160.97 309.52, 1063 | 160.3 309.82, 1064 | 159.64 310.01, 1065 | 159.41 310.1, 1066 | 159.03 310.27, 1067 | 158.56 310.6, 1068 | 158.22 310.77, 1069 | 157.55 310.63, 1070 | 156.52 310.92, 1071 | 156.16 310.79, 1072 | 155.85 310.58, 1073 | 154.95 311.69, 1074 | 154.21 311.89, 1075 | 153.94 312.1, 1076 | 153.5 312.36, 1077 | 152.8 312.9, 1078 | 152.49 313, 1079 | 152.54 313.67, 1080 | 152.4 313.61, 1081 | 150.89 313.19, 1082 | 150.14 314.01, 1083 | 149.29 314.82, 1084 | 148.99 315.25, 1085 | 148.77 315.6, 1086 | 148.6 316.33, 1087 | 148.43 316.67, 1088 | 148.31 317.03, 1089 | 148.31 317.12, 1090 | 148.37 317.27, 1091 | 148.47 317.38, 1092 | 148.43 317.43, 1093 | 148.32 317.36, 1094 | 147.89 317.51, 1095 | 147.79 317.68, 1096 | 147.78 317.79, 1097 | 147.82 317.86, 1098 | 147.66 318.16, 1099 | 147.72 318.27, 1100 | 147.72 318.44, 1101 | 147.67 318.58, 1102 | 148.09 319, 1103 | 148.37 319.7, 1104 | 148.45 319.81, 1105 | 148.5 320.25, 1106 | 148.59 320.47, 1107 | 148.77 320.7, 1108 | 149.07 320.98, 1109 | 148.37 321.73, 1110 | 148.11 322.07, 1111 | 147.82 321.92, 1112 | 147.18 322.2, 1113 | 146.08 323.14, 1114 | 145.87 323.36, 1115 | 145.78 323.55, 1116 | 146.81 324.47, 1117 | 147.85 326.17, 1118 | 146.87 327.26, 1119 | 146.18 328.11, 1120 | 145.85 328.45, 1121 | 145.55 328.65, 1122 | 145.32 328.95, 1123 | 144.95 329.31, 1124 | 144.76 329.4, 1125 | 144.37 329.66, 1126 | 143.9 329.88, 1127 | 143.52 330.13, 1128 | 143.1 330.51, 1129 | 142.66 331.08, 1130 | 142.32 331.27, 1131 | 141.97 331.52, 1132 | 141.61 331.85, 1133 | 140.83 331.85, 1134 | 140.72 331.68, 1135 | 140.78 331.41, 1136 | 140.6 330.96, 1137 | 140.2 330.63, 1138 | 139.3 330.11, 1139 | 138.55 330.22, 1140 | 138.33 329.63, 1141 | 138.19 328.76, 1142 | 137.94 328.63, 1143 | 136.8 328.25, 1144 | 134.47 328.15, 1145 | 133.25 328.32, 1146 | 132.27 328.82, 1147 | 131.88 329.24, 1148 | 131.56 329.93, 1149 | 131.48 330.26, 1150 | 131.41 330.39, 1151 | 131.45 330.99, 1152 | 131.61 331.21, 1153 | 130.55 332.46, 1154 | 130.39 332.82, 1155 | 130.21 333.44, 1156 | 130.23 333.74, 1157 | 130.42 333.78, 1158 | 130.51 333.94, 1159 | 130.47 334.19, 1160 | 130.24 334.69, 1161 | 129.77 335, 1162 | 129.69 335.21, 1163 | 129.53 335.38, 1164 | 129.47 335.62, 1165 | 129.39 335.7, 1166 | 128.83 336, 1167 | 128.59 336.4, 1168 | 128.79 337.1, 1169 | 129.29 338.15, 1170 | 130.05 338.92, 1171 | 130.52 339.53, 1172 | 130.26 339.92, 1173 | 129.51 340.89, 1174 | 129.42 341.08, 1175 | 129.2 341.04, 1176 | 129.07 341.14, 1177 | 128.76 341.19, 1178 | 128.67 341.28, 1179 | 128.7 341.36, 1180 | 128.68 342.05, 1181 | 128.52 342.63, 1182 | 128.54 343.97, 1183 | 128.33 344.4, 1184 | 128.23 344.52, 1185 | 128.14 345.24, 1186 | 128.27 345.93, 1187 | 128.21 346.26, 1188 | 128.13 346.59, 1189 | 127.56 347.54, 1190 | 127.39 347.98, 1191 | 127.92 349.26, 1192 | 128.07 349.53, 1193 | 128.23 350.19, 1194 | 128.54 350.79, 1195 | 128.62 352.72, 1196 | 129.18 352.96, 1197 | 129.18 353.6, 1198 | 129.56 354.66, 1199 | 129.33 354.97, 1200 | 128.79 355.52, 1201 | 128 355.75, 1202 | 126.7 356.58, 1203 | 126.33 356.92, 1204 | 126.07 357.29, 1205 | 125.47 357.57, 1206 | 124.92 357.95, 1207 | 124.08 358.78, 1208 | 124.03 358.87, 1209 | 123.81 360.28, 1210 | 123.82 360.69, 1211 | 123.75 361.03, 1212 | 123.86 361.81, 1213 | 124.28 363.15, 1214 | 124.29 363.59, 1215 | 124.36 364.18, 1216 | 124.32 364.81, 1217 | 124.49 365.45, 1218 | 124.27 365.75, 1219 | 123.96 366.65, 1220 | 123.75 367.15, 1221 | 123.38 367.51, 1222 | 123.14 368.16, 1223 | 123.19 368.42, 1224 | 122.78 368.97, 1225 | 122.38 369.57, 1226 | 122.36 370.28, 1227 | 122.41 371.17, 1228 | 122.27 371.85, 1229 | 122.1 372.23, 1230 | 121.13 373.54, 1231 | 120.98 374, 1232 | 120.8 374.17, 1233 | 120.44 374.71, 1234 | 120.22 374.91, 1235 | 120.06 375.21, 1236 | 119.7 376.13, 1237 | 119.41 376.32, 1238 | 119.27 376.96, 1239 | 118.79 377.6, 1240 | 118.41 377.8; 1241 | -------------------------------------------------------------------------------- /packages/polyclip-js/test/data/Fig20-E1.poly: -------------------------------------------------------------------------------- 1 | 35.184 -106.525, 2 | 35.184 -106.548, 3 | 35.185 -106.55, 4 | 35.185 -106.551, 5 | 35.184 -106.555, 6 | 35.184 -106.557, 7 | 35.185 -106.559, 8 | 35.185 -106.56, 9 | 35.174 -106.56, 10 | 35.174 -106.569, 11 | 35.201 -106.569, 12 | 35.203 -106.568, 13 | 35.218 -106.569, 14 | 35.218 -106.524, 15 | 35.193 -106.525; 16 | -------------------------------------------------------------------------------- /packages/polyclip-js/test/data/Fig20-E2.poly: -------------------------------------------------------------------------------- 1 | 35.164 -106.534, 2 | 35.16 -106.534, 3 | 35.16 -106.525, 4 | 35.151 -106.525, 5 | 35.149 -106.527, 6 | 35.147 -106.524, 7 | 35.147 -106.523, 8 | 35.146 -106.522, 9 | 35.146 -106.521, 10 | 35.145 -106.52, 11 | 35.144 -106.521, 12 | 35.143 -106.523, 13 | 35.143 -106.524, 14 | 35.142 -106.527, 15 | 35.141 -106.531, 16 | 35.141 -106.533, 17 | 35.139 -106.533, 18 | 35.139 -106.538, 19 | 35.14 -106.538, 20 | 35.142 -106.539, 21 | 35.145 -106.539, 22 | 35.146 -106.54, 23 | 35.149 -106.54, 24 | 35.149 -106.539, 25 | 35.15 -106.539, 26 | 35.15 -106.54, 27 | 35.155 -106.54, 28 | 35.156 -106.542, 29 | 35.174 -106.542, 30 | 35.175 -106.54, 31 | 35.175 -106.533, 32 | 35.174 -106.533, 33 | 35.169 -106.534, 34 | 35.168 -106.534, 35 | 35.167 -106.533, 36 | 35.166 -106.533; 37 | -------------------------------------------------------------------------------- /packages/polyclip-js/test/data/Fig20-E3.poly: -------------------------------------------------------------------------------- 1 | 35.217 -106.422, 2 | 35.217 -106.318, 3 | 35.216 -106.277, 4 | 35.215 -106.245, 5 | 35.215 -106.244, 6 | 35.142 -106.244, 7 | 35.142 -106.266, 8 | 35.127 -106.266, 9 | 35.127 -106.287, 10 | 35.133 -106.288, 11 | 35.133 -106.291, 12 | 35.136 -106.292, 13 | 35.138 -106.292, 14 | 35.138 -106.293, 15 | 35.141 -106.293, 16 | 35.141 -106.295, 17 | 35.142 -106.295, 18 | 35.142 -106.297, 19 | 35.141 -106.297, 20 | 35.141 -106.299, 21 | 35.135 -106.299, 22 | 35.135 -106.305, 23 | 35.142 -106.306, 24 | 35.142 -106.332, 25 | 35.131 -106.331, 26 | 35.131 -106.34, 27 | 35.135 -106.34, 28 | 35.135 -106.35, 29 | 35.129 -106.349, 30 | 35.129 -106.358, 31 | 35.132 -106.363, 32 | 35.132 -106.366, 33 | 35.135 -106.366, 34 | 35.136 -106.373, 35 | 35.137 -106.373, 36 | 35.138 -106.372, 37 | 35.138 -106.376, 38 | 35.14 -106.376, 39 | 35.14 -106.38, 40 | 35.139 -106.381, 41 | 35.139 -106.383, 42 | 35.141 -106.385, 43 | 35.142 -106.385, 44 | 35.143 -106.415, 45 | 35.144 -106.414, 46 | 35.153 -106.415, 47 | 35.155 -106.414, 48 | 35.16 -106.414, 49 | 35.163 -106.416, 50 | 35.172 -106.415, 51 | 35.18 -106.416, 52 | 35.189 -106.416, 53 | 35.193 -106.422, 54 | 35.194 -106.423, 55 | 35.195 -106.425, 56 | 35.196 -106.426, 57 | 35.196 -106.428, 58 | 35.197 -106.428, 59 | 35.198 -106.43, 60 | 35.198 -106.431, 61 | 35.199 -106.431, 62 | 35.2 -106.432, 63 | 35.2 -106.433, 64 | 35.201 -106.434, 65 | 35.202 -106.436, 66 | 35.204 -106.441, 67 | 35.205 -106.444, 68 | 35.206 -106.445, 69 | 35.209 -106.449, 70 | 35.211 -106.452, 71 | 35.214 -106.456, 72 | 35.217 -106.459, 73 | 35.218 -106.459, 74 | 35.218 -106.441; 75 | -------------------------------------------------------------------------------- /packages/polyclip-js/test/data/Fig20-E4.poly: -------------------------------------------------------------------------------- 1 | 35.172 -106.415, 2 | 35.163 -106.416, 3 | 35.16 -106.414, 4 | 35.155 -106.414, 5 | 35.153 -106.415, 6 | 35.144 -106.414, 7 | 35.143 -106.415, 8 | 35.137 -106.418, 9 | 35.136 -106.42, 10 | 35.136 -106.421, 11 | 35.134 -106.421, 12 | 35.134 -106.431, 13 | 35.135 -106.441, 14 | 35.135 -106.46, 15 | 35.134 -106.463, 16 | 35.134 -106.473, 17 | 35.135 -106.48, 18 | 35.136 -106.48, 19 | 35.136 -106.482, 20 | 35.137 -106.482, 21 | 35.138 -106.485, 22 | 35.138 -106.487, 23 | 35.139 -106.489, 24 | 35.139 -106.493, 25 | 35.14 -106.497, 26 | 35.14 -106.498, 27 | 35.145 -106.498, 28 | 35.145 -106.507, 29 | 35.144 -106.51, 30 | 35.144 -106.513, 31 | 35.143 -106.514, 32 | 35.143 -106.516, 33 | 35.142 -106.517, 34 | 35.144 -106.519, 35 | 35.145 -106.519, 36 | 35.145 -106.52, 37 | 35.146 -106.521, 38 | 35.146 -106.522, 39 | 35.147 -106.523, 40 | 35.147 -106.524, 41 | 35.149 -106.527, 42 | 35.151 -106.525, 43 | 35.16 -106.525, 44 | 35.16 -106.497, 45 | 35.157 -106.497, 46 | 35.157 -106.496, 47 | 35.158 -106.495, 48 | 35.158 -106.494, 49 | 35.159 -106.492, 50 | 35.159 -106.491, 51 | 35.158 -106.49, 52 | 35.158 -106.489, 53 | 35.159 -106.488, 54 | 35.159 -106.487, 55 | 35.16 -106.487, 56 | 35.16 -106.486, 57 | 35.159 -106.484, 58 | 35.159 -106.483, 59 | 35.16 -106.481, 60 | 35.16 -106.479, 61 | 35.161 -106.479, 62 | 35.161 -106.471, 63 | 35.162 -106.469, 64 | 35.164 -106.46, 65 | 35.164 -106.459, 66 | 35.165 -106.456, 67 | 35.165 -106.453, 68 | 35.166 -106.452, 69 | 35.166 -106.448, 70 | 35.167 -106.447, 71 | 35.168 -106.445, 72 | 35.168 -106.442, 73 | 35.171 -106.439, 74 | 35.173 -106.435, 75 | 35.173 -106.434, 76 | 35.174 -106.433, 77 | 35.174 -106.432, 78 | 35.175 -106.432, 79 | 35.175 -106.43, 80 | 35.177 -106.428, 81 | 35.178 -106.421, 82 | 35.179 -106.42, 83 | 35.179 -106.419, 84 | 35.181 -106.418, 85 | 35.189 -106.416, 86 | 35.18 -106.416; 87 | -------------------------------------------------------------------------------- /packages/polyclip-js/test/data/Fig20-E5.poly: -------------------------------------------------------------------------------- 1 | 35.218 -106.524, 2 | 35.218 -106.459, 3 | 35.217 -106.459, 4 | 35.214 -106.456, 5 | 35.211 -106.452, 6 | 35.209 -106.449, 7 | 35.206 -106.445, 8 | 35.205 -106.444, 9 | 35.204 -106.441, 10 | 35.202 -106.436, 11 | 35.201 -106.434, 12 | 35.2 -106.433, 13 | 35.2 -106.432, 14 | 35.199 -106.431, 15 | 35.198 -106.431, 16 | 35.198 -106.43, 17 | 35.197 -106.428, 18 | 35.196 -106.428, 19 | 35.196 -106.426, 20 | 35.195 -106.425, 21 | 35.194 -106.423, 22 | 35.193 -106.422, 23 | 35.189 -106.416, 24 | 35.181 -106.418, 25 | 35.179 -106.419, 26 | 35.179 -106.42, 27 | 35.178 -106.421, 28 | 35.177 -106.428, 29 | 35.175 -106.43, 30 | 35.175 -106.432, 31 | 35.174 -106.432, 32 | 35.174 -106.433, 33 | 35.173 -106.434, 34 | 35.173 -106.435, 35 | 35.171 -106.439, 36 | 35.168 -106.442, 37 | 35.168 -106.445, 38 | 35.167 -106.447, 39 | 35.166 -106.448, 40 | 35.166 -106.452, 41 | 35.165 -106.453, 42 | 35.165 -106.456, 43 | 35.164 -106.459, 44 | 35.164 -106.46, 45 | 35.162 -106.469, 46 | 35.161 -106.471, 47 | 35.161 -106.479, 48 | 35.16 -106.479, 49 | 35.16 -106.481, 50 | 35.159 -106.483, 51 | 35.159 -106.484, 52 | 35.16 -106.486, 53 | 35.16 -106.487, 54 | 35.159 -106.487, 55 | 35.159 -106.488, 56 | 35.158 -106.489, 57 | 35.158 -106.49, 58 | 35.159 -106.491, 59 | 35.159 -106.492, 60 | 35.158 -106.494, 61 | 35.158 -106.495, 62 | 35.157 -106.496, 63 | 35.157 -106.497, 64 | 35.16 -106.497, 65 | 35.16 -106.534, 66 | 35.164 -106.534, 67 | 35.166 -106.533, 68 | 35.167 -106.533, 69 | 35.168 -106.534, 70 | 35.169 -106.534, 71 | 35.174 -106.533, 72 | 35.175 -106.533, 73 | 35.175 -106.54, 74 | 35.174 -106.542, 75 | 35.184 -106.542, 76 | 35.184 -106.525, 77 | 35.193 -106.525; 78 | -------------------------------------------------------------------------------- /packages/polyclip-js/test/data/Fig20-H1.poly: -------------------------------------------------------------------------------- 1 | 35.218 -106.586, 2 | 35.218 -106.459, 3 | 35.217 -106.459, 4 | 35.215 -106.457, 5 | 35.211 -106.452, 6 | 35.206 -106.445, 7 | 35.204 -106.441, 8 | 35.203 -106.437, 9 | 35.202 -106.436, 10 | 35.2 -106.433, 11 | 35.199 -106.431, 12 | 35.198 -106.431, 13 | 35.198 -106.43, 14 | 35.197 -106.43, 15 | 35.196 -106.427, 16 | 35.195 -106.425, 17 | 35.189 -106.416, 18 | 35.181 -106.418, 19 | 35.18 -106.419, 20 | 35.179 -106.419, 21 | 35.179 -106.42, 22 | 35.178 -106.421, 23 | 35.177 -106.428, 24 | 35.175 -106.43, 25 | 35.175 -106.431, 26 | 35.174 -106.432, 27 | 35.174 -106.433, 28 | 35.173 -106.434, 29 | 35.173 -106.435, 30 | 35.171 -106.439, 31 | 35.168 -106.442, 32 | 35.168 -106.445, 33 | 35.167 -106.447, 34 | 35.166 -106.448, 35 | 35.166 -106.45, 36 | 35.165 -106.453, 37 | 35.165 -106.456, 38 | 35.164 -106.459, 39 | 35.164 -106.46, 40 | 35.162 -106.469, 41 | 35.161 -106.471, 42 | 35.161 -106.479, 43 | 35.16 -106.479, 44 | 35.16 -106.481, 45 | 35.159 -106.483, 46 | 35.159 -106.484, 47 | 35.16 -106.486, 48 | 35.16 -106.487, 49 | 35.159 -106.487, 50 | 35.159 -106.488, 51 | 35.158 -106.489, 52 | 35.158 -106.49, 53 | 35.159 -106.491, 54 | 35.159 -106.492, 55 | 35.158 -106.494, 56 | 35.158 -106.495, 57 | 35.157 -106.496, 58 | 35.157 -106.497, 59 | 35.152 -106.497, 60 | 35.152 -106.51, 61 | 35.151 -106.511, 62 | 35.151 -106.517, 63 | 35.152 -106.518, 64 | 35.152 -106.519, 65 | 35.153 -106.521, 66 | 35.154 -106.522, 67 | 35.154 -106.525, 68 | 35.151 -106.525, 69 | 35.149 -106.527, 70 | 35.145 -106.53, 71 | 35.143 -106.532, 72 | 35.141 -106.533, 73 | 35.139 -106.533, 74 | 35.139 -106.538, 75 | 35.14 -106.538, 76 | 35.142 -106.539, 77 | 35.145 -106.539, 78 | 35.146 -106.54, 79 | 35.149 -106.54, 80 | 35.149 -106.539, 81 | 35.15 -106.539, 82 | 35.15 -106.54, 83 | 35.154 -106.54, 84 | 35.153 -106.545, 85 | 35.153 -106.55, 86 | 35.154 -106.554, 87 | 35.158 -106.56, 88 | 35.174 -106.56, 89 | 35.174 -106.569, 90 | 35.175 -106.571, 91 | 35.175 -106.573, 92 | 35.174 -106.578, 93 | 35.174 -106.586, 94 | 35.175 -106.588, 95 | 35.175 -106.594, 96 | 35.174 -106.595, 97 | 35.174 -106.599, 98 | 35.175 -106.6, 99 | 35.175 -106.605, 100 | 35.185 -106.605, 101 | 35.187 -106.604, 102 | 35.188 -106.604, 103 | 35.194 -106.601, 104 | 35.197 -106.6, 105 | 35.201 -106.598, 106 | 35.202 -106.597, 107 | 35.202 -106.596, 108 | 35.203 -106.595, 109 | 35.208 -106.592, 110 | 35.208 -106.596, 111 | 35.21 -106.594, 112 | 35.21 -106.592, 113 | 35.214 -106.59, 114 | 35.215 -106.588, 115 | 35.216 -106.587; 116 | -------------------------------------------------------------------------------- /packages/polyclip-js/test/data/Fig20-H2.poly: -------------------------------------------------------------------------------- 1 | 35.172 -106.415, 2 | 35.163 -106.416, 3 | 35.16 -106.414, 4 | 35.155 -106.414, 5 | 35.153 -106.415, 6 | 35.144 -106.414, 7 | 35.137 -106.418, 8 | 35.136 -106.42, 9 | 35.136 -106.421, 10 | 35.134 -106.421, 11 | 35.134 -106.431, 12 | 35.135 -106.441, 13 | 35.135 -106.46, 14 | 35.134 -106.463, 15 | 35.134 -106.473, 16 | 35.135 -106.48, 17 | 35.099 -106.48, 18 | 35.099 -106.484, 19 | 35.098 -106.486, 20 | 35.098 -106.487, 21 | 35.097 -106.49, 22 | 35.097 -106.491, 23 | 35.096 -106.491, 24 | 35.096 -106.492, 25 | 35.095 -106.493, 26 | 35.095 -106.498, 27 | 35.101 -106.498, 28 | 35.101 -106.512, 29 | 35.102 -106.515, 30 | 35.103 -106.516, 31 | 35.109 -106.516, 32 | 35.109 -106.533, 33 | 35.141 -106.533, 34 | 35.143 -106.532, 35 | 35.145 -106.53, 36 | 35.149 -106.527, 37 | 35.151 -106.525, 38 | 35.154 -106.525, 39 | 35.154 -106.522, 40 | 35.153 -106.521, 41 | 35.152 -106.519, 42 | 35.152 -106.518, 43 | 35.151 -106.517, 44 | 35.151 -106.511, 45 | 35.152 -106.51, 46 | 35.152 -106.497, 47 | 35.157 -106.497, 48 | 35.157 -106.496, 49 | 35.158 -106.495, 50 | 35.158 -106.494, 51 | 35.159 -106.492, 52 | 35.159 -106.491, 53 | 35.158 -106.49, 54 | 35.158 -106.489, 55 | 35.159 -106.488, 56 | 35.159 -106.487, 57 | 35.16 -106.487, 58 | 35.16 -106.486, 59 | 35.159 -106.484, 60 | 35.159 -106.483, 61 | 35.16 -106.481, 62 | 35.16 -106.479, 63 | 35.161 -106.479, 64 | 35.161 -106.471, 65 | 35.162 -106.469, 66 | 35.164 -106.46, 67 | 35.164 -106.459, 68 | 35.165 -106.456, 69 | 35.165 -106.453, 70 | 35.166 -106.45, 71 | 35.166 -106.448, 72 | 35.167 -106.447, 73 | 35.168 -106.445, 74 | 35.168 -106.442, 75 | 35.171 -106.439, 76 | 35.173 -106.435, 77 | 35.173 -106.434, 78 | 35.174 -106.433, 79 | 35.174 -106.432, 80 | 35.175 -106.431, 81 | 35.175 -106.43, 82 | 35.177 -106.428, 83 | 35.178 -106.421, 84 | 35.179 -106.42, 85 | 35.179 -106.419, 86 | 35.18 -106.419, 87 | 35.181 -106.418, 88 | 35.189 -106.416, 89 | 35.18 -106.416; 90 | -------------------------------------------------------------------------------- /packages/polyclip-js/test/data/Fig20-M1.poly: -------------------------------------------------------------------------------- 1 | 35.217 -106.412, 2 | 35.217 -106.315, 3 | 35.215 -106.245, 4 | 35.215 -106.244, 5 | 35.142 -106.244, 6 | 35.142 -106.266, 7 | 35.127 -106.266, 8 | 35.127 -106.279, 9 | 35.121 -106.279, 10 | 35.117 -106.278, 11 | 35.108 -106.278, 12 | 35.108 -106.28, 13 | 35.107 -106.28, 14 | 35.107 -106.279, 15 | 35.106 -106.278, 16 | 35.099 -106.278, 17 | 35.097 -106.279, 18 | 35.088 -106.279, 19 | 35.088 -106.278, 20 | 35.087 -106.278, 21 | 35.086 -106.279, 22 | 35.084 -106.279, 23 | 35.084 -106.288, 24 | 35.085 -106.29, 25 | 35.085 -106.302, 26 | 35.083 -106.302, 27 | 35.083 -106.305, 28 | 35.085 -106.305, 29 | 35.085 -106.314, 30 | 35.083 -106.314, 31 | 35.083 -106.309, 32 | 35.08 -106.309, 33 | 35.08 -106.312, 34 | 35.081 -106.312, 35 | 35.081 -106.314, 36 | 35.071 -106.313, 37 | 35.056 -106.313, 38 | 35.043 -106.314, 39 | 35.043 -106.31, 40 | 35.038 -106.31, 41 | 35.038 -106.305, 42 | 35.04 -106.305, 43 | 35.04 -106.3, 44 | 35.038 -106.3, 45 | 35.038 -106.296, 46 | 35.04 -106.296, 47 | 35.04 -106.294, 48 | 35.039 -106.279, 49 | 35.018 -106.279, 50 | 35.018 -106.278, 51 | 35.016 -106.278, 52 | 35.016 -106.28, 53 | 35.012 -106.28, 54 | 35.012 -106.279, 55 | 34.954 -106.279, 56 | 34.953 -106.277, 57 | 34.954 -106.276, 58 | 34.953 -106.276, 59 | 34.953 -106.274, 60 | 34.954 -106.274, 61 | 34.953 -106.266, 62 | 34.953 -106.239, 63 | 34.954 -106.238, 64 | 34.954 -106.237, 65 | 34.953 -106.237, 66 | 34.953 -106.15, 67 | 34.87 -106.15, 68 | 34.87 -106.188, 69 | 34.869 -106.188, 70 | 34.869 -106.242, 71 | 34.87 -106.246, 72 | 34.87 -106.361, 73 | 34.871 -106.361, 74 | 34.871 -106.36, 75 | 34.872 -106.359, 76 | 34.872 -106.355, 77 | 34.874 -106.354, 78 | 34.874 -106.353, 79 | 34.876 -106.353, 80 | 34.881 -106.341, 81 | 34.883 -106.341, 82 | 34.885 -106.339, 83 | 34.885 -106.338, 84 | 34.884 -106.338, 85 | 34.886 -106.336, 86 | 34.896 -106.329, 87 | 34.896 -106.326, 88 | 34.897 -106.326, 89 | 34.897 -106.325, 90 | 34.898 -106.325, 91 | 34.898 -106.324, 92 | 34.899 -106.323, 93 | 34.902 -106.321, 94 | 34.902 -106.319, 95 | 34.903 -106.319, 96 | 34.903 -106.318, 97 | 34.914 -106.318, 98 | 34.921 -106.321, 99 | 34.928 -106.32, 100 | 34.931 -106.321, 101 | 34.935 -106.323, 102 | 34.938 -106.323, 103 | 34.938 -106.316, 104 | 34.942 -106.316, 105 | 34.942 -106.326, 106 | 34.948 -106.325, 107 | 34.948 -106.376, 108 | 34.947 -106.393, 109 | 34.947 -106.463, 110 | 35.015 -106.463, 111 | 35.026 -106.462, 112 | 35.027 -106.462, 113 | 35.03 -106.463, 114 | 35.043 -106.463, 115 | 35.043 -106.48, 116 | 35.057 -106.48, 117 | 35.057 -106.482, 118 | 35.058 -106.482, 119 | 35.058 -106.483, 120 | 35.059 -106.485, 121 | 35.061 -106.485, 122 | 35.065 -106.486, 123 | 35.065 -106.485, 124 | 35.064 -106.484, 125 | 35.064 -106.483, 126 | 35.063 -106.481, 127 | 35.063 -106.48, 128 | 35.062 -106.475, 129 | 35.063 -106.473, 130 | 35.063 -106.468, 131 | 35.064 -106.463, 132 | 35.068 -106.463, 133 | 35.068 -106.462, 134 | 35.073 -106.462, 135 | 35.072 -106.479, 136 | 35.072 -106.48, 137 | 35.135 -106.48, 138 | 35.134 -106.473, 139 | 35.134 -106.463, 140 | 35.135 -106.46, 141 | 35.135 -106.441, 142 | 35.134 -106.431, 143 | 35.134 -106.421, 144 | 35.136 -106.421, 145 | 35.136 -106.42, 146 | 35.137 -106.418, 147 | 35.143 -106.415, 148 | 35.144 -106.414, 149 | 35.153 -106.415, 150 | 35.155 -106.414, 151 | 35.16 -106.414, 152 | 35.163 -106.416, 153 | 35.172 -106.415, 154 | 35.18 -106.416, 155 | 35.189 -106.416, 156 | 35.193 -106.422, 157 | 35.194 -106.423, 158 | 35.195 -106.425, 159 | 35.196 -106.426, 160 | 35.196 -106.428, 161 | 35.198 -106.43, 162 | 35.198 -106.431, 163 | 35.199 -106.431, 164 | 35.199 -106.432, 165 | 35.2 -106.432, 166 | 35.2 -106.433, 167 | 35.201 -106.434, 168 | 35.204 -106.44, 169 | 35.205 -106.443, 170 | 35.205 -106.444, 171 | 35.206 -106.445, 172 | 35.209 -106.45, 173 | 35.211 -106.452, 174 | 35.215 -106.457, 175 | 35.217 -106.459, 176 | 35.218 -106.459, 177 | 35.218 -106.44; 178 | -------------------------------------------------------------------------------- /packages/polyclip-js/test/data/Fig20-M2.poly: -------------------------------------------------------------------------------- 1 | 35.218 -106.586, 2 | 35.218 -106.459, 3 | 35.217 -106.459, 4 | 35.215 -106.457, 5 | 35.211 -106.452, 6 | 35.209 -106.45, 7 | 35.206 -106.445, 8 | 35.205 -106.444, 9 | 35.205 -106.443, 10 | 35.204 -106.44, 11 | 35.201 -106.434, 12 | 35.2 -106.433, 13 | 35.2 -106.432, 14 | 35.199 -106.432, 15 | 35.199 -106.431, 16 | 35.198 -106.431, 17 | 35.198 -106.43, 18 | 35.196 -106.428, 19 | 35.196 -106.426, 20 | 35.195 -106.425, 21 | 35.194 -106.423, 22 | 35.193 -106.422, 23 | 35.189 -106.416, 24 | 35.181 -106.418, 25 | 35.179 -106.419, 26 | 35.179 -106.42, 27 | 35.178 -106.421, 28 | 35.177 -106.428, 29 | 35.175 -106.43, 30 | 35.175 -106.432, 31 | 35.174 -106.432, 32 | 35.174 -106.433, 33 | 35.173 -106.434, 34 | 35.173 -106.435, 35 | 35.171 -106.439, 36 | 35.168 -106.442, 37 | 35.168 -106.445, 38 | 35.167 -106.447, 39 | 35.166 -106.448, 40 | 35.166 -106.452, 41 | 35.165 -106.453, 42 | 35.165 -106.456, 43 | 35.164 -106.459, 44 | 35.164 -106.46, 45 | 35.162 -106.469, 46 | 35.161 -106.471, 47 | 35.161 -106.479, 48 | 35.16 -106.479, 49 | 35.16 -106.481, 50 | 35.159 -106.483, 51 | 35.159 -106.484, 52 | 35.16 -106.486, 53 | 35.16 -106.487, 54 | 35.159 -106.487, 55 | 35.159 -106.488, 56 | 35.158 -106.489, 57 | 35.158 -106.49, 58 | 35.159 -106.491, 59 | 35.159 -106.492, 60 | 35.158 -106.494, 61 | 35.158 -106.495, 62 | 35.157 -106.496, 63 | 35.157 -106.497, 64 | 35.16 -106.497, 65 | 35.16 -106.534, 66 | 35.164 -106.534, 67 | 35.166 -106.533, 68 | 35.167 -106.533, 69 | 35.168 -106.534, 70 | 35.169 -106.534, 71 | 35.174 -106.533, 72 | 35.175 -106.533, 73 | 35.175 -106.54, 74 | 35.174 -106.542, 75 | 35.174 -106.569, 76 | 35.175 -106.571, 77 | 35.175 -106.573, 78 | 35.174 -106.578, 79 | 35.174 -106.586, 80 | 35.175 -106.588, 81 | 35.175 -106.594, 82 | 35.174 -106.595, 83 | 35.174 -106.599, 84 | 35.175 -106.6, 85 | 35.175 -106.605, 86 | 35.185 -106.605, 87 | 35.188 -106.604, 88 | 35.193 -106.602, 89 | 35.194 -106.601, 90 | 35.197 -106.6, 91 | 35.201 -106.598, 92 | 35.202 -106.597, 93 | 35.202 -106.596, 94 | 35.203 -106.595, 95 | 35.208 -106.592, 96 | 35.208 -106.596, 97 | 35.21 -106.594, 98 | 35.21 -106.592, 99 | 35.214 -106.59, 100 | 35.215 -106.588, 101 | 35.216 -106.587; 102 | -------------------------------------------------------------------------------- /packages/polyclip-js/test/data/Fig20-M3.poly: -------------------------------------------------------------------------------- 1 | 35.172 -106.415, 2 | 35.163 -106.416, 3 | 35.16 -106.414, 4 | 35.155 -106.414, 5 | 35.153 -106.415, 6 | 35.144 -106.414, 7 | 35.143 -106.415, 8 | 35.137 -106.418, 9 | 35.136 -106.42, 10 | 35.136 -106.421, 11 | 35.134 -106.421, 12 | 35.134 -106.431, 13 | 35.135 -106.441, 14 | 35.135 -106.46, 15 | 35.134 -106.463, 16 | 35.134 -106.473, 17 | 35.135 -106.48, 18 | 35.127 -106.48, 19 | 35.127 -106.482, 20 | 35.128 -106.482, 21 | 35.128 -106.486, 22 | 35.129 -106.486, 23 | 35.129 -106.487, 24 | 35.13 -106.487, 25 | 35.13 -106.488, 26 | 35.129 -106.488, 27 | 35.13 -106.489, 28 | 35.13 -106.49, 29 | 35.131 -106.491, 30 | 35.131 -106.533, 31 | 35.139 -106.533, 32 | 35.139 -106.538, 33 | 35.14 -106.538, 34 | 35.142 -106.539, 35 | 35.145 -106.539, 36 | 35.146 -106.54, 37 | 35.149 -106.54, 38 | 35.149 -106.539, 39 | 35.15 -106.539, 40 | 35.15 -106.54, 41 | 35.155 -106.54, 42 | 35.156 -106.542, 43 | 35.174 -106.542, 44 | 35.175 -106.54, 45 | 35.175 -106.533, 46 | 35.174 -106.533, 47 | 35.169 -106.534, 48 | 35.168 -106.534, 49 | 35.167 -106.533, 50 | 35.166 -106.533, 51 | 35.164 -106.534, 52 | 35.16 -106.534, 53 | 35.16 -106.497, 54 | 35.157 -106.497, 55 | 35.157 -106.496, 56 | 35.158 -106.495, 57 | 35.158 -106.494, 58 | 35.159 -106.492, 59 | 35.159 -106.491, 60 | 35.158 -106.49, 61 | 35.158 -106.489, 62 | 35.159 -106.488, 63 | 35.159 -106.487, 64 | 35.16 -106.487, 65 | 35.16 -106.486, 66 | 35.159 -106.484, 67 | 35.159 -106.483, 68 | 35.16 -106.481, 69 | 35.16 -106.479, 70 | 35.161 -106.479, 71 | 35.161 -106.471, 72 | 35.162 -106.469, 73 | 35.164 -106.46, 74 | 35.164 -106.459, 75 | 35.165 -106.456, 76 | 35.165 -106.453, 77 | 35.166 -106.452, 78 | 35.166 -106.448, 79 | 35.167 -106.447, 80 | 35.168 -106.445, 81 | 35.168 -106.442, 82 | 35.171 -106.439, 83 | 35.173 -106.435, 84 | 35.173 -106.434, 85 | 35.174 -106.433, 86 | 35.174 -106.432, 87 | 35.175 -106.432, 88 | 35.175 -106.43, 89 | 35.177 -106.428, 90 | 35.178 -106.421, 91 | 35.179 -106.42, 92 | 35.179 -106.419, 93 | 35.181 -106.418, 94 | 35.189 -106.416, 95 | 35.18 -106.416; 96 | -------------------------------------------------------------------------------- /packages/polyclip-js/test/data/Fig8-P.poly: -------------------------------------------------------------------------------- 1 | 0 0, 2 | 2 4, 3 | 2 8, 4 | 7 6, 5 | 10 8, 6 | 12 4, 7 | 12 1, 8 | 15 -2, 9 | 9 0; 10 | -------------------------------------------------------------------------------- /packages/polyclip-js/test/data/Fig8-Q.poly: -------------------------------------------------------------------------------- 1 | 12 6, 2 | 3 6, 3 | 1 2, 4 | 4 -1, 5 | 8 3, 6 | 12 -1; 7 | -------------------------------------------------------------------------------- /packages/polyclip-js/test/data/Fig8-clip-u.poly: -------------------------------------------------------------------------------- 1 | 10 8, 2 | 7 6, 3 | 2 8, 4 | 2 4, 5 | 0 0, 6 | 3 0, 7 | 4 -1, 8 | 5 0, 9 | 9 0, 10 | 15 -2, 11 | 12 1, 12 | 12 6, 13 | 11 6; 14 | -------------------------------------------------------------------------------- /packages/polyclip-js/test/data/Fig8-clip.poly: -------------------------------------------------------------------------------- 1 | 12 4, 2 | 12 -1, 3 | 8 3, 4 | 5 0, 5 | 3 0, 6 | 1 2, 7 | 3 6, 8 | 11 6; 9 | -------------------------------------------------------------------------------- /packages/polyclip-js/test/helpers.ts: -------------------------------------------------------------------------------- 1 | import fs from 'fs' 2 | import { clipPolygons } from '../src' 3 | import { Point } from '../src/Point' 4 | import { Polygon } from '../src/Polygon' 5 | import { IteratorType } from '../src/types' 6 | 7 | /** 8 | * Get the test data as a string from a file. 9 | * 10 | * @param name The name of the file in the ./test/data folder. 11 | * 12 | * @returns The file contents as a string. 13 | */ 14 | export function getStringFromFile(name: string) { 15 | let data = fs.readFileSync(`./test/data/${name}`, 'utf8') 16 | data = data.replace(/\r\n/g, '\n') 17 | return data 18 | } 19 | 20 | /** 21 | * Convert the test data string into a list of polygons. 22 | * 23 | * @param data The test data string. 24 | * 25 | * @returns An array of polygons from the test data. 26 | */ 27 | export function getPolygonsFromString(data: string) { 28 | const result: Polygon[] = [] 29 | 30 | data 31 | .trim() 32 | .split(';') 33 | .forEach((polygon) => { 34 | const P = new Polygon() 35 | 36 | polygon 37 | .trim() 38 | .split(',') 39 | .forEach((pair) => { 40 | const points = pair 41 | .trim() 42 | .split(' ') 43 | .map((point) => parseFloat(point)) 44 | 45 | if (Number.isFinite(points[0]) && Number.isFinite(points[1])) { 46 | P.newVertex(new Point(points[0], points[1]), true) 47 | } 48 | }) 49 | 50 | if (P.root !== null) { 51 | result.push(P) 52 | } 53 | }) 54 | 55 | return result 56 | } 57 | 58 | /** 59 | * Convert the list of polygons into a string. 60 | * 61 | * @param polygons The list of polygons. 62 | * 63 | * @returns The polygons as a string. 64 | */ 65 | export function getStringFromPolygons(polygons: Polygon[]) { 66 | let result = `` 67 | 68 | for (const polygon of polygons) { 69 | const points: string[] = [] 70 | for (const vertex of polygon.vertices(IteratorType.ALL)) { 71 | points.push(`${vertex.p.x} ${vertex.p.y}`) 72 | } 73 | result += points.join(',\n') + ';\n' 74 | } 75 | 76 | return result 77 | } 78 | 79 | /** 80 | * Test the clip function with the given files. Runs the clip 81 | * function with the contents of the first and second files, 82 | * expecting the output to match the third file. 83 | * 84 | * @param first The first polygon file. 85 | * @param second The second polygon file. 86 | * @param output The expected output file. 87 | * 88 | */ 89 | export function testFiles( 90 | first: string, 91 | second: string, 92 | output: string, 93 | union: boolean 94 | ) { 95 | const P = getPolygonsFromString(getStringFromFile(first)) 96 | const Q = getPolygonsFromString(getStringFromFile(second)) 97 | const result = clipPolygons(P, Q, union) 98 | const expected = getStringFromFile(output) 99 | const out = getStringFromPolygons(result) 100 | expect(out).toBe(expected) 101 | } 102 | -------------------------------------------------------------------------------- /packages/polyclip-js/test/polyclip.test.ts: -------------------------------------------------------------------------------- 1 | import { 2 | testFiles, 3 | getPolygonsFromString, 4 | getStringFromFile, 5 | getStringFromPolygons, 6 | } from './helpers' 7 | 8 | describe('Helpers', () => { 9 | test('getStringFromFile -> getPolygonsFromString -> getStringFromPolygons', () => { 10 | const input = getStringFromFile('Fig8-P.poly') 11 | const P = getPolygonsFromString(input) 12 | const output = getStringFromPolygons(P) 13 | expect(output).toBe(input) 14 | }) 15 | }) 16 | 17 | describe('Intersections', () => { 18 | it('creates Figure 8', () => { 19 | testFiles('Fig8-P.poly', 'Fig8-Q.poly', 'Fig8-clip.poly', false) 20 | }) 21 | 22 | it('creates Figure 14', () => { 23 | testFiles('Fig14-P.poly', 'Fig14-Q.poly', 'Fig14-clip.poly', false) 24 | }) 25 | 26 | it('creates Figure 15', () => { 27 | testFiles('Fig15-P.poly', 'Fig15-Q.poly', 'Fig15-clip.poly', false) 28 | }) 29 | 30 | it('creates Figure 16', () => { 31 | testFiles('Fig16-P.poly', 'Fig16-Q.poly', 'Fig16-clip.poly', false) 32 | }) 33 | 34 | it('creates Figure 17', () => { 35 | testFiles('Fig17-P.poly', 'Fig17-Q.poly', 'Fig17-clip.poly', false) 36 | }) 37 | 38 | it('creates Figure 18', () => { 39 | testFiles('Fig18-P.poly', 'Fig18-Q.poly', 'Fig18-clip.poly', false) 40 | }) 41 | 42 | it('creates Figure 19', () => { 43 | testFiles('Fig19-P.poly', 'Fig19-Q.poly', 'Fig19-clip.poly', false) 44 | }) 45 | }) 46 | 47 | describe('Unions', () => { 48 | it('creates Figure 8', () => { 49 | testFiles('Fig8-P.poly', 'Fig8-Q.poly', 'Fig8-clip-u.poly', true) 50 | }) 51 | 52 | it('creates Figure 14', () => { 53 | testFiles('Fig14-P.poly', 'Fig14-Q.poly', 'Fig14-clip-u.poly', true) 54 | }) 55 | 56 | it('creates Figure 15', () => { 57 | testFiles('Fig15-P.poly', 'Fig15-Q.poly', 'Fig15-clip-u.poly', true) 58 | }) 59 | 60 | it('creates Figure 16', () => { 61 | testFiles('Fig16-P.poly', 'Fig16-Q.poly', 'Fig16-clip-u.poly', true) 62 | }) 63 | 64 | it('creates Figure 17', () => { 65 | testFiles('Fig17-P.poly', 'Fig17-Q.poly', 'Fig17-clip-u.poly', true) 66 | }) 67 | }) 68 | -------------------------------------------------------------------------------- /packages/polyclip-js/tsconfig.build.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es6", 4 | "composite": false, 5 | "resolveJsonModule": true, 6 | "downlevelIteration": true, 7 | "esModuleInterop": true, 8 | "moduleResolution": "node", 9 | "module": "commonjs", 10 | "lib": ["es2015", "esnext"], 11 | "outDir": "dist", 12 | "rootDir": "src", 13 | "sourceMap": true, 14 | "strict": true, 15 | "noImplicitAny": true, 16 | "noImplicitThis": true, 17 | "removeComments": true, 18 | "noFallthroughCasesInSwitch": true, 19 | "typeRoots": ["node_modules/@types"], 20 | "types": ["node", "@types/jest"] 21 | }, 22 | "files": ["src/index.ts"], 23 | "include": ["src/**/*.ts"], 24 | "exclude": ["node_modules"] 25 | } 26 | -------------------------------------------------------------------------------- /packages/polyclip-js/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es6", 4 | "composite": true, 5 | "resolveJsonModule": true, 6 | "downlevelIteration": true, 7 | "esModuleInterop": true, 8 | "moduleResolution": "node", 9 | "module": "commonjs", 10 | "lib": ["es2015", "esnext"], 11 | "outDir": "dist", 12 | "rootDir": "src", 13 | "sourceMap": true, 14 | "strict": true, 15 | "noImplicitAny": true, 16 | "noImplicitThis": true, 17 | "removeComments": true, 18 | "noFallthroughCasesInSwitch": true, 19 | "typeRoots": ["node_modules/@types"], 20 | "types": ["node", "@types/jest"] 21 | }, 22 | "files": ["src/index.ts"], 23 | "include": ["src/**/*.ts"], 24 | "exclude": ["node_modules"] 25 | } 26 | -------------------------------------------------------------------------------- /packages/polyclip-js/yarn.lock: -------------------------------------------------------------------------------- 1 | # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. 2 | # yarn lockfile v1 3 | 4 | 5 | "@esbuild/android-arm@0.15.18": 6 | version "0.15.18" 7 | resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.15.18.tgz#266d40b8fdcf87962df8af05b76219bc786b4f80" 8 | integrity sha512-5GT+kcs2WVGjVs7+boataCkO5Fg0y4kCjzkB5bAip7H4jfnOS3dA6KPiww9W1OEKTKeAcUVhdZGvgI65OXmUnw== 9 | 10 | "@esbuild/linux-loong64@0.15.18": 11 | version "0.15.18" 12 | resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.15.18.tgz#128b76ecb9be48b60cf5cfc1c63a4f00691a3239" 13 | integrity sha512-L4jVKS82XVhw2nvzLg/19ClLWg0y27ulRwuP7lcyL6AbUWB5aPglXY3M21mauDQMDfRLs8cQmeT03r/+X3cZYQ== 14 | 15 | "@nodelib/fs.scandir@2.1.5": 16 | version "2.1.5" 17 | resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" 18 | integrity sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g== 19 | dependencies: 20 | "@nodelib/fs.stat" "2.0.5" 21 | run-parallel "^1.1.9" 22 | 23 | "@nodelib/fs.stat@2.0.5", "@nodelib/fs.stat@^2.0.2": 24 | version "2.0.5" 25 | resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz#5bd262af94e9d25bd1e71b05deed44876a222e8b" 26 | integrity sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A== 27 | 28 | "@nodelib/fs.walk@^1.2.3": 29 | version "1.2.8" 30 | resolved "https://registry.yarnpkg.com/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz#e95737e8bb6746ddedf69c556953494f196fe69a" 31 | integrity sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg== 32 | dependencies: 33 | "@nodelib/fs.scandir" "2.1.5" 34 | fastq "^1.6.0" 35 | 36 | any-promise@^1.0.0: 37 | version "1.3.0" 38 | resolved "https://registry.yarnpkg.com/any-promise/-/any-promise-1.3.0.tgz#abc6afeedcea52e809cdc0376aed3ce39635d17f" 39 | integrity sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A== 40 | 41 | anymatch@~3.1.2: 42 | version "3.1.3" 43 | resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.3.tgz#790c58b19ba1720a84205b57c618d5ad8524973e" 44 | integrity sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw== 45 | dependencies: 46 | normalize-path "^3.0.0" 47 | picomatch "^2.0.4" 48 | 49 | array-union@^2.1.0: 50 | version "2.1.0" 51 | resolved "https://registry.yarnpkg.com/array-union/-/array-union-2.1.0.tgz#b798420adbeb1de828d84acd8a2e23d3efe85e8d" 52 | integrity sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw== 53 | 54 | balanced-match@^1.0.0: 55 | version "1.0.2" 56 | resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" 57 | integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== 58 | 59 | binary-extensions@^2.0.0: 60 | version "2.2.0" 61 | resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d" 62 | integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA== 63 | 64 | brace-expansion@^1.1.7: 65 | version "1.1.11" 66 | resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" 67 | integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== 68 | dependencies: 69 | balanced-match "^1.0.0" 70 | concat-map "0.0.1" 71 | 72 | braces@^3.0.2, braces@~3.0.2: 73 | version "3.0.2" 74 | resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" 75 | integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== 76 | dependencies: 77 | fill-range "^7.0.1" 78 | 79 | bundle-require@^3.1.2: 80 | version "3.1.2" 81 | resolved "https://registry.yarnpkg.com/bundle-require/-/bundle-require-3.1.2.tgz#1374a7bdcb8b330a7ccc862ccbf7c137cc43ad27" 82 | integrity sha512-Of6l6JBAxiyQ5axFxUM6dYeP/W7X2Sozeo/4EYB9sJhL+dqL7TKjg+shwxp6jlu/6ZSERfsYtIpSJ1/x3XkAEA== 83 | dependencies: 84 | load-tsconfig "^0.2.0" 85 | 86 | cac@^6.7.12: 87 | version "6.7.14" 88 | resolved "https://registry.yarnpkg.com/cac/-/cac-6.7.14.tgz#804e1e6f506ee363cb0e3ccbb09cad5dd9870959" 89 | integrity sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ== 90 | 91 | chokidar@^3.5.1: 92 | version "3.5.3" 93 | resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.3.tgz#1cf37c8707b932bd1af1ae22c0432e2acd1903bd" 94 | integrity sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw== 95 | dependencies: 96 | anymatch "~3.1.2" 97 | braces "~3.0.2" 98 | glob-parent "~5.1.2" 99 | is-binary-path "~2.1.0" 100 | is-glob "~4.0.1" 101 | normalize-path "~3.0.0" 102 | readdirp "~3.6.0" 103 | optionalDependencies: 104 | fsevents "~2.3.2" 105 | 106 | commander@^4.0.0: 107 | version "4.1.1" 108 | resolved "https://registry.yarnpkg.com/commander/-/commander-4.1.1.tgz#9fd602bd936294e9e9ef46a3f4d6964044b18068" 109 | integrity sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA== 110 | 111 | concat-map@0.0.1: 112 | version "0.0.1" 113 | resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" 114 | integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== 115 | 116 | cross-spawn@^7.0.3: 117 | version "7.0.3" 118 | resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" 119 | integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== 120 | dependencies: 121 | path-key "^3.1.0" 122 | shebang-command "^2.0.0" 123 | which "^2.0.1" 124 | 125 | debug@^4.3.1: 126 | version "4.3.4" 127 | resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" 128 | integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== 129 | dependencies: 130 | ms "2.1.2" 131 | 132 | dir-glob@^3.0.1: 133 | version "3.0.1" 134 | resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f" 135 | integrity sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA== 136 | dependencies: 137 | path-type "^4.0.0" 138 | 139 | esbuild-android-64@0.15.18: 140 | version "0.15.18" 141 | resolved "https://registry.yarnpkg.com/esbuild-android-64/-/esbuild-android-64-0.15.18.tgz#20a7ae1416c8eaade917fb2453c1259302c637a5" 142 | integrity sha512-wnpt3OXRhcjfIDSZu9bnzT4/TNTDsOUvip0foZOUBG7QbSt//w3QV4FInVJxNhKc/ErhUxc5z4QjHtMi7/TbgA== 143 | 144 | esbuild-android-arm64@0.15.18: 145 | version "0.15.18" 146 | resolved "https://registry.yarnpkg.com/esbuild-android-arm64/-/esbuild-android-arm64-0.15.18.tgz#9cc0ec60581d6ad267568f29cf4895ffdd9f2f04" 147 | integrity sha512-G4xu89B8FCzav9XU8EjsXacCKSG2FT7wW9J6hOc18soEHJdtWu03L3TQDGf0geNxfLTtxENKBzMSq9LlbjS8OQ== 148 | 149 | esbuild-darwin-64@0.15.18: 150 | version "0.15.18" 151 | resolved "https://registry.yarnpkg.com/esbuild-darwin-64/-/esbuild-darwin-64-0.15.18.tgz#428e1730ea819d500808f220fbc5207aea6d4410" 152 | integrity sha512-2WAvs95uPnVJPuYKP0Eqx+Dl/jaYseZEUUT1sjg97TJa4oBtbAKnPnl3b5M9l51/nbx7+QAEtuummJZW0sBEmg== 153 | 154 | esbuild-darwin-arm64@0.15.18: 155 | version "0.15.18" 156 | resolved "https://registry.yarnpkg.com/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.15.18.tgz#b6dfc7799115a2917f35970bfbc93ae50256b337" 157 | integrity sha512-tKPSxcTJ5OmNb1btVikATJ8NftlyNlc8BVNtyT/UAr62JFOhwHlnoPrhYWz09akBLHI9nElFVfWSTSRsrZiDUA== 158 | 159 | esbuild-freebsd-64@0.15.18: 160 | version "0.15.18" 161 | resolved "https://registry.yarnpkg.com/esbuild-freebsd-64/-/esbuild-freebsd-64-0.15.18.tgz#4e190d9c2d1e67164619ae30a438be87d5eedaf2" 162 | integrity sha512-TT3uBUxkteAjR1QbsmvSsjpKjOX6UkCstr8nMr+q7zi3NuZ1oIpa8U41Y8I8dJH2fJgdC3Dj3CXO5biLQpfdZA== 163 | 164 | esbuild-freebsd-arm64@0.15.18: 165 | version "0.15.18" 166 | resolved "https://registry.yarnpkg.com/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.15.18.tgz#18a4c0344ee23bd5a6d06d18c76e2fd6d3f91635" 167 | integrity sha512-R/oVr+X3Tkh+S0+tL41wRMbdWtpWB8hEAMsOXDumSSa6qJR89U0S/PpLXrGF7Wk/JykfpWNokERUpCeHDl47wA== 168 | 169 | esbuild-linux-32@0.15.18: 170 | version "0.15.18" 171 | resolved "https://registry.yarnpkg.com/esbuild-linux-32/-/esbuild-linux-32-0.15.18.tgz#9a329731ee079b12262b793fb84eea762e82e0ce" 172 | integrity sha512-lphF3HiCSYtaa9p1DtXndiQEeQDKPl9eN/XNoBf2amEghugNuqXNZA/ZovthNE2aa4EN43WroO0B85xVSjYkbg== 173 | 174 | esbuild-linux-64@0.15.18: 175 | version "0.15.18" 176 | resolved "https://registry.yarnpkg.com/esbuild-linux-64/-/esbuild-linux-64-0.15.18.tgz#532738075397b994467b514e524aeb520c191b6c" 177 | integrity sha512-hNSeP97IviD7oxLKFuii5sDPJ+QHeiFTFLoLm7NZQligur8poNOWGIgpQ7Qf8Balb69hptMZzyOBIPtY09GZYw== 178 | 179 | esbuild-linux-arm64@0.15.18: 180 | version "0.15.18" 181 | resolved "https://registry.yarnpkg.com/esbuild-linux-arm64/-/esbuild-linux-arm64-0.15.18.tgz#5372e7993ac2da8f06b2ba313710d722b7a86e5d" 182 | integrity sha512-54qr8kg/6ilcxd+0V3h9rjT4qmjc0CccMVWrjOEM/pEcUzt8X62HfBSeZfT2ECpM7104mk4yfQXkosY8Quptug== 183 | 184 | esbuild-linux-arm@0.15.18: 185 | version "0.15.18" 186 | resolved "https://registry.yarnpkg.com/esbuild-linux-arm/-/esbuild-linux-arm-0.15.18.tgz#e734aaf259a2e3d109d4886c9e81ec0f2fd9a9cc" 187 | integrity sha512-UH779gstRblS4aoS2qpMl3wjg7U0j+ygu3GjIeTonCcN79ZvpPee12Qun3vcdxX+37O5LFxz39XeW2I9bybMVA== 188 | 189 | esbuild-linux-mips64le@0.15.18: 190 | version "0.15.18" 191 | resolved "https://registry.yarnpkg.com/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.15.18.tgz#c0487c14a9371a84eb08fab0e1d7b045a77105eb" 192 | integrity sha512-Mk6Ppwzzz3YbMl/ZZL2P0q1tnYqh/trYZ1VfNP47C31yT0K8t9s7Z077QrDA/guU60tGNp2GOwCQnp+DYv7bxQ== 193 | 194 | esbuild-linux-ppc64le@0.15.18: 195 | version "0.15.18" 196 | resolved "https://registry.yarnpkg.com/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.15.18.tgz#af048ad94eed0ce32f6d5a873f7abe9115012507" 197 | integrity sha512-b0XkN4pL9WUulPTa/VKHx2wLCgvIAbgwABGnKMY19WhKZPT+8BxhZdqz6EgkqCLld7X5qiCY2F/bfpUUlnFZ9w== 198 | 199 | esbuild-linux-riscv64@0.15.18: 200 | version "0.15.18" 201 | resolved "https://registry.yarnpkg.com/esbuild-linux-riscv64/-/esbuild-linux-riscv64-0.15.18.tgz#423ed4e5927bd77f842bd566972178f424d455e6" 202 | integrity sha512-ba2COaoF5wL6VLZWn04k+ACZjZ6NYniMSQStodFKH/Pu6RxzQqzsmjR1t9QC89VYJxBeyVPTaHuBMCejl3O/xg== 203 | 204 | esbuild-linux-s390x@0.15.18: 205 | version "0.15.18" 206 | resolved "https://registry.yarnpkg.com/esbuild-linux-s390x/-/esbuild-linux-s390x-0.15.18.tgz#21d21eaa962a183bfb76312e5a01cc5ae48ce8eb" 207 | integrity sha512-VbpGuXEl5FCs1wDVp93O8UIzl3ZrglgnSQ+Hu79g7hZu6te6/YHgVJxCM2SqfIila0J3k0csfnf8VD2W7u2kzQ== 208 | 209 | esbuild-netbsd-64@0.15.18: 210 | version "0.15.18" 211 | resolved "https://registry.yarnpkg.com/esbuild-netbsd-64/-/esbuild-netbsd-64-0.15.18.tgz#ae75682f60d08560b1fe9482bfe0173e5110b998" 212 | integrity sha512-98ukeCdvdX7wr1vUYQzKo4kQ0N2p27H7I11maINv73fVEXt2kyh4K4m9f35U1K43Xc2QGXlzAw0K9yoU7JUjOg== 213 | 214 | esbuild-openbsd-64@0.15.18: 215 | version "0.15.18" 216 | resolved "https://registry.yarnpkg.com/esbuild-openbsd-64/-/esbuild-openbsd-64-0.15.18.tgz#79591a90aa3b03e4863f93beec0d2bab2853d0a8" 217 | integrity sha512-yK5NCcH31Uae076AyQAXeJzt/vxIo9+omZRKj1pauhk3ITuADzuOx5N2fdHrAKPxN+zH3w96uFKlY7yIn490xQ== 218 | 219 | esbuild-sunos-64@0.15.18: 220 | version "0.15.18" 221 | resolved "https://registry.yarnpkg.com/esbuild-sunos-64/-/esbuild-sunos-64-0.15.18.tgz#fd528aa5da5374b7e1e93d36ef9b07c3dfed2971" 222 | integrity sha512-On22LLFlBeLNj/YF3FT+cXcyKPEI263nflYlAhz5crxtp3yRG1Ugfr7ITyxmCmjm4vbN/dGrb/B7w7U8yJR9yw== 223 | 224 | esbuild-windows-32@0.15.18: 225 | version "0.15.18" 226 | resolved "https://registry.yarnpkg.com/esbuild-windows-32/-/esbuild-windows-32-0.15.18.tgz#0e92b66ecdf5435a76813c4bc5ccda0696f4efc3" 227 | integrity sha512-o+eyLu2MjVny/nt+E0uPnBxYuJHBvho8vWsC2lV61A7wwTWC3jkN2w36jtA+yv1UgYkHRihPuQsL23hsCYGcOQ== 228 | 229 | esbuild-windows-64@0.15.18: 230 | version "0.15.18" 231 | resolved "https://registry.yarnpkg.com/esbuild-windows-64/-/esbuild-windows-64-0.15.18.tgz#0fc761d785414284fc408e7914226d33f82420d0" 232 | integrity sha512-qinug1iTTaIIrCorAUjR0fcBk24fjzEedFYhhispP8Oc7SFvs+XeW3YpAKiKp8dRpizl4YYAhxMjlftAMJiaUw== 233 | 234 | esbuild-windows-arm64@0.15.18: 235 | version "0.15.18" 236 | resolved "https://registry.yarnpkg.com/esbuild-windows-arm64/-/esbuild-windows-arm64-0.15.18.tgz#5b5bdc56d341d0922ee94965c89ee120a6a86eb7" 237 | integrity sha512-q9bsYzegpZcLziq0zgUi5KqGVtfhjxGbnksaBFYmWLxeV/S1fK4OLdq2DFYnXcLMjlZw2L0jLsk1eGoB522WXQ== 238 | 239 | esbuild@^0.15.1: 240 | version "0.15.18" 241 | resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.15.18.tgz#ea894adaf3fbc036d32320a00d4d6e4978a2f36d" 242 | integrity sha512-x/R72SmW3sSFRm5zrrIjAhCeQSAWoni3CmHEqfQrZIQTM3lVCdehdwuIqaOtfC2slvpdlLa62GYoN8SxT23m6Q== 243 | optionalDependencies: 244 | "@esbuild/android-arm" "0.15.18" 245 | "@esbuild/linux-loong64" "0.15.18" 246 | esbuild-android-64 "0.15.18" 247 | esbuild-android-arm64 "0.15.18" 248 | esbuild-darwin-64 "0.15.18" 249 | esbuild-darwin-arm64 "0.15.18" 250 | esbuild-freebsd-64 "0.15.18" 251 | esbuild-freebsd-arm64 "0.15.18" 252 | esbuild-linux-32 "0.15.18" 253 | esbuild-linux-64 "0.15.18" 254 | esbuild-linux-arm "0.15.18" 255 | esbuild-linux-arm64 "0.15.18" 256 | esbuild-linux-mips64le "0.15.18" 257 | esbuild-linux-ppc64le "0.15.18" 258 | esbuild-linux-riscv64 "0.15.18" 259 | esbuild-linux-s390x "0.15.18" 260 | esbuild-netbsd-64 "0.15.18" 261 | esbuild-openbsd-64 "0.15.18" 262 | esbuild-sunos-64 "0.15.18" 263 | esbuild-windows-32 "0.15.18" 264 | esbuild-windows-64 "0.15.18" 265 | esbuild-windows-arm64 "0.15.18" 266 | 267 | execa@^5.0.0: 268 | version "5.1.1" 269 | resolved "https://registry.yarnpkg.com/execa/-/execa-5.1.1.tgz#f80ad9cbf4298f7bd1d4c9555c21e93741c411dd" 270 | integrity sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg== 271 | dependencies: 272 | cross-spawn "^7.0.3" 273 | get-stream "^6.0.0" 274 | human-signals "^2.1.0" 275 | is-stream "^2.0.0" 276 | merge-stream "^2.0.0" 277 | npm-run-path "^4.0.1" 278 | onetime "^5.1.2" 279 | signal-exit "^3.0.3" 280 | strip-final-newline "^2.0.0" 281 | 282 | fast-glob@^3.2.9: 283 | version "3.2.12" 284 | resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.12.tgz#7f39ec99c2e6ab030337142da9e0c18f37afae80" 285 | integrity sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w== 286 | dependencies: 287 | "@nodelib/fs.stat" "^2.0.2" 288 | "@nodelib/fs.walk" "^1.2.3" 289 | glob-parent "^5.1.2" 290 | merge2 "^1.3.0" 291 | micromatch "^4.0.4" 292 | 293 | fastq@^1.6.0: 294 | version "1.14.0" 295 | resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.14.0.tgz#107f69d7295b11e0fccc264e1fc6389f623731ce" 296 | integrity sha512-eR2D+V9/ExcbF9ls441yIuN6TI2ED1Y2ZcA5BmMtJsOkWOFRJQ0Jt0g1UwqXJJVAb+V+umH5Dfr8oh4EVP7VVg== 297 | dependencies: 298 | reusify "^1.0.4" 299 | 300 | fill-range@^7.0.1: 301 | version "7.0.1" 302 | resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" 303 | integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== 304 | dependencies: 305 | to-regex-range "^5.0.1" 306 | 307 | fs.realpath@^1.0.0: 308 | version "1.0.0" 309 | resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" 310 | integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== 311 | 312 | fsevents@~2.3.2: 313 | version "2.3.2" 314 | resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" 315 | integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== 316 | 317 | get-stream@^6.0.0: 318 | version "6.0.1" 319 | resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-6.0.1.tgz#a262d8eef67aced57c2852ad6167526a43cbf7b7" 320 | integrity sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg== 321 | 322 | glob-parent@^5.1.2, glob-parent@~5.1.2: 323 | version "5.1.2" 324 | resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" 325 | integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== 326 | dependencies: 327 | is-glob "^4.0.1" 328 | 329 | glob@7.1.6: 330 | version "7.1.6" 331 | resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6" 332 | integrity sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA== 333 | dependencies: 334 | fs.realpath "^1.0.0" 335 | inflight "^1.0.4" 336 | inherits "2" 337 | minimatch "^3.0.4" 338 | once "^1.3.0" 339 | path-is-absolute "^1.0.0" 340 | 341 | globby@^11.0.3: 342 | version "11.1.0" 343 | resolved "https://registry.yarnpkg.com/globby/-/globby-11.1.0.tgz#bd4be98bb042f83d796f7e3811991fbe82a0d34b" 344 | integrity sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g== 345 | dependencies: 346 | array-union "^2.1.0" 347 | dir-glob "^3.0.1" 348 | fast-glob "^3.2.9" 349 | ignore "^5.2.0" 350 | merge2 "^1.4.1" 351 | slash "^3.0.0" 352 | 353 | human-signals@^2.1.0: 354 | version "2.1.0" 355 | resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-2.1.0.tgz#dc91fcba42e4d06e4abaed33b3e7a3c02f514ea0" 356 | integrity sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw== 357 | 358 | ignore@^5.2.0: 359 | version "5.2.4" 360 | resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.4.tgz#a291c0c6178ff1b960befe47fcdec301674a6324" 361 | integrity sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ== 362 | 363 | inflight@^1.0.4: 364 | version "1.0.6" 365 | resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" 366 | integrity sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA== 367 | dependencies: 368 | once "^1.3.0" 369 | wrappy "1" 370 | 371 | inherits@2: 372 | version "2.0.4" 373 | resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" 374 | integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== 375 | 376 | is-binary-path@~2.1.0: 377 | version "2.1.0" 378 | resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09" 379 | integrity sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw== 380 | dependencies: 381 | binary-extensions "^2.0.0" 382 | 383 | is-extglob@^2.1.1: 384 | version "2.1.1" 385 | resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" 386 | integrity sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ== 387 | 388 | is-glob@^4.0.1, is-glob@~4.0.1: 389 | version "4.0.3" 390 | resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" 391 | integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== 392 | dependencies: 393 | is-extglob "^2.1.1" 394 | 395 | is-number@^7.0.0: 396 | version "7.0.0" 397 | resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" 398 | integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== 399 | 400 | is-stream@^2.0.0: 401 | version "2.0.1" 402 | resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.1.tgz#fac1e3d53b97ad5a9d0ae9cef2389f5810a5c077" 403 | integrity sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg== 404 | 405 | isexe@^2.0.0: 406 | version "2.0.0" 407 | resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" 408 | integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw== 409 | 410 | joycon@^3.0.1: 411 | version "3.1.1" 412 | resolved "https://registry.yarnpkg.com/joycon/-/joycon-3.1.1.tgz#bce8596d6ae808f8b68168f5fc69280996894f03" 413 | integrity sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw== 414 | 415 | lilconfig@^2.0.5: 416 | version "2.0.6" 417 | resolved "https://registry.yarnpkg.com/lilconfig/-/lilconfig-2.0.6.tgz#32a384558bd58af3d4c6e077dd1ad1d397bc69d4" 418 | integrity sha512-9JROoBW7pobfsx+Sq2JsASvCo6Pfo6WWoUW79HuB1BCoBXD4PLWJPqDF6fNj67pqBYTbAHkE57M1kS/+L1neOg== 419 | 420 | lines-and-columns@^1.1.6: 421 | version "1.2.4" 422 | resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.2.4.tgz#eca284f75d2965079309dc0ad9255abb2ebc1632" 423 | integrity sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg== 424 | 425 | load-tsconfig@^0.2.0: 426 | version "0.2.3" 427 | resolved "https://registry.yarnpkg.com/load-tsconfig/-/load-tsconfig-0.2.3.tgz#08af3e7744943caab0c75f8af7f1703639c3ef1f" 428 | integrity sha512-iyT2MXws+dc2Wi6o3grCFtGXpeMvHmJqS27sMPGtV2eUu4PeFnG+33I8BlFK1t1NWMjOpcx9bridn5yxLDX2gQ== 429 | 430 | lodash.sortby@^4.7.0: 431 | version "4.7.0" 432 | resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438" 433 | integrity sha512-HDWXG8isMntAyRF5vZ7xKuEvOhT4AhlRt/3czTSjvGUxjYCBVRQY48ViDHyfYz9VIoBkW4TMGQNapx+l3RUwdA== 434 | 435 | merge-stream@^2.0.0: 436 | version "2.0.0" 437 | resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" 438 | integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== 439 | 440 | merge2@^1.3.0, merge2@^1.4.1: 441 | version "1.4.1" 442 | resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" 443 | integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== 444 | 445 | micromatch@^4.0.4: 446 | version "4.0.5" 447 | resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.5.tgz#bc8999a7cbbf77cdc89f132f6e467051b49090c6" 448 | integrity sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA== 449 | dependencies: 450 | braces "^3.0.2" 451 | picomatch "^2.3.1" 452 | 453 | mimic-fn@^2.1.0: 454 | version "2.1.0" 455 | resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" 456 | integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== 457 | 458 | minimatch@^3.0.4: 459 | version "3.1.2" 460 | resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" 461 | integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== 462 | dependencies: 463 | brace-expansion "^1.1.7" 464 | 465 | ms@2.1.2: 466 | version "2.1.2" 467 | resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" 468 | integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== 469 | 470 | mz@^2.7.0: 471 | version "2.7.0" 472 | resolved "https://registry.yarnpkg.com/mz/-/mz-2.7.0.tgz#95008057a56cafadc2bc63dde7f9ff6955948e32" 473 | integrity sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q== 474 | dependencies: 475 | any-promise "^1.0.0" 476 | object-assign "^4.0.1" 477 | thenify-all "^1.0.0" 478 | 479 | normalize-path@^3.0.0, normalize-path@~3.0.0: 480 | version "3.0.0" 481 | resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" 482 | integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== 483 | 484 | npm-run-path@^4.0.1: 485 | version "4.0.1" 486 | resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-4.0.1.tgz#b7ecd1e5ed53da8e37a55e1c2269e0b97ed748ea" 487 | integrity sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw== 488 | dependencies: 489 | path-key "^3.0.0" 490 | 491 | object-assign@^4.0.1: 492 | version "4.1.1" 493 | resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" 494 | integrity sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg== 495 | 496 | once@^1.3.0: 497 | version "1.4.0" 498 | resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" 499 | integrity sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w== 500 | dependencies: 501 | wrappy "1" 502 | 503 | onetime@^5.1.2: 504 | version "5.1.2" 505 | resolved "https://registry.yarnpkg.com/onetime/-/onetime-5.1.2.tgz#d0e96ebb56b07476df1dd9c4806e5237985ca45e" 506 | integrity sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg== 507 | dependencies: 508 | mimic-fn "^2.1.0" 509 | 510 | path-is-absolute@^1.0.0: 511 | version "1.0.1" 512 | resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" 513 | integrity sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg== 514 | 515 | path-key@^3.0.0, path-key@^3.1.0: 516 | version "3.1.1" 517 | resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" 518 | integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== 519 | 520 | path-type@^4.0.0: 521 | version "4.0.0" 522 | resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" 523 | integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== 524 | 525 | picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.3.1: 526 | version "2.3.1" 527 | resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" 528 | integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== 529 | 530 | pirates@^4.0.1: 531 | version "4.0.5" 532 | resolved "https://registry.yarnpkg.com/pirates/-/pirates-4.0.5.tgz#feec352ea5c3268fb23a37c702ab1699f35a5f3b" 533 | integrity sha512-8V9+HQPupnaXMA23c5hvl69zXvTwTzyAYasnkb0Tts4XvO4CliqONMOnvlq26rkhLC3nWDFBJf73LU1e1VZLaQ== 534 | 535 | postcss-load-config@^3.0.1: 536 | version "3.1.4" 537 | resolved "https://registry.yarnpkg.com/postcss-load-config/-/postcss-load-config-3.1.4.tgz#1ab2571faf84bb078877e1d07905eabe9ebda855" 538 | integrity sha512-6DiM4E7v4coTE4uzA8U//WhtPwyhiim3eyjEMFCnUpzbrkK9wJHgKDT2mR+HbtSrd/NubVaYTOpSpjUl8NQeRg== 539 | dependencies: 540 | lilconfig "^2.0.5" 541 | yaml "^1.10.2" 542 | 543 | punycode@^2.1.0: 544 | version "2.1.1" 545 | resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" 546 | integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== 547 | 548 | queue-microtask@^1.2.2: 549 | version "1.2.3" 550 | resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" 551 | integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== 552 | 553 | readdirp@~3.6.0: 554 | version "3.6.0" 555 | resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7" 556 | integrity sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA== 557 | dependencies: 558 | picomatch "^2.2.1" 559 | 560 | resolve-from@^5.0.0: 561 | version "5.0.0" 562 | resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-5.0.0.tgz#c35225843df8f776df21c57557bc087e9dfdfc69" 563 | integrity sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw== 564 | 565 | reusify@^1.0.4: 566 | version "1.0.4" 567 | resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" 568 | integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== 569 | 570 | rollup@^3.2.5: 571 | version "3.9.0" 572 | resolved "https://registry.yarnpkg.com/rollup/-/rollup-3.9.0.tgz#0ff7ab7cd71ce3a6ab140c5cf661f2b35eb6aab8" 573 | integrity sha512-nGGylpmblyjTpF4lEUPgmOw6OVxRvnI6Iuuh6Lz4O/X66cVOX1XJSsqP1YamxQ+mPuFE7qJxLFDSCk8rNv5dDw== 574 | optionalDependencies: 575 | fsevents "~2.3.2" 576 | 577 | run-parallel@^1.1.9: 578 | version "1.2.0" 579 | resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.2.0.tgz#66d1368da7bdf921eb9d95bd1a9229e7f21a43ee" 580 | integrity sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA== 581 | dependencies: 582 | queue-microtask "^1.2.2" 583 | 584 | shebang-command@^2.0.0: 585 | version "2.0.0" 586 | resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" 587 | integrity sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA== 588 | dependencies: 589 | shebang-regex "^3.0.0" 590 | 591 | shebang-regex@^3.0.0: 592 | version "3.0.0" 593 | resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" 594 | integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== 595 | 596 | signal-exit@^3.0.3: 597 | version "3.0.7" 598 | resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9" 599 | integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== 600 | 601 | slash@^3.0.0: 602 | version "3.0.0" 603 | resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" 604 | integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== 605 | 606 | source-map@0.8.0-beta.0: 607 | version "0.8.0-beta.0" 608 | resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.8.0-beta.0.tgz#d4c1bb42c3f7ee925f005927ba10709e0d1d1f11" 609 | integrity sha512-2ymg6oRBpebeZi9UUNsgQ89bhx01TcTkmNTGnNO88imTmbSgy4nfujrgVEFKWpMTEGA11EDkTt7mqObTPdigIA== 610 | dependencies: 611 | whatwg-url "^7.0.0" 612 | 613 | strip-final-newline@^2.0.0: 614 | version "2.0.0" 615 | resolved "https://registry.yarnpkg.com/strip-final-newline/-/strip-final-newline-2.0.0.tgz#89b852fb2fcbe936f6f4b3187afb0a12c1ab58ad" 616 | integrity sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA== 617 | 618 | sucrase@^3.20.3: 619 | version "3.29.0" 620 | resolved "https://registry.yarnpkg.com/sucrase/-/sucrase-3.29.0.tgz#3207c5bc1b980fdae1e539df3f8a8a518236da7d" 621 | integrity sha512-bZPAuGA5SdFHuzqIhTAqt9fvNEo9rESqXIG3oiKdF8K4UmkQxC4KlNL3lVyAErXp+mPvUqZ5l13qx6TrDIGf3A== 622 | dependencies: 623 | commander "^4.0.0" 624 | glob "7.1.6" 625 | lines-and-columns "^1.1.6" 626 | mz "^2.7.0" 627 | pirates "^4.0.1" 628 | ts-interface-checker "^0.1.9" 629 | 630 | thenify-all@^1.0.0: 631 | version "1.6.0" 632 | resolved "https://registry.yarnpkg.com/thenify-all/-/thenify-all-1.6.0.tgz#1a1918d402d8fc3f98fbf234db0bcc8cc10e9726" 633 | integrity sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA== 634 | dependencies: 635 | thenify ">= 3.1.0 < 4" 636 | 637 | "thenify@>= 3.1.0 < 4": 638 | version "3.3.1" 639 | resolved "https://registry.yarnpkg.com/thenify/-/thenify-3.3.1.tgz#8932e686a4066038a016dd9e2ca46add9838a95f" 640 | integrity sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw== 641 | dependencies: 642 | any-promise "^1.0.0" 643 | 644 | to-regex-range@^5.0.1: 645 | version "5.0.1" 646 | resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" 647 | integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== 648 | dependencies: 649 | is-number "^7.0.0" 650 | 651 | tr46@^1.0.1: 652 | version "1.0.1" 653 | resolved "https://registry.yarnpkg.com/tr46/-/tr46-1.0.1.tgz#a8b13fd6bfd2489519674ccde55ba3693b706d09" 654 | integrity sha512-dTpowEjclQ7Kgx5SdBkqRzVhERQXov8/l9Ft9dVM9fmg0W0KQSVaXX9T4i6twCPNtYiZM53lpSSUAwJbFPOHxA== 655 | dependencies: 656 | punycode "^2.1.0" 657 | 658 | tree-kill@^1.2.2: 659 | version "1.2.2" 660 | resolved "https://registry.yarnpkg.com/tree-kill/-/tree-kill-1.2.2.tgz#4ca09a9092c88b73a7cdc5e8a01b507b0790a0cc" 661 | integrity sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A== 662 | 663 | ts-interface-checker@^0.1.9: 664 | version "0.1.13" 665 | resolved "https://registry.yarnpkg.com/ts-interface-checker/-/ts-interface-checker-0.1.13.tgz#784fd3d679722bc103b1b4b8030bcddb5db2a699" 666 | integrity sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA== 667 | 668 | tsup@^6.5.0: 669 | version "6.5.0" 670 | resolved "https://registry.yarnpkg.com/tsup/-/tsup-6.5.0.tgz#1be97481b7a56385b7c40d01bdabb4196f3649cf" 671 | integrity sha512-36u82r7rYqRHFkD15R20Cd4ercPkbYmuvRkz3Q1LCm5BsiFNUgpo36zbjVhCOgvjyxNBWNKHsaD5Rl8SykfzNA== 672 | dependencies: 673 | bundle-require "^3.1.2" 674 | cac "^6.7.12" 675 | chokidar "^3.5.1" 676 | debug "^4.3.1" 677 | esbuild "^0.15.1" 678 | execa "^5.0.0" 679 | globby "^11.0.3" 680 | joycon "^3.0.1" 681 | postcss-load-config "^3.0.1" 682 | resolve-from "^5.0.0" 683 | rollup "^3.2.5" 684 | source-map "0.8.0-beta.0" 685 | sucrase "^3.20.3" 686 | tree-kill "^1.2.2" 687 | 688 | webidl-conversions@^4.0.2: 689 | version "4.0.2" 690 | resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-4.0.2.tgz#a855980b1f0b6b359ba1d5d9fb39ae941faa63ad" 691 | integrity sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg== 692 | 693 | whatwg-url@^7.0.0: 694 | version "7.1.0" 695 | resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-7.1.0.tgz#c2c492f1eca612988efd3d2266be1b9fc6170d06" 696 | integrity sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg== 697 | dependencies: 698 | lodash.sortby "^4.7.0" 699 | tr46 "^1.0.1" 700 | webidl-conversions "^4.0.2" 701 | 702 | which@^2.0.1: 703 | version "2.0.2" 704 | resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" 705 | integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== 706 | dependencies: 707 | isexe "^2.0.0" 708 | 709 | wrappy@1: 710 | version "1.0.2" 711 | resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" 712 | integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== 713 | 714 | yaml@^1.10.2: 715 | version "1.10.2" 716 | resolved "https://registry.yarnpkg.com/yaml/-/yaml-1.10.2.tgz#2301c5ffbf12b467de8da2333a459e29e7920e4b" 717 | integrity sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg== 718 | -------------------------------------------------------------------------------- /turbo.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://turbo.build/schema.json", 3 | "pipeline": { 4 | "build": { 5 | "outputs": [ 6 | ".next/**" 7 | ] 8 | }, 9 | "lint": { 10 | "outputs": [] 11 | } 12 | } 13 | } --------------------------------------------------------------------------------