Socket
Socket
Sign inDemoInstall

normals

Package Overview
Dependencies
0
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    normals

Estimates normals for meshes


Version published
Weekly downloads
89K
increased by20.22%
Maintainers
1
Install size
6.36 kB
Created
Weekly downloads
 

Readme

Source

normals

Estimates normals for surface meshes.

Installation

Using npm:

npm install normals

Example

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

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 positions

Returns: 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 positions

Returns: An array of length = cells.length of the per-face normals.

Credits

(c) 2013 Mikola Lysenko. BSD

Keywords

FAQs

Last updated on 20 May 2016

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc