{"id":20562164,"url":"https://github.com/lanceschi/threejs-ply-loader","last_synced_at":"2025-04-14T14:24:05.675Z","repository":{"id":44710189,"uuid":"232148825","full_name":"lanceschi/threejs-ply-loader","owner":"lanceschi","description":"Node.js wrapper for three.js PLYLoader","archived":false,"fork":false,"pushed_at":"2023-09-29T07:11:37.000Z","size":188,"stargazers_count":7,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"develop","last_synced_at":"2025-03-28T03:24:11.107Z","etag":null,"topics":["javascript","nodejs","threejs"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/threejs-ply-loader","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/lanceschi.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-01-06T17:16:21.000Z","updated_at":"2024-07-04T08:39:03.000Z","dependencies_parsed_at":"2022-09-16T14:30:24.103Z","dependency_job_id":null,"html_url":"https://github.com/lanceschi/threejs-ply-loader","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lanceschi%2Fthreejs-ply-loader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lanceschi%2Fthreejs-ply-loader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lanceschi%2Fthreejs-ply-loader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lanceschi%2Fthreejs-ply-loader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lanceschi","download_url":"https://codeload.github.com/lanceschi/threejs-ply-loader/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248895416,"owners_count":21179232,"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":["javascript","nodejs","threejs"],"created_at":"2024-11-16T04:09:29.091Z","updated_at":"2025-04-14T14:24:05.648Z","avatar_url":"https://github.com/lanceschi.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![ci](https://github.com/lanceschi/threejs-ply-loader/workflows/ci/badge.svg)\u0026nbsp;\u0026nbsp;\u0026nbsp;![npm publish](https://github.com/lanceschi/threejs-ply-loader/workflows/npm%20publish/badge.svg)\u0026nbsp;\u0026nbsp;\u0026nbsp;[![npm version](https://badge.fury.io/js/threejs-ply-loader.svg)](http://badge.fury.io/js/threejs-ply-loader)\u0026nbsp;\u0026nbsp;\u0026nbsp;![npm](https://img.shields.io/npm/dm/threejs-ply-loader)\n\n# Three.js PLY file format loader to use with Node.js\n\n## Description\n\nNode.js wrapper for [three.js][THREEJS-github-link] PLYLoader (currently three.js v0.137.0).\n\nOriginal PLYLoader source code can be found [here][PLYLoader-source-link].\n\nBeside some minor edits, I added an additional helper function for converting Node Buffer to ArrayBuffer (convenience-wise) and I put in place tests.\n\nThis library was developed as a [JavaScript Module][javascript-module-url]. The recommended use with CommonJS files is through [dynamic imports][dynamic-import-url].\n\n## Usage\n\n```javascript\nconst fs = require(\"fs\");\nconst { join } = require(\"path\");\nconst THREE = require(\"three\");\n\n(async () =\u003e {\n  // Import PLYLoader Factory\n  const { PLYLoaderFactory } = await import(\"threejs-ply-loader\");\n\n  // Initialize PLYLoader Class\n  const PLYLoader = PLYLoaderFactory(THREE);\n\n  // Instantiate PLYLoader object\n  const plyLoader = new PLYLoader();\n\n  // Read 3D Model as PLY file format\n  const sourceFilepath = join(__dirname, \"assets/cube.ply\");\n  const fileBuffer = fs.readFileSync(sourceFilepath);\n\n  // Convert node file Buffer to ArrayBuffer\n  const fileArrayBuffer = plyLoader.bufferToArrayBuffer(fileBuffer);\n\n  // Parse 3D model into THREE geometry\n  const geometry = plyLoader.parse(fileArrayBuffer);\n})();\n```\n\n## Example\n\nAn example is present in the examples folder. It will load a PLY file model and output its rendering to a PNG file. It can be run from a shell:\n\n```bash\nnpm install\nnpm run example:cube-to-png\n```\n\nThe output image is going to located in `examples/temp/vertex-colored-cube.png`\n\n## Tests\n\nThey can be run from a shell:\n\n```bash\nnpm install\nnpm test\n```\n\n## Development notes\n\nDeveloped with Node v16.13.2\n\n[THREEJS-github-link]: https://github.com/mrdoob/three.js\n[PLYLoader-source-link]: https://github.com/mrdoob/three.js/blob/r137/examples/js/loaders/PLYLoader.js\n[javascript-module-url]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules\n[dynamic-import-url]: https://v8.dev/features/dynamic-import#dynamic\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flanceschi%2Fthreejs-ply-loader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flanceschi%2Fthreejs-ply-loader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flanceschi%2Fthreejs-ply-loader/lists"}