author | Michael Krelin <hacker@klever.net> | 2016-01-07 20:55:38 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2016-01-07 20:55:38 (UTC) |
commit | fb43f676ec642311ebd214a21be4c960b008bcad (patch) (side-by-side diff) | |
tree | c8fc64217c904e6dad7f96ce87a3b6ede596340e /delta.jscad | |
parent | 40385e372ced49ce2bc4acc1eff2f058feaa9b57 (diff) | |
download | redelta-fb43f676ec642311ebd214a21be4c960b008bcad.zip redelta-fb43f676ec642311ebd214a21be4c960b008bcad.tar.gz redelta-fb43f676ec642311ebd214a21be4c960b008bcad.tar.bz2 |
column connector for the foot
-rw-r--r-- | delta.jscad | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/delta.jscad b/delta.jscad index 2e6365c..9c13528 100644 --- a/delta.jscad +++ b/delta.jscad @@ -603,64 +603,65 @@ function duet() { rv.properties.vitamin = true; return rv; } function foot() { var F = CONFIG.foot; var br = F.bolt.hd/2+F.margin; var bh = F.zscalefactor*Math.sqrt(Math.pow(F.d/2,2)-Math.pow(br,2)); var th = F.h-bh; var r = 2*F.d; var rv = CSG.sphere({ // botom contorted sphere center: [0,0,0], radius: F.d/2, resolution: r }).scale([1,1,F.zscalefactor]).translate([0,0,bh]).union(CSG.cylinder({ // top hat start: [0,0,bh], end: [0,0,F.h], radius: F.d/2, resolution: r })).intersect(CSG.cylinder({ // cut off excess start: [0,0,0], end: [0,0,F.h], radius: F.d })).subtract([ CSG.cylinder({ // bolt hole start: [0,0,-1], end: [0,0,F.h+1], radius: F.bolt.d/2+PRINT.slide_tolerance }), CSG.cylinder({ // nut hole start: [0,0,F.h-F.nut.h-PRINT.play_tolerance], end: [0,0,F.h], radius: F.nut.d/2+PRINT.slide_tolerance, resolution: 6 }), CSG.cylinder({ // bolthead/washer hole start: [0,0,-1], end: [0,0,F.h-F.nut.h-PRINT.play_tolerance-F.shell], radius: F.bolt.hd/2+PRINT.play_tolerance }) ]).union(CSG.cylinder({ // bridging patch start: [0,0,F.h-F.nut.h-PRINT.play_tolerance-PRINT.layer_height], end: [0,0,F.h-F.nut.h-PRINT.play_tolerance], radius: F.nut.d/2 })); + rv.properties.c_column = new CSG.Connector([0,0,F.h],[0,0,1],[1,0,0]); rv.properties.P = new CSG.Connector([0,0,F.h],[0,0,-1],[1,0,0]); return rv.setColor(CONFIG.color.parts); } function refaxes(o) { if(!o) o = {}; var l = o.l||20, g = o.g||0.7; return union([ CSG.roundedCylinder({start:[0,0,0],end:[l,0,0]}).setColor([1,0,0,g]), CSG.roundedCylinder({start:[0,0,0],end:[0,l,0]}).setColor([0,1,0,g]), CSG.roundedCylinder({start:[0,0,0],end:[0,0,l]}).setColor([0,0,1,g]) ]); } function P(x) { return x.connectTo(x.properties.P,new CSG.Connector([0,0,0],[0,0,1],[1,0,0]), false, 0); } var PARTS = { wip: function(params) { return foot(); return union(base_extrusions(),column_extrusions(),duet()); } }; function main(params) { var part = params.part && PARTS[params.part]; if(!part) return refaxes(); var rv = P(part(params)); if(!params.print) rv = rv.union(refaxes()); return rv; } |