diff --git a/printed/psu_shroud.scad b/printed/psu_shroud.scad index 54a0185..f93b531 100644 --- a/printed/psu_shroud.scad +++ b/printed/psu_shroud.scad @@ -33,10 +33,8 @@ wall = 1.8; top = 1.5; screw = M3_cap_screw; insert = screw_insert(screw); -boss_r = wall + corrected_radius(insert_hole_radius(insert)); -boss_h = insert_hole_length(insert); +boss_r = insert_boss_radius(insert, wall); counter_bore = 2; -boss_h2 = boss_h + counter_bore; rad = 2; clearance = layer_height; overlap = 6; @@ -137,49 +135,13 @@ module psu_shroud(type, cable_d, name, cables = 1) { //! Generate the STL file f translate([0, height / 2]) vertical_tearslot(h = 0, r = cable_d / 2, l = cable_d); } - - mirror([0, 1, 0]) { - // insert boss - translate_z(height - boss_h) - linear_extrude(height = boss_h) - psu_shroud_hole_positions(type) - difference() { - hull() { - circle(boss_r); - - translate([0, $side * (boss_r - 1)]) - square([2 * boss_r, eps], center = true); - } - poly_circle(insert_hole_radius(insert)); - } - - // insert boss counter_bore - translate_z(height - boss_h2) - linear_extrude(height = counter_bore + eps) - psu_shroud_hole_positions(type) - difference() { - hull() { - circle(boss_r); - - translate([0, $side * (boss_r - 1)]) - square([2 * boss_r, eps], center = true); - } - poly_circle(insert_screw_diameter(insert) / 2 + 0.1); - } - // support cones - translate_z(height - boss_h2) - psu_shroud_hole_positions(type) - hull() { - cylinder(h = eps, r = boss_r - eps); - - translate([0, $side * (boss_r - 1)]) - cube([2 * boss_r, eps, eps], center = true); - - translate([0, $side * (boss_r - wall), - (2 * boss_r - wall)]) - cube(eps); - } - } -} + // insert lugs + mirror([0, 1, 0]) + psu_shroud_hole_positions(type) + translate_z(height) + rotate(90) + insert_lug(insert, wall, $side, counter_bore); + } module psu_shroud_assembly(type, cable_d, name, cables = 1) //! The printed parts with inserts fitted assembly(str("psu_shroud_", name)) { diff --git a/printed/ssr_shroud.scad b/printed/ssr_shroud.scad index 860c2f2..8eab5a3 100644 --- a/printed/ssr_shroud.scad +++ b/printed/ssr_shroud.scad @@ -33,10 +33,8 @@ wall = 1.8; top = 1.5; screw = M3_cap_screw; insert = screw_insert(screw); -boss_r = wall + corrected_radius(insert_hole_radius(insert)); -boss_h = insert_hole_length(insert); +boss_r = insert_boss_radius(insert, wall); counter_bore = 2; -boss_h2 = boss_h + counter_bore; rad = 3; clearance = layer_height; @@ -61,7 +59,6 @@ module ssr_shroud_holes(type, cable_d) { //! Drill the screw and ziptie holes translate([ssr_shroud_cable_x(type, cable_d), side * (ssr_width(type) / 2 - 2 * boss_r)]) rotate(-90) cable_tie_holes(cable_d / 2, h = 0); - } module ssr_shroud(type, cable_d, name) { //! Generate the STL file for a specified ssr and cable @@ -103,45 +100,11 @@ module ssr_shroud(type, cable_d, name) { //! Generate the STL file for a spec vertical_tearslot(h = 0, r = cable_d / 2, l = cable_d); } // insert boss - translate_z(height - boss_h) - linear_extrude(height = boss_h) - ssr_shroud_hole_positions(type) - difference() { - hull() { - circle(boss_r); - - translate([0, -$side * (boss_r - 1)]) - square([2 * boss_r, eps], center = true); - } - poly_circle(insert_hole_radius(insert)); - } - - // insert boss counter_bore - translate_z(height - boss_h2) - linear_extrude(height = counter_bore + eps) - ssr_shroud_hole_positions(type) - difference() { - hull() { - circle(boss_r); - - translate([0, -$side * (boss_r - 1)]) - square([2 * boss_r, eps], center = true); - } - poly_circle(insert_screw_diameter(insert) / 2 + 0.1); - } - // support cones ssr_shroud_hole_positions(type) - hull() { - translate_z(-height + boss_h2) { - cylinder(h = eps, r = boss_r - eps); - - translate([0, -$side * (boss_r - 1)]) - cube([2 * boss_r, eps, eps], center = true); - } - translate([0, -$side * (boss_r - wall), -height + boss_h2 + (2 * boss_r - wall)]) - cube(eps); - } - + vflip() + translate_z(height) + rotate(90) + insert_lug(insert, wall, $side, counter_bore); } module ssr_shroud_assembly(type, cable_d, name) //! The printed parts with inserts fitted @@ -153,7 +116,6 @@ assembly(str("ssr_shroud_", name)) { ssr_shroud_hole_positions(type) insert(insert); - } module ssr_shroud_fastened_assembly(type, cable_d, thickness, name) //! Assembly with screws in place @@ -177,6 +139,4 @@ module ssr_shroud_fastened_assembly(type, cable_d, thickness, name) //! Assembly color(grey20) cylinder(d = cable_d, h = 20, center = true); } - - } diff --git a/readme.md b/readme.md index f6d6966..d122006 100644 --- a/readme.md +++ b/readme.md @@ -900,6 +900,7 @@ Heatfit threaded inserts. Can be pushed into thermoplastics using a soldering ir | ```insert(type)``` | Draw specified insert | | ```insert_boss(type, z, wall = 2 * extrusion_width)``` | Make a boss to take an insert | | ```insert_hole(type, counterbore = 0, horizontal = false)``` | Make a hole to take an insert, ```counterbore``` is the extra length for the screw | +| ```insert_lug(insert, wall, side, counter_bore = 0)``` | Make a flying insert lug, see [ssr_shroud](#Ssr_shroud) | ![inserts](tests/png/inserts.png) diff --git a/vitamins/insert.scad b/vitamins/insert.scad index 9a34b1f..5cdd014 100644 --- a/vitamins/insert.scad +++ b/vitamins/insert.scad @@ -107,3 +107,45 @@ module insert_boss(type, z, wall = 2 * extrusion_width) { //! Make a boss to tak insert_hole(type, max(0, z - insert_hole_length(type) - 2 * layer_height)); } } + +module insert_lug(insert, wall, side, counter_bore = 0) { + boss_r = insert_boss_radius(insert, wall); + boss_h = insert_hole_length(insert); + boss_h2 = boss_h + counter_bore; + translate_z(-boss_h) + linear_extrude(height = boss_h) + difference() { + hull() { + circle(boss_r); + + translate([side * (boss_r - 1), 0]) + square([eps, 2 * boss_r], center = true); + } + poly_circle(insert_hole_radius(insert)); + } + + // insert boss counter_bore + translate_z(-boss_h2) { + linear_extrude(height = counter_bore + eps) + difference() { + hull() { + circle(boss_r); + + translate([side * (boss_r - 1), 0]) + square([eps, 2 * boss_r], center = true); + } + poly_circle(insert_screw_diameter(insert) / 2 + 0.1); + } + + // support cones + hull() { + cylinder(h = eps, r = boss_r - eps); + + translate([side * (boss_r - 1), 0]) + cube([eps, 2 * boss_r, eps], center = true); + + translate([side * (boss_r - wall + eps), 0, - (2 * boss_r - wall)]) + cube(eps, center = true); + } + } +}