{"id":32431034,"url":"https://github.com/coryasilva/roll-calc","last_synced_at":"2026-06-30T21:32:08.915Z","repository":{"id":214908294,"uuid":"737416261","full_name":"coryasilva/roll-calc","owner":"coryasilva","description":"Roll (spiral) calculator functions.","archived":false,"fork":false,"pushed_at":"2024-01-01T00:05:55.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-25T21:52:00.087Z","etag":null,"topics":["2d","calculator","diameter","inventory","length","machine","roll","spiral","winding"],"latest_commit_sha":null,"homepage":"","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/coryasilva.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-12-31T00:21:34.000Z","updated_at":"2024-01-14T18:37:00.000Z","dependencies_parsed_at":null,"dependency_job_id":"f949d8e3-89b8-4992-884c-0e0f800097fd","html_url":"https://github.com/coryasilva/roll-calc","commit_stats":{"total_commits":4,"total_committers":2,"mean_commits":2.0,"dds":0.25,"last_synced_commit":"7dba28b82bab3883ac7943c5b1b1e01cd1de5949"},"previous_names":["coryasilva/roll-calc"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/coryasilva/roll-calc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coryasilva%2Froll-calc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coryasilva%2Froll-calc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coryasilva%2Froll-calc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coryasilva%2Froll-calc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/coryasilva","download_url":"https://codeload.github.com/coryasilva/roll-calc/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coryasilva%2Froll-calc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34984784,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-30T02:00:05.919Z","response_time":92,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["2d","calculator","diameter","inventory","length","machine","roll","spiral","winding"],"created_at":"2025-10-25T21:51:44.560Z","updated_at":"2026-06-30T21:32:08.910Z","avatar_url":"https://github.com/coryasilva.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# roll-calc\n\nRoll calculator functions.\n\nThis module was created for calculating dimesions of materials in rolls for inventory and winding machines.\n\n## Install\n\n```sh\nnpm install roll-calc\n```\n\n## Usage\n\n```js\nimport { rollSolve } from 'roll-calc';\n\nconst materialHeight = 0.06;\nconst innerDiameter = 18;\nconst outerDiameter = 60;\nconst length = rollSolve(materialHeight, innerDiameter, outerDiameter);\n\nconsole.log(length);\n//=\u003e 42882.74547004675\n```\n\n## API\n\n### `function rollLength(h: number, d0: number, d1: number): number | undefined`\n\nCalculates length of a roll (2D spiral).\n\nEquations from https://www.giangrandi.ch/soft/spiral/spiral.shtml\n\n```js\nimport { rollLength } from 'roll-calc';\n\nconst materialHeight = 0.1;\nconst innerDiameter = 2;\nconst outerDiameter = 3;\nconst length = rollLength(materialHeight, innerDiameter, outerDiameter);\n\nconsole.log(length);\n//=\u003e 39.27313461871492\n```\n\n### `function rollOuterDiameter(h: number, d0: number, l: number, maxIter?: number): number | undefined`\n\nCalcuates the outer diameter of a roll (2D spiral).\n\n```js\nimport { rollOuterDiameter } from 'roll-calc';\n\nconst materialHeight = 0.1;\nconst innerDiameter = 2;\nconst length = 39.273_134_62;\nconst outerDiameter = rollOuterDiameter(materialHeight, innerDiameter, length);\n\nconsole.log(outerDiameter);\n//=\u003e 3.0000000000272684\n```\n\n### `function rollInnerDiameter(h: number, d1: number, l: number): number | undefined`\n\nCalculates the inner diameter of a roll (2D spiral).\n\n```js\nimport { rollInnerDiameter } from 'roll-calc';\n\nconst materialHeight = 0.1;\nconst outerDiameter = 3;\nconst length = 39.273_134_62;\nconst innerDiameter = rollInnerDiameter(materialHeight, innerDiameter, length);\n\nconsole.log(innerDiameter);\n//=\u003e 1.999999999959101\n```\n\n### `rollMaterialHeight(d0: number, d1: number, l: number): number | undefined`\n\nCalculates the nominal material height or thickness in a roll (2D Spiral).\n\nEquations from:\n\u003e Thickness of Material on a Roll Winding: Machines, Mechanics and Measurements\nBy James K. Good, David R. Roisum\npage 124\n\n```js\nimport { rollMaterialHeight } from 'roll-calc';\n\nconst innerDiameter = 2;\nconst outerDiameter = 3;\nconst length = 39.273_134_62;\nconst materialHeight = rollMaterialHeight(innerDiameter, outerDiameter, length);\n\nconsole.log(materialHeight);\n//=\u003e 0.09999178458720241\n```\n\n### `function rollSolve(h?: number, d0?: number, d1?: number, l?: number): number | undefined`\n\nSolves one missing dimension of a roll (2D spiral).\n\nPass in at least three arguments to solve for the fourth.\n\n```js\nimport { rollSolve } from 'roll-calc';\n\nconst materialHeight = 0.06;\nconst innerDiameter = 18;\nconst outerDiameter = 60;\nconst length = rollSolve(materialHeight, innerDiameter, outerDiameter, undefined);\n\nconsole.log(length);\n//=\u003e 42882.74547004675\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoryasilva%2Froll-calc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoryasilva%2Froll-calc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoryasilva%2Froll-calc/lists"}