# isosurface

> 3D isosurface polygonizer

Latest version **1.0.0** (published 2014-04-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install isosurface
pnpm add isosurface
yarn add isosurface
bun add isosurface
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2014-04-29 |
| First published | 2013-01-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 194 |
| Author | Mikola Lysenko |
| Maintainers | mikolalysenko |
| Keywords | voxel, isosurface, level, set, 0fps, surface, nets, marching, cubes, tetrahedra |

## Links

- npm: https://www.npmjs.com/package/isosurface
- Repository: https://github.com/mikolalysenko/isosurface
- Issues: https://github.com/mikolalysenko/isosurface/issues
- npm.io page: https://npm.io/package/isosurface

## Alternatives

- [jsforce](https://npm.io/package/jsforce.md) — 851.2K weekly downloads
- [react-native-qrcode-svg](https://npm.io/package/react-native-qrcode-svg.md) — 693.5K weekly downloads
- [@salesforce/plugin-data](https://npm.io/package/@salesforce/plugin-data.md) — 394.9K weekly downloads
- [@backstage/plugin-search-common](https://npm.io/package/@backstage/plugin-search-common.md) — 308.5K weekly downloads
- [@chain-registry/types](https://npm.io/package/@chain-registry/types.md) — 38.4K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2014-04-29
- 0.1.0 — 2013-02-11
- 0.0.1 — 2013-01-17
- 0.0.0 — 2013-01-15

## README

isosurface
==========

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

* [What is a solid?](http://0fps.wordpress.com/2012/08/29/what-is-a-solid/)
* Smooth voxel terrain [Part 1](http://0fps.wordpress.com/2012/07/10/smooth-voxel-terrain-part-1/) [Part 2](http://0fps.wordpress.com/2012/07/12/smooth-voxel-terrain-part-2/)

[Or try out a live demo](http://mikolalysenko.github.com/Isosurface/)

# Example

```javascript
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

```javascript
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

---
_Source: https://npm.io/package/isosurface · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
