-
Notifications
You must be signed in to change notification settings - Fork 4
/
src-adapter-untested.scad
92 lines (73 loc) · 1.76 KB
/
src-adapter-untested.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
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
base_x = 22.5;
base_y = 13.5;
base_h = 0.8;
base_hole_r = 5.5 / 2;
stem_shift = 5;
stem_cutout_x = 4.1;
stem_cutout_y = 1.5;
stem_cutout_x_margin = 0.7;
stem_h = 5;
rounding_r = 0.5;
epsilon = 0.01;
module base()
{
translate([-base_x / 2, -base_y / 2, 0])
{
intersection()
{
translate([rounding_r, rounding_r, 0]) minkowski()
{
cube([base_x - 2 * rounding_r, base_y - 2 * rounding_r, base_h]);
cylinder(base_h, rounding_r, rounding_r);
}
cube([base_x, base_y, base_h]);
}
}
}
module reinforcements()
{
translate([-base_x / 2 + 1, -base_y / 2, 0])
{
cube([base_x - 2, 1.5, 2]);
}
translate([-base_x / 2 + 1, base_y / 2 - 1.5, 0])
{
cube([base_x - 2, 1.5, 2]);
}
}
module stem_cutout()
{
translate([stem_shift, 0, 0]) union()
{
translate([-stem_cutout_x / 2 -stem_cutout_x_margin / 2, - stem_cutout_y / 2, - epsilon])
{
cube([stem_cutout_x + stem_cutout_x_margin, stem_cutout_y, stem_h + epsilon * 2]);
}
translate([-stem_cutout_y / 2, -stem_cutout_x / 2 -stem_cutout_x_margin / 2, - epsilon])
{
cube([stem_cutout_y, stem_cutout_x + stem_cutout_x_margin, stem_h + epsilon * 2]);
}
}
}
module stem()
{
translate([stem_shift - (stem_cutout_x + stem_cutout_x_margin) / 2 - 0.8, - stem_cutout_x / 2, 0])
{
cube([stem_cutout_x + stem_cutout_x_margin + 1.6, stem_cutout_x, stem_h]);
}
}
module adapter()
{
$fn = 100;
union()
{
base();
reinforcements();
difference()
{
stem();
stem_cutout();
}
}
}
adapter();