// this is drawn upside down totdepth = 140.2; height = 12.0; topthick = 1.6; wallthick = 1.3; cornerdepth = 1; keydepth = 25.3; keywidth = 19.9; backdepth = 44.7; backwidth = 7.8; middledepth = totdepth - keydepth - backdepth; middlewidth = 13.5; middlenotch_rad = 1.5; middlenotch_dep1 = 2 * middlenotch_rad; middlenotch_dep2 = 6; // note the circle here middlenotch_hei = 7 - middlenotch_rad; // 61.7 to the border; this var defines the distance of the midpoint middlenotch_x = 61.7 + middlenotch_dep2 / 2; // again the center of the circle middlenotch_z = 5 + middlenotch_rad; module outline(walloff) { cube([keydepth - walloff, keywidth - walloff, height]); translate([keydepth - walloff, (keywidth - middlewidth) / 2, 0]) cube([middledepth, middlewidth - walloff, height]); // this makes the end slightly thicker, but it is in the original too translate([keydepth + middledepth - walloff, (keywidth - backwidth) / 2, 0]) cube([backdepth - walloff, backwidth - walloff, height]); } module middlenotch() { translate([middlenotch_x, (keywidth-middlewidth)/2, middlenotch_z]) { translate([-middlenotch_dep2/2, 0, middlenotch_hei]) color([1, 0, 1]) polyhedron( points=[ [0, 0, 0], [0, middlewidth, 0], [middlenotch_dep2, 0, 0], [middlenotch_dep2, middlewidth, 0], [middlenotch_dep2/2 + (middlenotch_dep2-middlenotch_dep1)/2, 0, -middlenotch_hei], [middlenotch_dep2/2 + (middlenotch_dep2-middlenotch_dep1)/2, middlewidth, -middlenotch_hei], [middlenotch_dep2/2 - (middlenotch_dep2-middlenotch_dep1)/2, 0, -middlenotch_hei], [middlenotch_dep2/2 - (middlenotch_dep2-middlenotch_dep1)/2, middlewidth, -middlenotch_hei] ], faces=[ [0, 2, 4, 6], // front side [7, 5, 3, 1], // back side [0, 1, 3, 2], // up [2, 3, 5, 4], // end-facing [0, 6, 7, 1], // key-facing [6, 4, 5, 7] // down ] ); rotate(-90, [1, 0, 0]) color([1, 0, 0]) cylinder(h=middlewidth, r=middlenotch_rad,$fn=30); } } difference() { union() { outline(0); translate([-cornerdepth, 0, 0]) cube([cornerdepth, keywidth, topthick]); middlenotch(); // this is here too for debugging } union() { translate([wallthick, wallthick, topthick]) { outline(wallthick*2); } middlenotch(); } }