Socket
Book a DemoInstallSign in
Socket

rle-rasterize

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rle-rasterize

Rasterizes meshes into narrowband level sets

latest
Source
npmnpm
Version
0.0.6
Version published
Maintainers
1
Created
Source

rle-rasterize

Converts meshes into solid objects represented by narrowband level sets This library is part of the rle-* 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

Keywords

rasterize

FAQs

Package last updated on 10 Jun 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts