{"_id":"hachure-fill","_rev":"7-a1f042665c6dad146904ce619f197066","name":"hachure-fill","dist-tags":{"latest":"0.5.2"},"versions":{"0.1.0":{"name":"hachure-fill","version":"0.1.0","description":"Fill a polygon with lines ","main":"index.js","module":"index.js","types":"index.d.ts","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/pshihn/hachure-fill.git"},"keywords":["hachure","lines","polygon","plotter"],"author":{"name":"Preet Shihn"},"license":"MIT","bugs":{"url":"https://github.com/pshihn/hachure-fill/issues"},"homepage":"https://github.com/pshihn/hachure-fill#readme","gitHead":"a7383400191ce55c7581dd8aca318a74f894b7dc","_id":"hachure-fill@0.1.0","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-fLqRT+2Om45I0MmTgR0xlRvcCqgM7v75fj+W0dfn1jvHUh2UXoVtWOEDKtNvzaEX1BTIW2OeRFA1tQrLem7uCQ==","shasum":"be4dedc91e853ded46e00931a0bc91c687b4499c","tarball":"https://registry.npmjs.org/hachure-fill/-/hachure-fill-0.1.0.tgz","fileCount":4,"unpackedSize":5313,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeq3+qCRA9TVsSAnZWagAAkxIP/1rqOLckJfUMEIucOsuN\nXQ4yxI/gPPQbN5ei26fDbPJqECNduhnC9qamQIAdfoJlbeVio1APvU57Bj3m\nSZ4oYDzDEOvOTkjp1855ClQPRFNqtfKpbIKjcgVs4dHotgPPLK5cTSLjnTgu\nDTnRLTbchJFNq1iJWqNhNfp/p5xMPf/e15YpT1a55cAq6Rn71pHztJun6RCI\nEVEl/hUWB+AsOk9BSrFJVmEOf2KyTBZSiK2efZkLVUniv0mpfFRhRjBLsux2\nO6cNUtyM825x1uZjCzUPrSSpycGUYBkbfifbSts4W4g99mkpFA+3vKCtH8fm\nU4lMQR6Kn8o4kV7uZ1BnDDC0DVfODKM0B6Wa+kZzoAzOHja0wedCcZqTu0uy\nBYlHIff5qktxG7Owjc+48XMhc6TPXf5wMBdSR7FPD756VLiq4meUQKpY0xrl\nI7YJhB3HCBVn4uGIGm0UpYRpcCVigMlVIcTTzZ5VLerNd2sCSDgRcWuNP36/\nRIPlEFPl/2cr9VhvdRxA84sB1KLOH6wgHUDxpF9JmbhvfNp9qUp+swRvnBs9\n4WGV5xe4QJZVo1TYzSikt9nKcyJla5d4m0cmkmcmPGJ+pht5tu09JVaoAQzz\nOu0mHYAczS/mpejqLsd6PMCLSu9vhINg2gewxuhfKXnsI8SiytOt7F83NSUi\nDC3j\r\n=Kjub\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDsKPBRoIuh56H99MhECg0DL6rTBcxFjbu0kh6zqmA/PQIhAK/WyPg2KFotxcBiQfzPNe3OM+dNu7qyVPFTJnW4qCuU"}]},"maintainers":[{"name":"shihn","email":"preetshihn@gmail.com"}],"_npmUser":{"name":"shihn","email":"preetshihn@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hachure-fill_0.1.0_1588297642251_0.8165836977109713"},"_hasShrinkwrap":false},"0.2.0":{"name":"hachure-fill","version":"0.2.0","description":"Fill a polygon with lines ","main":"index.js","module":"index.js","types":"index.d.ts","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/pshihn/hachure-fill.git"},"keywords":["hachure","lines","polygon","plotter"],"author":{"name":"Preet Shihn"},"license":"MIT","bugs":{"url":"https://github.com/pshihn/hachure-fill/issues"},"homepage":"https://github.com/pshihn/hachure-fill#readme","gitHead":"b17b498c361343a16d2035db669fe273c2ba13ea","_id":"hachure-fill@0.2.0","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-ak2/Pexte1EOlFun+aAQbX/brru3G/UNP6cg7gKUlFB/C0KqrmBazB634jZ08hSqlo2gKWn0y0vZs82tQisHXQ==","shasum":"93b237be94c01adb2468e64eac26a1381cea3c97","tarball":"https://registry.npmjs.org/hachure-fill/-/hachure-fill-0.2.0.tgz","fileCount":5,"unpackedSize":5426,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeq6ECCRA9TVsSAnZWagAAdz8P/2brNdaHWnlr9EUl8Wrk\nvMsNPTc/k/ZmjAx+CRhZToMJ8YTGUzfnHgLDJTaQB8aGHgT6ogVPW5ur4B5U\n2yryo7tYvupwdoyv8ahoVjV4+MnTIRJNhLdB2mwJbkZBmmiDT4fXXpKwZoqF\nvvKU0PSNPdUpkqLjz9rLFkkHroNBt3stplBsnBb/lCOjSPKEbblZweg8/4j8\nwwb7ks/1n2pY/HtGfVKLOpBzjw8Dq6tv1R50+4D0OtKtpkGyoVKnTsmaXogt\nQp/pIXJROdlEShP9I6mx3+J+IRU01CJ4dgkVI/5EAsMJf5tXzlSFC/UqXgd+\nsBjn4qchEhGvkxWK8eiEbw1kk2igsWrxttRHTgHD8ivPnSgRN6bg1uwY8145\naKML7Xg5u8JHblMY2i+4s1PVrTuwFVuzxeQ0gOanzb49Uv4ko6B38t0GytL3\nKMV3b1XXkW2Wz99EZsnArN+lx3XOFePvtqrgFL/TgHU7xIeB2A2hrgdoyQSo\n1pe56hlhAYZoYLztTfhwUoP6KPjCxn98xzlSd019yeNAB+L+8pWl+k6fPOE8\natNIxoFNcb+FTvvSlyKKeGi7q7GJA4p9nTRqCEH/XWaoWwUSRRDON8AMwDxD\nvP6dgEnO4qgsNZHg0VYcV+O15xnDs1xTltGenYgjsDxzz3IKFZYyGc06pL4I\nSlKU\r\n=XdgO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCROgO6Y9JKfxgElRpJY+eWwnnl6hOhL95N9Kz2O9EkiwIgMgWLRR14+iScILRXtkmSuFUrHE0gtnhfebp6tzSJp8Q="}]},"maintainers":[{"name":"shihn","email":"preetshihn@gmail.com"}],"_npmUser":{"name":"shihn","email":"preetshihn@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hachure-fill_0.2.0_1588306177682_0.8713217061451868"},"_hasShrinkwrap":false},"0.3.0":{"name":"hachure-fill","version":"0.3.0","description":"Fill a polygon with lines ","main":"bin/hachure.js","types":"bin/hachure.d.ts","type":"module","scripts":{"build":"npm run lint && npm run build-ts","build-ts":"rm -rf bin && tsc","lint":"eslint --ext ts src"},"repository":{"type":"git","url":"git+https://github.com/pshihn/hachure-fill.git"},"keywords":["hachure","lines","polygon","plotter"],"author":{"name":"Preet Shihn"},"license":"MIT","bugs":{"url":"https://github.com/pshihn/hachure-fill/issues"},"homepage":"https://github.com/pshihn/hachure-fill#readme","devDependencies":{"@typescript-eslint/eslint-plugin":"^5.59.0","@typescript-eslint/parser":"^5.59.0","esbuild":"^0.17.18","eslint":"^8.39.0","typescript":"^5.0.4"},"gitHead":"a2d6dd512e8936b06493a3cfb7b18dde07c3fc09","_id":"hachure-fill@0.3.0","_nodeVersion":"18.12.1","_npmVersion":"8.19.2","dist":{"integrity":"sha512-A285PHGnfiCysvBd8ZM/eY523Ee6ytJHBNhGLRjmQMwvebOxUKxB987ZdEOmNbzb/V5OWrBC8J90jdlp9q6syw==","shasum":"54ee8b881c7e27575c0baca7b40656433fc3dd6a","tarball":"https://registry.npmjs.org/hachure-fill/-/hachure-fill-0.3.0.tgz","fileCount":6,"unpackedSize":8473,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCvyZd4r6zu8zPgmQsQjLkxT8OXLKMsgF/5CJ7bbhhkGQIgeeWrxctARlTfmVhxIKQoVuQACn3dsSXZcFuRAilrrh4="}]},"_npmUser":{"name":"shihn","email":"preetshihn@gmail.com"},"directories":{},"maintainers":[{"name":"shihn","email":"preetshihn@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hachure-fill_0.3.0_1685572660468_0.3497322787554229"},"_hasShrinkwrap":false},"0.4.0":{"name":"hachure-fill","version":"0.4.0","description":"Fill a polygon with lines ","main":"bin/hachure.js","types":"bin/hachure.d.ts","type":"module","scripts":{"build":"npm run lint && npm run build-ts","build-ts":"rm -rf bin && tsc","lint":"eslint --ext ts src"},"repository":{"type":"git","url":"git+https://github.com/pshihn/hachure-fill.git"},"keywords":["hachure","lines","polygon","plotter"],"author":{"name":"Preet Shihn"},"license":"MIT","bugs":{"url":"https://github.com/pshihn/hachure-fill/issues"},"homepage":"https://github.com/pshihn/hachure-fill#readme","devDependencies":{"@typescript-eslint/eslint-plugin":"^5.59.0","@typescript-eslint/parser":"^5.59.0","esbuild":"^0.17.18","eslint":"^8.39.0","typescript":"^5.0.4"},"gitHead":"5a38746222178e82af2b3951acd9679be526e8f3","_id":"hachure-fill@0.4.0","_nodeVersion":"18.12.1","_npmVersion":"8.19.2","dist":{"integrity":"sha512-adAAzV4vgE5BBkeimtSPMkTARn6XFoV8vhel4C4S/B+cC7XNZGXyU3Fb2zNBz0PgYHkLLWWSL0CRSSnC+Xcw5g==","shasum":"5684c5268261cb7ea71f11e49696fb7b12a8a5aa","tarball":"https://registry.npmjs.org/hachure-fill/-/hachure-fill-0.4.0.tgz","fileCount":6,"unpackedSize":8514,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCA3HBOS+hFlZP9aX7QZKEoQmSKQ95m1FEhwQ3HdHt6XgIgJScy1bob2ZdzRIlDfRGKR1iqnLC0m8ufF4goHGHg8fQ="}]},"_npmUser":{"name":"shihn","email":"preetshihn@gmail.com"},"directories":{},"maintainers":[{"name":"shihn","email":"preetshihn@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hachure-fill_0.4.0_1685573525994_0.004145882894836639"},"_hasShrinkwrap":false},"0.5.0":{"name":"hachure-fill","version":"0.5.0","description":"Fill a polygon with lines ","main":"bin/hachure.js","types":"bin/hachure.d.ts","type":"module","scripts":{"build":"npm run lint && npm run build-ts","build-ts":"rm -rf bin && tsc","lint":"eslint --ext ts src"},"repository":{"type":"git","url":"git+https://github.com/pshihn/hachure-fill.git"},"keywords":["hachure","lines","polygon","plotter"],"author":{"name":"Preet Shihn"},"license":"MIT","bugs":{"url":"https://github.com/pshihn/hachure-fill/issues"},"homepage":"https://github.com/pshihn/hachure-fill#readme","devDependencies":{"@typescript-eslint/eslint-plugin":"^5.59.0","@typescript-eslint/parser":"^5.59.0","esbuild":"^0.17.18","eslint":"^8.39.0","typescript":"^5.0.4"},"gitHead":"570435fabaff93b88524852604e00cbc93dad8c6","_id":"hachure-fill@0.5.0","_nodeVersion":"18.12.1","_npmVersion":"8.19.2","dist":{"integrity":"sha512-cdbveJnoOsFmWbLO8hke3yKpSpJBsDfJx5zuXeobDcjDwXpnTf2rLPnf9G0CnqkFvuGo9kvtTsfQzJ7QFsuJeQ==","shasum":"85329d42c77713ca8e55d1dad526dcf2373206b8","tarball":"https://registry.npmjs.org/hachure-fill/-/hachure-fill-0.5.0.tgz","fileCount":6,"unpackedSize":8622,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBQAZs6LSRbvCqaNLc7Erk+jLQLgGHtvuFS/t8nkJZHFAiEAxSS+cp9bJ0cF8QIsvb9S2LoRFrHlyK6Q9g/cjcknJt4="}]},"_npmUser":{"name":"shihn","email":"preetshihn@gmail.com"},"directories":{},"maintainers":[{"name":"shihn","email":"preetshihn@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hachure-fill_0.5.0_1695775667108_0.9374372281736336"},"_hasShrinkwrap":false},"0.5.1":{"name":"hachure-fill","version":"0.5.1","description":"Fill a polygon with lines ","main":"bin/hachure.js","types":"bin/hachure.d.ts","type":"module","scripts":{"build":"npm run lint && npm run build-ts","build-ts":"rm -rf bin && tsc","lint":"eslint --ext ts src"},"repository":{"type":"git","url":"git+https://github.com/pshihn/hachure-fill.git"},"keywords":["hachure","lines","polygon","plotter"],"author":{"name":"Preet Shihn"},"license":"MIT","bugs":{"url":"https://github.com/pshihn/hachure-fill/issues"},"homepage":"https://github.com/pshihn/hachure-fill#readme","devDependencies":{"@typescript-eslint/eslint-plugin":"^5.59.0","@typescript-eslint/parser":"^5.59.0","esbuild":"^0.17.18","eslint":"^8.39.0","typescript":"^5.0.4"},"gitHead":"2083be6f7e6c814dc6a8c2c88a7823827566504e","_id":"hachure-fill@0.5.1","_nodeVersion":"18.12.1","_npmVersion":"8.19.2","dist":{"integrity":"sha512-55DKd8CBA/n1kRfcCHAheHggUQnf4ptVlOlA1FfwiUOhGwgYi9h7/Ryq4Ra3psHAYhXwprayVtTKPBmQ7MizKg==","shasum":"9fe747492cfd6d4e0c5fa66ed1833a48b29b2516","tarball":"https://registry.npmjs.org/hachure-fill/-/hachure-fill-0.5.1.tgz","fileCount":6,"unpackedSize":8644,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCCCpbzNYhNhekosabyuVHixzoIOihd7b3A5mpj99ZkRQIhAJcpD2lMAZK1flkWsoVzdTWDK4ibY4kZxZRWmD+ayBrZ"}]},"_npmUser":{"name":"shihn","email":"preetshihn@gmail.com"},"directories":{},"maintainers":[{"name":"shihn","email":"preetshihn@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hachure-fill_0.5.1_1695776033320_0.6857057177176551"},"_hasShrinkwrap":false},"0.5.2":{"name":"hachure-fill","version":"0.5.2","description":"Fill a polygon with lines ","main":"bin/hachure.js","types":"bin/hachure.d.ts","type":"module","scripts":{"build":"npm run lint && npm run build-ts","build-ts":"rm -rf bin && tsc","lint":"eslint --ext ts src"},"repository":{"type":"git","url":"git+https://github.com/pshihn/hachure-fill.git"},"keywords":["hachure","lines","polygon","plotter"],"author":{"name":"Preet Shihn"},"license":"MIT","bugs":{"url":"https://github.com/pshihn/hachure-fill/issues"},"homepage":"https://github.com/pshihn/hachure-fill#readme","devDependencies":{"@typescript-eslint/eslint-plugin":"^5.59.0","@typescript-eslint/parser":"^5.59.0","esbuild":"^0.17.18","eslint":"^8.39.0","typescript":"^5.0.4"},"gitHead":"2083be6f7e6c814dc6a8c2c88a7823827566504e","_id":"hachure-fill@0.5.2","_nodeVersion":"18.12.1","_npmVersion":"8.19.2","dist":{"integrity":"sha512-3GKBOn+m2LX9iq+JC1064cSFprJY4jL1jCXTcpnfER5HYE2l/4EfWSGzkPa/ZDBmYI0ZOEj5VHV/eKnPGkHuOg==","shasum":"d19bc4cc8750a5962b47fb1300557a85fcf934cc","tarball":"https://registry.npmjs.org/hachure-fill/-/hachure-fill-0.5.2.tgz","fileCount":6,"unpackedSize":8675,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDwu9IQR2/WZip+NtXrX4w8f79SIlSP7ov+Th2RKJJyRAiAoUfknOJ9RP9tmCM2iiWByFlJm81HWH1AhQ1CWSWdHJw=="}]},"_npmUser":{"name":"shihn","email":"preetshihn@gmail.com"},"directories":{},"maintainers":[{"name":"shihn","email":"preetshihn@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hachure-fill_0.5.2_1695776258483_0.34836298691209255"},"_hasShrinkwrap":false}},"time":{"created":"2020-05-01T01:47:22.251Z","0.1.0":"2020-05-01T01:47:22.343Z","modified":"2023-09-27T00:57:38.866Z","0.2.0":"2020-05-01T04:09:37.803Z","0.3.0":"2023-05-31T22:37:40.632Z","0.4.0":"2023-05-31T22:52:06.190Z","0.5.0":"2023-09-27T00:47:47.332Z","0.5.1":"2023-09-27T00:53:53.608Z","0.5.2":"2023-09-27T00:57:38.699Z"},"maintainers":[{"name":"shihn","email":"preetshihn@gmail.com"}],"description":"Fill a polygon with lines ","homepage":"https://github.com/pshihn/hachure-fill#readme","keywords":["hachure","lines","polygon","plotter"],"repository":{"type":"git","url":"git+https://github.com/pshihn/hachure-fill.git"},"author":{"name":"Preet Shihn"},"bugs":{"url":"https://github.com/pshihn/hachure-fill/issues"},"license":"MIT","readme":"# hachure-fill\n\n[Demo](https://hachure-fill.pages.dev/)\n\nThis package calculates the hachure lined to fill a polygon. The **angle** of the lines and the **gap** between lines can be configured.\n\nThe algorithm works on convex, concave, simple, complex polygons, and polygons with holes. \n\n![preview of a polygon](https://user-images.githubusercontent.com/833927/242424090-90e60c00-c87b-4033-ae63-c0f38fa5d291.png)\n\n\n## Install\n\nFrom npm\n\n```\nnpm install --save hachure-fill\n```\n\nThe package is distributed as an ES6 module. \n\n## Usage\n\n### hachureFill(points: Point[], angle: number, gap: number): Line[];\n\nThe function takes in a polygon, which is represented as an array of points (each point being a an array of 2 numbers `[x, y]`). \n\nThe **angle** sets the angle of the hachure lines in degrees. \n\nThe  **gap** arguments sets the distance between each hachure line. \n\nThe function returns an array of lines. Each line is an array of two points. \n\n```javascript\nimport { hachureFill } from 'hachure-fill';\n\n// Polygon vertices\nconst vertices = [\n  [10, 10],\n  [200, 10],\n  [100, 100],\n  [300, 100],\n  [60, 200]\n];\n\n// Lines filling the polygon \n// at an angle of 45 degrees. \n// Lines are 10px apart.\nconst lines = hachureFill(vertices, 45, 10);\n\n// Draw lines...\n```\n\n### hachureFill(points: Point[][], angle: number, gap: number): Line[];\n\nWhen dealing with Polygon with holes, you can provide an array of polygons. The outer polygon, and polygones represented each of the holes. \nThe polygons need not be nested, but if they are, even-odd rules apply to fill the shape. \n","readmeFilename":"README.md"}