mirror of
https://github.com/nophead/NopSCADlib.git
synced 2025-01-17 21:48:43 +01:00
Merge branch 'sk_bracket_screw_length' of https://github.com/martinbudden/NopSCADlib into martinbudden-sk_bracket_screw_length
This commit is contained in:
commit
6a7f7dcbbf
@ -20,12 +20,19 @@ include <../core.scad>
|
|||||||
use <../utils/layout.scad>
|
use <../utils/layout.scad>
|
||||||
|
|
||||||
include <../vitamins/sk_brackets.scad>
|
include <../vitamins/sk_brackets.scad>
|
||||||
|
include <../vitamins/extrusions.scad>
|
||||||
|
|
||||||
module sk_brackets() {
|
module sk_brackets() {
|
||||||
screws = [M5_cap_screw, M5_cap_screw, M4_cap_screw, M5_cap_screw];
|
screws = [M4_dome_screw, M4_cap_screw, M5_cap_screw, M5_cap_screw];
|
||||||
nuts = [undef, M5_nut, M4_sliding_t_nut, M5_sliding_t_nut];
|
nuts = [M4_hammer_nut, M4_sliding_t_nut, M5_sliding_t_nut, undef];
|
||||||
layout([for(s = sk_brackets) 1.5 * sk_size(s)[1]])
|
// channel depth = 6 for 2020 extrusion, 9 for 3030 extrusion
|
||||||
sk_bracket_assembly(sk_brackets[$i], screw_type = screws[$i], nut_type = nuts[$i]);
|
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)
|
if($preview)
|
||||||
|
@ -100,7 +100,7 @@ module sk_bracket_hole_positions(type) { //! Place children at hole positions
|
|||||||
children();
|
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);
|
sk_bracket(type);
|
||||||
|
|
||||||
screw_type = is_undef(screw_type) ? scs_screw(type) : screw_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_washer_thickness = nut_washer_type ? washer_thickness(nut_washer_type) : 0;
|
||||||
|
|
||||||
nut_offset = sk_base_height(type) + part_thickness;
|
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_length = max_screw_depth ? screw_shorter_than(sk_base_height(type) + screw_washer_thickness + max_screw_depth)
|
||||||
: screw_shorter_than(nut_offset + screw_washer_thickness + nut_thickness(nut_type) + 2);
|
: screw_longer_than(nut_offset + screw_washer_thickness + nut_washer_thickness + nut_thickness(nut_type));
|
||||||
|
|
||||||
sk_bracket_hole_positions(type) {
|
sk_bracket_hole_positions(type) {
|
||||||
screw_and_washer(screw_type, screw_length);
|
screw_and_washer(screw_type, screw_length);
|
||||||
translate_z(-nut_offset)
|
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);
|
sliding_t_nut(nut_type);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user