summaryrefslogtreecommitdiffabout
path: root/delta.jscad
authorMichael Krelin <hacker@klever.net>2016-03-20 14:38:37 (UTC)
committer Michael Krelin <hacker@klever.net>2016-03-20 14:38:37 (UTC)
commit00a023fb1fa3370550b2b30b6ce06aec45436a52 (patch) (unidiff)
tree51bd7b76423adc4004514b0b5d22d972ad6eda1f /delta.jscad
parent8805ba36fd9da26d3764ad83a5c8b97c30140dc0 (diff)
downloadredelta-00a023fb1fa3370550b2b30b6ce06aec45436a52.zip
redelta-00a023fb1fa3370550b2b30b6ce06aec45436a52.tar.gz
redelta-00a023fb1fa3370550b2b30b6ce06aec45436a52.tar.bz2
newer openjscad compatibility
Diffstat (limited to 'delta.jscad') (more/less context) (ignore whitespace changes)
-rw-r--r--delta.jscad1
1 files changed, 1 insertions, 0 deletions
diff --git a/delta.jscad b/delta.jscad
index e9fb773..b783913 100644
--- a/delta.jscad
+++ b/delta.jscad
@@ -949,102 +949,103 @@ var PARTS = {
949 hd.properties.microswitch_screw_connector[0], 949 hd.properties.microswitch_screw_connector[0],
950 false, 0); 950 false, 0);
951 var hdhd = EFFECTOR.split_hinged(hd); 951 var hdhd = EFFECTOR.split_hinged(hd);
952 return U.P(hdhd[1]); 952 return U.P(hdhd[1]);
953 }, 953 },
954 // TODO: eliminate common code above and below 954 // TODO: eliminate common code above and below
955 clamp: function(params) { 955 clamp: function(params) {
956 // TODO: handle print mode 956 // TODO: handle print mode
957 var ms = microswitch(); 957 var ms = microswitch();
958 var e = EFFECTOR.effector(); 958 var e = EFFECTOR.effector();
959 var hd = EFFECTOR.hinged({ 959 var hd = EFFECTOR.hinged({
960 microswitch:ms,effector:e 960 microswitch:ms,effector:e
961 }); 961 });
962 ms = ms.connectTo( 962 ms = ms.connectTo(
963 ms.properties.screw_connector[0], 963 ms.properties.screw_connector[0],
964 hd.properties.microswitch_screw_connector[0], 964 hd.properties.microswitch_screw_connector[0],
965 false, 0); 965 false, 0);
966 var hdhd = EFFECTOR.split_hinged(hd); 966 var hdhd = EFFECTOR.split_hinged(hd);
967 return U.P(hdhd[0]); 967 return U.P(hdhd[0]);
968 }, 968 },
969 fanholder: function(params) { 969 fanholder: function(params) {
970 EFFECTOR.effector(); // to set up rmount 970 EFFECTOR.effector(); // to set up rmount
971 return U.P(EFFECTOR.fanholder()); 971 return U.P(EFFECTOR.fanholder());
972 } 972 }
973}; 973};
974 974
975function main(params) { 975function main(params) {
976 var part = params.part && PARTS[params.part]; 976 var part = params.part && PARTS[params.part];
977 if(!part) return U.axes(); 977 if(!part) return U.axes();
978 var rv = U.P(part(params)); 978 var rv = U.P(part(params));
979 if(!params.print) rv = rv.union(U.axes()); 979 if(!params.print) rv = rv.union(U.axes());
980 return rv; 980 return rv;
981} 981}
982 982
983function _main(params) { 983function _main(params) {
984 var e = EFFECTOR.effector(); 984 var e = EFFECTOR.effector();
985 var hs = E3DV6.heatsink(); 985 var hs = E3DV6.heatsink();
986 hs = hs.connectTo(hs.properties.grove_connector,e.properties.grove_connector,false,0); 986 hs = hs.connectTo(hs.properties.grove_connector,e.properties.grove_connector,false,0);
987 var ms = microswitch(); 987 var ms = microswitch();
988 var hd = EFFECTOR.hinged({ 988 var hd = EFFECTOR.hinged({
989 microswitch:ms,effector:e 989 microswitch:ms,effector:e
990 }); 990 });
991 ms = ms.connectTo( 991 ms = ms.connectTo(
992 ms.properties.screw_connector[0], 992 ms.properties.screw_connector[0],
993 hd.properties.microswitch_screw_connector[0], 993 hd.properties.microswitch_screw_connector[0],
994 false, 0); 994 false, 0);
995 var hdhd = EFFECTOR.split_hinged(hd); 995 var hdhd = EFFECTOR.split_hinged(hd);
996 var fh = EFFECTOR.fanholder(); 996 var fh = EFFECTOR.fanholder();
997 return union({ 997 return union({
998 platform: e, 998 platform: e,
999 hinged: hdhd[1], 999 hinged: hdhd[1],
1000 clamp: hdhd[0], 1000 clamp: hdhd[0],
1001 fanholder: fh, 1001 fanholder: fh,
1002 alltogethernow: [e,hdhd[0],hdhd[1], columns(),hs,ms,fh] 1002 alltogethernow: [e,hdhd[0],hdhd[1], columns(),hs,ms,fh]
1003 }[params.part||'alltogethernow']) 1003 }[params.part||'alltogethernow'])
1004 var rv = union( 1004 var rv = union(
1005 e, 1005 e,
1006 hs, 1006 hs,
1007 columns(), 1007 columns(),
1008 ///hd, 1008 ///hd,
1009 hdhd[0], hdhd[1], 1009 hdhd[0], hdhd[1],
1010 ms); 1010 ms);
1011 return rv; 1011 return rv;
1012} 1012}
1013 1013
1014function getParameterDefinitions() { 1014function getParameterDefinitions() {
1015 return [{ 1015 return [{
1016 name: 'part', 1016 name: 'part',
1017 type: 'choice', 1017 type: 'choice',
1018 values: [ 1018 values: [
1019 'platform', 1019 'platform',
1020 'hinged', 1020 'hinged',
1021 'clamp', 1021 'clamp',
1022 'fanholder', 1022 'fanholder',
1023 'duetholder', 1023 'duetholder',
1024 'foot', 'shoe', 1024 'foot', 'shoe',
1025 'bedholder', 1025 'bedholder',
1026 'alltogethernow', 1026 'alltogethernow',
1027 'wip' 1027 'wip'
1028 ], 1028 ],
1029 captions: [ 1029 captions: [
1030 'Effector platform', 1030 'Effector platform',
1031 'Hinged part', 1031 'Hinged part',
1032 'Clamp', 1032 'Clamp',
1033 'Fan holder', 1033 'Fan holder',
1034 'Duet holder', 1034 'Duet holder',
1035 'Foot', 'Shoe', 1035 'Foot', 'Shoe',
1036 'Bed holder', 1036 'Bed holder',
1037 'All together now!', 1037 'All together now!',
1038 'Work in progress' 1038 'Work in progress'
1039 ], 1039 ],
1040 caption: 'Part', 1040 caption: 'Part',
1041 initial: 'wip' 1041 initial: 'wip'
1042 },{ 1042 },{
1043 name: 'print', 1043 name: 'print',
1044 type: 'checkbox', 1044 type: 'checkbox',
1045 checked: false,
1045 caption: 'For print, no nonsense', 1046 caption: 'For print, no nonsense',
1046 initial: false 1047 initial: false
1047 }]; 1048 }];
1048} 1049}
1049 1050
1050/* vim:set ft=javascript ai: */ 1051/* vim:set ft=javascript ai: */