Skip to content

Instantly share code, notes, and snippets.

@philogb
Created August 23, 2011 22:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save philogb/1166774 to your computer and use it in GitHub Desktop.
Save philogb/1166774 to your computer and use it in GitHub Desktop.
var fs = require('fs');
var sys = require('sys');
['surf_reg_model_both_inflate_high.obj',
'surf_reg_model_both_inflate_low.obj',
'surf_reg_model_both_inflate_middle.obj',
'surf_reg_model_both_inflate_high.obj',
'surf_reg_model_both_normal.obj'].forEach(function(filename) {
fs.readFile(filename, 'utf-8', function(err, data) {
var ans = new MNIObject(String(data));
fs.writeFile(filename.split('.')[0] + '.json',
JSON.stringify([ans.positionArray, ans.normalArray, ans.indexArray]), function() {
sys.puts('done');
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment