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])

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.