diff --git a/latch.scad b/latch.scad new file mode 100644 index 0000000..51462a1 --- /dev/null +++ b/latch.scad @@ -0,0 +1,53 @@ +/* + * Latch + * + * Copyright (C) 2024 Matthias Neeracher + */ + +$fn = $preview ? 32 : 64; + +module _top_post(thickness, axis, ridge, funnel, tol) { + overlap = ridge+tol; + dia = 2*thickness+axis; + f_diag = (axis+2*funnel)/sqrt(2); + difference() { + union() { + translate([0, -dia/2, 0]) cube([thickness, dia, dia/2+overlap]); + translate([thickness, 0, dia/2+overlap]) rotate([0, -90, 0]) cylinder(h=thickness, d=dia); + } + translate([thickness, 0, dia/2+overlap]) rotate([0, -90, 0]) cylinder(h=thickness, d=axis+tol); + translate([0, 0, dia/2-axis/2+overlap]) cube([thickness, dia/2, axis]); + translate([0, dia/2, dia/2+overlap+tol]) rotate([-45, 0, 0]) translate([0, -f_diag/2, -f_diag/2]) cube([thickness, f_diag, f_diag]); + } +} + +module latch_top(spacing=10, thickness=3, axis=2.5, ridge=.5, funnel=.7, tol=.2) { + translate([spacing/2, 0, 0]) _top_post(thickness, axis, ridge, funnel, tol); + translate([-spacing/2-thickness, 0, 0]) _top_post(thickness, axis, ridge, funnel, tol); +} + +module latch_tongue(length=20, width=10, thickness=3, axis=2.5, ridge=.5, tol=.2) { + overlap = ridge; + translate([width+thickness, 0, thickness/2]) rotate([0, -90, 0]) cylinder(h=width+2*thickness, d=axis); + hull() { + translate([width-tol, 0, thickness/2]) rotate([0, -90, 0]) cylinder(h=width-tol, d=thickness); + translate([width-tol, length+thickness-.5, .5]) rotate([0, -90, 0]) cylinder(h=width-tol, d=1); + translate([0, thickness/2, thickness/2]) cube([width-tol, length+thickness/2, thickness/2]); + } + translate([0, length, thickness]) cube([width-tol, thickness, overlap+ridge-.5]); + hull() { + translate([width-tol, length, thickness+overlap+ridge/2]) rotate([0, -90, 0]) cylinder(h=width-tol, d=ridge); + translate([width-tol, length+thickness-.5, thickness+overlap+ridge-.5]) rotate([0, -90, 0]) cylinder(h=width-tol, d=1); + } +} + +module latch_catch(width=10, thickness=3, axis=2.5, ridge=.5, tol=.2) { + overlap = ridge; + translate([-width/2, 0, 0]) cube([width-tol, thickness, (thickness+ridge)/2+overlap]); + translate([width/2-tol, 0, thickness/2+overlap]) rotate([0, -90, 0]) cylinder(h=width-tol, d=ridge); +} + +translate([-8, -20, 0]) cube([16, 24.25, 3]); +translate([0, 0, 3]) latch_top(); +translate([20, 0, 0]) mirror([0, 1, 0]) latch_tongue(); +translate([0, -20, 3]) latch_catch(); diff --git a/latch.stl b/latch.stl new file mode 100644 index 0000000..462f7a6 Binary files /dev/null and b/latch.stl differ