Browse Source

add universal dual-color sign

Thomas Buck 2 years ago
parent
commit
d905a36535

+ 60
- 0
Universal Sign/rounded.scad View File

@@ -0,0 +1,60 @@
1
+
2
+
3
+module rounded_cube(x, y, z, rx=fillet, ry=fillet, rz=fillet, noback=true, nobottom=false, notop=false) {
4
+    $fs = 0.15;
5
+    union() {
6
+        
7
+        if (rx == ry && ry == rz) {
8
+             minkowski() {
9
+                translate([rx, rx, rx])cube([x-rx*2, y-rx*2, z-rx*2]);                
10
+                sphere(r = rx);
11
+            }           
12
+        } else {
13
+            minkowski() {
14
+                translate([rz+ry, rz+rx, rz+ry])cube([x-rz*2-ry*2, y-rz*2-rx*2, z-rx*2-ry*2]);
15
+                cylinder(r = rz, h = 0.01);
16
+                rotate ([0, 90, 0]) cylinder(r = rx, h = 0.01);
17
+                rotate ([90, 0, 0]) cylinder(r = ry, h = 0.01);
18
+            }
19
+        }
20
+        
21
+        if (noback) {
22
+            minkowski() {
23
+                translate([ry, y/2, ry])cube([x-ry*2, y/2, z-ry*2]);
24
+                rotate ([90, 0, 0]) cylinder(r = ry, h = 0.01);
25
+            }
26
+        }
27
+        
28
+        if (nobottom) {
29
+            minkowski() {
30
+                translate([rz, rz, 0])cube([x-rz*2, y-rz*2, z/2]);
31
+                rotate ([0, 0, 0]) cylinder(r = rz, h = 0.01);
32
+            }
33
+        }
34
+        
35
+        if (notop) {
36
+            minkowski() {
37
+                translate([rz, rz, z/2])cube([x-rz*2, y-rz*2, z/2]);
38
+                rotate ([0, 0, 0]) cylinder(r = rz, h = 0.01);
39
+            }
40
+        }
41
+    }
42
+    
43
+}
44
+
45
+module rounded_cylinder(r, h, rrnd = fillet, rtop = true, rbottom = false, center=false) {
46
+    $fs = 0.15;    
47
+    
48
+    htr = center ? -h/2 : 0;
49
+    translate([0, 0, htr]) union() {        
50
+        minkowski() {
51
+            translate([0,0,rrnd]) cylinder(r=r-rrnd, h=h-rrnd*2);
52
+            sphere(rrnd);
53
+        }
54
+        
55
+        if (!rbottom) 
56
+                translate([0,0,h/2]) cylinder(r=r, h=h/2);
57
+        if (!rtop) 
58
+                translate([0,0,0]) cylinder(r=r, h=h/2);        
59
+    }   
60
+}

+ 144
- 0
Universal Sign/sign.scad View File

