-
Notifications
You must be signed in to change notification settings - Fork 0
/
shared.scad
106 lines (90 loc) · 3.11 KB
/
shared.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
include <variables.scad>;
//tripod_mount_file = "Easy 35 B2 Body.stl";
module SlideInRails(print_tolerance) {
rail_width = 2;
rail_height = 2;
rail_distance_from_edge = - rail_height - 3;
color("red")
translate([0,
0,
rail_distance_from_edge - print_tolerance / 2]) {
translate([0, -rail_width - print_tolerance, 0])
cube(size=[lens_mount_width + print_tolerance,
rail_width + print_tolerance,
rail_height + print_tolerance]);
translate([0, lens_mount_width + print_tolerance, 0])
cube(size=[lens_mount_width + print_tolerance,
rail_width + print_tolerance,
rail_height + print_tolerance]);
}
}
module BackWall() {
color("black")
translate([0,
0,
0])
cube(size=[back_wall_width,
outer_box_size[1],
outer_box_size[2]]);
};
module LightCoverX(print_tolerance) {
color("blue")
translate([lens_mount_width + print_tolerance,
0,
- 2 - print_tolerance])
cube(size=[2 + print_tolerance,
lens_mount_width + print_tolerance,
2 + print_tolerance]);
};
module CameraFrontWithoutLensMount(print_tolerance) {
difference() {
union() {
BackWall();
translate(inner_box_offset - [0, print_tolerance / 2, 0]) {
translate([0, 0, - inner_box_size[2]])
cube(size=inner_box_size
+ [print_tolerance,
print_tolerance,
// No print tolerance on Z axis, because
// one has already been applied on rails.
// Doubling it on Z axis is dangerous
// as could affect flange distance.
0]);
SlideInRails(print_tolerance);
LightCoverX(print_tolerance);
};
}
}
}
rear_lens_cap_file = "E-mount_rear_lenscap.STL";
module CameraFront() {
difference() {
union() {
CameraFrontWithoutLensMount(0);
// Height is ~ 9,00 mm.
translate(inner_box_offset)
import(rear_lens_cap_file);
}
translate(inner_box_offset
+ [lens_mount_width / 2,
lens_mount_width / 2,
0]) {
cylinder(r1 = 21.5, r2 = 21.5, h = 4);
translate([0, 0, -10])
cylinder(r1 = 30, r2 = 22, h = 10);
}
}
}
module CameraBack() {
difference() {
cube(size=outer_box_size);
CameraFrontWithoutLensMount(print_tolerance);
};
}
module CenteredOnBack(size) {
translate(inner_box_offset + [(lens_mount_width - size) / 2,
(lens_mount_width - size) / 2,
-inner_box_size[2] - 2]) {
children();
}
}