summaryrefslogtreecommitdiffabout
path: root/delta.jscad
authorMichael Krelin <hacker@klever.net>2016-01-07 20:54:42 (UTC)
committer Michael Krelin <hacker@klever.net>2016-01-07 20:54:42 (UTC)
commit07d64020a23339f759f183c12ebda7a5f69acc78 (patch) (unidiff)
tree8ab795bf566d384ccbf9061fb31705e20c143c1c /delta.jscad
parent5980d4a6d0f40119a633020146b861a805b108c8 (diff)
downloadredelta-07d64020a23339f759f183c12ebda7a5f69acc78.zip
redelta-07d64020a23339f759f183c12ebda7a5f69acc78.tar.gz
redelta-07d64020a23339f759f183c12ebda7a5f69acc78.tar.bz2
rounded reference axes
Diffstat (limited to 'delta.jscad') (more/less context) (ignore whitespace changes)
-rw-r--r--delta.jscad6
1 files changed, 3 insertions, 3 deletions
diff --git a/delta.jscad b/delta.jscad
index fa33a0d..e6516f9 100644
--- a/delta.jscad
+++ b/delta.jscad
@@ -608,51 +608,51 @@ function foot() {
608 })).subtract([ 608 })).subtract([
609 CSG.cylinder({ // bolt hole 609 CSG.cylinder({ // bolt hole
610 start: [0,0,-1], end: [0,0,F.h+1], radius: F.bolt.d/2+PRINT.slide_tolerance 610 start: [0,0,-1], end: [0,0,F.h+1], radius: F.bolt.d/2+PRINT.slide_tolerance
611 }), CSG.cylinder({ // nut hole 611 }), CSG.cylinder({ // nut hole
612 start: [0,0,F.h-F.nut.h-PRINT.play_tolerance], 612 start: [0,0,F.h-F.nut.h-PRINT.play_tolerance],
613 end: [0,0,F.h], 613 end: [0,0,F.h],
614 radius: F.nut.d/2+PRINT.slide_tolerance, resolution: 6 614 radius: F.nut.d/2+PRINT.slide_tolerance, resolution: 6
615 }), CSG.cylinder({ // bolthead/washer hole 615 }), CSG.cylinder({ // bolthead/washer hole
616 start: [0,0,-1], end: [0,0,F.h-F.nut.h-PRINT.play_tolerance-F.shell], 616 start: [0,0,-1], end: [0,0,F.h-F.nut.h-PRINT.play_tolerance-F.shell],
617 radius: F.bolt.hd/2+PRINT.play_tolerance 617 radius: F.bolt.hd/2+PRINT.play_tolerance
618 }) 618 })
619 ]).union(CSG.cylinder({ // bridging patch 619 ]).union(CSG.cylinder({ // bridging patch
620 start: [0,0,F.h-F.nut.h-PRINT.play_tolerance-PRINT.layer_height], 620 start: [0,0,F.h-F.nut.h-PRINT.play_tolerance-PRINT.layer_height],
621 end: [0,0,F.h-F.nut.h-PRINT.play_tolerance], 621 end: [0,0,F.h-F.nut.h-PRINT.play_tolerance],
622 radius: F.nut.d/2 622 radius: F.nut.d/2
623 })); 623 }));
624 rv.properties.P = new CSG.Connector([0,0,F.h],[0,0,-1],[1,0,0]); 624 rv.properties.P = new CSG.Connector([0,0,F.h],[0,0,-1],[1,0,0]);
625 return rv.setColor(CONFIG.color.parts); 625 return rv.setColor(CONFIG.color.parts);
626} 626}
627 627
628function refaxes(o) { 628function refaxes(o) {
629 if(!o) o = {}; 629 if(!o) o = {};
630 var l = o.l||20, g = o.g||0.7; 630 var l = o.l||20, g = o.g||0.7;
631 return union([ 631 return union([
632 CSG.cylinder({start:[0,0,0],end:[l,0,0]}).setColor([1,0,0,g]), 632 CSG.roundedCylinder({start:[0,0,0],end:[l,0,0]}).setColor([1,0,0,g]),
633 CSG.cylinder({start:[0,0,0],end:[0,l,0]}).setColor([0,1,0,g]), 633 CSG.roundedCylinder({start:[0,0,0],end:[0,l,0]}).setColor([0,1,0,g]),
634 CSG.cylinder({start:[0,0,0],end:[0,0,l]}).setColor([0,0,1,g]) 634 CSG.roundedCylinder({start:[0,0,0],end:[0,0,l]}).setColor([0,0,1,g])
635 ]); 635 ]);
636} 636}
637 637
638function P(x) { 638function P(x) {
639 return x.connectTo(x.properties.P,new CSG.Connector([0,0,0],[0,0,1],[1,0,0]), false, 0); 639 return x.connectTo(x.properties.P,new CSG.Connector([0,0,0],[0,0,1],[1,0,0]), false, 0);
640} 640}
641 641
642var PARTS = { 642var PARTS = {
643 wip: function(params) { 643 wip: function(params) {
644 return foot(); 644 return foot();
645 return union(base_extrusions(),column_extrusions(),duet()); 645 return union(base_extrusions(),column_extrusions(),duet());
646 } 646 }
647}; 647};
648 648
649function main(params) { 649function main(params) {
650 var part = params.part && PARTS[params.part]; 650 var part = params.part && PARTS[params.part];
651 if(!part) return refaxes(); 651 if(!part) return refaxes();
652 var rv = P(part(params)); 652 var rv = P(part(params));
653 if(!params.print) rv = rv.union(refaxes()); 653 if(!params.print) rv = rv.union(refaxes());
654 return rv; 654 return rv;
655} 655}
656 656
657function _main(params) { 657function _main(params) {
658 var e = EFFECTOR.effector(); 658 var e = EFFECTOR.effector();