Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/thibauts/merge-meshes

Merges multiple meshes into one
https://github.com/thibauts/merge-meshes

Last synced: 2 months ago
JSON representation

Merges multiple meshes into one

Awesome Lists containing this project

README

        

merge-meshes
============
### Merges multiple meshes into one

Install
-------

```bash
$ npm install merge-meshes
```

Usage
-----

```javascript
var mergeMeshes = require('merge-meshes');

var meshA = {
cells: [
[0, 1, 2]
],
positions: [
[ 0, 0, 0],
[ 1, 0, 0],
[ 0, 1, 0],
]
}

var meshB = {
cells: [
[0, 1, 2],
],
positions: [
[ 0, 0, 0],
[-1, 0, 0],
[ 0, 1, 0]
]
}

var mesh = mergeMeshes([meshA, meshB]);

console.log(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]
]
}
*/
```