1.0.0 • Published 10 years ago

merge-meshes v1.0.0

Weekly downloads
4
License
MIT
Repository
github
Last release
10 years ago

merge-meshes

Merges multiple meshes into one

Install

$ npm install merge-meshes

Usage

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] 
  ] 
}
*/