mead-horn: note dependency on dotscad
[clinton/3d-models.git] / etc / shelving-foot.scad
1 // super simple feet for metal shelving
2 // Created 2017 Clinton Ebadi <clinton@unknownlamer.org>
3
4 // Released under the https://wiki.creativecommons.org/wiki/CC0
5 // To the extent possible under law, Clinton Ebadi has waived all
6 // copyright and related or neighboring rights to super simple feet
7 // for metal shelving.
8
9
10 // preview[view:east, tilt:top diagonal]
11
12 // Length of slot for shelving leg
13 slot_length = 32;
14 // Thickness of slot for shelving leg
15 slot_thickness = 1.8;
16
17 // Thickness of wall around slot
18 wall_thickness = 3;
19
20 // Depth of the base foot
21 base_depth = 4;
22 // Depth of the slot and walls around the length
23 slot_depth = 20;
24 // Offset for leg slot into the base
25 slot_offset = -1;
26 // Enable/disable base
27 base_enabled = true;
28
29 $fs = 0.1;
30
31 foot ();
32
33 module base () {
34 side = slot_length + slot_thickness/2;
35 if (base_enabled) {
36 offset (r = wall_thickness) polygon ([ [0, 0], [ side , 0], [0, side] ]);
37 } else {
38 walls ();
39 }
40 }
41
42 module walls () {
43 intersection () {
44 offset (r = wall_thickness) {
45 square ([slot_thickness, slot_length + slot_thickness/2]);
46 square ([slot_length + slot_thickness/2, slot_thickness]);
47 }
48 if (base_enabled) { base (); }
49 }
50 }
51
52 module slot () {
53 square ([slot_thickness, slot_length]);
54 square ([slot_length, slot_thickness]);
55
56 // tiny chamfer around bend
57 x = 2;
58 polygon ([ [0, 0], [ slot_thickness*2+x/2, 0], [0, slot_thickness*2+x/2] ]);
59 }
60
61
62 module foot () {
63 difference () {
64 union () {
65 linear_extrude (base_depth) base ();
66 translate ([0, 0, base_depth+slot_offset]) linear_extrude (slot_depth+slot_offset) walls ();
67 }
68 translate ([0, 0, base_depth+slot_offset]) linear_extrude (slot_depth+slot_offset+0.1) slot ();
69 }
70 }