summaryrefslogtreecommitdiffabout
path: root/delta.jscad
authorMichael Krelin <hacker@klever.net>2016-01-08 22:17:13 (UTC)
committer Michael Krelin <hacker@klever.net>2016-01-08 22:17:13 (UTC)
commit717f3676d93e8b2f8d71ea4b25461614becb79ef (patch) (unidiff)
tree09e0de72b5828715c8c794ef10f513687caf12b4 /delta.jscad
parent34a65279effcec5f51a9853846f6593dadb72246 (diff)
downloadredelta-717f3676d93e8b2f8d71ea4b25461614becb79ef.zip
redelta-717f3676d93e8b2f8d71ea4b25461614becb79ef.tar.gz
redelta-717f3676d93e8b2f8d71ea4b25461614becb79ef.tar.bz2
wip wip
Diffstat (limited to 'delta.jscad') (more/less context) (show whitespace changes)
-rw-r--r--delta.jscad6
1 files changed, 5 insertions, 1 deletions
diff --git a/delta.jscad b/delta.jscad
index 01a5dc7..8233e74 100644
--- a/delta.jscad
+++ b/delta.jscad
@@ -695,98 +695,102 @@ function duetholder() {
695 ]); 695 ]);
696 rv = rv.subtract([ 696 rv = rv.subtract([
697 CSG.cylinder({ // through vertical 697 CSG.cylinder({ // through vertical
698 start: [0,-1,CONFIG.extrusion.w/2], end: [0,s+1,CONFIG.extrusion.w/2], 698 start: [0,-1,CONFIG.extrusion.w/2], end: [0,s+1,CONFIG.extrusion.w/2],
699 radius: DH.bolt.d/2+PRINT.slide_tolerance 699 radius: DH.bolt.d/2+PRINT.slide_tolerance
700 }), 700 }),
701 CSG.cylinder({ // through horizontal to extrusion 701 CSG.cylinder({ // through horizontal to extrusion
702 start: [0,-CONFIG.extrusion.w/2,-s-1], 702 start: [0,-CONFIG.extrusion.w/2,-s-1],
703 end: [0,-CONFIG.extrusion.w/2,1], 703 end: [0,-CONFIG.extrusion.w/2,1],
704 radius: DH.bolt.d/2+PRINT.slide_tolerance 704 radius: DH.bolt.d/2+PRINT.slide_tolerance
705 }), 705 }),
706 CSG.cube({ // cut off 706 CSG.cube({ // cut off
707 corner1: [-hw/2-1,-2*s,0], 707 corner1: [-hw/2-1,-2*s,0],
708 corner2: [hw/2+1,0,-2*s] 708 corner2: [hw/2+1,0,-2*s]
709 }).rotateX(45).translate([0,-CONFIG.extrusion.w,0]), 709 }).rotateX(45).translate([0,-CONFIG.extrusion.w,0]),
710 CSG.cylinder({ // duet bolt 710 CSG.cylinder({ // duet bolt
711 start: [0,hl,-lower], end: [0,hl,-lower+DH.s], 711 start: [0,hl,-lower], end: [0,hl,-lower+DH.s],
712 radius: DH.bolt.d/2+PRINT.slide_tolerance 712 radius: DH.bolt.d/2+PRINT.slide_tolerance
713 }) 713 })
714 ]); 714 ]);
715 var cp = [0,hl,-lower+DH.s]; 715 var cp = [0,hl,-lower+DH.s];
716 rv.properties.duet = new CSG.Properties(); 716 rv.properties.duet = new CSG.Properties();
717 rv.properties.duet.c_sw = new CSG.Connector(cp,[0,0,1],[1,0,0]); 717 rv.properties.duet.c_sw = new CSG.Connector(cp,[0,0,1],[1,0,0]);
718 rv.properties.duet.c_se = new CSG.Connector(cp,[0,0,1],[1,0,0]); 718 rv.properties.duet.c_se = new CSG.Connector(cp,[0,0,1],[1,0,0]);
719 rv.properties.duet.c_ne = new CSG.Connector(cp,[0,0,1],[-Math.cos(Math.PI/3),-Math.sin(Math.PI/3),0]); 719 rv.properties.duet.c_ne = new CSG.Connector(cp,[0,0,1],[-Math.cos(Math.PI/3),-Math.sin(Math.PI/3),0]);
720 rv.properties.duet.c_nw = new CSG.Connector(cp,[0,0,1],[-Math.cos(Math.PI/3),Math.sin(Math.PI/3),0]); 720 rv.properties.duet.c_nw = new CSG.Connector(cp,[0,0,1],[-Math.cos(Math.PI/3),Math.sin(Math.PI/3),0]);
721 rv.properties.c_h = new CSG.Connector([0,-CONFIG.extrusion.w/2,0],[0,0,1],[1,0,0]); 721 rv.properties.c_h = new CSG.Connector([0,-CONFIG.extrusion.w/2,0],[0,0,1],[1,0,0]);
722 rv.properties.c_v = new CSG.Connector([0,0,CONFIG.extrusion.w/2],[0,-1,0],[0,0,1]); 722 rv.properties.c_v = new CSG.Connector([0,0,CONFIG.extrusion.w/2],[0,-1,0],[0,0,1]);
723 rv.properties.P = new CSG.Connector([-hw/2,0,0],[1,0,0],[0,1,0]); 723 rv.properties.P = new CSG.Connector([-hw/2,0,0],[1,0,0],[0,1,0]);
724 return rv.setColor(CONFIG.color.parts); 724 return rv.setColor(CONFIG.color.parts);
725} 725}
726 726
727function refaxes(o) { 727function refaxes(o) {
728 if(!o) o = {}; 728 if(!o) o = {};
729 var l = o.l||20, g = o.g||0.7; 729 var l = o.l||20, g = o.g||0.7;
730 return union([ 730 return union([
731 CSG.roundedCylinder({start:[0,0,0],end:[l,0,0]}).setColor([1,0,0,g]), 731 CSG.roundedCylinder({start:[0,0,0],end:[l,0,0]}).setColor([1,0,0,g]),
732 CSG.roundedCylinder({start:[0,0,0],end:[0,l,0]}).setColor([0,1,0,g]), 732 CSG.roundedCylinder({start:[0,0,0],end:[0,l,0]}).setColor([0,1,0,g]),
733 CSG.roundedCylinder({start:[0,0,0],end:[0,0,l]}).setColor([0,0,1,g]) 733 CSG.roundedCylinder({start:[0,0,0],end:[0,0,l]}).setColor([0,0,1,g])
734 ]); 734 ]);
735} 735}
736 736
737function P(x) { 737function P(x) {
738 return x.connectTo(x.properties.P,new CSG.Connector([0,0,0],[0,0,1],[1,0,0]), false, 0); 738 return x.connectTo(x.properties.P,new CSG.Connector([0,0,0],[0,0,1],[1,0,0]), false, 0);
739} 739}
740 740
741var PARTS = { 741var PARTS = {
742 wip: function(params) { 742 wip: function(params) {
743 return duetholder(params);
744 return PARTS.alltogethernow(params);
745 return base_extrusions();
743 return foot(); 746 return foot();
744 return union(base_extrusions(),column_extrusions(),duet()); 747 return union(base_extrusions(),column_extrusions(),duet().translate([0,-20,0]));
748 },
745 alltogethernow: function(params) { 749 alltogethernow: function(params) {
746 var cols = columns(); 750 var cols = columns();
747 var sides = base_sides(); 751 var sides = base_sides();
748 var feet = THREEWINDS.map(function(w,i) { 752 var feet = THREEWINDS.map(function(w,i) {
749 var rv = foot(); 753 var rv = foot();
750 rv = rv.connectTo(rv.properties.c_column,cols[i].properties.c_bottom,false,0); 754 rv = rv.connectTo(rv.properties.c_column,cols[i].properties.c_bottom,false,0);
751 return rv; 755 return rv;
752 }); 756 });
753 var dh = duetholder(); 757 var dh = duetholder();
754 var dhsw = dh.connectTo(dh.properties.c_h, 758 var dhsw = dh.connectTo(dh.properties.c_h,
755 new CSG.Connector([-CONFIG.duet.hole_spacing.x/2,-CD.base.mid_inscription_r,CONFIG.foot.h],[0,0,1],[1,0,0]), 759 new CSG.Connector([-CONFIG.duet.hole_spacing.x/2,-CD.base.mid_inscription_r,CONFIG.foot.h],[0,0,1],[1,0,0]),
756 false,0); 760 false,0);
757 var d = duet(); 761 var d = duet();
758 d = d.connectTo(d.properties.holes.c_sw,dhsw.properties.duet.c_sw,false,0); 762 d = d.connectTo(d.properties.holes.c_sw,dhsw.properties.duet.c_sw,false,0);
759 var dhse = dh.connectTo(dh.properties.duet.c_se,d.properties.holes.c_se,false,0); 763 var dhse = dh.connectTo(dh.properties.duet.c_se,d.properties.holes.c_se,false,0);
760 var dhne = dh.connectTo(dh.properties.duet.c_ne,d.properties.holes.c_ne,false,0); 764 var dhne = dh.connectTo(dh.properties.duet.c_ne,d.properties.holes.c_ne,false,0);
761 var dhnw = dh.connectTo(dh.properties.duet.c_nw,d.properties.holes.c_nw,false,0); 765 var dhnw = dh.connectTo(dh.properties.duet.c_nw,d.properties.holes.c_nw,false,0);
762 var rv = union(cols).union(sides.map(union)).union(feet).union([ 766 var rv = union(cols).union(sides.map(union)).union(feet).union([
763 d,dhsw,dhse,dhne,dhnw 767 d,dhsw,dhse,dhne,dhnw
764 ]); 768 ]);
765 rv.properties.P = new CSG.Connector([0,0,0],[0,0,1],[1,0,0]); 769 rv.properties.P = new CSG.Connector([0,0,0],[0,0,1],[1,0,0]);
766 return rv; 770 return rv;
767 }, 771 },
768 duetholder: function(params) { 772 duetholder: function(params) {
769 return duetholder(); 773 return duetholder();
770 } 774 }
771}; 775};
772 776
773function main(params) { 777function main(params) {
774 var part = params.part && PARTS[params.part]; 778 var part = params.part && PARTS[params.part];
775 if(!part) return refaxes(); 779 if(!part) return refaxes();
776 var rv = P(part(params)); 780 var rv = P(part(params));
777 if(!params.print) rv = rv.union(refaxes()); 781 if(!params.print) rv = rv.union(refaxes());
778 return rv; 782 return rv;
779} 783}
780 784
781function _main(params) { 785function _main(params) {
782 var e = EFFECTOR.effector(); 786 var e = EFFECTOR.effector();
783 var hs = E3DV6.heatsink(); 787 var hs = E3DV6.heatsink();
784 hs = hs.connectTo(hs.properties.grove_connector,e.properties.grove_connector,false,0); 788 hs = hs.connectTo(hs.properties.grove_connector,e.properties.grove_connector,false,0);
785 var ms = microswitch(); 789 var ms = microswitch();
786 var hd = EFFECTOR.hinged({ 790 var hd = EFFECTOR.hinged({
787 microswitch:ms,effector:e 791 microswitch:ms,effector:e
788 }); 792 });
789 ms = ms.connectTo( 793 ms = ms.connectTo(
790 ms.properties.screw_connector[0], 794 ms.properties.screw_connector[0],
791 hd.properties.microswitch_screw_connector[0], 795 hd.properties.microswitch_screw_connector[0],
792 false, 0); 796 false, 0);