|
@@ -0,0 +1,198 @@
|
|
1
|
+$fn = 100;
|
|
2
|
+
|
|
3
|
+base = 35;
|
|
4
|
+body = 20;
|
|
5
|
+
|
|
6
|
+module rc(a, b, c, r, to) {
|
|
7
|
+ hull() {
|
|
8
|
+ if (to)
|
|
9
|
+ translate([0, 0, r])
|
|
10
|
+ cube([a, b, c - r * 2]);
|
|
11
|
+ else
|
|
12
|
+ cube([a, b, c - r]);
|
|
13
|
+
|
|
14
|
+ for (y = [r, b - r])
|
|
15
|
+ translate([0, y, c - r])
|
|
16
|
+ rotate([0, 90, 0])
|
|
17
|
+ cylinder(r = r, h = a);
|
|
18
|
+
|
|
19
|
+ if (to)
|
|
20
|
+ for (y = [r, b - r])
|
|
21
|
+ translate([0, y, r])
|
|
22
|
+ rotate([0, 90, 0])
|
|
23
|
+ cylinder(r = r, h = a);
|
|
24
|
+ }
|
|
25
|
+}
|
|
26
|
+
|
|
27
|
+module stem() {
|
|
28
|
+ translate([-152, 36, 0])
|
|
29
|
+ cube([106, 4, 2]);
|
|
30
|
+
|
|
31
|
+ hull() {
|
|
32
|
+ #translate([-34.5, 10, 0])
|
|
33
|
+ cube([4.5, 0.1, 2]);
|
|
34
|
+
|
|
35
|
+ #translate([-50, 39.9, 0])
|
|
36
|
+ cube([4, 0.1, 2]);
|
|
37
|
+ }
|
|
38
|
+}
|
|
39
|
+
|
|
40
|
+// https://www.thingiverse.com/thing:776622
|
|
41
|
+module glasses() {
|
|
42
|
+ f = body / 122;
|
|
43
|
+
|
|
44
|
+ scale([f, f, f])
|
|
45
|
+ translate([0, -61, -40])
|
|
46
|
+ union() {
|
|
47
|
+ translate([-10, -24, -20])
|
|
48
|
+ rotate([90, 0, -90])
|
|
49
|
+ import("dealwithit_main_hole.stl");
|
|
50
|
+
|
|
51
|
+ for (y = [0, 124])
|
|
52
|
+ rotate([90, 0, 0])
|
|
53
|
+ translate([138, 0, -y])
|
|
54
|
+ //import("dealwithit_stem.stl");
|
|
55
|
+ stem();
|
|
56
|
+ }
|
|
57
|
+}
|
|
58
|
+
|
|
59
|
+// https://openhome.cc/eGossip/OpenSCAD/SectorArc.html
|
|
60
|
+module sector(radius, angles, fn = $fn) {
|
|
61
|
+ r = radius / cos(180 / fn);
|
|
62
|
+ step = -360 / fn;
|
|
63
|
+
|
|
64
|
+ points = concat([[0, 0]],
|
|
65
|
+ [for(a = [angles[0] : step : angles[1] - 360])
|
|
66
|
+ [r * cos(a), r * sin(a)]
|
|
67
|
+ ],
|
|
68
|
+ [[r * cos(angles[1]), r * sin(angles[1])]]
|
|
69
|
+ );
|
|
70
|
+
|
|
71
|
+ difference() {
|
|
72
|
+ circle(radius, $fn = fn);
|
|
73
|
+ polygon(points);
|
|
74
|
+ }
|
|
75
|
+}
|
|
76
|
+module arc(radius, angles, width = 1, fn = $fn) {
|
|
77
|
+ difference() {
|
|
78
|
+ sector(radius + width, angles, fn);
|
|
79
|
+ sector(radius, angles, fn);
|
|
80
|
+ }
|
|
81
|
+}
|
|
82
|
+
|
|
83
|
+module glas() {
|
|
84
|
+ difference() {
|
|
85
|
+ cylinder(d1 = 9, d2 = 12, h = 20);
|
|
86
|
+
|
|
87
|
+ translate([0, 0, 1])
|
|
88
|
+ scale([0.8, 0.8, 1.1])
|
|
89
|
+ cylinder(d1 = 9, d2 = 12, h = 20);
|
|
90
|
+ }
|
|
91
|
+}
|
|
92
|
+
|
|
93
|
+module gripper() {
|
|
94
|
+ difference() {
|
|
95
|
+ cylinder(d = 12, h = 3);
|
|
96
|
+
|
|
97
|
+ translate([-20, -10, -10])
|
|
98
|
+ cube([20, 20, 20]);
|
|
99
|
+
|
|
100
|
+ translate([0, 0, -1])
|
|
101
|
+ cylinder(d = 5.5, h = 5);
|
|
102
|
+ }
|
|
103
|
+}
|
|
104
|
+
|
|
105
|
+module arm() {
|
|
106
|
+ hull() {
|
|
107
|
+ translate([5, 0, -5.5])
|
|
108
|
+ rotate([0, 90, 0])
|
|
109
|
+ cylinder(d = 5, h = 1);
|
|
110
|
+
|
|
111
|
+ translate([15, -5, -10])
|
|
112
|
+ rotate([0, 90, -45])
|
|
113
|
+ cylinder(d = 5, h = 1);
|
|
114
|
+ }
|
|
115
|
+ hull() {
|
|
116
|
+ translate([15, -5, -10])
|
|
117
|
+ rotate([0, 90, -45])
|
|
118
|
+ cylinder(d = 5, h = 1);
|
|
119
|
+
|
|
120
|
+ translate([22, -15, 0])
|
|
121
|
+ rotate([0, 90, -90])
|
|
122
|
+ cylinder(d = 5, h = 1);
|
|
123
|
+ }
|
|
124
|
+
|
|
125
|
+ translate([0, 0, -7])
|
|
126
|
+ gripper();
|
|
127
|
+
|
|
128
|
+ // glass
|
|
129
|
+ rotate([180, 0, 0])
|
|
130
|
+ scale(0.6)
|
|
131
|
+ glas();
|
|
132
|
+}
|
|
133
|
+
|
|
134
|
+module marvin() {
|
|
135
|
+ // base
|
|
136
|
+ color("green")
|
|
137
|
+ hull() {
|
|
138
|
+ translate([0, 0, 10])
|
|
139
|
+ rotate([0, 90, 0])
|
|
140
|
+ rc(10, base, base, 3, true);
|
|
141
|
+
|
|
142
|
+ translate([(base - body) / 2, (base - body) / 2, 15])
|
|
143
|
+ cube([body, body, 1]);
|
|
144
|
+ }
|
|
145
|
+
|
|
146
|
+ // feet
|
|
147
|
+ color("blue")
|
|
148
|
+ for (x = [3, base - 3])
|
|
149
|
+ for (y = [3, base - 3])
|
|
150
|
+ translate([x, y, 0])
|
|
151
|
+ sphere(r = 3);
|
|
152
|
+
|
|
153
|
+ // body
|
|
154
|
+ translate([(base - body) / 2, (base - body) / 2, 15]) {
|
|
155
|
+ difference() {
|
|
156
|
+ rc(body, body, 40, 2, false);
|
|
157
|
+
|
|
158
|
+ // face
|
|
159
|
+ translate([-1, 2.5, 25.5])
|
|
160
|
+ rc(2, 15, 12, 2, true);
|
|
161
|
+ }
|
|
162
|
+
|
|
163
|
+ // mouth
|
|
164
|
+ color("yellow")
|
|
165
|
+ translate([-1, 2.5, 25.5])
|
|
166
|
+ translate([2.5, 4, 0])
|
|
167
|
+ rotate([0, -90, 0])
|
|
168
|
+ rotate([0, 0, -50])
|
|
169
|
+ linear_extrude(1.7)
|
|
170
|
+ arc(3, [10, 120], 1);
|
|
171
|
+ }
|
|
172
|
+
|
|
173
|
+ // arm
|
|
174
|
+ translate([-2, 42, -3]) {
|
|
175
|
+ translate([0, 0, 40])
|
|
176
|
+ arm();
|
|
177
|
+
|
|
178
|
+ //%cylinder(d = 0.2, h = 40);
|
|
179
|
+
|
|
180
|
+ // puddle
|
|
181
|
+ //cylinder(d = 10, h = 0.5);
|
|
182
|
+
|
|
183
|
+ // TODO ice cubes
|
|
184
|
+ }
|
|
185
|
+
|
|
186
|
+ // glasses
|
|
187
|
+ color("black")
|
|
188
|
+ translate([base / 2 - 8.3, base / 2, 50.5])
|
|
189
|
+ glasses();
|
|
190
|
+
|
|
191
|
+ // lamp
|
|
192
|
+ color("red")
|
|
193
|
+ translate([base / 2, base / 2, 55])
|
|
194
|
+ sphere(r = 2);
|
|
195
|
+}
|
|
196
|
+
|
|
197
|
+translate([0, 0, 3])
|
|
198
|
+marvin();
|