scad-builder
Tools for scad-builder project.
Installation
npm install scad-builder
Project Example
Project files as follows:
- src
- main.js
- scad
- util.scad
- build.yml
- gulpfile.js
- package.json
gulpfile.js :
;
build.yml :
defaults: header: "// header : scad-builder test" footer: "// footer" include: - /lib/utilscadmodels: - dest: sample1 module: main func: sample1 - dest: sample2 module: main func: sample2
.gitignore :
DS_Storenode_modules/build/
scad/util.scad :
module SSThread( h=10, // length d=3, // diameter p=0.5, // pitch a=60 // angle){ cylinder(h=h, d=d);}
src/main.js :
const call comment func generateScad GeneratorScad genImportSrc square circle scircle polygon cube sphere cylinder polyhedron union difference intersection translate scale rotate mirror multmatrix minkowski hull linear_extrude rotate_extrude color text } = ; { let p = d: 115 + 08 h: 5 + 04 l: 10 let ds = pd*Math; let model = return model;} { return ;} moduleexports = sample1 sample2;
Build
gulp build
or
gulp watch
Result
Output files as follows:
- build
- sample1.scad
- sample2.scad
- util.scad
sample1.scad:
// header : scad-builder test include <./lib/util.scad> union(){ cylinder(d=12.3,h=5.4,$fn=6); translate([0,-5.326056233274298,0]){ cube([10,10.652112466548596,5.4]); }} // footer
sample2.scad:
// header : scad-builder test include <./lib/util.scad> cylinder(d=4,h=20,$fn=6); // footer
scad/util.scad
module SSThread( h=10, // length d=3, // diameter p=0.5, // pitch a=60 // angle){ cylinder(h=h, d=d);}
Copyrights
Some copyrights apply. Copyright (c) 2017 Mitsuaki Fujii (silvershell100@gmail.com), under the MIT license.
License
The MIT License (MIT) (unless specified otherwise)