concertina

Elecronic concertina
git clone https://git.woozle.org/neale/concertina.git

concertina / 3d
Neale Pickett  ·  2026-02-01

cherryvoid.scad

 1// Riskable's Cherry MX void/cutout module for making keyboard (top) plates and key switch testers
 2
 3$fn = 32;
 4
 5// AUTHOR: Riskable <riskable@youknowwhat.com>
 6// VERSION: 1.1 (Changelog is at the bottom)
 7// LICENSE: Creative Commons - Attribution - Non-Commercial (if you want to use it in a commercial setting/product just ask!)
 8
 9// NOTES
10/*
11    * Feel free to use this .scad in your own projects to add proper Cherry MX-styled switch cutouts to keyboards, perhipherals, testers, or whatever you like.
12    * You can just copy cherry_switch_void() into your own code if you like--it's entirely self-contained and reasonably small.  Just make sure to credit, "This module was written by Riskable:" or something like that =)
13*/
14
15/* Creates the shape of a (proper) Cherry MX switch hole.
16    height: The thickness, really.  Doesn't impact PLATE_THICKNESS
17    x_extra: Extra (void) space on the X axis (e.g. to save some plastic). Doesn't change the top plate.
18    y_extra: Extra (void) space on the Y axis.  Same thing as X.
19    tolerance: Extra room on all sides (0.1 default should be good for most printers)
20    plate_thickness: How thick the top plate will be. Typical Cherry MX plates are about 1.5mm thick.
21*/
22module cherry_switch_void(height=12, x_extra=0, y_extra=0, tolerance=0.1, plate_thickness=1.5, corner_radius=0.5) { // Cherry MX body is supposed to be 11.6mm
23    switch_width = 15.6;
24    switch_length = 14; // Slightly shorter because we're making an acurate profile (see below)
25    center_space = 3.5; // Space between the cutouts on the sides of the switch
26    sides_width = (5+center_space); // Taken from the Cherry MX developer PDF
27    // Make the basic switch shape:
28    cube(
29        [switch_length+tolerance, switch_length+tolerance, height],
30        center=true);
31    // Profile for the sides:
32    translate([0,sides_width/2,0])
33        cube([switch_width-tolerance, center_space+tolerance, height], center=true);
34    translate([0,-sides_width/2,0])
35        cube([switch_width-tolerance,center_space+tolerance, height], center=true);
36}
37
38/*
39CHANGELOG:
40    1.1: Now using roundedCube so the interior edges aren't so sharp.
41    1.0: Initial release
42*/