jscad
v1.1.0
Published
OpenJSCAD
Downloads
1,104
Maintainers
Readme
Origin
This is from https://openjscad.org. I just made a few changes to use it as a Node library. (Made a PR that's been open for awhile.)
Node.js (as library)
Add to project:
npm i --save jscad
Create a 'lumber' module:
require('jscad');
exports._2x4 = function _2x4() {
return cube({size:[2,4,96]});
}
Use your module to build something and render to STL file:
var cad = require('jscad');
inc('./lumber.js');
function board(n) {
return [ color('yellow', _2x4().rotateY(210).translate([0,n*24,0])) ]
}
cad.renderFile(board(0), 'boards.stl');