Przeglądaj źródła

add lack light switches

Thomas Buck 3 lat temu
rodzic
commit
9c699b6e67
2 zmienionych plików z 108 dodań i 0 usunięć
  1. 108
    0
      ikea-lack/light-switches.scad
  2. BIN
      ikea-lack/light-switches.stl

+ 108
- 0
ikea-lack/light-switches.scad Wyświetl plik

@@ -0,0 +1,108 @@
1
+mount_width = 40;
2
+mount_height = 35;
3
+mount_wall_depth = 30;
4
+head_dia = 6.0;
5
+head_height = 2.7;
6
+hole_dia = 3.2;
7
+hole_off = 10;
8
+wall = 5;
9
+switch_off = 5;
10
+switch_height_off = 5;
11
+prism_w = 5;
12
+
13
+switch_width = 18.2;
14
+switch_depth = 11.5;
15
+switch_height = 11.0;
16
+switch_top_width = 20.8;
17
+switch_top_depth = 14.8;
18
+switch_top_height = 2.1;
19
+switch_add_negative = 1.0;
20
+
21
+text_top = "2";
22
+text_bottom = "1";
23
+text_font = "Liberation Sans:style=Bold";
24
+text_h = 10;
25
+text_d = 0.5;
26
+text_spacing = 1.0;
27
+text_off = 7.5;
28
+text_top_off = 6;
29
+text_bottom_off = 10.5;
30
+
31
+$fn = 42;
32
+
33
+switches_width = switch_depth * 2 + switch_off;
34
+
35
+module screw(h) {
36
+    translate([0, 0, h - head_height])
37
+    cylinder(d1 = hole_dia, d2 = head_dia, h = head_height);
38
+    
39
+    cylinder(d = hole_dia, h = h - head_height + 0.01);
40
+}
41
+
42
+module prism(l, w, h) {
43
+    polyhedron(
44
+        points = [[0,0,0], [l,0,0], [l,w,0], [0,w,0], [0,w,h], [l,w,h]],
45
+        faces = [[0,1,2,3],[5,4,3,2],[0,4,5,1],[0,3,4],[5,2,1]]
46
+    );
47
+}
48
+
49
+module switch(s = 0) {
50
+    translate([-s / 2, -s / 2, s - switch_height])
51
+    cube([switch_width + s, switch_depth + s, switch_height]);
52
+    
53
+    translate([-(switch_top_width - switch_width) / 2, -(switch_top_depth - switch_depth) / 2, s])
54
+    cube([switch_top_width, switch_top_depth, switch_top_height]);
55
+}
56
+
57
+module light_switches() {
58
+    difference() {
59
+        cube([mount_width, mount_height, wall]);
60
+    
61
+        for (i = [0, switch_off + switch_depth]) {
62
+            translate([i + switch_depth + (mount_width - switches_width) / 2, switch_height_off, wall])
63
+            rotate([0, 0, 90])
64
+            switch(switch_add_negative);
65
+        }
66
+    }
67
+    
68
+    for (i = [0, switch_off + switch_depth]) {
69
+        %translate([i + switch_depth + (mount_width - switches_width) / 2, switch_height_off, wall])
70
+        rotate([0, 0, 90])
71
+        switch();
72
+    }
73
+}
74
+
75
+module mount() {
76
+    
77
+    difference() {
78
+        union() {
79
+            cube([wall, wall + mount_wall_depth, mount_width]);
80
+            
81
+            translate([mount_height + wall, wall, 0])
82
+            rotate([90, -90, 0])
83
+            light_switches();
84
+        }
85
+        
86
+        for (i = [0, switch_depth + switch_off]) {
87
+            translate([-0.01, wall + mount_wall_depth - hole_off, switch_depth + (mount_width - switches_width) / 2 - switch_depth / 2 + i])
88
+            rotate([0, 90, 0])
89
+            screw(wall + 0.02);
90
+        }
91
+        
92
+        translate([text_off, text_d, switch_depth + (mount_width - switches_width) / 2 + text_top_off])
93
+        rotate([90, 0, 0])
94
+        linear_extrude(height = text_d + 0.1)
95
+        text(text_top, font = text_font, size = text_h, spacing = text_spacing, halign = "center");
96
+        
97
+        translate([text_off, text_d, switch_depth + (mount_width - switches_width) / 2 - text_bottom_off])
98
+        rotate([90, 0, 0])
99
+        linear_extrude(height = text_d + 0.1)
100
+        text(text_bottom, font = text_font, size = text_h, spacing = text_spacing, halign = "center");
101
+    }
102
+    
103
+    translate([wall, wall + prism_w, 0])
104
+    rotate([0, -90, 180])
105
+    prism(mount_width, prism_w, prism_w);
106
+}
107
+
108
+mount();

BIN
ikea-lack/light-switches.stl Wyświetl plik


Ładowanie…
Anuluj
Zapisz