https://github.com/mikolalysenko/bitmap-triangulate
Triangulates a bitmap image
https://github.com/mikolalysenko/bitmap-triangulate
Last synced: 26 days ago
JSON representation
Triangulates a bitmap image
- Host: GitHub
- URL: https://github.com/mikolalysenko/bitmap-triangulate
- Owner: mikolalysenko
- License: mit
- Created: 2014-03-04T04:07:11.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2014-03-04T16:36:04.000Z (over 11 years ago)
- Last Synced: 2025-05-27T06:44:07.155Z (about 1 month ago)
- Language: JavaScript
- Size: 129 KB
- Stars: 7
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
bitmap-triangulate
==================
Triangulates a 2D bitmap image.# Example
```javascript
var pack = require("ndarray-pack")
var bitmap = pack([
[1, 1, 1, 1],
[1, 0, 1, 1],
[1, 1, 0, 1],
[1, 1, 1, 0]
])var mesh = require("bitmap-triangulate")(bitmap)
```# Install
```
npm install bitmap-triangulate
```# API
### `require("bitmap-triangulate")(bitmap)`
Triangulates a 2D bitmap* `bitmap` is a 2D ndarray encoding an image
**Returns** A simplicial complex with two properties:
* `cells` which are the faces of the triangulation
* `positions` which are the vertices# Credits
(c) 2014 Mikola Lysenko. MIT License