diff --git a/readme.md b/readme.md index cb14936..4487e20 100644 --- a/readme.md +++ b/readme.md @@ -1252,6 +1252,7 @@ Heatfit threaded inserts. Can be pushed into thermoplastics using a soldering ir | Function | Description | |:--- |:--- | | ```insert_boss_radius(type, wall)``` | Compute the outer radius of an insert boss | +| ```insert_nose_length(type, d)``` | The length before the second ring. | ### Modules | Module | Description | diff --git a/vitamins/insert.scad b/vitamins/insert.scad index 8647e60..8391a94 100644 --- a/vitamins/insert.scad +++ b/vitamins/insert.scad @@ -35,6 +35,15 @@ function insert_ring3_d(type) = type[8]; //! Diameter of the bottom r function insert_hole_length(type) = round_to_layer(insert_length(type)); +function insert_nose_length(type, d) = let( //! The length before the second ring. + length = insert_length(type), + ring1_h = insert_ring1_h(type), + chamfer1 = (insert_ring2_d(type) - insert_barrel_d(type)) / 2, + chamfer2 = (insert_ring3_d(type) - insert_barrel_d(type)) / 2, + ring2_h = ring1_h + chamfer1, + gap = (length - ring1_h - ring2_h - chamfer2) / 3 + ) ring1_h + gap + ring2_h - d + insert_barrel_d(type); + module insert(type) { //! Draw specified insert length = insert_length(type); ring1_h = insert_ring1_h(type); @@ -58,7 +67,7 @@ module insert(type) { //! Draw specified insert h3 = ring1_h + gap + ring2_h; h4 = ring1_h + gap + ring2_h + gap; color(brass) - rotate_extrude() + rotate_extrude(convexity = 3) polygon([ [r1, 0], [r1, length],