diff options
author | Steven <steven.vasilogianis@gmail.com> | 2021-11-13 13:37:35 -0500 |
---|---|---|
committer | Steven <steven.vasilogianis@gmail.com> | 2021-11-13 13:52:39 -0500 |
commit | e8b6466ddfdaadfb44ec550d584696509aea3077 (patch) | |
tree | f021f8199b245e99d6ceae90770bbdea46e0bac7 | |
parent | 7c5ffe4102f62149ba810307790d20e2ecec60ea (diff) |
enforce minimum cubby dimensions
-rw-r--r-- | cubbies.scad | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/cubbies.scad b/cubbies.scad index ea1884d..7a78b71 100644 --- a/cubbies.scad +++ b/cubbies.scad | |||
@@ -49,6 +49,21 @@ if ( part == "both" ) { | |||
49 | female_tabs(cubby_depth, cubby_height); | 49 | female_tabs(cubby_depth, cubby_height); |
50 | } | 50 | } |
51 | 51 | ||
52 | function assert_cubby_width() = | ||
53 | let (min_width = (thickness * 2) + (strut_thickness * 2)) | ||
54 | assert(cubby_width >= min_width, | ||
55 | str("Cubby width must be atleast ", min_width, "mm")); | ||
56 | |||
57 | function assert_cubby_depth() = | ||
58 | let (min_depth = tab_width * 2) | ||
59 | assert(cubby_depth >= min_depth, | ||
60 | str("Cubby width must be atleast ", min_depth, "mm")); | ||
61 | |||
62 | function assert_cubby_height() = | ||
63 | let (min_height = cubby_side_bracket_height()) | ||
64 | assert(cubby_height >= min_height, | ||
65 | str("Cubby width must be atleast ", min_height, "mm")); | ||
66 | |||
52 | function double (x) = x * 2; | 67 | function double (x) = x * 2; |
53 | function half (x) = x / 2; | 68 | function half (x) = x / 2; |
54 | 69 | ||
@@ -60,6 +75,9 @@ module both () { | |||
60 | } | 75 | } |
61 | 76 | ||
62 | module cubby_bottom (width, depth) { | 77 | module cubby_bottom (width, depth) { |
78 | let (_=assert_cubby_width()); | ||
79 | let (_=assert_cubby_depth()); | ||
80 | |||
63 | rot(90) yrot(90) color("blue") bottom_wall() yrot(90) down(tab_height / 2) { | 81 | rot(90) yrot(90) color("blue") bottom_wall() yrot(90) down(tab_height / 2) { |
64 | move_dist=width / 2 + (tab_depth / 2); | 82 | move_dist=width / 2 + (tab_depth / 2); |
65 | fwd(move_dist) | 83 | fwd(move_dist) |
@@ -78,6 +96,9 @@ module cubby_bottom (width, depth) { | |||
78 | /* this calculation needs to be referenced by the view_tab_fit function */ | 96 | /* this calculation needs to be referenced by the view_tab_fit function */ |
79 | function cubby_side_bracket_height() = double(tab_height) + tab_tolerance; | 97 | function cubby_side_bracket_height() = double(tab_height) + tab_tolerance; |
80 | module cubby_side (depth, height, screw_tabs=true) { | 98 | module cubby_side (depth, height, screw_tabs=true) { |
99 | let (_=assert_cubby_depth()); | ||
100 | let (_=assert_cubby_height()); | ||
101 | |||
81 | screw_tab_width=15; | 102 | screw_tab_width=15; |
82 | screw_tab_height=20; | 103 | screw_tab_height=20; |
83 | screw_tab_thickness=thickness; | 104 | screw_tab_thickness=thickness; |