-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.scad
executable file
·406 lines (331 loc) · 13.1 KB
/
main.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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
/*
Generic Action Camera Adapter for 3DR Solo
Copyright (C) 2016 - 2017 Hugh Eaves
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/************************************************
* PART SELECTION
************************************************/
// Select the part you would like to display
part = "adapter"; // [adapter:Adapter,retaining_clip:Retaining clip,back_weight:Back Weight,side_weight:Side Weight]
/********************
* MAIN PARAMETERS *
********************/
// No-name SJ4000 clone
// camera_length = 59.8;
// camera_width = 40.8;
// camera_height = 25.6;
// The values below are for the GitUp Git2P
/* [Adapter Parameters] */
// Length of camera body (side to side)
camera_length = 59.4; // [57:62]
// Width of camera body (top to bottom)
camera_width = 41.1; // [38:42]
// Height of camera body (front to back)
camera_height = 19.6; // [15:40]
// Adapter arm bump size (How far out the "bumps" protrude on the ends of the arms)
adapter_arm_bump_size = 2.5; // [1:5]
/* [Back Weight Parameters] */
// The length of the counterbalance weight on the back of the camera. Larger values make it heavier.
back_weight_length = 29; // [10:40]
// The offset of the weight on the back of the gimbal. Values greater than zero move the weight to the outer side of the gimbal
back_weight_offset = 0; // [0:20]
/* [Side Weight Parameters] */
// The thickness of the side weight, thicker is heavier
side_weight_thickness = 4; // [4:8]
// The length of the side weight, longer is heavier
side_weight_length = 10; // [9:17]
/********************
* OTHER PARAMETERS *
********************/
/* [Hidden] */
/* How much to shift the camera to the right to avoid the curved protrusion from the pitch motor housing */
camera_offset = 3.2;
/* Dimensions of the base of the camera adapter, so that it is a nice snug fit inside the 3DR gimbal mount */
base_height = 8; // (thickness) thick enough to clear the GoPro plug in the back
base_width = 42;
base_length = 60;
/* Dimensions of the small bracket that holds the camera adapter to the gimbal mount */
bracket_width = 9;
bracket_depth = 9.5;
bracket_thickness = 3;
bracket_radius = 2;
/* Typical values for M2 cap-head screws */
screw_thread_diameter = 2.5;
screw_head_diameter = 5;
screw_head_height = 3;
/* Dimensions of the "stud" that the 3DR balancing weights attach to */
stud_height = 2.5;
stud_diameter = 6.4;
stud_hole_diameter = 2;
bottom_lip_width = 4.5;
bottom_lip_height = 2.6;
// cutout for GoPro plug
plug_thickness = 5;
plug_width = 23;
plug_offset = 55.5 - (plug_thickness / 2);
// cutout for right side wall of "gimbal bracket"
side_wall_length = 31;
side_wall_height = 6.4;
side_wall_width = 3;
side_wall_offset = 59.4;
// height of hook on bottom left of "gimbal bracket"
hook_width = 17.6;
hook_height = 2.5; // distance from bottom
hook_length = 4;
hook_thickness = 1;
// width of protrusion on front of "pitch motor"
motor_protrusion_width = 20;
// thickness / length of camera retaining clips
clip_thickness = 1.6;
right_clip_opening_width = 26;
// left_clip_opening_width = motor_protrusion_width;
left_clip_opening_width = right_clip_opening_width;
x_midpoint = base_width / 2;
main_length = camera_length + camera_offset * 2;
camera_gap = (base_width - camera_width) / 2;
camera_height_adjustment = 0;
// more facets for smaller holes
$fn=16;
module lip_cutout() {
cube([bottom_lip_width, base_length, bottom_lip_height]);
translate([0,0,bottom_lip_height])
mirror([1,-1,0])
wedge(base_length, bottom_lip_width, bottom_lip_width, false, false);
}
module side_wall_cutout() {
translate ([0, side_wall_offset, 0]) {
cutout_base_height = side_wall_height - (side_wall_width / 2);
cube([side_wall_length, side_wall_width, cutout_base_height + 0.01]);
translate([0,0,cutout_base_height])
prism (side_wall_length, side_wall_width, side_wall_width / 2- 0.01);
}
}
module hook_cutout() {
translate ([x_midpoint - hook_width/2 ,0,hook_height]) {
cube([hook_width,hook_length,hook_thickness]);
translate([0,0,hook_thickness])
wedge (hook_width, hook_length, hook_length, false);
}
}
module bracket_cutout() {
bracket_clearance = 0.4;
adj_bracket_width = bracket_width + bracket_clearance;
adj_bracket_depth = bracket_depth + bracket_clearance;
translate([base_width - bracket_depth, base_length + bracket_clearance / 2 - adj_bracket_width, 0]) {
translate([-bracket_clearance,0,base_height - bracket_thickness])
cube([adj_bracket_depth,adj_bracket_width,bracket_thickness + 5]);
translate([bracket_depth - bracket_thickness,0,0])
cube([bracket_depth,adj_bracket_width,base_height]);
}
}
module clip_corner(length) {
cube([clip_thickness, length + clip_thickness, length]);
wedge(clip_thickness, length + clip_thickness, length + clip_thickness, false, true);
}
module clip(length) {
cube([base_width,clip_thickness,camera_height]);
translate([-clip_thickness + camera_gap,0,camera_height])
cube([camera_width+clip_thickness*2,clip_thickness,length * 2 + camera_height_adjustment]);
translate ([-clip_thickness + camera_gap, clip_thickness, camera_height + camera_height_adjustment])
mirror([0,1,-1])
prism(camera_width+clip_thickness*2,length*2,length);
// cube([camera_width+clip_thickness*2, length + clip_thickness, clip_thickness ]);
wedge(base_width,camera_offset - clip_thickness,camera_height+ length * 2 + camera_height_adjustment, true, false);
translate([0,0,camera_height + adapter_arm_bump_size + camera_height_adjustment - length]) {
translate([-clip_thickness + camera_gap,0,0]) clip_corner(length);
translate([base_width - camera_gap,0,0]) clip_corner(length);
}
}
module left_clip() {
translate ([0,camera_offset - clip_thickness,base_height]) {
difference() {
clip(adapter_arm_bump_size);
translate ([x_midpoint - left_clip_opening_width / 2,-clip_thickness,2])
cube([left_clip_opening_width,adapter_arm_bump_size + clip_thickness * 2,camera_height+adapter_arm_bump_size*2]);
}
}
}
module right_clip() {
translate ([0,camera_length + camera_offset + clip_thickness,base_height]) {
mirror ([0,1,0]) difference() {
clip(adapter_arm_bump_size);
translate ([x_midpoint - right_clip_opening_width / 2,-clip_thickness,2])
cube([right_clip_opening_width,adapter_arm_bump_size + clip_thickness * 2,camera_height+adapter_arm_bump_size*2]);
}
}
}
module prism(x, y, z, upside_down){
translate([0,y/2,0]) {
wedge(x, y/2, z, true, upside_down);
wedge(x, y/2, z, false, upside_down);
}
}
module wedge(x, y, z, reverse, upside_down){
ly = reverse ? -y : y;
lz = upside_down ? -z : z;
polyhedron(
points=[[0,0,0], [x,0,0], [x,ly,0], [0,ly,0], [0,0,lz], [x,0,lz]],
faces=[[0,1,2,3],[5,4,3,2],[0,4,5,1],[0,3,4],[5,2,1]]
);
}
module weight_stud() {
difference() {
cylinder(d=stud_diameter - 0.4, h=stud_height, $fn=32);
cylinder(d=stud_hole_diameter, h=stud_height, $fn=16);
}
}
/********************************************
* Top level function to render the adapter
********************************************/
module adapter() {
difference () {
cube([base_width, main_length, base_height]);
lip_cutout();
translate([base_width,0,0]) mirror([-1,0,0]) lip_cutout();
side_wall_cutout();
translate ([x_midpoint - plug_width/2, plug_offset ,0])
cube([plug_width, plug_thickness, base_height]);
hook_cutout();
bracket_cutout();
}
left_clip();
right_clip();
}
/********************************************
* Top level function to render the retaining clip
********************************************/
module retaining_clip() {
bracket_inside_height = 11.4 + base_height - bracket_thickness;
difference() {
union() {
hull() {
cube([bracket_width, bracket_thickness, bracket_depth + bracket_thickness - bracket_radius]);
cube([1, bracket_thickness, bracket_depth + bracket_thickness]);
translate([bracket_width - bracket_radius,0,bracket_depth + bracket_thickness - bracket_radius])
mirror ([0,-1,1]) cylinder(r = bracket_radius, h = bracket_thickness);
}
translate([0, bracket_inside_height + bracket_thickness, 0])
cube([bracket_width, bracket_thickness, bracket_depth + bracket_thickness]);
translate([0, bracket_thickness, 0])
cube([bracket_width, bracket_inside_height, bracket_thickness * 2]);
}
translate([bracket_width - 3,bracket_thickness,bracket_thickness - 0.2])
cube([2,bracket_inside_height,bracket_depth]);
translate ([bracket_width - 3.6,0,bracket_depth + bracket_thickness - 2.8])
mirror ([0,-1,1]) {
translate([0,0,-bracket_thickness/2])
cylinder(d = 4, h = bracket_thickness);
translate([0,0,bracket_thickness / 2])
cylinder(d = 2, h = bracket_thickness);
}
}
}
/********************************************
* Top level function to render the back / counterbalance weight
********************************************/
module back_weight() {
thickness = 2;
length = 57.8;
width = 34;
weight_thickness = 100;
intersection() {
difference() {
union() {
cube([length, width, thickness]);
translate([back_weight_offset, 0, -weight_thickness])
cube([back_weight_length, width, weight_thickness]);
translate([12, 0, thickness])
cube([3, width, 3.4]);
translate([33.6, 0, thickness])
cube([3, width, 4]);
translate([54.8, 8, thickness])
cube([3, width - 8, 4]);
translate([36, 0, 0]) {
translate([4.5, 18, -2])
cylinder(d = 5, h = 2);
translate([16.5, 6.75, -2])
cylinder(d = 5, h = 2);
translate([13.5, 27, -2])
cylinder(d = 5, h = 2);
}
}
translate([36, 0, 0]) {
translate([4.5, 18, -90])
cylinder(d = screw_thread_diameter, h = 100);
translate([16.5, 6.75, -90])
cylinder(d = screw_thread_diameter, h = 100);
translate([13.5, 27, -90])
cylinder(d = screw_thread_diameter, h = 100);
}
}
mirror([-1, 0, 1])
translate([26, width / 2, 0]) {
cylinder(d = 77, h = 14, $fn = 64);
translate([0, 0, 14])
cylinder(d = 70, h = 16, $fn = 64);
translate([0, 0, 30])
cylinder(d = 77, h = 100, $fn = 64);
}
}
}
module curve_cutout(beam_curve_diameter, beam_thickness) {
difference() {
cylinder(d = beam_curve_diameter, h = 100, $fn = 64);
cylinder(d = beam_curve_diameter - (beam_thickness * 2), h = 100, $fn = 64);
}
}
/********************************************
* Top level function to render the side weight
********************************************/
module side_weight() {
side_weight_width = 2;
beam_curve_diameter = 34;
beam_thickness = 1.2;
beam_height = 4;
beam_width = 5.7;
beam_length = beam_curve_diameter / 2;
bracket_length = beam_length;
bracket_width = beam_width + side_weight_width + beam_thickness;
bracket_height = beam_height + side_weight_thickness;
bracket_depth = 3;
difference() {
union() {
difference() {
cube([bracket_length, bracket_width, bracket_height]);
translate([0, beam_curve_diameter / 2 + side_weight_width, side_weight_thickness])
curve_cutout(beam_curve_diameter, beam_thickness);
translate([bracket_length - screw_head_diameter / 2- 1,bracket_width / 2 - 1, 0]){
cylinder(d = screw_head_diameter, h = screw_head_height);
cylinder(d = screw_thread_diameter, h = bracket_height);
}
}
translate([-side_weight_length, 0, 0])
difference() {
cube([side_weight_length, bracket_width, bracket_height]);
translate([0, side_weight_width, side_weight_thickness])
cube([side_weight_length, beam_thickness, 100]);
}
}
}
}
// Call the top level rendering function based on "part"
if (part == "adapter") {
adapter();
} else if (part == "back_weight") {
back_weight();
} else if (part == "retaining_clip") {
retaining_clip();
} else if (part == "side_weight") {
side_weight();
translate([0,20,0]) mirror([1,0,0]) side_weight();
}