//uncentered hole module u_hole() { translate([2.7/2,2.7/2, -5]) cylinder(10, d=2.7,false, $fn=20); } //divot module divot() { u_hole(); translate([12.9-2.7 ,0, 0]) u_hole(); translate([0,-1,-5]) cube([12.9,1+2.7/2,10]); } /* * PCB Board itself */ p_w = 327; p_h = 113; module pcb() { difference (){ //PCB Board union() { cube([p_w,p_h,1.8],false); //represents solder on bottom translate([7.3,7.3,-1]) cube([p_w-2*7.3,p_h-2*7.3,1]); }; //holes translate([4.85,16.6,0]) u_hole(); translate([4.85,54.8,0]) u_hole(); translate([p_w-4.85-2.7,54.8,0]) u_hole(); translate([p_w-4.85-2.7,93.8,0]) u_hole(); //divots translate([p_w/2 - 12.9/2,0,0])divot(); translate([p_w/2 - 12.9/2,p_h,0]) rotate([180,0,0]) divot(); } } /* * Plate above PCB and KEy switches */ pl_d = 13.08-3.92-1.8; //plate depth pl_w = p_w - 2.6*2; pl_h = p_h - 6.5 - 6.5; module plate() { //move above pcb translate([0,0,3.92+1.8]) { difference() { union () { //account for size shrink translate([2.6,6.5,0]) cube([pl_w, pl_h ,pl_d]); } translate([2.6-1,42.81+6.5,-5]) cube([1+3.27,10+57.2,pl_d+10]); translate([2.6+pl_w-3.27,42.81+6.5,-5]) cube([1+3.27,10+57.2,pl_d+10]); translate([2.6+pl_w-3.27-11.12,81.3+6.5,-5]) cube([1+3.27+11.12,10+18.51,pl_d+10]); } } } /* * Keys */ module key(x,y, w=1) { translate([x*(18+0.9), y* (18+0.9),0]) cube([w*(18+0.9)-0.9,18,12.5]); } //Keys module keys() { translate([15.55, 9.98,18.5+1.8]) { //translate([15,10,18.5+1.8]) { union() { translate ([4.08,0,0]) { for(i=[0:1:14]) key(i,4); } translate([-4.86,0,0]) { for(i=[0:1:15]) key(i,3); } for(i=[0:1:13]) key(i,2); key(14,2,1.5); key(0,1,1.5); for(i=[1.5:1:11.5]) key(i,1); key(12.5,1,1.5); key(14,1); key(0,0,1.5); key(2.5,0,8); } } } module switches() { translate([p_w - 12.23 - 82.8 ,12.5, 13.08]) union() { translate([0,0,0]) cube([17.4,9.33,13]); translate([32.78,0,0]) cube([17.4,9.33,13]); translate([65.6,0,0]) cube([17.4,9.33,13]); } } /* * Leds */ module led() { translate([6.04/2, 2.93/2,0]) cylinder(7.47, d=2.93, false, $fn=25); cube([6.04,2.93,2.4]); } module leds() { translate([11.11+2.71, 52.23+(6.04-2.93)/2, 13.08]) rotate([0,0,90])led(); translate([p_w-16.85-6.08,6.5,13.8]) led(); } /* * Connectors */ module f_header(x, y) { translate([x*2.56, y*4, 0]) { difference() { cube([2.56,4,4.5]); translate([2.54/2-1/2, 4/2-0.4/2, 4.5-4]) cube([1,0.4,4+1]); } } } translate([p_w - 121.5, p_h - 5.6, 1.8]) { for(i=[0:1:11]) f_header(i,0); for(i=[13:1:24]) f_header(i,0); } /* * Fin. */ module keyboard() { pcb(); plate(); keys(); switches(); leds(); } //keyboard();