# mesh-winding-number

> Compute winding number for a mesh

Latest version **1.0.0** (published 2017-11-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install mesh-winding-number
pnpm add mesh-winding-number
yarn add mesh-winding-number
bun add mesh-winding-number
```

## 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 | 2017-11-28 |
| First published | 2017-11-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Andrew Taber |
| Maintainers | ataber |
| Keywords | mesh, winding, number, topology, simplicial, complex, topological, invariant |

## Links

- npm: https://www.npmjs.com/package/mesh-winding-number
- Repository: https://github.com/ataber/mesh-winding-number
- Homepage: https://github.com/ataber/mesh-winding-number#readme
- Issues: https://github.com/ataber/mesh-winding-number/issues
- npm.io page: https://npm.io/package/mesh-winding-number

## Dependencies (2)

- [gl-mat3](https://npm.io/package/gl-mat3.md) ^1.0.0
- [gl-vec3](https://npm.io/package/gl-vec3.md) ^1.0.3

## Alternatives

- [random-seedable](https://npm.io/package/random-seedable.md) — 27.9K weekly downloads
- [n2words](https://npm.io/package/n2words.md) — 22.2K weekly downloads
- [@stdlib/math-base-special-factorialln](https://npm.io/package/@stdlib/math-base-special-factorialln.md) — 5.7K weekly downloads
- [@stdlib/math-base-special-abs2](https://npm.io/package/@stdlib/math-base-special-abs2.md) — 1.7K weekly downloads
- [commons-math-interpolation](https://npm.io/package/commons-math-interpolation.md) — 1.4K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2017-11-28

## README

# mesh-winding-number

[![experimental](http://badges.github.io/stability-badges/dist/experimental.svg)](http://github.com/badges/stability-badges)

Computes [winding number](https://en.wikipedia.org/wiki/Winding_number) of a triangle mesh at a point. Uses formulae and ideas from [this paper](http://igl.ethz.ch/projects/winding-number/robust-inside-outside-segmentation-using-generalized-winding-numbers-siggraph-2013-jacobson-et-al.pdf).

## Usage

[![NPM](https://nodei.co/npm/mesh-winding-number.png)](https://www.npmjs.com/package/mesh-winding-number)

```javascript
var bunny   = require('bunny')
var patches = require('mesh-winding-number')([0,1,0], bunny.cells, bunny.positions); # returns 1
```

`require("mesh-winding-number")(point, cells, positions)`
----------------------------------------------------
Returns a float representing winding number at `point`. Note that due to floating point errors you may get slightly off of the correct integer value even for closed meshes. Furthermore, the result scales with mesh quality (for instance, the less watertight the mesh, the more likely the result is far from an integer value).

## Contributing

See [stackgl/contributing](https://github.com/stackgl/contributing) for details.

## License

MIT. See [LICENSE.md](http://github.com/ataber/mesh-winding-number/blob/master/LICENSE.md) for details.

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