From 6cbd9460671d9348d77259c9d11e14e73546f733 Mon Sep 17 00:00:00 2001 From: Steven Date: Wed, 7 Jul 2021 14:06:35 -0400 Subject: Fix bug in calculation of parts placement when displaying both parts --- cubbies.scad | 79 ++++++------------------------------------------------------ 1 file 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) { module position_flat () { rot(90) yrot(90) cubby_bottom(w, d); + gap=5; yrot(180+90) { - down(300) cubby_divider(d, h); - //up(d/2 + h*2) cubby_divider(d, h); + down(((w + h) / 2) + (tab_height * 2) + gap) cubby_divider(d, h); } } } -module print_tab_line (w, d, h, male=true) { - yrot(90) { - if (male) { - cubby_bottom(10, d); - } else { - rot(180) xrot(90) bottom_half(z=(h / -2 + 5)) cubby_divider(d, h); - } - } -} - -module print_single_tab (male=true) { - if (male) { - single_tab(tab_width=tab_width, - tab_depth=tab_depth, - tab_height=tab_height, - male=true, - tolerance=tab_tolerance) - attach(BOTTOM, TOP) - single_tab(tab_width=tab_width*1.5, - tab_depth=tab_depth*1.5, - tab_height=tab_height*1.5, - male=true, - tolerance=tab_tolerance); - } else { - difference() { - single_tab(tab_width=tab_width*1.5, - tab_depth=tab_depth*1.5, - tab_height=tab_height*1.5, - male=false, - tolerance=tab_tolerance); - up((tab_width / 8)) - single_tab(tab_width=tab_width, - tab_depth=tab_depth, - tab_height=tab_height, - male=false, - tolerance=tab_tolerance); - } - } -} - -module view_tab_fit (w, d, h) { - // position for testing tab fit - module position_fit_test (left=true) { - yrot(90) cubby_bottom(w, d); - dist=(w / 2) + (thickness / -2) + tab_depth - 2; - fwd(dist * (left ? 1 : -1)) up((h / 2) + 3) zrot(90) cubby_divider(d, h); - } - - position_fit_test(left=true); - xrot(180) fwd(w*3) up(30) position_fit_test(left=false); -} - - -module add_tabs ( length, male=true, between=false ) { - tab_line(length, - tab_width=tab_width, - tab_depth=tab_depth, - tab_height=tab_height, - tab_padding=tab_padding, - male=male, - tolerance=tab_tolerance, - edge_padding=5, - between=between); -} - -module cubby_divider (depth, height) { - function bracket_height ()=thickness * 2; +module cubby_divider (depth, height, screw_tabs=true) { + function bracket_height() = thickness * 2; screw_tab_width=15; screw_tab_height=20; screw_tab_thickness=thickness; divider_wall() { - position(TOP+FRONT+LEFT) screw_tab(); - up(screw_tab_height) position(BOTTOM+FRONT+LEFT) screw_tab(); + if ( screw_tabs ) { + position(TOP+FRONT+LEFT) screw_tab(); + up(screw_tab_height) position(BOTTOM+FRONT+LEFT) screw_tab(); + } attach(BOTTOM, TOP) zrot(90) tab_bracket(); attach(TOP, BOTTOM) zrot(90) tab_bracket(); } -- cgit v1.2.3