{"id":13827332,"url":"https://github.com/dmnsgn/frenet-serret-frames","last_synced_at":"2025-04-30T11:21:51.912Z","repository":{"id":33741834,"uuid":"148498822","full_name":"dmnsgn/frenet-serret-frames","owner":"dmnsgn","description":"Compute Frenet-Serret frames for a path of 3D points and tangents.","archived":false,"fork":false,"pushed_at":"2024-07-07T14:54:01.000Z","size":2203,"stargazers_count":26,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-20T22:32:51.697Z","etag":null,"topics":["algorithm","frenet-serret-frame","geometry","tangent"],"latest_commit_sha":null,"homepage":"https://dmnsgn.github.io/frenet-serret-frames/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dmnsgn.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-09-12T15:06:40.000Z","updated_at":"2025-02-10T11:48:20.000Z","dependencies_parsed_at":"2024-07-07T16:07:18.978Z","dependency_job_id":"4d8dc478-8c9d-4d23-8381-b085755b34cc","html_url":"https://github.com/dmnsgn/frenet-serret-frames","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmnsgn%2Ffrenet-serret-frames","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmnsgn%2Ffrenet-serret-frames/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmnsgn%2Ffrenet-serret-frames/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmnsgn%2Ffrenet-serret-frames/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dmnsgn","download_url":"https://codeload.github.com/dmnsgn/frenet-serret-frames/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251689009,"owners_count":21627815,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["algorithm","frenet-serret-frame","geometry","tangent"],"created_at":"2024-08-04T09:01:54.249Z","updated_at":"2025-04-30T11:21:51.880Z","avatar_url":"https://github.com/dmnsgn.png","language":"JavaScript","funding_links":["https://paypal.me/dmnsgn"],"categories":["JavaScript"],"sub_categories":[],"readme":"# frenet-serret-frames\n\n[![npm version](https://img.shields.io/npm/v/frenet-serret-frames)](https://www.npmjs.com/package/frenet-serret-frames)\n[![stability-stable](https://img.shields.io/badge/stability-stable-green.svg)](https://www.npmjs.com/package/frenet-serret-frames)\n[![npm minzipped size](https://img.shields.io/bundlephobia/minzip/frenet-serret-frames)](https://bundlephobia.com/package/frenet-serret-frames)\n[![dependencies](https://img.shields.io/librariesio/release/npm/frenet-serret-frames)](https://github.com/dmnsgn/frenet-serret-frames/blob/main/package.json)\n[![types](https://img.shields.io/npm/types/frenet-serret-frames)](https://github.com/microsoft/TypeScript)\n[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-fa6673.svg)](https://conventionalcommits.org)\n[![styled with prettier](https://img.shields.io/badge/styled_with-Prettier-f8bc45.svg?logo=prettier)](https://github.com/prettier/prettier)\n[![linted with eslint](https://img.shields.io/badge/linted_with-ES_Lint-4B32C3.svg?logo=eslint)](https://github.com/eslint/eslint)\n[![license](https://img.shields.io/github/license/dmnsgn/frenet-serret-frames)](https://github.com/dmnsgn/frenet-serret-frames/blob/main/LICENSE.md)\n\nCompute Frenet-Serret frames for a geometry of 3D positions and optionally provided tangents.\n\n[![paypal](https://img.shields.io/badge/donate-paypal-informational?logo=paypal)](https://paypal.me/dmnsgn)\n[![coinbase](https://img.shields.io/badge/donate-coinbase-informational?logo=coinbase)](https://commerce.coinbase.com/checkout/56cbdf28-e323-48d8-9c98-7019e72c97f3)\n[![twitter](https://img.shields.io/twitter/follow/dmnsgn?style=social)](https://twitter.com/dmnsgn)\n\n![](https://raw.githubusercontent.com/dmnsgn/frenet-serret-frames/main/screenshot.gif)\n\n## Installation\n\n```bash\nnpm install frenet-serret-frames\n```\n\n## Usage\n\n```js\nimport frenetSerretFrames from \"frenet-serret-frames\";\n\nconst geometry = { positions, cells };\nfrenetSerretFrames(geometry, {\n  closed: true,\n  initialNormal: [0, 1, 0],\n});\nconsole.log(geometry);\n// {\n//   positions: Float32Array [x, y, z, x, y, z,  ...],\n//   tangents: Float32Array [x, y, z, x, y, z, ...]\n//   normals: Float32Array [x, y, z, x, y, z, ...]\n//   binormals: Float32Array [x, y, z, x, y, z, ...]\n//   cells: Uint8/16/32/Array [a, b, c, a, b, c, ...],\n// }\n```\n\n## API\n\n\u003c!-- api-start --\u003e\n\n## Functions\n\n\u003cdl\u003e\n\u003cdt\u003e\u003ca href=\"#frenetSerretFrames\"\u003efrenetSerretFrames(geometry, [options])\u003c/a\u003e ⇒ \u003ccode\u003e\u003ca href=\"#SimplicialComplexWithTNB\"\u003eSimplicialComplexWithTNB\u003c/a\u003e\u003c/code\u003e\u003c/dt\u003e\n\u003cdd\u003e\u003cp\u003eCompute Frenet-Serret frames for a geometry of 3D positions and optionally provided tangents.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\n## Typedefs\n\n\u003cdl\u003e\n\u003cdt\u003e\u003ca href=\"#vec2\"\u003evec2\u003c/a\u003e : \u003ccode\u003eArray.\u0026lt;number\u0026gt;\u003c/code\u003e\u003c/dt\u003e\n\u003cdd\u003e\u003c/dd\u003e\n\u003cdt\u003e\u003ca href=\"#vec3\"\u003evec3\u003c/a\u003e : \u003ccode\u003eArray.\u0026lt;number\u0026gt;\u003c/code\u003e\u003c/dt\u003e\n\u003cdd\u003e\u003c/dd\u003e\n\u003cdt\u003e\u003ca href=\"#SimplicialComplex\"\u003eSimplicialComplex\u003c/a\u003e : \u003ccode\u003eobject\u003c/code\u003e\u003c/dt\u003e\n\u003cdd\u003e\u003cp\u003eGeometry definition.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003ca href=\"#SimplicialComplexWithTNB\"\u003eSimplicialComplexWithTNB\u003c/a\u003e : \u003ccode\u003eobject\u003c/code\u003e\u003c/dt\u003e\n\u003cdd\u003e\u003cp\u003eGeometry definition augmented with tangents, normals and binormals.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003ca href=\"#Options\"\u003eOptions\u003c/a\u003e : \u003ccode\u003eobject\u003c/code\u003e\u003c/dt\u003e\n\u003cdd\u003e\u003cp\u003eOptions for frames computation. All optional.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\n\u003ca name=\"frenetSerretFrames\"\u003e\u003c/a\u003e\n\n## frenetSerretFrames(geometry, [options]) ⇒ [\u003ccode\u003eSimplicialComplexWithTNB\u003c/code\u003e](#SimplicialComplexWithTNB)\n\nCompute Frenet-Serret frames for a geometry of 3D positions and optionally provided tangents.\n\n**Kind**: global function\n**See**: [Frenet–Serret formulas](https://en.wikipedia.org/wiki/Frenet%E2%80%93Serret_formulas)\n\n| Param     | Type                                                 | Default         |\n| --------- | ---------------------------------------------------- | --------------- |\n| geometry  | [\u003ccode\u003eSimplicialComplex\u003c/code\u003e](#SimplicialComplex) |                 |\n| [options] | [\u003ccode\u003eOptions\u003c/code\u003e](#Options)                     | \u003ccode\u003e{}\u003c/code\u003e |\n\n\u003ca name=\"vec2\"\u003e\u003c/a\u003e\n\n## vec2 : \u003ccode\u003eArray.\u0026lt;number\u0026gt;\u003c/code\u003e\n\n**Kind**: global typedef\n\u003ca name=\"vec3\"\u003e\u003c/a\u003e\n\n## vec3 : \u003ccode\u003eArray.\u0026lt;number\u0026gt;\u003c/code\u003e\n\n**Kind**: global typedef\n\u003ca name=\"SimplicialComplex\"\u003e\u003c/a\u003e\n\n## SimplicialComplex : \u003ccode\u003eobject\u003c/code\u003e\n\nGeometry definition.\n\n**Kind**: global typedef\n**Properties**\n\n| Name       | Type                                                                                                                                              |\n| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| positions  | \u003ccode\u003eFloat32Array\u003c/code\u003e \\| \u003ccode\u003eArray\u003c/code\u003e \\| [\u003ccode\u003eArray.\u0026lt;vec3\u0026gt;\u003c/code\u003e](#vec3)                                                       |\n| [tangents] | \u003ccode\u003eFloat32Array\u003c/code\u003e \\| \u003ccode\u003eArray\u003c/code\u003e \\| [\u003ccode\u003eArray.\u0026lt;vec3\u0026gt;\u003c/code\u003e](#vec3)                                                       |\n| [normals]  | \u003ccode\u003eFloat32Array\u003c/code\u003e \\| \u003ccode\u003eArray\u003c/code\u003e \\| [\u003ccode\u003eArray.\u0026lt;vec3\u0026gt;\u003c/code\u003e](#vec3)                                                       |\n| [uvs]      | \u003ccode\u003eFloat32Array\u003c/code\u003e \\| \u003ccode\u003eArray\u003c/code\u003e \\| [\u003ccode\u003eArray.\u0026lt;vec2\u0026gt;\u003c/code\u003e](#vec2)                                                       |\n| [cells]    | \u003ccode\u003eUint8Array\u003c/code\u003e \\| \u003ccode\u003eUint16Array\u003c/code\u003e \\| \u003ccode\u003eUint32Array\u003c/code\u003e \\| \u003ccode\u003eArray\u003c/code\u003e \\| [\u003ccode\u003eArray.\u0026lt;vec3\u0026gt;\u003c/code\u003e](#vec3) |\n\n\u003ca name=\"SimplicialComplexWithTNB\"\u003e\u003c/a\u003e\n\n## SimplicialComplexWithTNB : \u003ccode\u003eobject\u003c/code\u003e\n\nGeometry definition augmented with tangents, normals and binormals.\n\n**Kind**: global typedef\n**Properties**\n\n| Name      | Type                                                                                                                                              |\n| --------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| positions | \u003ccode\u003eFloat32Array\u003c/code\u003e \\| \u003ccode\u003eArray\u003c/code\u003e \\| [\u003ccode\u003eArray.\u0026lt;vec3\u0026gt;\u003c/code\u003e](#vec3)                                                       |\n| tangents  | \u003ccode\u003eFloat32Array\u003c/code\u003e \\| \u003ccode\u003eArray\u003c/code\u003e \\| [\u003ccode\u003eArray.\u0026lt;vec3\u0026gt;\u003c/code\u003e](#vec3)                                                       |\n| normals   | \u003ccode\u003eFloat32Array\u003c/code\u003e \\| \u003ccode\u003eArray\u003c/code\u003e \\| [\u003ccode\u003eArray.\u0026lt;vec3\u0026gt;\u003c/code\u003e](#vec3)                                                       |\n| binormals | \u003ccode\u003eFloat32Array\u003c/code\u003e \\| \u003ccode\u003eArray\u003c/code\u003e \\| [\u003ccode\u003eArray.\u0026lt;vec3\u0026gt;\u003c/code\u003e](#vec3)                                                       |\n| [uvs]     | \u003ccode\u003eFloat32Array\u003c/code\u003e \\| \u003ccode\u003eArray\u003c/code\u003e \\| [\u003ccode\u003eArray.\u0026lt;vec2\u0026gt;\u003c/code\u003e](#vec2)                                                       |\n| [cells]   | \u003ccode\u003eUint8Array\u003c/code\u003e \\| \u003ccode\u003eUint16Array\u003c/code\u003e \\| \u003ccode\u003eUint32Array\u003c/code\u003e \\| \u003ccode\u003eArray\u003c/code\u003e \\| [\u003ccode\u003eArray.\u0026lt;vec3\u0026gt;\u003c/code\u003e](#vec3) |\n\n\u003ca name=\"Options\"\u003e\u003c/a\u003e\n\n## Options : \u003ccode\u003eobject\u003c/code\u003e\n\nOptions for frames computation. All optional.\n\n**Kind**: global typedef\n**Properties**\n\n| Name            | Type                       | Default            | Description                                                                                          |\n| --------------- | -------------------------- | ------------------ | ---------------------------------------------------------------------------------------------------- |\n| [closed]        | \u003ccode\u003eboolean\u003c/code\u003e       | \u003ccode\u003efalse\u003c/code\u003e | Specify is the path is closed.                                                                       |\n| [initialNormal] | [\u003ccode\u003evec3\u003c/code\u003e](#vec3) | \u003ccode\u003e\u003c/code\u003e      | Specify a starting normal for the frames. Default to the direction of the minimum tangent component. |\n\n\u003c!-- api-end --\u003e\n\n## License\n\nMIT. See [license file](https://github.com/dmnsgn/frenet-serret-frames/blob/main/LICENSE.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmnsgn%2Ffrenet-serret-frames","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdmnsgn%2Ffrenet-serret-frames","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmnsgn%2Ffrenet-serret-frames/lists"}