Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mikolalysenko/rle-rasterize
Converts meshes into voxels
https://github.com/mikolalysenko/rle-rasterize
Last synced: about 2 months ago
JSON representation
Converts meshes into voxels
- Host: GitHub
- URL: https://github.com/mikolalysenko/rle-rasterize
- Owner: mikolalysenko
- Created: 2013-02-10T05:19:53.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2013-06-10T18:53:06.000Z (over 11 years ago)
- Last Synced: 2024-10-20T14:26:53.049Z (2 months ago)
- Language: JavaScript
- Size: 137 KB
- Stars: 4
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
`rle-rasterize`
==============
Converts meshes into solid objects represented by narrowband level sets This library is part of the [`rle-*`](https://github.com/mikolalysenko/rle-csg) collection of libraries for working with multiphase narrowband level sets.Installation/Usage
==================
First, install the package using npm:npm install rle-rasterize
Once that's done, you can use it to turn any mesh into a narrowband level set. For example, here is how you can make a narrowband level set representation of the Stanford bunny:var bunny = require("bunny");
var bunny_rle = require("rle-rasterize")(bunny.cells, bunny.positions);`require("rle-rasterize")(cells, positions[, faceNormals])`
--------------------------------
Rasterizes a mesh into a voxel grid. The mesh is rasterized at the resolution of one voxel/unit. If you want to use a different resolution, you need to transform the mesh first. Mesh must have at least the following properties:* `cells`: an array of convex polygons represented by their clockwise oriented indices.
* `positions`: An array of length 3 arrays representing the positions of the mesh vertices.
* `faceNormals`: (Optional) An array of the per-face normals. If you don't specify this, it will be computed when the function gets called.Note that the mesh must be a closed oriented manifold for this process to work. (Otherwise, it would not be a solid obviously).
Returns: A solid narrowband level set representing the mesh.
Credits
=======
(c) 2013 Mikola Lysenko. BSD