summaryrefslogtreecommitdiffabout
path: root/delta.jscad
authorMichael Krelin <hacker@klever.net>2016-02-27 14:42:47 (UTC)
committer Michael Krelin <hacker@klever.net>2016-02-27 14:42:47 (UTC)
commit33c7b3b1dc1d7d9c706bfa25e9f56eb237aa7dfc (patch) (unidiff)
tree5adc0e7e818ace30173fc7c4ba54aa861191dccb /delta.jscad
parentb0cb21f0d722dd4ae845ba3341c6a3066afa0409 (diff)
downloadredelta-33c7b3b1dc1d7d9c706bfa25e9f56eb237aa7dfc.zip
redelta-33c7b3b1dc1d7d9c706bfa25e9f56eb237aa7dfc.tar.gz
redelta-33c7b3b1dc1d7d9c706bfa25e9f56eb237aa7dfc.tar.bz2
some missing parts
Diffstat (limited to 'delta.jscad') (more/less context) (ignore whitespace changes)
-rw-r--r--delta.jscad36
1 files changed, 35 insertions, 1 deletions
diff --git a/delta.jscad b/delta.jscad
index 45e8765..12bdb97 100644
--- a/delta.jscad
+++ b/delta.jscad
@@ -789,175 +789,209 @@ function glass() {
789 }); 789 });
790 rv.properties.c_bed = new CSG.Connector([0,0,0],[0,0,1],[1,0,0]); 790 rv.properties.c_bed = new CSG.Connector([0,0,0],[0,0,1],[1,0,0]);
791 rv.properties.P = new CSG.Connector([0,0,-CONFIG.foot.h-CONFIG.heatbed.h],[0,0,1],[1,0,0]); 791 rv.properties.P = new CSG.Connector([0,0,-CONFIG.foot.h-CONFIG.heatbed.h],[0,0,1],[1,0,0]);
792 rv.properties.vitamin = true; 792 rv.properties.vitamin = true;
793 return rv.setColor(CONFIG.color.glass); 793 return rv.setColor(CONFIG.color.glass);
794} 794}
795function platform() { 795function platform() {
796 var b = heatbed(); 796 var b = heatbed();
797 var g = glass(); 797 var g = glass();
798 g = g.connectTo(g.properties.c_bed,b.properties.c_glass,false,0); 798 g = g.connectTo(g.properties.c_bed,b.properties.c_glass,false,0);
799 return b.union(g); 799 return b.union(g);
800} 800}
801 801
802function bedholder(params) { 802function bedholder(params) {
803 var h0 = CONFIG.foot.h+CONFIG.extrusion.w*2+CONFIG.base.gap; 803 var h0 = CONFIG.foot.h+CONFIG.extrusion.w*2+CONFIG.base.gap;
804 var bolt_s = CONFIG.bedholder.bolt.l-CONFIG.extrusion.slotdepth+PRINT.play_tolerance*2; 804 var bolt_s = CONFIG.bedholder.bolt.l-CONFIG.extrusion.slotdepth+PRINT.play_tolerance*2;
805 var nuth=h0+CONFIG.bedholder.h*3/4; 805 var nuth=h0+CONFIG.bedholder.h*3/4;
806 var nutth = nuth+CONFIG.bedholder.nut.h/2+PRINT.slide_tolerance/2; 806 var nutth = nuth+CONFIG.bedholder.nut.h/2+PRINT.slide_tolerance/2;
807 var rv = CSG.roundedCube({ 807 var rv = CSG.roundedCube({
808 corner1: [-CONFIG.extrusion.w/2,-CD.base.inner_inscription_r,h0], 808 corner1: [-CONFIG.extrusion.w/2,-CD.base.inner_inscription_r,h0],
809 corner2: [ CONFIG.extrusion.w/2,-CONFIG.heatbed.sr-3/2-CONFIG.bedholder.margin,h0+CONFIG.bedholder.h], 809 corner2: [ CONFIG.extrusion.w/2,-CONFIG.heatbed.sr-3/2-CONFIG.bedholder.margin,h0+CONFIG.bedholder.h],
810 roundradius: CONFIG.bedholder.margin 810 roundradius: CONFIG.bedholder.margin
811 }); 811 });
812 rv = rv.subtract([ 812 rv = rv.subtract([
813 CSG.cylinder({ // base screw 813 CSG.cylinder({ // base screw
814 start: [0,-CD.base.mid_inscription_r,h0-1], 814 start: [0,-CD.base.mid_inscription_r,h0-1],
815 end: [0,-CD.base.mid_inscription_r,h0+CONFIG.bedholder.h+1], 815 end: [0,-CD.base.mid_inscription_r,h0+CONFIG.bedholder.h+1],
816 radius: CONFIG.bedholder.bolt.d/2+PRINT.screw_tolerance/2 816 radius: CONFIG.bedholder.bolt.d/2+PRINT.screw_tolerance/2
817 }), 817 }),
818 CSG.cylinder({ // bed screw 818 CSG.cylinder({ // bed screw
819 start: [0,-CONFIG.heatbed.sr,h0-1], 819 start: [0,-CONFIG.heatbed.sr,h0-1],
820 end: [0,-CONFIG.heatbed.sr,h0+CONFIG.bedholder.h+1], 820 end: [0,-CONFIG.heatbed.sr,h0+CONFIG.bedholder.h+1],
821 radius: CONFIG.bedholder.bolt.d/2+PRINT.screw_tolerance/2 821 radius: CONFIG.bedholder.bolt.d/2+PRINT.screw_tolerance/2
822 }), 822 }),
823 CSG.cube({ // nut pocket 823 CSG.cube({ // nut pocket
824 center: [0,-CONFIG.heatbed.sr,nuth], 824 center: [0,-CONFIG.heatbed.sr,nuth],
825 radius: [CONFIG.extrusion.w/2+1,(CONFIG.bedholder.nut.w+PRINT.slide_tolerance)/2,(CONFIG.bedholder.nut.h+PRINT.slide_tolerance)/2] 825 radius: [CONFIG.extrusion.w/2+1,(CONFIG.bedholder.nut.w+PRINT.slide_tolerance)/2,(CONFIG.bedholder.nut.h+PRINT.slide_tolerance)/2]
826 }), 826 }),
827 CSG.cylinder({ // sink base screw 827 CSG.cylinder({ // sink base screw
828 start: [0,-CD.base.mid_inscription_r,h0+bolt_s], 828 start: [0,-CD.base.mid_inscription_r,h0+bolt_s],
829 end: [0,-CD.base.mid_inscription_r,h0+CONFIG.bedholder.h+1], 829 end: [0,-CD.base.mid_inscription_r,h0+CONFIG.bedholder.h+1],
830 radius: CONFIG.bedholder.bolt.head.d/2+PRINT.play_tolerance 830 radius: CONFIG.bedholder.bolt.head.d/2+PRINT.play_tolerance
831 }) 831 })
832 ]); 832 ]);
833 rv = rv.union(CSG.cylinder({ // patch up for bridging 833 rv = rv.union(CSG.cylinder({ // patch up for bridging
834 start: [0,-CONFIG.heatbed.sr,nutth], end: [0,-CONFIG.heatbed.sr,nutth+PRINT.layer_height], 834 start: [0,-CONFIG.heatbed.sr,nutth], end: [0,-CONFIG.heatbed.sr,nutth+PRINT.layer_height],
835 radius: (CONFIG.bedholder.nut.w+PRINT.slide_tolerance)/2+PRINT.extrusion_width 835 radius: (CONFIG.bedholder.nut.w+PRINT.slide_tolerance)/2+PRINT.extrusion_width
836 })); 836 }));
837 rv = rv.intersect(CSG.cylinder({ // cut off excess 837 rv = rv.intersect(CSG.cylinder({ // cut off excess
838 start: [0,0,h0-1], end: [0,0,h0+CONFIG.bedholder.h+1], 838 start: [0,0,h0-1], end: [0,0,h0+CONFIG.bedholder.h+1],
839 radius: CONFIG.heatbed.r, resolution: 270 839 radius: CONFIG.heatbed.r, resolution: 270
840 })); 840 }));
841 rv.properties.P = new CSG.Connector([0,-CD.base.mid_inscription_r,h0],[0,0,1],[1,0,0]); 841 rv.properties.P = new CSG.Connector([0,-CD.base.mid_inscription_r,h0],[0,0,1],[1,0,0]);
842 return rv.setColor(CONFIG.color.parts); 842 return rv.setColor(CONFIG.color.parts);
843} 843}
844 844
845var PARTS = { 845var PARTS = {
846 wip: function(params) { 846 wip: function(params) {
847 return duetholder(params); 847 return duetholder(params);
848 return PARTS.alltogethernow(params); 848 return PARTS.alltogethernow(params);
849 return base_extrusions(); 849 return base_extrusions();
850 return foot(); 850 return foot();
851 return union(base_extrusions(),column_extrusions(),duet().translate([0,-20,0])); 851 return union(base_extrusions(),column_extrusions(),duet().translate([0,-20,0]));
852 }, 852 },
853 alltogethernow: function(params) { 853 alltogethernow: function(params) {
854 var cols = columns(); 854 var cols = columns();
855 var sides = base_sides(); 855 var sides = base_sides();
856 var feet = THREEWINDS.map(function(w,i) { 856 var feet = THREEWINDS.map(function(w,i) {
857 var rv = foot(); 857 var rv = foot();
858 rv = rv.connectTo(rv.properties.c_column,cols[i].properties.c_bottom,false,0); 858 rv = rv.connectTo(rv.properties.c_column,cols[i].properties.c_bottom,false,0);
859 var s = shoe(); 859 var s = shoe();
860 s = s.connectTo(s.properties.c_foot,rv.properties.c_shoe,false,0); 860 s = s.connectTo(s.properties.c_foot,rv.properties.c_shoe,false,0);
861 return rv.union(s); 861 return rv.union(s);
862 }); 862 });
863 var dh = duetholder(); 863 var dh = duetholder();
864 var dhsw = dh.connectTo(dh.properties.c_h, 864 var dhsw = dh.connectTo(dh.properties.c_h,
865 new CSG.Connector([-CONFIG.duet.hole_spacing.x/2,-CD.base.mid_inscription_r,CONFIG.foot.h],[0,0,1],[1,0,0]), 865 new CSG.Connector([-CONFIG.duet.hole_spacing.x/2,-CD.base.mid_inscription_r,CONFIG.foot.h],[0,0,1],[1,0,0]),
866 false,0); 866 false,0);
867 var d = duet(); 867 var d = duet();
868 d = d.connectTo(d.properties.holes.c_sw,dhsw.properties.duet.c_sw,false,0); 868 d = d.connectTo(d.properties.holes.c_sw,dhsw.properties.duet.c_sw,false,0);
869 var dhse = dh.connectTo(dh.properties.duet.c_se,d.properties.holes.c_se,false,0); 869 var dhse = dh.connectTo(dh.properties.duet.c_se,d.properties.holes.c_se,false,0);
870 var dhne = dh.connectTo(dh.properties.duet.c_ne,d.properties.holes.c_ne,false,0); 870 var dhne = dh.connectTo(dh.properties.duet.c_ne,d.properties.holes.c_ne,false,0);
871 var dhnw = dh.connectTo(dh.properties.duet.c_nw,d.properties.holes.c_nw,false,0); 871 var dhnw = dh.connectTo(dh.properties.duet.c_nw,d.properties.holes.c_nw,false,0);
872 var rv = union(cols).union(sides.map(union)).union(feet).union([ 872 var rv = union(cols).union(sides.map(union)).union(feet).union([
873 d,dhsw,dhse,dhne,dhnw 873 d,dhsw,dhse,dhne,dhnw
874 ]); 874 ]);
875 var p = U.P(platform()); 875 var p = U.P(platform());
876 rv = rv.union(p); 876 rv = rv.union(p);
877 rv.properties.P = new CSG.Connector([0,0,0],[0,0,1],[1,0,0]); 877 rv.properties.P = new CSG.Connector([0,0,0],[0,0,1],[1,0,0]);
878 return rv; 878 return rv;
879 }, 879 },
880 duetholder: function(params) { 880 duetholder: function(params) {
881 return duetholder(); 881 return duetholder();
882 }, 882 },
883 foot: foot, 883 foot: foot,
884 shoe: shoe, 884 shoe: shoe,
885 bedholder: bedholder 885 bedholder: bedholder,
886 platform: function(params) { return U.P(EFFECTOR.effector()) },
887 hinged: function(params) {
888 // TODO: handle print mode
889 var ms = microswitch();
890 var e = EFFECTOR.effector();
891 var hd = EFFECTOR.hinged({
892 microswitch:ms,effector:e
893 });
894 ms = ms.connectTo(
895 ms.properties.screw_connector[0],
896 hd.properties.microswitch_screw_connector[0],
897 false, 0);
898 var hdhd = EFFECTOR.split_hinged(hd);
899 return U.P(hdhd[1]);
900 },
901 // TODO: eliminate common code above and below
902 clamp: function(params) {
903 // TODO: handle print mode
904 var ms = microswitch();
905 var e = EFFECTOR.effector();
906 var hd = EFFECTOR.hinged({
907 microswitch:ms,effector:e
908 });
909 ms = ms.connectTo(
910 ms.properties.screw_connector[0],
911 hd.properties.microswitch_screw_connector[0],
912 false, 0);
913 var hdhd = EFFECTOR.split_hinged(hd);
914 return U.P(hdhd[0]);
915 },
916 fanholder: function(params) {
917 EFFECTOR.effector(); // to set up rmount
918 return U.P(EFFECTOR.fanholder());
919 }
886}; 920};
887 921
888function main(params) { 922function main(params) {
889 var part = params.part && PARTS[params.part]; 923 var part = params.part && PARTS[params.part];
890 if(!part) return U.axes(); 924 if(!part) return U.axes();
891 var rv = U.P(part(params)); 925 var rv = U.P(part(params));
892 if(!params.print) rv = rv.union(U.axes()); 926 if(!params.print) rv = rv.union(U.axes());
893 return rv; 927 return rv;
894} 928}
895 929
896function _main(params) { 930function _main(params) {
897 var e = EFFECTOR.effector(); 931 var e = EFFECTOR.effector();
898 var hs = E3DV6.heatsink(); 932 var hs = E3DV6.heatsink();
899 hs = hs.connectTo(hs.properties.grove_connector,e.properties.grove_connector,false,0); 933 hs = hs.connectTo(hs.properties.grove_connector,e.properties.grove_connector,false,0);
900 var ms = microswitch(); 934 var ms = microswitch();
901 var hd = EFFECTOR.hinged({ 935 var hd = EFFECTOR.hinged({
902 microswitch:ms,effector:e 936 microswitch:ms,effector:e
903 }); 937 });
904 ms = ms.connectTo( 938 ms = ms.connectTo(
905 ms.properties.screw_connector[0], 939 ms.properties.screw_connector[0],
906 hd.properties.microswitch_screw_connector[0], 940 hd.properties.microswitch_screw_connector[0],
907 false, 0); 941 false, 0);
908 var hdhd = EFFECTOR.split_hinged(hd); 942 var hdhd = EFFECTOR.split_hinged(hd);
909 var fh = EFFECTOR.fanholder(); 943 var fh = EFFECTOR.fanholder();
910 return union({ 944 return union({
911 platform: e, 945 platform: e,
912 hinged: hdhd[1], 946 hinged: hdhd[1],
913 clamp: hdhd[0], 947 clamp: hdhd[0],
914 fanholder: fh, 948 fanholder: fh,
915 alltogethernow: [e,hdhd[0],hdhd[1], columns(),hs,ms,fh] 949 alltogethernow: [e,hdhd[0],hdhd[1], columns(),hs,ms,fh]
916 }[params.part||'alltogethernow']) 950 }[params.part||'alltogethernow'])
917 var rv = union( 951 var rv = union(
918 e, 952 e,
919 hs, 953 hs,
920 columns(), 954 columns(),
921 ///hd, 955 ///hd,
922 hdhd[0], hdhd[1], 956 hdhd[0], hdhd[1],
923 ms); 957 ms);
924 return rv; 958 return rv;
925} 959}
926 960
927function getParameterDefinitions() { 961function getParameterDefinitions() {
928 return [{ 962 return [{
929 name: 'part', 963 name: 'part',
930 type: 'choice', 964 type: 'choice',
931 values: [ 965 values: [
932 'platform', 966 'platform',
933 'hinged', 967 'hinged',
934 'clamp', 968 'clamp',
935 'fanholder', 969 'fanholder',
936 'duetholder', 970 'duetholder',
937 'foot', 'shoe', 971 'foot', 'shoe',
938 'bedholder', 972 'bedholder',
939 'alltogethernow', 973 'alltogethernow',
940 'wip' 974 'wip'
941 ], 975 ],
942 captions: [ 976 captions: [
943 'Effector platform', 977 'Effector platform',
944 'Hinged part', 978 'Hinged part',
945 'Clamp', 979 'Clamp',
946 'Fan holder', 980 'Fan holder',
947 'Duet holder', 981 'Duet holder',
948 'Foot', 'Shoe', 982 'Foot', 'Shoe',
949 'Bed holder', 983 'Bed holder',
950 'All together now!', 984 'All together now!',
951 'Work in progress' 985 'Work in progress'
952 ], 986 ],
953 caption: 'Part', 987 caption: 'Part',
954 initial: 'wip' 988 initial: 'wip'
955 },{ 989 },{
956 name: 'print', 990 name: 'print',
957 type: 'checkbox', 991 type: 'checkbox',
958 caption: 'For print, no nonsense', 992 caption: 'For print, no nonsense',
959 initial: false 993 initial: false
960 }]; 994 }];
961} 995}
962 996
963/* vim:set ft=javascript ai: */ 997/* vim:set ft=javascript ai: */