Socket
Book a DemoInstallSign in
Socket

signed-distance

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

signed-distance

Signed distance field computations

latest
Source
npmnpm
Version
0.0.3
Version published
Maintainers
1
Created
Source

signed-distance

Signed distance field computations for meshes

Usage & Install

Via npm:

npm install signed-distance

Here is how you can use it:

var mesh = require("bunny");
var dist = require("signed-distance")(
              require("spatial-grid")(grid, 0.1), 
              require("normals").faceNormals(mesh.positions, mesh.faces),
              [1.0, 0.0, 0.0]);

require("signed-distance")(grid, faceNormals, point)

Computes the signed distance to the mesh from point

  • grid: A spatial grid
  • faceNormals: The normals of the mesh
  • point: The point to query

Returns: The signed distance to the boundary of the mesh, or else NaN

Credit

(c) 2013 Mikola Lysenko. BSD

Keywords

signed

FAQs

Package last updated on 15 Feb 2013

Did you know?

Socket

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