diff options
author | Steven <steven.vasilogianis@gmail.com> | 2021-05-03 18:54:49 -0400 |
---|---|---|
committer | Steven <steven.vasilogianis@gmail.com> | 2021-05-03 18:54:49 -0400 |
commit | daa7b057232227345c9be514ef701f05979b15ba (patch) | |
tree | 52424933ea58c17f8b21ff3c742764a807eb0d71 | |
parent | 741759865fef3ba9fb1f8f2d6d169d44dbb958a9 (diff) |
add male and female tabs to objects
-rw-r--r-- | tabs.scad | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/tabs.scad b/tabs.scad new file mode 100644 index 0000000..dc8494b --- /dev/null +++ b/tabs.scad | |||
@@ -0,0 +1,35 @@ | |||
1 | module tabs ( | ||
2 | distance=100, | ||
3 | tab_width=10, | ||
4 | tab_depth=5, | ||
5 | tab_height=5, | ||
6 | male=true, | ||
7 | tolerance=1, | ||
8 | edge_padding=0, | ||
9 | between=false | ||
10 | ) { | ||
11 | tab_line() children(); | ||
12 | |||
13 | module tab () { | ||
14 | size=male | ||
15 | ? [tab_width, tab_depth, tab_height] | ||
16 | : [tab_width + tolerance, tab_depth + tolerance, tab_height + tolerance]; | ||
17 | move_dist = male ? 0 : (tolerance / 2); | ||
18 | if (male) { | ||
19 | #cuboid(size); | ||
20 | } else { | ||
21 | cuboid(size); | ||
22 | } | ||
23 | } | ||
24 | |||
25 | module tab_line () { | ||
26 | tab_spacing = tab_spacing(tab_width); | ||
27 | dist = between ? (distance - tab_spacing - tab_width) : distance - tab_width; | ||
28 | start=(dist / (-2)) + edge_padding + (tab_width / 2); | ||
29 | |||
30 | echo([start:tab_spacing:dist / 2]); | ||
31 | for ( i = [start:tab_spacing:dist / 2] ) { | ||
32 | right(i) tab(); | ||
33 | } | ||
34 | } | ||
35 | } | ||