@@ -0,0 +1,144 @@
1
+
2
+// ----------------------------------------------------
3
+
4
+/*
5
+sign_width = 86;
6
+sign_length = 20;
7
+text_str = "xythobuz.de";
8
+text_font = "Liberation Sans:style=Bold";
9
+text_size_off = 4;
10
+text_double = false;
11
+sign_base_height = 3;
12
+sign_border_height = 2;
13
+sign_border_width = 3;
14
+fillet = 0.5;
15
+*/
16
+
17
+// ----------------------------------------------------
18
+
19
+
20
+sign_width = 105;
21
+sign_length = 22;
22
+text_str = "xythobuz.de";
23
+text_str2 = "Thomas Buck";
24
+text_font = "Liberation Sans:style=Bold";
25
+text_size_off = 5;
26
+text_double = true;
27
+text_double_off = 11;
28
+sign_base_height = 3;
29
+sign_border_height = 4;
30
+sign_border_width = 3;
31
+fillet = 1.0;
32
+
33
+
34
+// ----------------------------------------------------
35
+
36
+/*
37
+sign_width = 65;
38
+sign_length = 20;
39
+text_str = "Toolbox";
40
+text_font = "Liberation Sans:style=Bold";
41
+text_size_off = 3;
42
+text_double = false;
43
+sign_base_height = 3;
44
+sign_border_height = 2;
45
+sign_border_width = 3;
46
+fillet = 0.5;
47
+*/
48
+
49
+// ----------------------------------------------------
50
+
51
+/*
52
+sign_width = 80;
53
+sign_length = 20;
54
+text_str = "Toolbox";
55
+text_str2 = "Bodensee";
56
+text_font = "Liberation Sans:style=Bold";
57
+text_size_off = 3;
58
+text_double = true;
59
+text_double_off = 13;
60
+sign_base_height = 3;
61
+sign_border_height = 2;
62
+sign_border_width = 3;
63
+fillet = 0.5;
64
+*/
65
+
66
+// ----------------------------------------------------
67
+
68
+draw_bottom = true;
69
+draw_walls = true;
70
+draw_text = false;
71
+
72
+color_base = "grey";
73
+color_walls = "grey";
74
+color_text = "white";
75
+
76
+// ----------------------------------------------------
77
+
78
+text_size = sign_length - (2 * sign_border_width) - text_size_off;
79
+
80
+include <rounded.scad>
81
+
82
+// ----------------------------------------------------
83
+
84
+if (draw_bottom) {
85
+    if (text_double) {
86
+        // base
87
+        color(color_base)
88
+        rounded_cube(sign_width, sign_length + text_double_off, sign_base_height, fillet, fillet, fillet, false, true, true);
89
+    } else {
90
+        // base
91
+        color(color_base)
92
+        rounded_cube(sign_width, sign_length, sign_base_height, fillet, fillet, fillet, false, true, true);
93
+    }
94
+}
95
+
96
+if (draw_walls) {
97
+    // top walls
98
+    color(color_walls)
99
+    translate([0, 0, sign_base_height])
100
+    difference() {
101
+        union() {
102
+            rounded_cube(sign_width, sign_border_width, sign_border_height, fillet, fillet, fillet, false, true, false);
103
+            
104
+            if (text_double) {
105
+                rounded_cube(sign_border_width, sign_length + text_double_off, sign_border_height, fillet, fillet, fillet, false, true, false);
106
+                
107
+                translate([sign_width - sign_border_width, 0, 0])
108
+                rounded_cube(sign_border_width, sign_length + text_double_off, sign_border_height, fillet, fillet, fillet, false, true, false);
109
+                
110
+                translate([0, sign_length + text_double_off - sign_border_width, 0])
111
+                rounded_cube(sign_width, sign_border_width, sign_border_height, fillet, fillet, fillet, false, true, false);
112
+            } else {
113
+                rounded_cube(sign_border_width, sign_length, sign_border_height, fillet, fillet, fillet, false, true, false);
114
+                
115
+                translate([sign_width - sign_border_width, 0, 0])
116
+                rounded_cube(sign_border_width, sign_length, sign_border_height, fillet, fillet, fillet, false, true, false);
117
+                
118
+                translate([0, sign_length - sign_border_width, 0])
119
+                rounded_cube(sign_width, sign_border_width, sign_border_height, fillet, fillet, fillet, false, true, false);
120
+            }
121
+        }
122
+    }
123
+}
124
+
125
+if (draw_text) {
126
+    if (text_double) {
127
+        // text
128
+        color(color_text)
129
+        translate([sign_width / 2, sign_length / 2 + text_double_off, sign_base_height])
130
+            linear_extrude(height = sign_border_height)
131
+            text(text = text_str, font = text_font, size = text_size, valign = "center", halign = "center");
132
+        
133
+        color(color_text)
134
+        translate([sign_width / 2, sign_length / 2, sign_base_height])
135
+            linear_extrude(height = sign_border_height)
136
+            text(text = text_str2, font = text_font, size = text_size, valign = "center", halign = "center");
137
+    } else {
138
+        // text
139
+        color(color_text)
140
+        translate([sign_width / 2, sign_length / 2, sign_base_height])
141
+            linear_extrude(height = sign_border_height)
142
+            text(text = text_str, font = text_font, size = text_size, valign = "center", halign = "center");
143
+    }
144
+}

+ 2718
- 0
Universal Sign/sign_toolbox_bottom.stl
File diff suppressed because it is too large
View File


+ 7394
- 0
Universal Sign/sign_toolbox_top.stl
File diff suppressed because it is too large
View File


+ 4510
- 0
Universal Sign/sign_xythobuz_thomas_bottom.stl
File diff suppressed because it is too large
View File


+ 29122
- 0
Universal Sign/sign_xythobuz_thomas_top.stl
File diff suppressed because it is too large
View File


Loading…
Cancel
Save