edger
v1.0.1
Published
generate hard edges for voxel data
Downloads
1
Readme
##Edger
Generate hard edges for voxel data
Installnpm install edger
Usage
var edger = require('edger');
var ndarray = require('ndarray');
var voxel = ndarray([], [16, 16, 16]);
voxel.set(0, 0, 0, 0xff0000);
var result = edger(voxel);
console.log(result);
//12 edges for one block
//[ [ [ 0, 0, 0 ], [ 0, 0, 1 ] ],
//[ [ 0, 1, 0 ], [ 0, 1, 1 ] ],
//[ [ 1, 0, 0 ], [ 1, 0, 1 ] ],
//[ [ 1, 1, 0 ], [ 1, 1, 1 ] ],
//[ [ 0, 1, 0 ], [ 1, 1, 0 ] ],
//[ [ 0, 0, 0 ], [ 1, 0, 0 ] ],
//[ [ 0, 0, 1 ], [ 1, 0, 1 ] ],
//[ [ 0, 1, 1 ], [ 1, 1, 1 ] ],
//[ [ 1, 0, 0 ], [ 1, 1, 0 ] ],
//[ [ 1, 0, 1 ], [ 1, 1, 1 ] ],
//[ [ 0, 0, 1 ], [ 0, 1, 1 ] ],
//[ [ 0, 0, 0 ], [ 0, 1, 0 ] ] ]