diff options
author | Steven <steven.vasilogianis@gmail.com> | 2021-07-07 14:06:35 -0400 |
---|---|---|
committer | Steven <steven.vasilogianis@gmail.com> | 2021-07-07 14:06:35 -0400 |
commit | 6cbd9460671d9348d77259c9d11e14e73546f733 (patch) | |
tree | 21c0c4014cbfcc84653b0c799d8c695d429b6be7 | |
parent | f9d14bc27e8ede588d7f29803ec1479247ade6e3 (diff) |
Fix bug in calculation of parts placement when displaying both parts
-rw-r--r-- | cubbies.scad | 79 |
1 files changed, 8 insertions, 71 deletions
diff --git a/cubbies.scad b/cubbies.scad index accfdef..fdd4eb8 100644 --- a/cubbies.scad +++ b/cubbies.scad | |||
@@ -49,87 +49,24 @@ module cubby (w, d, h) { | |||
49 | 49 | ||
50 | module position_flat () { | 50 | module position_flat () { |
51 | rot(90) yrot(90) cubby_bottom(w, d); | 51 | rot(90) yrot(90) cubby_bottom(w, d); |
52 | gap=5; | ||
52 | yrot(180+90) { | 53 | yrot(180+90) { |
53 | down(300) cubby_divider(d, h); | 54 | down(((w + h) / 2) + (tab_height * 2) + gap) cubby_divider(d, h); |
54 | //up(d/2 + h*2) cubby_divider(d, h); | ||
55 | } | 55 | } |
56 | } | 56 | } |
57 | } | 57 | } |
58 | 58 | ||
59 | module print_tab_line (w, d, h, male=true) { | 59 | module cubby_divider (depth, height, screw_tabs=true) { |
60 | yrot(90) { | 60 | function bracket_height() = thickness * 2; |
61 | if (male) { | ||
62 | cubby_bottom(10, d); | ||
63 | } else { | ||
64 | rot(180) xrot(90) bottom_half(z=(h / -2 + 5)) cubby_divider(d, h); | ||
65 | } | ||
66 | } | ||
67 | } | ||
68 | |||
69 | module print_single_tab (male=true) { | ||
70 | if (male) { | ||
71 | single_tab(tab_width=tab_width, | ||
72 | tab_depth=tab_depth, | ||
73 | tab_height=tab_height, | ||
74 | male=true, | ||
75 | tolerance=tab_tolerance) | ||
76 | attach(BOTTOM, TOP) | ||
77 | single_tab(tab_width=tab_width*1.5, | ||
78 | tab_depth=tab_depth*1.5, | ||
79 | tab_height=tab_height*1.5, | ||
80 | male=true, | ||
81 | tolerance=tab_tolerance); | ||
82 | } else { | ||
83 | difference() { | ||
84 | single_tab(tab_width=tab_width*1.5, | ||
85 | tab_depth=tab_depth*1.5, | ||
86 | tab_height=tab_height*1.5, | ||
87 | male=false, | ||
88 | tolerance=tab_tolerance); | ||
89 | up((tab_width / 8)) | ||
90 | single_tab(tab_width=tab_width, | ||
91 | tab_depth=tab_depth, | ||
92 | tab_height=tab_height, | ||
93 | male=false, | ||
94 | tolerance=tab_tolerance); | ||
95 | } | ||
96 | } | ||
97 | } | ||
98 | |||
99 | module view_tab_fit (w, d, h) { | ||
100 | // position for testing tab fit | ||
101 | module position_fit_test (left=true) { | ||
102 | yrot(90) cubby_bottom(w, d); | ||
103 | dist=(w / 2) + (thickness / -2) + tab_depth - 2; | ||
104 | fwd(dist * (left ? 1 : -1)) up((h / 2) + 3) zrot(90) cubby_divider(d, h); | ||
105 | } | ||
106 | |||
107 | position_fit_test(left=true); | ||
108 | xrot(180) fwd(w*3) up(30) position_fit_test(left=false); | ||
109 | } | ||
110 | |||
111 | |||
112 | module add_tabs ( length, male=true, between=false ) { | ||
113 | tab_line(length, | ||
114 | tab_width=tab_width, | ||
115 | tab_depth=tab_depth, | ||
116 | tab_height=tab_height, | ||
117 | tab_padding=tab_padding, | ||
118 | male=male, | ||
119 | tolerance=tab_tolerance, | ||
120 | edge_padding=5, | ||
121 | between=between); | ||
122 | } | ||
123 | |||
124 | module cubby_divider (depth, height) { | ||
125 | function bracket_height ()=thickness * 2; | ||
126 | screw_tab_width=15; | 61 | screw_tab_width=15; |
127 | screw_tab_height=20; | 62 | screw_tab_height=20; |
128 | screw_tab_thickness=thickness; | 63 | screw_tab_thickness=thickness; |
129 | 64 | ||
130 | divider_wall() { | 65 | divider_wall() { |
131 | position(TOP+FRONT+LEFT) screw_tab(); | 66 | if ( screw_tabs ) { |
132 | up(screw_tab_height) position(BOTTOM+FRONT+LEFT) screw_tab(); | 67 | position(TOP+FRONT+LEFT) screw_tab(); |
68 | up(screw_tab_height) position(BOTTOM+FRONT+LEFT) screw_tab(); | ||
69 | } | ||
133 | attach(BOTTOM, TOP) zrot(90) tab_bracket(); | 70 | attach(BOTTOM, TOP) zrot(90) tab_bracket(); |
134 | attach(TOP, BOTTOM) zrot(90) tab_bracket(); | 71 | attach(TOP, BOTTOM) zrot(90) tab_bracket(); |
135 | } | 72 | } |