Insert lug made more flexible and insert_boss made faster.

Both added to the insert test.
This commit is contained in:
Chris Palmer 2019-08-21 17:31:23 +01:00
parent 9bb84593be
commit 79f1c95136
7 changed files with 61 additions and 34 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 712 KiB

After

Width:  |  Height:  |  Size: 713 KiB

View File

@ -139,8 +139,8 @@ module psu_shroud(type, cable_d, name, cables = 1) { //! Generate the STL file f
mirror([0, 1, 0])
psu_shroud_hole_positions(type)
translate_z(height)
rotate(90)
insert_lug(insert, wall, $side, counter_bore);
rotate($side * 90)
insert_lug(insert, wall, counter_bore);
}
module psu_shroud_assembly(type, cable_d, name, cables = 1) //! The printed parts with inserts fitted

View File

@ -103,8 +103,8 @@ module ssr_shroud(type, cable_d, name) { //! Generate the STL file for a spec
ssr_shroud_hole_positions(type)
vflip()
translate_z(height)
rotate(90)
insert_lug(insert, wall, $side, counter_bore);
rotate($side * 90)
insert_lug(insert, wall, counter_bore);
}
module ssr_shroud_assembly(type, cable_d, name) //! The printed parts with inserts fitted

View File

@ -955,7 +955,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) |
| ```insert_lug(insert, wall, counter_bore = 0, extension = 0, corner_r = 0, flying = true)``` | Make a flying insert lug, see [ssr_shroud](#Ssr_shroud) |
![inserts](tests/png/inserts.png)

View File

@ -21,10 +21,20 @@ use <../utils/layout.scad>
include <../vitamins/inserts.scad>
module inserts()
module inserts() {
for(i = [0: len(inserts) -1])
translate([10 * i, 0])
insert(inserts[i]);
color(pp1_colour)
translate([len(inserts) * 10, 0]) {
insert_lug(inserts[0], 2, 1);
translate([10, 0])
insert_boss(inserts[0], z = 10, wall = 2);
}
}
if($preview)
inserts();

Binary file not shown.

Before

Width:  |  Height:  |  Size: 90 KiB

After

Width:  |  Height:  |  Size: 78 KiB

View File

@ -21,6 +21,7 @@
//! Heatfit threaded inserts. Can be pushed into thermoplastics using a soldering iron with a conical bit set to 200&deg;C.
//
include <../core.scad>
use <../utils/quadrant.scad>
function insert_length(type) = type[1]; //! Length
function insert_outer_d(type) = type[2]; //! Outer diameter at the top
@ -96,31 +97,52 @@ module insert_hole(type, counterbore = 0, horizontal = false) { //! Make a hole
function insert_boss_radius(type, wall) = corrected_radius(insert_hole_radius(type)) + wall; //! Compute the outer radius of an insert boss
module insert_boss(type, z, wall = 2 * extrusion_width) { //! Make a boss to take an insert
render(convexity = 3)
difference() {
ir = insert_hole_radius(type);
linear_extrude(height = z)
or = corrected_radius(ir) + wall;
module shape()
hull()
poly_ring(corrected_radius(ir) + wall, ir);
poly_ring(or, ir);
translate_z(z)
insert_hole(type, max(0, z - insert_hole_length(type) - 2 * layer_height));
}
linear_extrude(height = z)
poly_ring(or, ir);
linear_extrude(height = z - insert_hole_length(type))
difference() {
shape();
poly_circle(insert_screw_diameter(type) / 2 + 0.1);
}
module insert_lug(insert, wall, side, counter_bore = 0) { //! Make a flying insert lug, see [ssr_shroud](#Ssr_shroud)
if(z > insert_hole_length(type) + 2 * layer_height)
linear_extrude(height = 2 * layer_height) // cap the end if room
shape();
}
module insert_lug(insert, wall, counter_bore = 0, extension = 0, corner_r = 0, flying = true) { //! Make a flying insert lug, see [ssr_shroud](#Ssr_shroud)
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() {
module shape()
intersection() {
hull() {
circle(boss_r);
translate([side * (boss_r - 1), 0])
translate([boss_r + extension - eps, 0])
square([eps, 2 * boss_r], center = true);
}
if(corner_r)
translate([boss_r + extension - corner_r, 0])
rotate(-45)
quadrant(w = 100, r = corner_r - eps, center = true);
}
translate_z(-boss_h)
linear_extrude(height = boss_h)
difference() {
shape();
poly_circle(insert_hole_radius(insert));
}
@ -128,23 +150,18 @@ module insert_lug(insert, wall, side, counter_bore = 0) { //! Make a flying inse
translate_z(-boss_h2) {
linear_extrude(height = counter_bore + eps)
difference() {
hull() {
circle(boss_r);
shape();
translate([side * (boss_r - 1), 0])
square([eps, 2 * boss_r], center = true);
}
poly_circle(insert_screw_diameter(insert) / 2 + 0.1);
}
// support cones
// support cone
if(flying)
hull() {
cylinder(h = eps, r = boss_r - eps);
linear_extrude(height = eps)
shape();
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)])
translate([boss_r + extension - wall - eps, 0, - (2 * boss_r + extension - wall)])
cube(eps, center = true);
}
}