{"_id":"@autarkis/chitin-web","_rev":"3-39dea365ba06dfe686078641fd1ae6eb","name":"@autarkis/chitin-web","dist-tags":{"latest":"0.1.2"},"versions":{"0.1.0":{"name":"@autarkis/chitin-web","version":"0.1.0","license":"MIT","_id":"@autarkis/chitin-web@0.1.0","maintainers":[{"name":"autarkis","email":"autarkis@gmail.com"}],"homepage":"https://github.com/Autarkis/chitin#readme","bugs":{"url":"https://github.com/Autarkis/chitin/issues"},"dist":{"shasum":"322cb707c0b4ff33a996babb04d6943b3f69854b","tarball":"https://registry.npmjs.org/@autarkis/chitin-web/-/chitin-web-0.1.0.tgz","fileCount":9,"integrity":"sha512-mNw1sU+mcp3URCYtUQshQuSowHxH+8tIgcWlQLX27naic0iRVwy7B4+tTceAqK//NvPJbVCQeY4JCd77G+sBQA==","signatures":[{"sig":"MEYCIQDA8Xwvl7yKHpMk2ZUHzRltKAD6OprSQcP6wqjjtjwu5AIhAPNCPyMcjHHIM7geDHbNFcSDKkFJRa29uRcJ1GnvxLs2","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":16883},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./three":{"types":"./dist/three.d.ts","import":"./dist/three.js"},"./rapier":{"types":"./dist/rapier.d.ts","import":"./dist/rapier.js"}},"gitHead":"51f26b455c01f6735643a90b6cfef40fef6769f4","scripts":{"test":"vitest run","build":"tsc"},"_npmUser":{"name":"autarkis","email":"autarkis@gmail.com"},"repository":{"url":"git+https://github.com/Autarkis/chitin.git","type":"git","directory":"integrations/web"},"_npmVersion":"11.4.2","description":"Load chitin .phys collision sidecars in the browser","directories":{},"sideEffects":false,"_nodeVersion":"22.17.1","_hasShrinkwrap":false,"devDependencies":{"three":"^0.184.0","vitest":"^4.1.6","typescript":"^6.0.3","@types/three":"^0.184.1","@dimforge/rapier3d-compat":"^0.19.3"},"peerDependencies":{"three":">=0.160","@dimforge/rapier3d-compat":">=0.13"},"peerDependenciesMeta":{"three":{"optional":true},"@dimforge/rapier3d-compat":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/chitin-web_0.1.0_1784434189414_0.053902039243540534","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@autarkis/chitin-web","version":"0.1.1","license":"MIT","_id":"@autarkis/chitin-web@0.1.1","maintainers":[{"name":"autarkis","email":"autarkis@gmail.com"}],"homepage":"https://github.com/Autarkis/chitin#readme","bugs":{"url":"https://github.com/Autarkis/chitin/issues"},"dist":{"shasum":"dc6740d70c9d94ee0b875e53132024d9136a620c","tarball":"https://registry.npmjs.org/@autarkis/chitin-web/-/chitin-web-0.1.1.tgz","fileCount":10,"integrity":"sha512-MCgZ8oiawZ+AJtCD8g3t2eSI2u44DjR71PYkyTlcDdSe4LWJpgyS66sNmbTgNrvq5qwW0p6RyzeC8U2I7BeVRA==","signatures":[{"sig":"MEYCIQDl1roBTeZi9GXljAfURoVaN+TMg2E6CsCURFQjChZU4AIhAISVooxQf499mA3wIvIoaLbMYlvc4xSFuVBmfCg2v3ec","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":19234},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./three":{"types":"./dist/three.d.ts","import":"./dist/three.js"},"./rapier":{"types":"./dist/rapier.d.ts","import":"./dist/rapier.js"}},"gitHead":"feccb61b03dc4c8d2f3b277e2576c6d2ea16f89e","scripts":{"test":"vitest run","build":"tsc"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:75e417e9-9c8d-4741-a540-19ab36cf96cc"}},"repository":{"url":"git+https://github.com/Autarkis/chitin.git","type":"git","directory":"integrations/web"},"_npmVersion":"12.0.1","description":"Load chitin .phys collision sidecars in the browser","directories":{},"sideEffects":false,"_nodeVersion":"22.23.1","_hasShrinkwrap":false,"devDependencies":{"three":"^0.184.0","vitest":"^4.1.6","typescript":"^6.0.3","@types/three":"^0.184.1","@dimforge/rapier3d-compat":"^0.19.3"},"peerDependencies":{"three":">=0.160","@dimforge/rapier3d-compat":">=0.13"},"peerDependenciesMeta":{"three":{"optional":true},"@dimforge/rapier3d-compat":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/chitin-web_0.1.1_1784435834039_0.30095418454195877","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@autarkis/chitin-web","version":"0.1.2","description":"Load chitin .phys collision sidecars in the browser","keywords":["physics","collision","collider","convex-hull","three","threejs","rapier","gltf","glb","robotics","webgl","phys"],"homepage":"https://github.com/Autarkis/chitin#readme","bugs":{"url":"https://github.com/Autarkis/chitin/issues"},"repository":{"type":"git","url":"git+https://github.com/Autarkis/chitin.git","directory":"integrations/web"},"type":"module","main":"dist/index.js","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./rapier":{"types":"./dist/rapier.d.ts","import":"./dist/rapier.js"},"./three":{"types":"./dist/three.d.ts","import":"./dist/three.js"}},"sideEffects":false,"scripts":{"build":"tsc","test":"vitest run"},"peerDependencies":{"@dimforge/rapier3d-compat":">=0.13","three":">=0.160"},"peerDependenciesMeta":{"three":{"optional":true},"@dimforge/rapier3d-compat":{"optional":true}},"devDependencies":{"@dimforge/rapier3d-compat":"^0.19.3","@types/three":"^0.184.1","three":"^0.184.0","typescript":"^6.0.3","vitest":"^4.1.6"},"license":"MIT","gitHead":"2f6f00102a98caa3251e27872786a6618e15e299","_id":"@autarkis/chitin-web@0.1.2","_nodeVersion":"22.23.1","_npmVersion":"12.0.1","dist":{"integrity":"sha512-dvXp0oFCoREhOyqvjG0xZEAYC3P7jlmdf9ctaecZ6rSaxw4d90ART9drIOOsJ/3OFWN0Jb6JJrK+YMWcHmFlZA==","shasum":"db7bec7f5c73a63376ebb38023ad4eab96803e37","tarball":"https://registry.npmjs.org/@autarkis/chitin-web/-/chitin-web-0.1.2.tgz","fileCount":10,"unpackedSize":19541,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIEomM+LpF7YUl/mrCwdz0mzs7I8tKNU1YsN5MHOWz1mZAiBwXnHv1y8vScfCTaJLMEg/8TdrfK109H58cs3AH7SgjQ=="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:75e417e9-9c8d-4741-a540-19ab36cf96cc"}},"directories":{},"maintainers":[{"name":"autarkis","email":"autarkis@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/chitin-web_0.1.2_1784487270430_0.07309177286259283"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-19T04:09:49.212Z","modified":"2026-07-19T18:54:30.704Z","0.1.0":"2026-07-19T04:09:49.559Z","0.1.1":"2026-07-19T04:37:14.207Z","0.1.2":"2026-07-19T18:54:30.563Z"},"bugs":{"url":"https://github.com/Autarkis/chitin/issues"},"license":"MIT","homepage":"https://github.com/Autarkis/chitin#readme","repository":{"type":"git","url":"git+https://github.com/Autarkis/chitin.git","directory":"integrations/web"},"description":"Load chitin .phys collision sidecars in the browser","maintainers":[{"name":"autarkis","email":"autarkis@gmail.com"}],"readme":"# @autarkis/chitin-web\n\nLoad chitin `.phys` collision sidecars in the browser. Parses the binary format\nand turns it into Rapier colliders or Three.js debug meshes.\n\n## Setup\n\n```bash\nnpm install @autarkis/chitin-web\n```\n\nThe package uses subpath exports. The root is dependency-free -- just the `.phys`\nparser and validator. The Rapier and Three.js bindings live under `/rapier` and\n`/three` and pull their engines in as optional peer dependencies:\n\n```bash\nnpm install @dimforge/rapier3d-compat   # for /rapier\nnpm install three                        # for /three\n```\n\n## Usage\n\n### Parse a .phys file\n\n```typescript\nimport { parsePhys } from \"@autarkis/chitin-web\";\n\nconst buffer = await fetch(\"/assets/scene.phys\").then((r) => r.arrayBuffer());\nconst phys = parsePhys(buffer); // throws on malformed input\n\nfor (const hull of phys.hulls) {\n  console.log(hull.vertices, hull.indices); // Float32Array, Uint16Array\n}\n```\n\n### Add colliders to a Rapier world\n\n```typescript\nimport RAPIER from \"@dimforge/rapier3d-compat\";\nimport { parsePhys } from \"@autarkis/chitin-web\";\nimport { addToWorld } from \"@autarkis/chitin-web/rapier\";\n\nconst phys = parsePhys(await fetch(\"/scene.phys\").then((r) => r.arrayBuffer()));\naddToWorld(RAPIER, world, phys);\n```\n\nUse `createColliders(rapier, phys)` if you want the `ColliderDesc`s without\nattaching them to a body.\n\n### Pick a LOD tier\n\nFor a `.phys` with LOD tiers, select the set nearest a target concavity:\n\n```typescript\nimport { selectLodHulls } from \"@autarkis/chitin-web\";\nimport { createColliders } from \"@autarkis/chitin-web/rapier\";\n\nconst coarseHulls = selectLodHulls(phys, 0.3); // hull data only\nconst { colliders } = createColliders(rapier, phys, { lodConcavity: 0.3 });\n```\n\nReaders with no target pick default to LOD 0 (highest detail).\n\n### Debug meshes\n\n```typescript\nimport { createDebugMeshes } from \"@autarkis/chitin-web/three\";\n\nscene.add(createDebugMeshes(phys)); // wireframe hull visualization\n```\n\n## Other engines\n\n`parsePhys` returns plain `Float32Array` / `Uint16Array` hull data. If you use a\nphysics engine other than Rapier, read the hulls directly and pass each one's\nvertices and indices to your engine's convex-collider API -- no `/rapier` import\nneeded.\n\nColliders are generated by the [chitin](https://github.com/Autarkis/chitin)\ncompiler (or `@autarkis/chitin-lite` in the browser); this package only reads\ntheir `.phys` output.\n","readmeFilename":"README.md","keywords":["physics","collision","collider","convex-hull","three","threejs","rapier","gltf","glb","robotics","webgl","phys"]}