diff --git a/tests/sk_brackets.scad b/tests/sk_brackets.scad index 9c8d02e..aa19505 100644 --- a/tests/sk_brackets.scad +++ b/tests/sk_brackets.scad @@ -20,12 +20,19 @@ include <../core.scad> use <../utils/layout.scad> include <../vitamins/sk_brackets.scad> +include <../vitamins/extrusions.scad> module sk_brackets() { - screws = [M5_cap_screw, M5_cap_screw, M4_cap_screw, M5_cap_screw]; - nuts = [undef, M5_nut, M4_sliding_t_nut, M5_sliding_t_nut]; - layout([for(s = sk_brackets) 1.5 * sk_size(s)[1]]) - sk_bracket_assembly(sk_brackets[$i], screw_type = screws[$i], nut_type = nuts[$i]); + screws = [M4_dome_screw, M4_cap_screw, M5_cap_screw, M5_cap_screw]; + nuts = [M4_hammer_nut, M4_sliding_t_nut, M5_sliding_t_nut, undef]; + // channel depth = 6 for 2020 extrusion, 9 for 3030 extrusion + depths = [6, 6, 9, 0]; + layout([for(s = sk_brackets) 1.5 * sk_size(s)[1]]) { + sk_bracket_assembly(sk_brackets[$i], screw_type = screws[$i], nut_type = nuts[$i], max_screw_depth = depths[$i]); + translate([0, -sk_hole_offset(sk_brackets[$i]) - extrusion_width($i < 2 ? E2020 : E3030) / 2, 0]) + rotate([0, 90, 0]) + extrusion($i < 2 ? E2020 : E3030, 20); + } } if($preview) diff --git a/vitamins/sk_bracket.scad b/vitamins/sk_bracket.scad index 43d7c80..803e80e 100644 --- a/vitamins/sk_bracket.scad +++ b/vitamins/sk_bracket.scad @@ -100,7 +100,7 @@ module sk_bracket_hole_positions(type) { //! Place children at hole positions children(); } -module sk_bracket_assembly(type, part_thickness = 2, screw_type = M5_cap_screw, nut_type = undef) { //! Assembly with fasteners in place +module sk_bracket_assembly(type, part_thickness = 2, screw_type = M5_cap_screw, nut_type = undef, max_screw_depth = 6) { //! Assembly with fasteners in place sk_bracket(type); screw_type = is_undef(screw_type) ? scs_screw(type) : screw_type; @@ -110,9 +110,8 @@ module sk_bracket_assembly(type, part_thickness = 2, screw_type = M5_cap_screw, nut_washer_thickness = nut_washer_type ? washer_thickness(nut_washer_type) : 0; nut_offset = sk_base_height(type) + part_thickness; - screw_length = nut_washer_type ? screw_longer_than(nut_offset + screw_washer_thickness + nut_washer_thickness + nut_thickness(nut_type)) - : screw_shorter_than(nut_offset + screw_washer_thickness + nut_thickness(nut_type) + 2); - + screw_length = max_screw_depth ? screw_shorter_than(sk_base_height(type) + screw_washer_thickness + max_screw_depth) + : screw_longer_than(nut_offset + screw_washer_thickness + nut_washer_thickness + nut_thickness(nut_type)); sk_bracket_hole_positions(type) { screw_and_washer(screw_type, screw_length); translate_z(-nut_offset) @@ -123,3 +122,4 @@ module sk_bracket_assembly(type, part_thickness = 2, screw_type = M5_cap_screw, sliding_t_nut(nut_type); } } +