module keycap(type="sa",row=1) { if(type == "sa" || type == "SA" ) { keycap_sa(row); } if(type == "mt3" || type == "MT3") { keycap_mt3(row); } } module keycap_sa(row=1) { // sa is taken from https://github.com/getclacking/SA-profile-keys-3D-models $fn=400; if(row == 1) { import("stl/keycaps/sa/sa_r1_u1.stl"); } if(row == 2) { import("stl/keycaps/sa/sa_r2_u1.stl"); } if(row == 3) { import("stl/keycaps/sa/sa_r3_u1.stl"); } if(row == 4) { import("stl/keycaps/sa/sa_r4_u1.stl"); } if(row == 5) { import("stl/keycaps/sa/sa_r5_u1.stl"); } } module keycap_mt3(row=1) { // sa is taken from https://github.com/getclacking/SA-profile-keys-3D-models $fn=400; if(row == 1) { import("stl/keycaps/mt3/mt3_r1_u1.stl"); } if(row == 2) { import("stl/keycaps/mt3/mt3_r2_u1.stl"); } if(row == 3) { import("stl/keycaps/mt3/mt3_r3_u1.stl"); } if(row == 4) { import("stl/keycaps/mt3/mt3_r5_u1.stl"); } if(row == 5) { import("stl/keycaps/mt3/mt3_r5_u1.stl"); } } o=[10,30,50,70]; translate([0,-5,0]) text("sa 1u",size=5); translate([30,-5,0]) text("mt3 1u",size=5); translate([-10,o[0],0]) text("R1",size=5); translate([-10,o[1],0]) text("R2",size=5); translate([-10,o[2],0]) text("R3",size=5); translate([-10,o[3],0]) text("R4",size=5); for(i=[1:4]) { translate([10,o[i-1],0]) keycap("sa",5-i); } for(i=[1:4]) { translate([40,o[i-1],0]) keycap("mt3",5-i); }