{"id":13534336,"url":"https://github.com/andstor/voxelizer","last_synced_at":"2025-05-04T15:32:18.285Z","repository":{"id":34473996,"uuid":"177637357","full_name":"andstor/voxelizer","owner":"andstor","description":":space_invader: Voxelization of 3D models","archived":false,"fork":false,"pushed_at":"2024-03-20T18:32:34.000Z","size":11740,"stargazers_count":53,"open_issues_count":21,"forks_count":11,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-18T22:36:10.279Z","etag":null,"topics":["3d-models","threejs","voxel","voxelization","voxelizer"],"latest_commit_sha":null,"homepage":"https://npmjs.org/package/voxelizer","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/andstor.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2019-03-25T17:55:29.000Z","updated_at":"2025-01-04T16:58:41.000Z","dependencies_parsed_at":"2024-04-14T06:46:44.212Z","dependency_job_id":null,"html_url":"https://github.com/andstor/voxelizer","commit_stats":{"total_commits":72,"total_committers":3,"mean_commits":24.0,"dds":0.06944444444444442,"last_synced_commit":"51f5c7c6812efff5adc5cfe67ff5d577d398b727"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andstor%2Fvoxelizer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andstor%2Fvoxelizer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andstor%2Fvoxelizer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andstor%2Fvoxelizer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andstor","download_url":"https://codeload.github.com/andstor/voxelizer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251456065,"owners_count":21592287,"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":["3d-models","threejs","voxel","voxelization","voxelizer"],"created_at":"2024-08-01T07:01:30.707Z","updated_at":"2025-05-04T15:32:16.204Z","avatar_url":"https://github.com/andstor.png","language":"JavaScript","funding_links":[],"categories":["Libraries"],"sub_categories":["JavaScript"],"readme":"\u003cp align=center\u003e\n\t\u003cimg width=\"240\" src=\"https://raw.githubusercontent.com/andstor/voxelizer/master/media/voxel.svg\" alt=\"Voxelizer Logo\"\u003e\n\u003c/p\u003e\n\u003ch1 align=\"center\"\u003eVoxelizer\u003c/h1\u003e\n\n\u003e Voxelization of 3D models\n\n[![npm version](http://img.shields.io/npm/v/voxelizer.svg?style=flat)](https://npmjs.org/package/voxelizer \"View this project on npm\")\n![Build](https://github.com/andstor/voxelizer/workflows/Build/badge.svg)\n[![Coverage Status](https://coveralls.io/repos/github/andstor/voxelizer/badge.svg?branch=master)](https://coveralls.io/github/andstor/voxelizer?branch=master)\n[![Language grade: JavaScript](https://img.shields.io/lgtm/grade/javascript/g/andstor/voxelizer.svg?)](https://lgtm.com/projects/g/andstor/voxelizer/context:javascript)\n\nVoxelizer is a JavaScript voxelization engine for conducting voxelization of 3D models. It does so by leveraging [three.js](https://github.com/mrdoob/three.js/) and allowing you to use it's wast ecosystem of file loaders, plugins, etc.\n\n[Examples](https://andstor.github.io/voxelizer/examples/) - \n[Documentation](https://andstor.github.io/voxelizer/) - \n[Wiki](https://github.com/andstor/voxelizer/wiki) - \n[Migration](https://github.com/andstor/voxelizer/wiki/Migration)\n\n## Table of Contents\n  * [Install](#install)\n    * [As NPM package](#as-npm-package)\n    * [Using a CDN](#using-a-cdn)\n    * [Peer Dependency](#peer-dependency)\n  * [Usage](#usage)\n    * [Example](#example)\n  * [Import support](#import-support)\n  * [Export support](#export-support)\n    * [File formats](#file-formats)\n    * [Data structures](#data-structures)\n  * [License](#license)\n  * [Related](#related)\n\n## Install\n\n### As NPM package\n\n```sh\n$ npm install voxelizer\n```\n\n### Using a CDN\n\nYou can import the latest standalone [UMD](https://github.com/umdjs/umd) build from a [CDN](https://en.wikipedia.org/wiki/Content_delivery_network) such as:\n\n```html\n\u003cscript src=\"https://unpkg.com/voxelizer/lib/voxelizer.js\"\u003e\u003c/script\u003e\n```\n\nIf you want a specific version, use `https://unpkg.com/react-dropdown-tree-select@\u003cversion\u003e/lib/voxelizer.js` Visit [unpkg.com](https://unpkg.com) for further details.\n\n### Peer Dependency\n\nIn order to avoid version conflicts in your project, you must install [three.js](https://github.com/mrdoob/three.js/) as a [peer dependency](https://nodejs.org/en/blog/npm/peer-dependencies/). Note that NPM doesn't install peer dependencies automatically. Instead it will generate a warning message with instructions on how to install them.\n\nIf you're using the CDN build, you'd also need to add the peer dependency to your application.\n\n```html\n\u003cscript src=\"https://unpkg.com/three/build/...\"\u003e\u003c/script\u003e\n```\n\n## Usage\n\n### Example\n```js\n// Import via ES6 modules\nimport * as THREE from 'three';\nimport {Sampler, XMLExporter} from 'voxelizer';\n// or UMD\nconst { Sampler, XMLExporter } = window.Voxelizer;\n\n\n// Generate a yellow torus mesh to voxelize.\nlet geometry = new THREE.TorusGeometry( 10, 3, 16, 100 );\nlet material = new THREE.MeshBasicMaterial( { color: 0xffff00 } );\nlet torus = new THREE.Mesh( geometry, material );\n\n// Setup Voxelizer.\nlet options = {\n  fill: false,\n  color: true\n};\nconst sampler = new Sampler('raycast', options);\n\n// Voxelize torus.\nconst resolution = 10;\nlet data = sampler.sample(torus, resolution);\n\n// Export result to XML.\nconst exporter = new XMLExporter()\nexporter.parse(data, function (xml) {\n  console.log(xml)\n});\n```\n\n## Import support\nVoxelizer is able to load any mesh created with three.js. By doing so, one can make use of the around 40 📄 file loaders provided by three.js, including support for the popular [glTF](https://threejs.org/examples/?q=loader#webgl_loader_gltf), [OBJ](https://threejs.org/examples/?q=loader#webgl_loader_obj_mtl) and [STL](https://threejs.org/examples/?q=loader#webgl_loader_stl) formats. \n\nthree.js classifies these [loaders](https://github.com/mrdoob/three.js/tree/master/examples/jsm/loaders) as *\"examples\"*. Please see the [three.js documentation](https://threejs.org/docs/index.html#manual/en/introduction/Loading-3D-models) for how to use these. \n\nFollowing is an example of how to load and voxelize a glTF file:\n\n```js\nimport {GLTFLoader} from 'three/examples/jsm/loaders/GLTFLoader';\n\n// Setup voxelizer.\n// ...\n\nconst gltfloader = new GLTFLoader();\ngltfloader.load('path/to/file.glb', function (data) {\n  let mesh = data.scene;\n  let data = sampler.sample(mesh, resolution);\n  \n  // Do something with the data.\n  // ...\n});\n\n```\n\n## Export support\n\n Several file types and data structures are supported for exporting the voxel data.\n\n### File formats\n\n- [BINVOX](https://www.patrickmin.com/binvox/binvox.html)\n- XML\n\n### Data structures\n\n- [ndarray](https://github.com/scijs/ndarray)\n- 3D Array\n\n## License\n\nCopyright © [André Storhaug](https://github.com/andstor)\n\nVoxelizer is licensed under the [MIT License](https://github.com/andstor/voxelizer/blob/master/LICENSE).  \n\n## Related\n- [voxelizer-desktop](https://github.com/andstor/voxelizer-desktop) - Easy 3D model voxelization desktop app\n- [three-voxel-loader](https://github.com/andstor/three-voxel-loader) - three.js plugin for loading voxel data\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandstor%2Fvoxelizer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandstor%2Fvoxelizer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandstor%2Fvoxelizer/lists"}