Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

isosurface

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

isosurface

3D isosurface polygonizer

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6
decreased by-76.92%
Maintainers
1
Weekly downloads
 
Created
Source

isosurface

Isosurface polygonizer algorithms in JavaScript. For more details, see the following blog posts:

  • What is a solid?
  • Smooth voxel terrain Part 1 Part 2

Or try out a live demo

Example

var isosurface = require("isosurface")

var mesh = isosurface.surfaceNets([64,64,64], function(x,y,z) {
  return x*x + y*y + z*z - 100
}, [[-11,-11,-11], [11,11,11]])

console.log(mesh)

Install

npm install isosurface

API

var isosurface = require("isosurface")
isosurface.surfaceNets(dims, potential[, bounds])

Extracts an isosurface from potential using surface nets with resolution given by dims.

Params:

  • dims: A 3D vector of integers representing the resolution of the isosurface
  • potential(x,y,z): A scalar valued potential function taking 3 coordinates as arguments returning a scalar.
  • bounds: A pair of 3D vectors [lo, hi] giving bounds on the potential to sample. If not specified, default is [[0,0,0], dims].

Returns: A mesh object with the following members:

  • positions: The coordinates of the vertices of the mesh
  • cells: The faces of the mesh.
isosurface..marchingCubes(dims, potential[, bounds])

Same as above, except uses marching cubes instead of surface nets to extract the isosurface.

isosurface.marchingTetrahedra(dims, potential[, bounds])

Same as above, except uses marching tetrahedra instead of surface nets to extract the isosurface.

Credits

(c) 2012-2014 Mikola Lysenko. MIT License

Keywords

FAQs

Package last updated on 29 Apr 2014

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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc