{"id":20767769,"url":"https://github.com/dmnsgn/vector-field","last_synced_at":"2025-08-25T20:07:41.668Z","repository":{"id":44739752,"uuid":"233903722","full_name":"dmnsgn/vector-field","owner":"dmnsgn","description":"A data structure and lookup for 3D vector fields (flow fields).","archived":false,"fork":false,"pushed_at":"2024-07-07T14:27:13.000Z","size":11761,"stargazers_count":41,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-08-17T03:08:58.189Z","etag":null,"topics":["3d","flow","flow-field","lookup","noise","perlin","vector-field","vectors"],"latest_commit_sha":null,"homepage":"https://dmnsgn.github.io/vector-field/","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":"2020-01-14T18:03:35.000Z","updated_at":"2025-01-26T19:56:46.000Z","dependencies_parsed_at":"2024-07-07T16:00:04.495Z","dependency_job_id":null,"html_url":"https://github.com/dmnsgn/vector-field","commit_stats":{"total_commits":11,"total_committers":1,"mean_commits":11.0,"dds":0.0,"last_synced_commit":"f0af4b1023071b709fe4ff622be177bb198b9477"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/dmnsgn/vector-field","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmnsgn%2Fvector-field","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmnsgn%2Fvector-field/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmnsgn%2Fvector-field/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmnsgn%2Fvector-field/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dmnsgn","download_url":"https://codeload.github.com/dmnsgn/vector-field/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmnsgn%2Fvector-field/sbom","scorecard":{"id":348205,"data":{"date":"2025-08-11","repo":{"name":"github.com/dmnsgn/vector-field","commit":"d83953e8cdc02feab4de615b12d44bdfaef1b559"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 0/21 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.md:0","Info: FSF or OSI recognized license: MIT License: LICENSE.md:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}}]},"last_synced_at":"2025-08-18T07:40:39.931Z","repository_id":44739752,"created_at":"2025-08-18T07:40:39.932Z","updated_at":"2025-08-18T07:40:39.932Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272124753,"owners_count":24877720,"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","status":"online","status_checked_at":"2025-08-25T02:00:12.092Z","response_time":1107,"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":["3d","flow","flow-field","lookup","noise","perlin","vector-field","vectors"],"created_at":"2024-11-17T11:33:19.230Z","updated_at":"2025-08-25T20:07:41.588Z","avatar_url":"https://github.com/dmnsgn.png","language":"JavaScript","readme":"# vector-field\n\n[![npm version](https://img.shields.io/npm/v/vector-field)](https://www.npmjs.com/package/vector-field)\n[![stability-stable](https://img.shields.io/badge/stability-stable-green.svg)](https://www.npmjs.com/package/vector-field)\n[![npm minzipped size](https://img.shields.io/bundlephobia/minzip/vector-field)](https://bundlephobia.com/package/vector-field)\n[![dependencies](https://img.shields.io/librariesio/release/npm/vector-field)](https://github.com/dmnsgn/vector-field/blob/main/package.json)\n[![types](https://img.shields.io/npm/types/vector-field)](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/vector-field)](https://github.com/dmnsgn/vector-field/blob/main/LICENSE.md)\n\nA data structure and lookup for 3D vector fields (flow fields).\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/vector-field/main/screenshot.gif)\n\nSee the [example](https://dmnsgn.github.io/vector-field/) and its [source](index.html).\n\n## Installation\n\n```bash\nnpm install vector-field\n```\n\n## Usage\n\n```js\nimport VectorField from \"vector-field\";\n\nlet time = 0;\nconst directionFn = ([x, y, z]) =\u003e {\n  const n = myNoise4D(x, y, z, time);\n  const theta = n;\n  const phi = n;\n\n  return [\n    Math.sin(theta) * Math.cos(phi),\n    Math.sin(theta) * Math.sin(phi),\n    Math.cos(theta),\n  ];\n};\nconst vectorField = new VectorField(directionFn, [12, 6, 6], 1);\n\nconst frame = () =\u003e {\n  time += 0.001;\n  vectorField.update();\n  requestAnimationFrame(frame);\n};\n\nrequestAnimationFrame(() =\u003e {\n  frame();\n});\n```\n\n## API\n\n\u003c!-- api-start --\u003e\n\n## Classes\n\n\u003cdl\u003e\n\u003cdt\u003e\u003ca href=\"#VectorField\"\u003eVectorField\u003c/a\u003e\u003c/dt\u003e\n\u003cdd\u003e\u003cp\u003eA data structure and lookup for 3D vector fields (flow fields).\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\n## Typedefs\n\n\u003cdl\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=\"#VectorFieldCell\"\u003eVectorFieldCell\u003c/a\u003e : \u003ccode\u003eobject\u003c/code\u003e\u003c/dt\u003e\n\u003cdd\u003e\u003c/dd\u003e\n\u003cdt\u003e\u003ca href=\"#VectorFieldDirectionFn\"\u003eVectorFieldDirectionFn\u003c/a\u003e : \u003ccode\u003efunction\u003c/code\u003e\u003c/dt\u003e\n\u003cdd\u003e\u003cp\u003eThe custom function to compute the cell direction (often a noise function)\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\n\u003ca name=\"VectorField\"\u003e\u003c/a\u003e\n\n## VectorField\n\nA data structure and lookup for 3D vector fields (flow fields).\n\n**Kind**: global class\n**Properties**\n\n| Name        | Type                                                           |\n| ----------- | -------------------------------------------------------------- |\n| directionFn | [\u003ccode\u003eVectorFieldDirectionFn\u003c/code\u003e](#VectorFieldDirectionFn) |\n| steps       | [\u003ccode\u003evec3\u003c/code\u003e](#vec3)                                     |\n| bounds      | [\u003ccode\u003evec3\u003c/code\u003e](#vec3)                                     |\n| halfBounds  | [\u003ccode\u003evec3\u003c/code\u003e](#vec3)                                     |\n| field       | [\u003ccode\u003eArray.\u0026lt;VectorFieldCell\u0026gt;\u003c/code\u003e](#VectorFieldCell) |\n\n- [VectorField](#VectorField)\n  - [new VectorField(directionFn, [steps], [bounds])](#new_VectorField_new)\n  - [.update()](#VectorField+update)\n  - [.lookup(cell)](#VectorField+lookup) ⇒ [\u003ccode\u003eVectorFieldCell\u003c/code\u003e](#VectorFieldCell) \\| \u003ccode\u003eundefined\u003c/code\u003e\n\n\u003ca name=\"new_VectorField_new\"\u003e\u003c/a\u003e\n\n### new VectorField(directionFn, [steps], [bounds])\n\nCreates an instance of VectorField.\n\n| Param       | Type                                                           | Default         | Description                                                                                                                                |\n| ----------- | -------------------------------------------------------------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |\n| directionFn | [\u003ccode\u003eVectorFieldDirectionFn\u003c/code\u003e](#VectorFieldDirectionFn) |                 | The custom function to compute the cell direction (often a noise function)                                                                 |\n| [steps]     | \u003ccode\u003enumber\u003c/code\u003e \\| [\u003ccode\u003evec3\u003c/code\u003e](#vec3)              | \u003ccode\u003e10\u003c/code\u003e | The number of steps on each dimension (all positive integer). Use integer for identical dimensions.                                        |\n| [bounds]    | \u003ccode\u003enumber\u003c/code\u003e \\| [\u003ccode\u003evec3\u003c/code\u003e](#vec3)              | \u003ccode\u003e1\u003c/code\u003e  | The size of a containing box for the field. Is divided into steps for each dimension (all positive). Use integer for identical dimensions. |\n\n\u003ca name=\"VectorField+update\"\u003e\u003c/a\u003e\n\n### vectorField.update()\n\nCreate/update the field according to the provided noise function.\n\n**Kind**: instance method of [\u003ccode\u003eVectorField\u003c/code\u003e](#VectorField)\n\u003ca name=\"VectorField+lookup\"\u003e\u003c/a\u003e\n\n### vectorField.lookup(cell) ⇒ [\u003ccode\u003eVectorFieldCell\u003c/code\u003e](#VectorFieldCell) \\| \u003ccode\u003eundefined\u003c/code\u003e\n\nFind a `VectorFieldCell` at specified position. Useful to compute a particle's velocity for instance.\n\n**Kind**: instance method of [\u003ccode\u003eVectorField\u003c/code\u003e](#VectorField)\n\n| Param | Type                       | Description  |\n| ----- | -------------------------- | ------------ |\n| cell  | [\u003ccode\u003evec3\u003c/code\u003e](#vec3) | [cx, cy, cz] |\n\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=\"VectorFieldCell\"\u003e\u003c/a\u003e\n\n## VectorFieldCell : \u003ccode\u003eobject\u003c/code\u003e\n\n**Kind**: global typedef\n**Properties**\n\n| Name      | Type                       |\n| --------- | -------------------------- |\n| position  | [\u003ccode\u003evec3\u003c/code\u003e](#vec3) |\n| direction | [\u003ccode\u003evec3\u003c/code\u003e](#vec3) |\n\n\u003ca name=\"VectorFieldDirectionFn\"\u003e\u003c/a\u003e\n\n## VectorFieldDirectionFn : \u003ccode\u003efunction\u003c/code\u003e\n\nThe custom function to compute the cell direction (often a noise function)\n\n**Kind**: global typedef\n\n| Param        | Type                       |\n| ------------ | -------------------------- |\n| position     | [\u003ccode\u003evec3\u003c/code\u003e](#vec3) |\n| stepPosition | [\u003ccode\u003evec3\u003c/code\u003e](#vec3) |\n\n\u003c!-- api-end --\u003e\n\n## License\n\nMIT. See [license file](https://github.com/dmnsgn/vector-field/blob/main/LICENSE.md).\n","funding_links":["https://paypal.me/dmnsgn"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmnsgn%2Fvector-field","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdmnsgn%2Fvector-field","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmnsgn%2Fvector-field/lists"}