pack a simplicial-complex mesh into a binary format
var pack = require('pack-mesh/pack')
var fs = require('fs')
var mesh = JSON.parse(fs.readFileSync(process.argv[2],'utf8'))
process.stdout.write(Buffer.from(pack(mesh)))
var unpack = require('pack-mesh/unpack')
var fs = require('fs')
var buf = fs.readFileSync(process.argv[2])
console.log(JSON.stringify(unpack(buf)))
usage: pack-mesh FILE {OPTIONS}
-t --type Set a vertex precision: s8 s16 f32 f64
-u --unpack Turn binary data into simplicial complex json
If FILE is not provided or is "-", read from stdin.
var pack = require('pack-mesh/pack')
var unpack = require('pack-mesh/unpack')
Return a Uint8Array u8
given a simplicial complex mesh
.
Optionally set:
opts.type
- precision per vertex: one of 'f32'
, 'f64'
, 's8'
, 's16'
Simplicial complexes have:
Return a simplicial complex mesh
given an array buffer buf
.
To get the library:
npm install pack-mesh
To get the command-line program:
npm install -g pack-mesh
BSD
Version | Tag | Published |
---|---|---|
1.0.0 | latest | 6yrs ago |