Estimates normals for surface meshes.
Using npm:
npm install normals
Here is how to compute the vertex and face normals for the Stanford bunny:
var bunny = require("bunny");
bunny.vertexNormals = require("normals").vertexNormals(bunny.cells, bunny.positions[,epsilon]);
bunny.faceNormals = require("normals").faceNormals(bunny.cells, bunny.positions[,epsilon]);
This estimates the vertex normals for an oriented mesh.
cells
is an array of indexed vertex positionspositions
is an array of vertex positions
Returns: An array of length = positions.length
of the per-vertex normals.
This estimates the face normals for an oriented mesh.
cells
is an array of indexed vertex positionspositions
is an array of vertex positions
Returns: An array of length = cells.length
of the per-face normals.
(c) 2013 Mikola Lysenko. BSD