]> www.fi.muni.cz Git - things.git/blob - 808-glasses-holder.scad
smaller baseplate, higher horn
[things.git] / 808-glasses-holder.scad
1 infty = 100;
2 eps = 0.01;
3
4 wall = 1.5;
5
6 lens_size = 9.2;
7 lens_depth = 3;
8 lens_side = 0.9;
9 lens_up_angle = 0;
10
11 cable_w = 7;
12
13 stem_w = 2.75;
14 slot_l = 8;
15 slot_x_off = 6;
16 slot_angle = 10;
17 slot_y_angle = 10;
18
19 module body() {
20         intersection() {
21                 hull() {
22                         // lens outer body
23                         rotate([lens_up_angle, 0, 0])
24                         translate([-lens_size/2-wall, 0, 0])
25                                 cube([lens_size+2*wall, 2*wall+lens_depth, wall+lens_size/2]);
26                         // stem outer body
27                         rotate([0, 0, slot_angle])
28                         translate([-stem_w-wall-slot_x_off, -slot_l, 0])
29                                 cube([stem_w + 2*wall, slot_l, wall + lens_size/2]);
30                 }
31                 translate([-infty/2, -infty/2, 0])
32                         cube([infty, infty, wall+lens_size/2]);
33         }
34 }
35
36 difference() {
37         body();
38         // lens body
39         rotate([lens_up_angle, 0, 0])
40         translate([-lens_size/2, wall, wall+(wall+lens_depth)*tan(-lens_angle)])
41                 cube([lens_size, lens_depth, lens_size + eps]);
42         // lens front
43         rotate([lens_up_angle, 0, 0])
44         translate([-lens_size/2+lens_side, wall, wall+(wall+lens_depth)*tan(-lens_angle)])
45                 cube([lens_size-2*lens_side, lens_depth+wall+eps, lens_size + wall + 2*eps]);
46         // cable hole
47         translate([-cable_w/2, wall, -eps])
48                 cube([cable_w, lens_depth+wall+eps, lens_size+wall+2*eps]);
49         rotate([0, 0, slot_angle])
50         rotate([0, slot_y_angle, 0])
51         translate([-stem_w-slot_x_off, -infty/2, lens_size/2-1.5-infty])
52                 cube([stem_w, infty, infty]);
53 }