瀏覽代碼

add double capsule caddy

Thomas Buck 1 年之前
父節點
當前提交
109bdf6b53
共有 1 個檔案被更改,包括 120 行新增0 行删除
  1. 120
    0
      s_und_b/double_capsule_caddy.scad

+ 120
- 0
s_und_b/double_capsule_caddy.scad 查看文件

@@ -0,0 +1,120 @@
1
+include <../../threads.scad>
2
+use <../../knurledFinishLib_v2_1.scad>
3
+
4
+di = 15.0;
5
+do = di + 5.0;
6
+h_capsules = 35.0;
7
+h_finger = 10.0;
8
+h_th_male = 5.0;
9
+h_th_male_add = 2.0;
10
+h_th_female = h_th_male + 2.0;
11
+th_p = 1.5;
12
+th_dia = di + ((do - di) / 2);
13
+h_o_ring = 1.25;
14
+wall_cap = 3.0;
15
+di_cap = di - 3.0;
16
+h_body = h_capsules + 2 * h_th_female;
17
+h_cap = h_finger + h_th_male + h_th_male_add;
18
+
19
+t_top = "FULL FULL ";
20
+t_bot = "EMPTY EMPTY ";
21
+t_len = max(len(t_bot), len(t_top));
22
+t_d = 1.0;
23
+t_off = 5.0;
24
+
25
+cut_for_visualization = true;
26
+$fn = 42;
27
+
28
+// https://openhome.cc/eGossip/OpenSCAD/TextCylinder.html
29
+module text_wrap(t, l) {
30
+    for (i = [0 : l - 1])
31
+    rotate([0, 0, i * 360 / l]) 
32
+    translate([0, do / 2 - t_d, 0]) 
33
+    rotate([90, 0, 180])
34
+    linear_extrude(t_d + 2.0)
35
+    text(t[i],
36
+    font = "Liberation Sans Mono; Style = Bold",
37
+    size = do * 3.141 / l,
38
+    valign = "center", halign = "center");
39
+}
40
+
41
+module body() {
42
+    color("green")
43
+    difference() {
44
+        cylinder(d = do, h = h_body);
45
+        
46
+        translate([0, 0, -1])
47
+        cylinder(d = di, h = h_body + 2);
48
+        
49
+        translate([0, 0, h_capsules + h_th_female])
50
+        metric_thread(diameter=th_dia, pitch=th_p, length=h_th_female, internal=true, leadin=1);
51
+        
52
+        metric_thread(diameter=th_dia, pitch=th_p, length=h_th_female, internal=true, leadin=3);
53
+        
54
+        translate([0, 0, h_body - t_off])
55
+        text_wrap(t_top, len(t_top));
56
+        
57
+        translate([0, 0, t_off])
58
+        rotate([180, 0, 0])
59
+        text_wrap(t_bot, len(t_bot));
60
+    }
61
+}
62
+
63
+module cap() {
64
+    color("orange")
65
+    difference() {
66
+        union() {
67
+            translate([0, 0, h_th_male + h_th_male_add])
68
+            //cylinder(d = do, h = h_finger);
69
+            knurl(k_cyl_hg = h_finger, k_cyl_od = do, knurl_wd = 1, knurl_hg = 1, knurl_dp = 1);
70
+            
71
+            translate([0, 0, h_th_male])
72
+            cylinder(d = di, h = h_th_male_add);
73
+            
74
+            metric_thread(diameter=th_dia, pitch=th_p, length=h_th_male, internal=false);
75
+        }
76
+        
77
+        translate([0, 0, -1])
78
+        cylinder(d = di_cap, h = h_cap + 1 - wall_cap);
79
+    }
80
+    
81
+    %color("blue")
82
+    translate([0, 0, h_th_male + h_th_male_add - h_o_ring])
83
+    difference() {
84
+        cylinder(d = do, h = h_o_ring);
85
+        
86
+        translate([0, 0, -1])
87
+        cylinder(d = di, h = h_o_ring + 2);
88
+    }
89
+}
90
+
91
+module assembly() {
92
+    difference() {
93
+        union() {
94
+            body();
95
+            
96
+            translate([0, 0, h_body - h_th_male - h_th_male_add + h_o_ring])
97
+            cap();
98
+            
99
+            translate([0, 0, h_th_male + h_th_male_add - h_o_ring])
100
+            rotate([180, 0, 0])
101
+            cap();
102
+        }
103
+        
104
+        if (cut_for_visualization)
105
+        translate([-20, 0, -20])
106
+        cube([40, 20, 100]);
107
+    }
108
+}
109
+
110
+module print() {
111
+    body();
112
+    
113
+    for (i = [0 : 1])
114
+    translate([(do + 10) * (i + 1), 0, h_cap])
115
+    rotate([180, 0, 0])
116
+    cap();
117
+}
118
+
119
+//assembly();
120
+print();

Loading…
取消
儲存