-
Notifications
You must be signed in to change notification settings - Fork 0
/
CameraGrip.scad
193 lines (125 loc) · 5.66 KB
/
CameraGrip.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
$fn=50;
cam_width = 120.5;
cam_depth = 31.6;
cam_slope = 2;
cam_back_radius = 15;
cam_front_radius = 4;
base_plate_thickness = 6.3; //= tripod screw length + tripod screw head height
handle_height = 47;
handle_depth = 15;
handle_width = 17;
handle_outer_radius = 6;
handle_radius = 2;
tripod_hole_position_x = 57.78; // measured from left side of the camera
tripod_hole_position_y = 15.8; // measured from the camera back
tripod_hole_diameter = 6.2;
tripod_screw_head_diameter = 13.50;
tripod_screw_head_height = 3.7;
hole_tolerance = 1; // will be added to the measured diameters
// Create a hull of two to four circles
// Usage: RoundedCornerPolygon([x1, y1, r1], ..., [x4, y4, r4])
module RoundedCornerPolygon(A=[0, 0, 0], B=[0, 0, 0], C=[0, 0, -1], D=[0, 0, -1]) {
// adapted from http://www.thingiverse.com/thing:9347 {
hull() {
translate([A[0], A[1], 0])
circle(r=A[2]);
translate([B[0], B[1], 0])
circle(r=B[2]);
if (C[2]!=-1) {
translate([C[0], C[1], 0])
circle(r=C[2]);
if (C[2]!=-1) {
translate([D[0], D[1], 0])
circle(r=D[2]);
}
}
}
}
module BasePlate() {
linear_extrude(height=base_plate_thickness)
RoundedCornerPolygon([-(cam_width/2-cam_back_radius), -(cam_depth/2-cam_back_radius), cam_back_radius],
[(cam_width/2-cam_back_radius), -(cam_depth/2-cam_back_radius), cam_back_radius],
[(cam_width/2-cam_front_radius-cam_slope), (cam_depth/2-cam_front_radius), cam_front_radius],
[-(cam_width/2-cam_front_radius-cam_slope), (cam_depth/2-cam_front_radius), cam_front_radius]);
}
module Handle() {
handle_outer_right_corner_x = (cam_width/2-handle_outer_radius-(cam_depth+handle_depth-cam_back_radius-handle_outer_radius)*cam_slope/(cam_depth-cam_back_radius-cam_front_radius));
handle_outer_right_corner_y = cam_depth/2+handle_depth-handle_outer_radius;
handle_outer_left_corner_x = handle_outer_right_corner_x+handle_outer_radius-handle_width+handle_radius;
handle_outer_left_corner_y = cam_depth/2+handle_depth-handle_radius;
handle_inner_right_corner_x = -cam_slope / (cam_depth/2-cam_front_radius) * (cam_depth/2+handle_radius) + cam_width/2-cam_front_radius+handle_radius;//TODO bug
handle_inner_right_corner_y = cam_depth/2+handle_radius;
handle_inner_left_corner_x = handle_outer_left_corner_x;
handle_inner_left_corner_y = handle_inner_right_corner_y;
// handle base
difference() {
union(){
linear_extrude(height=base_plate_thickness)
RoundedCornerPolygon([(cam_width/2-cam_front_radius-cam_slope), (cam_depth/2-cam_front_radius), cam_front_radius],
[handle_outer_right_corner_x, (cam_depth/2+handle_depth-handle_outer_radius), handle_outer_radius],
[handle_outer_left_corner_x, (cam_depth/2+handle_depth-handle_radius), handle_radius],
[handle_inner_left_corner_x, (cam_depth/2-cam_front_radius), handle_radius]);
linear_extrude(height=base_plate_thickness+handle_height-handle_radius)
RoundedCornerPolygon([handle_inner_right_corner_x, handle_inner_right_corner_y, handle_radius],
[handle_outer_right_corner_x, handle_outer_right_corner_y, handle_outer_radius],
[handle_outer_left_corner_x, handle_outer_left_corner_y, handle_radius],
[handle_inner_left_corner_x, handle_inner_left_corner_y, handle_radius]);
linear_extrude(height=base_plate_thickness)
RoundedCornerPolygon([(cam_width/2-cam_front_radius-cam_slope), (cam_depth/2-cam_front_radius), cam_front_radius],
[handle_outer_right_corner_x, (cam_depth/2+handle_depth-handle_outer_radius), handle_outer_radius],
[handle_outer_left_corner_x, (cam_depth/2+handle_depth-handle_radius), handle_radius],
[handle_inner_left_corner_x, (cam_depth/2-cam_front_radius), handle_radius]);
linear_extrude(height=base_plate_thickness+handle_height-handle_radius)
RoundedCornerPolygon([handle_inner_right_corner_x, handle_inner_right_corner_y, handle_radius],
[handle_outer_right_corner_x, handle_outer_right_corner_y, handle_outer_radius],
[handle_outer_left_corner_x, handle_outer_left_corner_y, handle_radius],
[handle_inner_left_corner_x, handle_inner_left_corner_y, handle_radius]);
translate([0, 0, base_plate_thickness+handle_height-handle_radius-.1])
minkowski() {
linear_extrude(height=.1)//minkowski apparently only works on 3D objects...
hull() {
polygon(points=[[handle_inner_left_corner_x, handle_inner_left_corner_y],[handle_inner_right_corner_x, handle_inner_right_corner_y],[handle_outer_left_corner_x, handle_outer_left_corner_y]], paths=[[0,1,2]]);
translate([handle_outer_right_corner_x,
handle_outer_right_corner_y,
0])
circle(r=handle_outer_radius-handle_radius);
}
sphere(r=handle_radius);
}
}
// Cut away excess material from the handle
translate([0, 0, base_plate_thickness])
linear_extrude(height=2*handle_height)
square(size = [cam_width, cam_depth], center = true);
}
}
// function to make simple holes, supports negative depth!
module Hole(diameter, depth, placement=[0, 0, 0]) {
placement_offset=depth < 0? [0, 0, depth] : [0, 0, 0];
translate(placement+placement_offset)
linear_extrude(height=abs(depth))
circle(r=diameter/2);
}
module BasePlateHoles(tolerance = 0) {
center_hole_x = -cam_width/2 + tripod_hole_position_x
;
center_hole_y = -cam_depth/2 + tripod_hole_position_y;
Hole(tripod_hole_diameter+tolerance,
base_plate_thickness,
[center_hole_x, 0, 0]);
Hole(tripod_screw_head_diameter+tolerance,
tripod_screw_head_height,
[center_hole_x, 0, 0]);
}
module BasePlateWithHolesAndHandle() {
// Cut Holes for levers on the bottom of the camera
difference() {
// Join BasePlate and Handle
union() {
BasePlate();
Handle();
}
BasePlateHoles(hole_tolerance);
}
}
BasePlateWithHolesAndHandle();