Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mikolalysenko/normals
Computes normals for triangulated meshes
https://github.com/mikolalysenko/normals
Last synced: about 2 months ago
JSON representation
Computes normals for triangulated meshes
- Host: GitHub
- URL: https://github.com/mikolalysenko/normals
- Owner: mikolalysenko
- License: mit
- Created: 2013-02-06T16:20:51.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2016-05-20T22:27:35.000Z (over 8 years ago)
- Last Synced: 2024-10-19T02:23:10.698Z (2 months ago)
- Language: JavaScript
- Size: 5.86 KB
- Stars: 17
- Watchers: 5
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
normals
=======
Estimates normals for surface meshes.Installation
============
Using [npm](https://npmjs.org/):npm install normals
Example
=======
Here is how to compute the vertex and face normals for the Stanford bunny:```js
var bunny = require("bunny");
bunny.vertexNormals = require("normals").vertexNormals(bunny.cells, bunny.positions[,epsilon]);
bunny.faceNormals = require("normals").faceNormals(bunny.cells, bunny.positions[,epsilon]);
````require("normals").vertexNormals(cells, positions[,epsilon])`
----------------------------------------------------
This estimates the vertex normals for an oriented mesh.* `cells` is an array of indexed vertex positions
* `positions` is an array of vertex positionsReturns: An array of length = `positions.length` of the per-vertex normals.
`require("normals").faceNormals(cells, positions[,epsilon])`
----------------------------------------------------
This estimates the face normals for an oriented mesh.* `cells` is an array of indexed vertex positions
* `positions` is an array of vertex positionsReturns: An array of length = `cells.length` of the per-face normals.
Credits
=======
(c) 2013 Mikola Lysenko. BSD