diff main.scad @ 5:fdd022a1bfb1

reworked latch hook reinforcement, now a simple line count
author ark
date 2026-11-16 19:26 +0100
parents 80122df4a6c5
children f2694e49cec1
line wrap: on
line diff
--- a/main.scad	Mon Nov 16 11:01:08 2026 +0100
+++ b/main.scad	Mon Nov 16 19:26:19 2026 +0100
@@ -61,6 +61,8 @@
 latch_detent = .3; // [0:.05:.7]
 // grip tab length below the hook
 latch_grip = 5; // [0:.5:20]
+// hook wall around the filament bar, in extrusions
+latch_hook_lines = 3; // [2:1:8]
 
 /* [print settings] */
 line_width = .4; // [0:.01:1]
@@ -115,7 +117,9 @@
 
 // latch. the flap hangs from lid knuckles and its hook wraps around a
 // filament bar held by body knuckles straight below the flap axis.
-// in the front frame u runs outward from the front face, z up
+// in the front frame u runs outward from the front face, z up.
+// a latch wider than the hinge span is narrowed to it
+latch_w = min(latch_width, hinge_span);
 latch_x = -out_x/2 - knuckle_u;
 latch_z = seam_z + knuckle_r + cl;
 bar_z = seam_z - cl - knuckle_r;
@@ -123,7 +127,7 @@
 // distance between flap axis and bar axis
 bar_h = latch_z - bar_z;
 hook_ri = bar_r + cl;
-hook_ro = hook_ri + hinge_lines*lw;
+hook_ro = hook_ri + latch_hook_lines*lw;
 // outer radius of the bar minus radius of the hook tip, both around the
 // flap axis, for a hook reaching angle b past the bottom of the bar
 function _detent(b) =
@@ -137,8 +141,6 @@
 plate_t = latch_layers*lh;
 plate_u = knuckle_u + knuckle_r + 2*cl;
 plate_bz = bar_z - hook_ro - latch_grip;
-// a latch wider than the hinge span is narrowed to it
-latch_w = min(latch_width, hinge_span);
 latch_slot = (latch_w - 2*knuckle_gap)/3;
 // y start of the two outer latch slots
 latch_outer_y0 = [-latch_w/2, latch_slot/2 + knuckle_gap];
@@ -162,12 +164,11 @@
     echo(str("WARNING: body_ratio ", body_ratio, " leaves the lid too low, using ",
         body_ih/inner_height));
 echo("body height", seam_z, "mm, lid height", lid_h, "mm, body ratio", body_ih/inner_height);
+if (latch_w < latch_width)
+    echo(str("WARNING: latch_width ", latch_width, " is wider than the hinge span, using ",
+        latch_w));
 echo("pin hole", pin_d, "mm, knuckle diameter", 2*knuckle_r, "mm");
 echo("hinge knuckle length", knuckle_l, "mm");
-if (latch_w < latch_width)
-    echo(str("WARNING: latch_width ", latch_width, " is wider than the box front, using ",
-        latch_w));
-echo("latch width", latch_w, "mm");
 echo("latch plate outer face", plate_u + plate_t, "mm from the front");
 echo("latch hook reaches", hook_a, "degrees past the bar bottom, detent", _detent(hook_a), "mm");
 echo("lid sweep clearance over centred paper", sweep_margin, "mm");
@@ -292,21 +293,14 @@
 // in assembly position, closed
 module latch() {
     // hook around the bar, from the plate side down under the bar and
-    // hook_a degrees up its wall side. its back is filled with a web down
-    // to the plate, sloped like the knuckle webs. a web reaching closer
-    // than 2 extrusions to the grip edge is cut off there, but never above
-    // the bottom of the hook
+    // hook_a degrees up its wall side
     module _hook() {
         tip_a = 270 - hook_a;
-        web_z = bar_z - hook_ro - (plate_u - knuckle_u);
-        cut_z = min(plate_bz + 2*lw, bar_z - hook_ro);
         difference() {
-            intersection() {
-                hull() {
-                    translate([knuckle_u, bar_z]) circle(r=hook_ro);
-                    translate([plate_u, web_z]) square([epsilon, bar_z - web_z]);
-                }
-                translate([0, cut_z]) square([plate_u + epsilon, bar_z - cut_z]);
+            hull() {
+                translate([knuckle_u, bar_z]) circle(r=hook_ro);
+                translate([knuckle_u, bar_z - hook_ro])
+                    square([plate_u - knuckle_u + epsilon, hook_ro]);
             }
             translate([knuckle_u, bar_z]) circle(r=hook_ri);
             // open wedge over the top and the wall side of the bar