Skip to content

Instantly share code, notes, and snippets.

View smj-edison's full-sized avatar

Mason Jones smj-edison

  • Washingon, US
View GitHub Profile
@smj-edison
smj-edison / stl-loader.js
Created December 11, 2018 21:06
A simple stl loader to convert to a ascii format
//load files and parse libraries
var fs = require('fs');
var stl = require('stl');
//load stl file
var facets = stl.toObject(fs.readFileSync('leafer-thingie.stl'));
//round points to minimize usage
function myRound(num) {
return Math.round(num * 1000) / 1000;