-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbody_dimensions.scad
More file actions
105 lines (80 loc) · 3.55 KB
/
Copy pathbody_dimensions.scad
File metadata and controls
105 lines (80 loc) · 3.55 KB
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
// include
include <common.scad>
include <body_tables.scad>
include <BOSL2/std.scad>
// Sheet 1
KBD_FWD_Y = 13.5;
KBD_FWD_A = 30;
KBD_TOP_A = 13;
KBD_BACK_R = 14;
SCR_FWD_A = 12;
SCR_TOP_X = 182;
// Body height varies from 285.07 (X=182) to 283.64 (X=400),
// but we simplify it a constant 285
SCR_TOP_Y = 285; // custom; Sheet 30, Data List #2 for X=182
// Depth of the model
BODY_BACK_X = 400; // custom
// Default wall thickness
BODY_WALL = 4; // custom
// Calculate missing coordinates
kbd_fwd_x = adj_ang_to_opp(KBD_FWD_Y, KBD_FWD_A);
// echo("kbd_fwd_x", kbd_fwd_x); // 7.79423
// echo("KBD_FWD_Y", KBD_FWD_Y); // 13.5
/* Top back point of the keyboard
kbd_back_x and kbd_back_y are only defined by KBD_FWD_A and KBD_TOP_A
tan(KBD_TOP_A) = (y - KBD_FWD_Y) / (x - kbd_fwd_x)
x * tan(KBD_TOP_A) - kbd_fwd_x * tan(KBD_TOP_A) + KBD_FWD_Y = y
cotan(SCR_FWD_A) = (y - SCR_TOP_Y) / (x - SCR_TOP_X)
x * cotan(SCR_FWD_A) - SCR_TOP_X * cotan(SCR_FWD_A) + SCR_TOP_Y = y
x * tan(KBD_TOP_A) - kbd_fwd_x * tan(KBD_TOP_A) + KBD_FWD_Y =
x * cotan(SCR_FWD_A) - SCR_TOP_X * cotan(SCR_FWD_A) + SCR_TOP_Y
x * tan(KBD_TOP_A) - x * cotan(SCR_FWD_A) =
kbd_fwd_x * tan(KBD_TOP_A) - KBD_FWD_Y - SCR_TOP_X * cotan(SCR_FWD_A) + SCR_TOP_Y
x = (kbd_fwd_x * tan(KBD_TOP_A) - KBD_FWD_Y - SCR_TOP_X * cotan(SCR_FWD_A) + SCR_TOP_Y) / (tan(KBD_TOP_A) - cotan(SCR_FWD_A))
*/
kbd_back_x = (kbd_fwd_x * tan(KBD_TOP_A) - KBD_FWD_Y - SCR_TOP_X * cotan(SCR_FWD_A) + SCR_TOP_Y) / (tan(KBD_TOP_A) - cotan(SCR_FWD_A));
kbd_back_y = kbd_back_x * tan(KBD_TOP_A) - kbd_fwd_x * tan(KBD_TOP_A) + KBD_FWD_Y;
// echo("kbd_back_x", kbd_back_x); // 130.303
// echo("kbd_back_y", kbd_back_y); // 41.7833
// Extend the model to -Y and shorten the front edge to fit a larger keyboard; custom
EXTEND_Y = 6;
EXTEND_KBD_FWD_Y = 1.7;
// Extend forward top corner into -X and -Y:
// - extend model to -Y by EXTEND_Y, which makes keyboard top side extend to -X to keep the same front edge height
// - in addition, also decrease front edge height by EXTEND_KBD_FWD_Y to further extend the model into -X
extend_fwd_top_y = EXTEND_Y + EXTEND_KBD_FWD_Y;
extend_fwd_top_x = ang_opp_to_adj(KBD_TOP_A, extend_fwd_top_y);
// Adjust forward bottom corner to adapt, keeping all angles the same
extend_fwd_bot_y = EXTEND_Y;
extend_fwd_bot_x = extend_fwd_top_x - kbd_fwd_x + ang_adj_to_opp(KBD_FWD_A, KBD_FWD_Y - EXTEND_KBD_FWD_Y);
// Sheet 3, Sheet 19
// The YZ profile is slightly different for different X, see Figure 3 - Figure 16
YZ_TOP_CORNER_R = 20; // Sheet 6, Section AA-AA
// X values for which we have YZ_CURVE_X* tables
YZ_X = [0, 50, 100, 150, 200, 250/*, 300, 350, 400*/];
// Values from Sheet 29, Data List #1 for X values in YZ_X
XZ_CURVE_Y000 = [
258.50000, // X = 0
259.92857, // X = 50
261.11905, // X = 100
262.07143, // X = 150
262.78571, // X = 200
263.26191, // X = 250
// 263.50000, // X = 300
// 263.50000, // X = 350
// 263.29190, // X = 400
];
// Sheet 5
ZX_FWD_CORNER_R = 20; // Sheet 5, Bottom View H-H
// Empirically tuned to match keyboard forward rounded corners to the body sides
KBD_FWD_CORNER_ADJ_BOTTOM_Y = 0.55; // added to XZ_CURVE_Y000[0] when positioning bottom of the corner
KBD_FWD_CORNER_ADJ_TOP_Y = 0.2; // additional shift when positioning top of the corner
// Decorative bezel on certain edges
// Sheet 2, Section AD-AD, Section AE-AE, Section AH-AH
// TODO apply decorative bezel
// - forward top edge of keyboard AD-AD
// - side edges of the keyboard !REF
// - forward top edge of the body AE-AE
// - side edges of the body AH-AH
DEC_BEZEL_HEIGHT = .75;
DEC_BEZEL_R = 1.5;