acorn: only render threads if thread_height is nonzero
[clinton/3d-models.git] / etc / canister.scad
CommitLineData
acf52db5
CE
1// super simple canister
2// 2018 Clinton Ebadi
3
dd5fa90d
CE
4// incense sticks are ~22cm
5// add a few cm in cap for packaging
6
7inner_d = 25;
8inner_h = 215;
9cap_inner_h = 35; // height inside of cap, above rim of the canister
acf52db5 10cap_overlap = 10;
dd5fa90d 11cap_tolerance = 0.3;
acf52db5
CE
12
13wall = 2;
dd5fa90d
CE
14base = 2;
15sides = 7;
acf52db5
CE
16
17
18// calculated
19outer_d = inner_d + wall*2;
dd5fa90d 20outer_h = inner_h + base;
acf52db5 21
dd5fa90d
CE
22cap_outer_d = outer_d + wall*2 + cap_tolerance;
23cap_outer_h = cap_inner_h + cap_overlap + base;
acf52db5 24
dd5fa90d
CE
25cap_bump_size = 0.75;
26cap_bump_h = 3;
27cap_bump_offset = 3;
acf52db5
CE
28
29echo (cap_bump_offset);
30
31
32// other asserts, if I care enough...
dd5fa90d
CE
33//assert (cap_inner_h > cap_overlap);
34//assert (cap_outer_h - cap_bump_offset > base);
acf52db5
CE
35
36
37//$fa = 0.1;
38//$fs = 0.1;
39
40canister_base ();
dd5fa90d
CE
41translate ([cap_outer_d + 1, 0, 0]) canister_cap ();
42//#translate ([0, 0, outer_h + cap_inner_h + base]) rotate ([0, 180, 180]) canister_cap ();
acf52db5
CE
43
44//cap_bump ();
45
dd5fa90d 46module cap_bump (cap_bump_size=cap_bump_size, cap_bump_h=cap_bump_h) {
acf52db5
CE
47 cap_bump_d = outer_d+cap_bump_size/2;
48 hull () {
49 translate ([0, 0, 0])
50 cylinder (d = cap_bump_d, h = cap_bump_h/3, $fn = sides);
51 translate ([0, 0, cap_bump_h/3])
52 cylinder (d = cap_bump_d + cap_bump_size, h = cap_bump_h/3, $fn = sides);
53 translate ([0, 0, cap_bump_h/3*2])
54 cylinder (d = cap_bump_d, h = cap_bump_h/3, $fn = sides);
55 }
acf52db5
CE
56}
57
58module canister_base () {
59 difference () {
60 union () {
61 cylinder (d = outer_d, h = outer_h, $fn = sides);
62 translate ([0, 0, outer_h - cap_overlap + cap_bump_offset]) cap_bump ();
dd5fa90d 63 translate ([0, 0, outer_h - cap_overlap - cap_bump_h - 0.2]) cap_bump (cap_bump_size = wall);
acf52db5
CE
64 }
65 translate ([0, 0, base]) cylinder (d = inner_d, h = outer_h + 1, $fn = sides);
66 }
67}
68
69module canister_cap () {
dd5fa90d 70 tolerance_pct = 1.00;
acf52db5
CE
71 difference () {
72 cylinder (d = cap_outer_d, h = cap_outer_h, $fn = sides);
73 translate ([0, 0, base]) cylinder (d = outer_d + cap_tolerance, h = cap_outer_h+1, $fn = sides);
dd5fa90d 74 translate ([0, 0, cap_outer_h - cap_bump_offset - cap_bump_h]) scale ([tolerance_pct, tolerance_pct, tolerance_pct]) rotate ([0, 0, 0]) cap_bump ();
acf52db5
CE
75 }
76}