Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mikolalysenko/rle-save-binvox
Exports a narrow band level set to a binvox stream
https://github.com/mikolalysenko/rle-save-binvox
Last synced: 7 days ago
JSON representation
Exports a narrow band level set to a binvox stream
- Host: GitHub
- URL: https://github.com/mikolalysenko/rle-save-binvox
- Owner: mikolalysenko
- Created: 2013-05-03T22:13:54.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2013-07-10T15:19:39.000Z (over 11 years ago)
- Last Synced: 2024-12-16T22:35:33.573Z (10 days ago)
- Language: JavaScript
- Size: 148 KB
- Stars: 2
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
rle-save-binvox
===============
Exports a [narrowband level set](http://github.com/mikolalysenko/rle-core) to [binvox format](http://www.cs.princeton.edu/~min/binvox/).Example
=======
Here is a simple script showing how you can create a binvox model of a sphere:```javascript
var volume = require("rle-sample").solid.dense([-6,-6,-6], [7,7,7], function(x) {
return Math.sqrt(x[0]*x[0]+x[1]*x[1]+x[2]*x[2]) - 5.0;
});
require("rle-save-binvox")(volume).pipe(process.stdout)
```This will pipe a binvox file to stdout. Using [viewvox](http://www.cs.princeton.edu/~min/viewvox/) to check the result gives the following mesh:
Install
=======npm install rle-save-binvox
### `require("rle-save-binvox")(volume[, bounds, translate, scale])`
Returns a stream encoding the binvox file.* `volume` is an rle narrowband level set
* `bounds` is a bound on the range of the level set to save (if not specified is computed using rle-extents)
* `translate` is the translation parameter in the binvox file
* `scale` is the scale parameter in the binvox file# Credits
(c) 2013 Mikola Lysenko. MIT License