]> www.fi.muni.cz Git - things.git/blob - diffuser.scad
firefly q6 case: side hooks
[things.git] / diffuser.scad
1 inner_d = 38;
2 outer_d = 44;
3 wall_thickness = 1.5;
4 diaphragm_thickness = 0.8;
5 cable_thickness = 4;
6
7 base_h = 4;
8 shader_h = 6;
9 holder_h = 16;
10
11 epsilon = 0.01;
12
13 module diaphragm() {
14         cylinder(h=diaphragm_thickness, r = outer_d/2 + wall_thickness-epsilon);
15 };
16
17 module shader() {
18         difference() {
19                 cylinder(r=outer_d/2 + wall_thickness, h = shader_h);
20                 translate([0, 0, -epsilon/2])
21                         cylinder(r1 = outer_d/2+wall_thickness/2, r2=outer_d/2+wall_thickness/2-(2/5)*(outer_d-inner_d),
22                                 h = shader_h + epsilon);
23         };
24 };
25
26 module base() {
27         difference() {
28                 cylinder(r =  outer_d/2 + wall_thickness, h = base_h + epsilon);
29                 translate([0, 0, - epsilon/2])
30                         cylinder(r = inner_d/2, h = base_h + 2*epsilon);
31         };
32 };
33
34 module outer_clip() {
35         difference() {
36                 cylinder(r = outer_d/2 + wall_thickness, h = holder_h-base_h);
37                 translate([0, 0, -epsilon/2])
38                         cylinder(r = outer_d/2, h = holder_h - base_h + epsilon);
39         };
40
41         intersection() {
42                 difference() {
43                         cylinder(r = outer_d/2 + wall_thickness - epsilon, h = holder_h-base_h-epsilon);
44                         translate([-50, -(inner_d-3)/2, -epsilon])
45                                 cube([100, inner_d-3, 100]);
46                 };
47                 rotate_extrude()
48                         translate([outer_d/2+1.5, holder_h-base_h-1, 0])
49                                 circle(r = 2);
50         };
51 };
52
53 module belt_clip() {
54         intersection() { // belt clip arc
55                 difference() {
56                         cylinder(r = outer_d/2 + 2*wall_thickness + cable_thickness, h = shader_h + holder_h);
57                         translate([0, 0, -epsilon/2])
58                                 cylinder(r = outer_d/2 + wall_thickness + cable_thickness, h = shader_h + holder_h + epsilon);
59                 };
60                 translate([0, -6, 0])
61                 cube([outer_d + 4*wall_thickness + 2*cable_thickness + epsilon, 12, shader_h + holder_h]);
62         };
63         difference() { // connect the clip to the body
64                 rotate([0, 0, -10])
65                         translate([outer_d/2-3, 0, 0])
66                         cylinder(r = cable_thickness + 2*wall_thickness + 3, h = shader_h + holder_h);
67                 translate([0, 0, -epsilon/2])
68                         cylinder(r = outer_d/2 + wall_thickness - epsilon, h = shader_h + holder_h + epsilon);
69                 translate([0, -4, -epsilon/2])
70                 cube([outer_d/2 + 2*wall_thickness + cable_thickness + epsilon, 20, holder_h + shader_h + epsilon]);
71
72         };
73         intersection() { // hold the cable in position
74                 rotate([0, 0, 10])
75                 translate([outer_d/2+2*wall_thickness + cable_thickness, 0, 0])
76                 cylinder(r = 2.75, h = shader_h + holder_h);
77                 translate([0, 0, -epsilon/2])
78                         cylinder(r = outer_d/2 + 2*wall_thickness + cable_thickness, h = shader_h + holder_h + epsilon);
79         };
80 };
81
82 module main() {
83         shader();
84         translate([0, 0, shader_h])
85                 color([1, 0.5, 0.5, 0.2]) diaphragm();
86
87         translate([0, 0, shader_h-epsilon])
88                 base();
89
90         translate([0, 0, shader_h+base_h-2*epsilon])
91                 outer_clip();
92
93         belt_clip();
94 };
95
96 main($fn = 128);