{"_id":"@davepagurek/bezier-path","_rev":"8-6d0aa3a6987b54f3ca307fc6ed174c00","name":"@davepagurek/bezier-path","dist-tags":{"latest":"0.0.8"},"versions":{"0.0.1":{"name":"@davepagurek/bezier-path","version":"0.0.1","author":{"name":"Dave Pagurek","email":"dave@davepagurek.com"},"license":"MIT","_id":"@davepagurek/bezier-path@0.0.1","maintainers":[{"name":"davepagurek","email":"davepagurek@gmail.com"}],"homepage":"https://github.com/davepagurek/bezier-path","bugs":{"url":"https://github.com/davepagurek/glsl-autodiff/issues"},"dist":{"shasum":"51c5678d487497e2c60b485c5e85624de77a473d","tarball":"https://registry.npmjs.org/@davepagurek/bezier-path/-/bezier-path-0.0.1.tgz","fileCount":9,"integrity":"sha512-OlfW3X5mMznoXCuTviwCNlAv/aUfaFeJ6o3I3ITEdT4IovyDJu56886ZR6hIeUXElnwhbAGqGqQ82PX/OJBhJA==","signatures":[{"sig":"MEQCIDtO0+HSEJe1e/jct/a4UsjF0mv4jIHeOVxzOtJnOWY1AiAg08n2h+Q2I0ghlRdzkQ8R1Kc9XX+20MrzGsmpJbRN2A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":20218},"main":"build/bezier-path.js","types":"build/bezier-path.d.ts","gitHead":"faabf8889cd84cedcfa78fe9b6e28220df0ca322","scripts":{"build":"yarn generate:js","publish":"npm publish --access public","generate:js":"yarn run webpack"},"_npmUser":{"name":"davepagurek","email":"davepagurek@gmail.com"},"repository":{"url":"git+https://github.com/davepagurek/bezier-path.git","type":"git"},"_npmVersion":"10.2.3","description":"A library for efficiently querying points along cubic Bezier curves.","directories":{},"_nodeVersion":"18.19.0","_hasShrinkwrap":false,"devDependencies":{"ts-node":"^10.0.0","webpack":"^5.41.1","ts-loader":"^9.2.3","typescript":"^4.3.4","@types/node":"^15.12.5","webpack-cli":"^4.7.2"},"_npmOperationalInternal":{"tmp":"tmp/bezier-path_0.0.1_1727886574159_0.6450116352889539","host":"s3://npm-registry-packages"}},"0.0.2":{"name":"@davepagurek/bezier-path","version":"0.0.2","author":{"name":"Dave Pagurek","email":"dave@davepagurek.com"},"license":"MIT","_id":"@davepagurek/bezier-path@0.0.2","maintainers":[{"name":"davepagurek","email":"davepagurek@gmail.com"}],"homepage":"https://github.com/davepagurek/bezier-path","bugs":{"url":"https://github.com/davepagurek/glsl-autodiff/issues"},"dist":{"shasum":"7c9d3bc6ba62bbf4e78259463280a268309ac1c4","tarball":"https://registry.npmjs.org/@davepagurek/bezier-path/-/bezier-path-0.0.2.tgz","fileCount":9,"integrity":"sha512-4L9ddgzZc9DRGyl1RrS3z5nwnVJoyjsAelVG4X1jh4tVxryEHr4H9QavhxW/my6Rn3669Qz6mhv8gd5O/WeFTA==","signatures":[{"sig":"MEUCICmUouK6B5/3JwN1IstCVLKcMqdUqwxzSEePfTFm9VCFAiEAjbYvhdzyq2AwLQ9WhGBcyGLC0YFg+64XLZocbA8k7Xk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":20212},"main":"build/bezier-path.js","types":"build/index.d.ts","gitHead":"f32f4560bcae7db8b442b6b1d8a6ac15dbd9d4bd","scripts":{"build":"yarn generate:js","publish":"npm publish --access public","generate:js":"yarn run webpack"},"_npmUser":{"name":"davepagurek","email":"davepagurek@gmail.com"},"repository":{"url":"git+https://github.com/davepagurek/bezier-path.git","type":"git"},"_npmVersion":"10.2.3","description":"A library for efficiently querying points along cubic Bezier curves.","directories":{},"_nodeVersion":"18.19.0","_hasShrinkwrap":false,"devDependencies":{"ts-node":"^10.0.0","webpack":"^5.41.1","ts-loader":"^9.2.3","typescript":"^4.3.4","@types/node":"^15.12.5","webpack-cli":"^4.7.2"},"_npmOperationalInternal":{"tmp":"tmp/bezier-path_0.0.2_1727887095913_0.8054990902033954","host":"s3://npm-registry-packages"}},"0.0.3":{"name":"@davepagurek/bezier-path","version":"0.0.3","author":{"name":"Dave Pagurek","email":"dave@davepagurek.com"},"license":"MIT","_id":"@davepagurek/bezier-path@0.0.3","maintainers":[{"name":"davepagurek","email":"davepagurek@gmail.com"}],"homepage":"https://github.com/davepagurek/bezier-path","bugs":{"url":"https://github.com/davepagurek/bezier-path/issues"},"dist":{"shasum":"de33b5a0651a93201c65adb9fe911f3495a29c38","tarball":"https://registry.npmjs.org/@davepagurek/bezier-path/-/bezier-path-0.0.3.tgz","fileCount":13,"integrity":"sha512-Vn4Q28XPXWUZz+R4dLZY8p0Jd+aJLAW0J5hko2XJlU6hr89cmMTFpgNjbHLPJhJ/vhTGyBXB27vRZZuAhSTDyg==","signatures":[{"sig":"MEUCIFRFMI77SywMF+CINkJrwgbhmo2LGNkXWx/IJULJSnASAiEAmPh4nCfebH1/hqJy2RMVtPAsWFANuk3198yxt2KGkCE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":65013},"main":"./build/index.js","type":"module","types":"./build/index.d.ts","unpkg":"./build/bezier-path.min.js","exports":{".":{"import":{"types":"./build/index.d.ts","default":"./build/index.js"},"browser":"./build/bezier-path.min.js"}},"gitHead":"c51744428aa5e5196d39fffc20a394b9f2effc70","scripts":{"build":"tsc && rollup -c","clean":"node -e \"fs.rmSync('./build', { recursive: true, force: true })\"","publish":"npm publish --access public","lint:dts":"npx --yes @arethetypeswrong/cli --pack .","lint:npm":"npx publint --pack npm","prebuild":"yarn run clean"},"_npmUser":{"name":"davepagurek","actor":{"name":"davepagurek","type":"user","email":"davepagurek@gmail.com"},"email":"davepagurek@gmail.com"},"jsdeliver":"./build/bezier-path.min.js","repository":{"url":"git+https://github.com/davepagurek/bezier-path.git","type":"git"},"_npmVersion":"10.8.2","description":"A library for efficiently querying points along cubic Bezier curves.","directories":{},"_nodeVersion":"20.19.0","_hasShrinkwrap":false,"packageManager":"yarn@4.4.1+sha512.f825273d0689cc9ead3259c14998037662f1dcd06912637b21a450e8da7cfeb4b1965bbee73d16927baa1201054126bc385c6f43ff4aa705c8631d26e12460f1","devDependencies":{"rollup":"^4.44.0","typescript":"^5.8.3","@types/node":"^24.0.4","rollup-plugin-dts":"^6.2.1","@rollup/plugin-terser":"^0.4.4"},"_npmOperationalInternal":{"tmp":"tmp/bezier-path_0.0.3_1751546884452_0.9701333210998178","host":"s3://npm-registry-packages-npm-production"}},"0.0.4":{"name":"@davepagurek/bezier-path","version":"0.0.4","author":{"name":"Dave Pagurek","email":"dave@davepagurek.com"},"license":"MIT","_id":"@davepagurek/bezier-path@0.0.4","maintainers":[{"name":"davepagurek","email":"davepagurek@gmail.com"}],"homepage":"https://github.com/davepagurek/bezier-path","bugs":{"url":"https://github.com/davepagurek/bezier-path/issues"},"dist":{"shasum":"6e939e5e600d23d688d806e745c79ec0b3a2cece","tarball":"https://registry.npmjs.org/@davepagurek/bezier-path/-/bezier-path-0.0.4.tgz","fileCount":4,"integrity":"sha512-2C3K5I1sOjBzB08oQ+L/Ux/z4NGj/C+xhvwbUf0Dk/dSfapaWHNTTuLLuEi3d1sz9uY+2I/4LMBijqYIYl7h6w==","signatures":[{"sig":"MEUCIQCf6q6MpqKiNRbyONtHlB2IMTLIJxkAbAnWZ8804BgPIgIgLT5wbJzAT13lmevj9/r6qHa47DVaRUL22DbIlC4cIRk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":30908},"main":"./build/index.js","type":"module","types":"./build/index.d.ts","unpkg":"./build/bezier-path.min.js","exports":{".":{"import":{"types":"./build/index.d.ts","default":"./build/index.js"},"browser":"./build/bezier-path.min.js"}},"gitHead":"968c6be6dc9e7ff6afbd037d6c7cdbc597e6b8ff","scripts":{"build":"tsc && rollup -c","clean":"node -e \"fs.rmSync('./build', { recursive: true, force: true })\"","publish":"npm publish --access public","lint:dts":"npx --yes @arethetypeswrong/cli --pack .","lint:npm":"npx publint --pack npm","prebuild":"yarn run clean"},"_npmUser":{"name":"davepagurek","actor":{"name":"davepagurek","type":"user","email":"davepagurek@gmail.com"},"email":"davepagurek@gmail.com"},"jsdelivr":"./build/bezier-path.min.js","repository":{"url":"git+https://github.com/davepagurek/bezier-path.git","type":"git"},"_npmVersion":"10.8.2","description":"A library for efficiently querying points along cubic Bezier curves.","directories":{},"_nodeVersion":"20.19.0","_hasShrinkwrap":false,"packageManager":"yarn@4.4.1+sha512.f825273d0689cc9ead3259c14998037662f1dcd06912637b21a450e8da7cfeb4b1965bbee73d16927baa1201054126bc385c6f43ff4aa705c8631d26e12460f1","devDependencies":{"rollup":"^4.44.0","typescript":"^5.8.3","@types/node":"^24.0.4","rollup-plugin-dts":"^6.2.1","@rollup/plugin-terser":"^0.4.4"},"_npmOperationalInternal":{"tmp":"tmp/bezier-path_0.0.4_1751634844012_0.6617035428323625","host":"s3://npm-registry-packages-npm-production"}},"0.0.5":{"name":"@davepagurek/bezier-path","version":"0.0.5","author":{"name":"Dave Pagurek","email":"dave@davepagurek.com"},"license":"MIT","_id":"@davepagurek/bezier-path@0.0.5","maintainers":[{"name":"davepagurek","email":"davepagurek@gmail.com"}],"homepage":"https://github.com/davepagurek/bezier-path","bugs":{"url":"https://github.com/davepagurek/bezier-path/issues"},"dist":{"shasum":"d456fa62f3c7edb301834fd6ac3f8ed19f46ebcb","tarball":"https://registry.npmjs.org/@davepagurek/bezier-path/-/bezier-path-0.0.5.tgz","fileCount":5,"integrity":"sha512-DEWR/tGAXUKVh2KpeQ5FGDFgL0L8ss4tVVW0ntOawhpKusRFZOtltxYz4PrcoCxt/+/QDmTA662CrNGrgBxKCA==","signatures":[{"sig":"MEUCIQDPNnDFpGREPkcO65kn9yQWph2kKWAwSyZljgR7nZHFyAIgYYfwBqPCT2c59XFQ2gR+/Yp8/Ge4wagBfFEsS+ajU7U=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":40348},"main":"./build/index.js","type":"module","types":"./build/index.d.ts","unpkg":"./build/bezier-path.min.js","exports":{".":{"import":{"types":"./build/index.d.ts","default":"./build/index.js"},"browser":"./build/bezier-path.min.js"}},"gitHead":"162acf294d7991bd5cb7d8bb9c3a26fe5788c31b","scripts":{"lint":"eslint .","build":"yarn run clean && tsc -p tsconfig.build.json && rollup -c","clean":"node clean.config.js","publish":"npm publish --access public","lint:dts":"npx --yes @arethetypeswrong/cli --pack .","lint:fix":"yarn run lint -- --fix","lint:npm":"npx publint --pack npm","lint:tsc":"tsc --noEmit"},"_npmUser":{"name":"davepagurek","email":"davepagurek@gmail.com"},"jsdelivr":"./build/bezier-path.min.js","repository":{"url":"git+https://github.com/davepagurek/bezier-path.git","type":"git"},"_npmVersion":"10.8.2","description":"A library for efficiently querying points along cubic Bezier curves.","directories":{},"_nodeVersion":"20.19.0","_hasShrinkwrap":false,"packageManager":"yarn@4.4.1+sha512.f825273d0689cc9ead3259c14998037662f1dcd06912637b21a450e8da7cfeb4b1965bbee73d16927baa1201054126bc385c6f43ff4aa705c8631d26e12460f1","devDependencies":{"eslint":"^9.30.1","rollup":"^4.44.0","globals":"^16.3.0","typescript":"^5.8.3","@types/node":"^24.0.4","@eslint/compat":"^1.3.1","rollup-plugin-dts":"^6.2.1","typescript-eslint":"^8.35.1","@rollup/plugin-terser":"^0.4.4","@stylistic/eslint-plugin":"^5.1.0"},"_npmOperationalInternal":{"tmp":"tmp/bezier-path_0.0.5_1753127857606_0.20282767910150779","host":"s3://npm-registry-packages-npm-production"}},"0.0.6":{"name":"@davepagurek/bezier-path","version":"0.0.6","author":{"name":"Dave Pagurek","email":"dave@davepagurek.com"},"license":"MIT","_id":"@davepagurek/bezier-path@0.0.6","maintainers":[{"name":"davepagurek","email":"davepagurek@gmail.com"}],"homepage":"https://github.com/davepagurek/bezier-path","bugs":{"url":"https://github.com/davepagurek/bezier-path/issues"},"dist":{"shasum":"61478a89d75aa127bbf8fbf7f15df5e31a8ad31c","tarball":"https://registry.npmjs.org/@davepagurek/bezier-path/-/bezier-path-0.0.6.tgz","fileCount":5,"integrity":"sha512-HCV7SzP5TOdgpq290pJrqOIbnTvxZJtrRew0kydoflO9pp/rVSB9p6g6MEOrJBSR7nILh97a3vgqhyDI8Yrqpw==","signatures":[{"sig":"MEYCIQC75Ey1kfcbrsgCO1ZF+YEX1ebPGUJ1lGw7GZrPvs/0LgIhALxMehzLeH+kSed8CGZuB7NV4/UAc8UV5HeX0gdz3ZOY","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":40401},"main":"./build/index.js","type":"module","types":"./build/index.d.ts","unpkg":"./build/bezier-path.min.js","exports":{".":{"import":{"types":"./build/index.d.ts","default":"./build/index.js"},"browser":"./build/bezier-path.min.js"}},"gitHead":"a22406e80fb80607e2a7173f5bd041d21ca095b3","scripts":{"lint":"eslint .","build":"yarn run clean && tsc -p tsconfig.build.json && rollup -c","clean":"node clean.config.js","publish":"npm publish --access public","lint:dts":"npx --yes @arethetypeswrong/cli --pack .","lint:fix":"yarn run lint -- --fix","lint:npm":"npx publint --pack npm","lint:tsc":"tsc --noEmit"},"_npmUser":{"name":"davepagurek","email":"davepagurek@gmail.com"},"jsdelivr":"./build/bezier-path.min.js","repository":{"url":"git+https://github.com/davepagurek/bezier-path.git","type":"git"},"_npmVersion":"10.8.2","description":"A library for efficiently querying points along cubic Bezier curves.","directories":{},"_nodeVersion":"20.19.0","_hasShrinkwrap":false,"packageManager":"yarn@4.4.1+sha512.f825273d0689cc9ead3259c14998037662f1dcd06912637b21a450e8da7cfeb4b1965bbee73d16927baa1201054126bc385c6f43ff4aa705c8631d26e12460f1","devDependencies":{"eslint":"^9.30.1","rollup":"^4.44.0","globals":"^16.3.0","typescript":"^5.8.3","@types/node":"^24.0.4","@eslint/compat":"^1.3.1","rollup-plugin-dts":"^6.2.1","typescript-eslint":"^8.35.1","@rollup/plugin-terser":"^0.4.4","@stylistic/eslint-plugin":"^5.1.0"},"_npmOperationalInternal":{"tmp":"tmp/bezier-path_0.0.6_1760634465446_0.03590247785360989","host":"s3://npm-registry-packages-npm-production"}},"0.0.7":{"name":"@davepagurek/bezier-path","version":"0.0.7","author":{"name":"Dave Pagurek","email":"dave@davepagurek.com"},"license":"MIT","_id":"@davepagurek/bezier-path@0.0.7","maintainers":[{"name":"davepagurek","email":"davepagurek@gmail.com"}],"homepage":"https://github.com/davepagurek/bezier-path","bugs":{"url":"https://github.com/davepagurek/bezier-path/issues"},"dist":{"shasum":"1e8200f826af0d5d424d4c674c24a0748c14a037","tarball":"https://registry.npmjs.org/@davepagurek/bezier-path/-/bezier-path-0.0.7.tgz","fileCount":5,"integrity":"sha512-CVlnCOrV1iy4Z12T756i9l4G6kF7r8uhlnb+xqDemAMmWQB+8Q0b+8VEqIiUfywgZDSiDr18Rm7pZlnA69rE8Q==","signatures":[{"sig":"MEUCIEGWPR4RPwCVUsjkhOoqot1qRmgsmvr39t+8Ym4f+DyBAiEAr61kjyYFirVhrxSGnxS0nqtDB5TcGTrCAc3e4xS7SBg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":41773},"main":"./build/index.js","type":"module","types":"./build/index.d.ts","unpkg":"./build/bezier-path.min.js","exports":{".":{"import":{"types":"./build/index.d.ts","default":"./build/index.js"},"browser":"./build/bezier-path.min.js"}},"gitHead":"2a2de242068765c12a3528d3a8c3c9efc12e5488","scripts":{"lint":"eslint .","build":"yarn run clean && tsc -p tsconfig.build.json && rollup -c","clean":"node clean.config.js","publish":"npm publish --access public","lint:dts":"npx --yes @arethetypeswrong/cli --pack .","lint:fix":"yarn run lint -- --fix","lint:npm":"npx publint --pack npm","lint:tsc":"tsc --noEmit"},"_npmUser":{"name":"davepagurek","email":"davepagurek@gmail.com"},"jsdelivr":"./build/bezier-path.min.js","repository":{"url":"git+https://github.com/davepagurek/bezier-path.git","type":"git"},"_npmVersion":"10.8.2","description":"A library for efficiently querying points along cubic Bezier curves.","directories":{},"_nodeVersion":"20.19.0","_hasShrinkwrap":false,"packageManager":"yarn@4.4.1+sha512.f825273d0689cc9ead3259c14998037662f1dcd06912637b21a450e8da7cfeb4b1965bbee73d16927baa1201054126bc385c6f43ff4aa705c8631d26e12460f1","devDependencies":{"eslint":"^9.30.1","rollup":"^4.44.0","globals":"^16.3.0","typescript":"^5.8.3","@types/node":"^24.0.4","@eslint/compat":"^1.3.1","rollup-plugin-dts":"^6.2.1","typescript-eslint":"^8.35.1","@rollup/plugin-terser":"^0.4.4","@stylistic/eslint-plugin":"^5.1.0"},"_npmOperationalInternal":{"tmp":"tmp/bezier-path_0.0.7_1760711141911_0.638424651452943","host":"s3://npm-registry-packages-npm-production"}},"0.0.8":{"name":"@davepagurek/bezier-path","version":"0.0.8","homepage":"https://github.com/davepagurek/bezier-path","bugs":{"url":"https://github.com/davepagurek/bezier-path/issues"},"repository":{"type":"git","url":"git+https://github.com/davepagurek/bezier-path.git"},"license":"MIT","author":{"name":"Dave Pagurek","email":"dave@davepagurek.com"},"type":"module","exports":{".":{"import":{"types":"./build/index.d.ts","default":"./build/index.js"},"browser":"./build/bezier-path.min.js"}},"main":"./build/index.js","jsdelivr":"./build/bezier-path.min.js","unpkg":"./build/bezier-path.min.js","scripts":{"build":"yarn run clean && tsc -p tsconfig.build.json && rollup -c","clean":"node clean.config.js","lint":"eslint .","lint:fix":"yarn run lint -- --fix","lint:tsc":"tsc --noEmit","lint:npm":"npx publint --pack npm","lint:dts":"npx --yes @arethetypeswrong/cli --pack .","publish":"npm publish --access public"},"devDependencies":{"@eslint/compat":"^1.3.1","@rollup/plugin-terser":"^0.4.4","@stylistic/eslint-plugin":"^5.1.0","@types/node":"^24.0.4","eslint":"^9.30.1","globals":"^16.3.0","rollup":"^4.44.0","rollup-plugin-dts":"^6.2.1","typescript":"^5.8.3","typescript-eslint":"^8.35.1"},"packageManager":"yarn@4.4.1+sha512.f825273d0689cc9ead3259c14998037662f1dcd06912637b21a450e8da7cfeb4b1965bbee73d16927baa1201054126bc385c6f43ff4aa705c8631d26e12460f1","_id":"@davepagurek/bezier-path@0.0.8","gitHead":"9123ff58ee75114913f7958773898e65353d994a","types":"./build/index.d.ts","description":"A library for efficiently querying points along cubic Bezier curves.","_nodeVersion":"20.19.0","_npmVersion":"10.8.2","dist":{"integrity":"sha512-9HYfG8WfP8oJaZ2cZ4Q85EfzCWm0QOfw/uyjG12083QRHgEHcCSFmhACvIxNPIZrLsmrbPdLnSxB40OCyMk22A==","shasum":"e9713b63f2802393f56086a0cb760312df149132","tarball":"https://registry.npmjs.org/@davepagurek/bezier-path/-/bezier-path-0.0.8.tgz","fileCount":5,"unpackedSize":41823,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIFiQ4uIRsW5LfJ6LF6qQk4xIZNs+9ywoZyuT/R71p6BhAiEAqnipUksZKsZzrYjXnP7mu5d11LgVEmWbOthc1aohhKs="}]},"_npmUser":{"name":"davepagurek","email":"davepagurek@gmail.com"},"directories":{},"maintainers":[{"name":"davepagurek","email":"davepagurek@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/bezier-path_0.0.8_1763410234435_0.5578971970319657"},"_hasShrinkwrap":false}},"time":{"created":"2024-10-02T16:29:34.041Z","modified":"2025-11-17T20:10:34.876Z","0.0.1":"2024-10-02T16:29:34.331Z","0.0.2":"2024-10-02T16:38:16.188Z","0.0.3":"2025-07-03T12:48:04.636Z","0.0.4":"2025-07-04T13:14:04.166Z","0.0.5":"2025-07-21T19:57:37.817Z","0.0.6":"2025-10-16T17:07:45.646Z","0.0.7":"2025-10-17T14:25:42.074Z","0.0.8":"2025-11-17T20:10:34.641Z"},"bugs":{"url":"https://github.com/davepagurek/bezier-path/issues"},"author":{"name":"Dave Pagurek","email":"dave@davepagurek.com"},"license":"MIT","homepage":"https://github.com/davepagurek/bezier-path","repository":{"type":"git","url":"git+https://github.com/davepagurek/bezier-path.git"},"description":"A library for efficiently querying points along cubic Bezier curves.","maintainers":[{"name":"davepagurek","email":"davepagurek@gmail.com"}],"readme":"# bezier-path\n\nA library for efficiently querying points along cubic Bezier curves.\n\n## Why?\n\nThis implements two features of the native JS `SVGPathElement` API: `path.getTotalLength()`, and `path.getPointAtLength()`, but a lot faster than the native API.\n\nBezier curves aren't easy to sample by length. Normally, you sample in \"Bezier space\" for each segment via a number between 0 and 1, but evenly spaced values in Bezier space won't produce evenly spaced points in Cartesian coordinates. Finding a point at a specific distance normally means doing an integration of some kind, which can be slow if you are getting a lot of points. I need it to be fast, though, which is where this library comes in!\n\n## Usage\n\n### Adding the library\n\nAdd the library in a script tag:\n\n```html\n<script src=\"https://cdn.jsdelivr.net/npm/@davepagurek/bezier-path@0.0.8\"></script>\n```\n\nOr on OpenProcessing, add the CDN link as a library:\n\n```\nhttps://cdn.jsdelivr.net/npm/@davepagurek/bezier-path@0.0.8\n```\n> [!IMPORTANT]  \n> This package is ESM-only. It cannot be require()'d from CommonJS. [Read More](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c)\n\n### Creating paths\n\n#### Via the control point API\n\nYou can call `create()` with an array of control points. Each control point in an object including a `pt` property, which is the coordinate the curve will pass through. It may optionally include `left` and `right` properties, which control the handles going into and out of the point, respectively.\n\n<table>\n<tr>\n<td>\n  \n```js\nconst myPath = BezierPath.create([\n  {\n    pt: { x: 10, y: 10 },\n    right: { x: 50, y: 10 }\n  },\n  {\n    left: { x: 20, y: 20 },\n    pt: { x: 20, y: 30 },\n    right: { x: 20, y: 40 }\n  },\n  {\n    left: { x: 50, y: 50 },\n    pt: { x: 10, y: 50 },\n  },\n])\n```\n\n</td>\n<td>\n  \n![image](https://github.com/user-attachments/assets/863a837c-b53c-4151-b23f-be804bd726df)\n\n</td>\n<td>\n\n![image](https://github.com/user-attachments/assets/a86a9bf1-42ad-4d01-902d-b2c53cc83dde)\n\n</td>\n</tr>\n</table>\n\nhttps://editor.p5js.org/davepagurek/sketches/dg2o-sLeK\n\nIf you want a fully smooth curve, then the line between a control point's `left` and `right` coordinates must pass through its `pt` coordinate. A way to ensure this is to create just one side, e.g. `right`, and then mirror it for the other side. Here's an example resembling Catmull-Rom interpolation, using p5's `p5.Vector` class for the points:\n\n<table>\n<tr>\n<td>\n  \n```js\nconst pts = []\nfor (let i = 0; i < 5; i++) {\n  pts.push({\n    pt: createVector(random(width), random(height))\n  })\n}\n\n// Smooth tangents\nfor (let i = 0; i < 5; i++) {\n  const prev = pts[i-1]\n  const curr = pts[i]\n  const next = pts[i+1]\n  if (prev && next) {\n    // Change the scaling of the tangent to adjust the curve tightness\n    const tangent = next.pt.copy().sub(prev.pt).div(4)\n    curr.right = curr.pt.copy().add(tangent)\n    curr.left = curr.pt.copy().sub(tangent)\n  }\n}\n\nconst myPath = BezierPath.create(pts)\n```\n\n</td>\n<td>\n  \n![image](https://github.com/user-attachments/assets/d1b18cbf-436d-46f0-9080-042b1e2b5cec)\n\n</td>\n<td>\n\n![image](https://github.com/user-attachments/assets/53e4e1a3-1147-4913-ab54-3ac8fea5e832)\n\n</td>\n</tr>\n</table>\nhttps://editor.p5js.org/davepagurek/sketches/g2GvhxcNj\n\n#### Via an SVG `<path>` tag\n\nYou can also import a path from an SVG embedded in the page:\n\n```js\nconst myPath = BezierPath.createFromElement(document.querySelector('path'))\n```\n\n### Drawing paths\n\nYou can draw a path as a polyline by querying points via `getPointAtLength()`:\n```js\nbeginShape()\nfor (let i = 0; i <= 60; i++) {\n  const pt = myPath.getPointAtLength(\n    map(i, 0, 60, 0, myPath.getTotalLength())\n  )\n  vertex(pt.x, pt.y)\n}\nendShape()\n```\n\nTypically, you'll want to vary the number of sample points based on the length of the curve, e.g.:\n```js\nbeginShape()\nconst sampleRate = 3 // One point every 3px\nconst numSamples = ceil(myPath.getTotalLength / sampleRate)\nfor (let i = 0; i < numSamples; i++) {\n  const pt = myPath.getPointAtLength(\n    map(i, 0, numSamples-1, 0, myPath.getTotalLength())\n  )\n  vertex(pt.x, pt.y)\n}\nendShape()\n```\n\n### Morphing paths\n\nAs long as you have the same number of sample points per path, you can morph between two paths by lerping each sample point between the two:\n\n<table>\n<tr>\n<td>\n\n```js\nconst mix = map(cos(frameCount / 120 * TWO_PI), -1, 1, 0, 1)\nconst numSamples = ceil(max(path1.getTotalLength(), path2.getTotalLength()) / 3)\nbeginShape()\nfor (let i = 0; i < numSamples; i++) {\n  const pt1 = path1.getPointAtLength(\n    map(i, 0, numSamples-1, 0, path1.getTotalLength())\n  )\n  const pt2 = path2.getPointAtLength(\n    map(i, 0, numSamples-1, 0, path2.getTotalLength())\n  )\n  vertex(lerp(pt1.x, pt2.x, mix), lerp(pt1.y, pt2.y, mix))\n}\nendShape()\n```\n\n</td>\n<td>\n\n![morph](https://github.com/user-attachments/assets/7a97ff41-0ec3-42a9-ad43-afa37d98e4d6)\n\n</td>\n</tr>\n</table>\n\nhttps://editor.p5js.org/davepagurek/sketches/XvC5H7Zhi\n\n### Full API\n\n#### `BezierPath`\nA full path made of a number of segments.\n\n- `getTotalLength(): number`\n  - Returns the total length of the path\n- `getPointAtLength(length: number, approximate: boolean = false): Point`\n  - Returns a coordinate at the given length on the path\n  - Specifying `true` for `approximate` will use linear interpolation between internal sample points. This will be faster, but will result in a more segmented line.\n- `getTangentAtLength(length: number, approximate: boolean = false): Point`\n  - Returns the tangent vector at a given length on the path, normalized to have a length of 1\n  - Specifying `true` for `approximate` will use linear interpolation between tangents at internal sample points for faster execution. The result will still be normalized, so this actually will still look pretty good, if not perfectly accurate.\n- `getAngleAtLength(length: number, approximate: boolean = false): number`\n  - Like `getTangentAtLength`, but it will return the angle of the path in radians\n  - This is equivalent to calling `Math.atan2(y, x)` on the tangent vector\n","readmeFilename":"README.md"}