-
Notifications
You must be signed in to change notification settings - Fork 5
/
switch-and-keycap-specs.scad
65 lines (54 loc) · 1.8 KB
/
switch-and-keycap-specs.scad
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
mx_keyswitch_length = 13.97;
mx_keyhole_length = 14;
mx_switch_travel = 4.0;
xda_keycap_top_height = 15.0;
xda_keycap_width = 18.11;
xda_keycap_depth = 18.11;
xda_keycap_height = 8.5;
xda_keycap_thickness = 1;
xda_top_width = 13.66;
xda_top_depth = 13.66;
xda_top_corner_radius = 1.16;
xda_bottom_corner_radius = 0.57;
choc_switch_travel = 2.18;
choc_keyhole_length = 13.8;
choc_keycap_width = 17.6;
choc_keycap_depth = 16.6;
choc_keycap_height = 3.4;
choc_keycap_top_height = 9;
sa_keycap_width = 18.42;
sa_keycap_depth = 18.42;
sa_top_width = 12.7;
sa_top_depth = 12.7;
sa_keycap_height = 12.42;
sa_keycap_top_height = sa_keycap_height + 6;
sa_top_corner_radius = 1.16;
sa_bottom_corner_radius = 0.57;
switch_specs = [
[["mx", "keyhole_length"], mx_keyhole_length],
[["choc", "keyhole_length"], choc_keyhole_length],
];
keycap_specs = [
[["xda", "base_width"], xda_keycap_width],
[["xda", "base_depth"], xda_keycap_depth],
[["xda", "top_width"], xda_top_width],
[["xda", "top_depth"], xda_top_depth],
[["xda", "height"], xda_keycap_height],
[["xda", "switch_combined_height"], xda_keycap_top_height],
[["choc", "base_width"], choc_keycap_width],
[["choc", "base_depth"], choc_keycap_depth],
[["choc", "height"], choc_keycap_height],
[["choc", "switch_combined_height"], choc_keycap_top_height],
[["sa", "base_width"], sa_keycap_width],
[["sa", "base_depth"], sa_keycap_depth],
[["sa", "height"], sa_keycap_height],
[["sa", "switch_combined_height"], sa_keycap_top_height],
];
function get_switch_property(type, property) = (
let(index = search([[type, property]], switch_specs))
len(index) == 0 ? undef : switch_specs[index[0]][1]
);
function get_keycap_property(type, property) = (
let(index = search([[type, property]], keycap_specs))
len(index) == 0 ? undef : keycap_specs[index[0]][1]
);