README
geom-normals
Compute normals for the mesh based on faces/cells information
Usage
var normals = require('geom-normals')
var cube = require('primitive-cube')()
cube.normals = normals(cube.positions, cube.cells)
API
normals(positions, cells, [out])
positions
- array of [x, y, z] positionscells
- array of [i, j, k] trianglesout
- optional array to put normals into
Returns array of computed normals, one per vertex
Note: If there are two vertices with the same position but different index there will be discontinuity (hard edge)
License
MIT, see LICENSE.md for details.