Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/thibauts/merge-vertices
Merges mesh vertices having identical coordinates
https://github.com/thibauts/merge-vertices
Last synced: 2 months ago
JSON representation
Merges mesh vertices having identical coordinates
- Host: GitHub
- URL: https://github.com/thibauts/merge-vertices
- Owner: thibauts
- License: mit
- Created: 2015-03-01T12:24:28.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2015-03-01T16:43:44.000Z (almost 10 years ago)
- Last Synced: 2024-10-12T05:15:10.914Z (2 months ago)
- Language: JavaScript
- Size: 117 KB
- Stars: 10
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
merge-vertices
==============
### Merges mesh vertices having identical coordinatesMerges vertices having equal coordinates and reindexes the faces.
Install
-------```bash
$ npm install merge-vertices
```Usage
-----```javascript
var mergeVertices = require('merge-vertices');var mesh = {
cells: [
[0, 1, 2],
[3, 4, 5]
],
positions: [
[ 0, 0, 0],
[ 1, 0, 0],
[ 0, 1, 0],
[ 0, 0, 0],
[-1, 0, 0],
[ 0, 1, 0]
]
}mesh = mergeVertices(mesh.cells, mesh.positions);
console.log(mesh);
/*
{
cells: [
[0, 1, 2],
[0, 3, 2]
],
positions: [
[ 0, 0, 0],
[ 1, 0, 0],
[ 0, 1, 0],
[-1, 0, 0]
]
}
*/
```