Compare commits
4 Commits
766a604400
...
8ed1f2772a
Author | SHA1 | Date | |
---|---|---|---|
8ed1f2772a | |||
e27e31d3c2 | |||
93cd7de90b | |||
4be6fef5f3 |
84
libclasp.scad
Normal file
84
libclasp.scad
Normal file
|
@ -0,0 +1,84 @@
|
||||||
|
/*
|
||||||
|
* Latch
|
||||||
|
*
|
||||||
|
* Copyright (C) 2024 Matthias Neeracher <microtherion@gmail.com>
|
||||||
|
*/
|
||||||
|
|
||||||
|
$fn = $preview ? 32 : 64;
|
||||||
|
|
||||||
|
// Thickness of walls
|
||||||
|
thickness = 3.0; // [2:5:.5]
|
||||||
|
|
||||||
|
// Diameter of axle
|
||||||
|
axle = 2.5; // [2:5:.5]
|
||||||
|
|
||||||
|
// Clearance above bottom
|
||||||
|
clearance = 3; // [0:10:1]
|
||||||
|
|
||||||
|
// Width of latch
|
||||||
|
width = 10; // [5:50:1]
|
||||||
|
|
||||||
|
// Length of latch
|
||||||
|
length = 20; // [5:100:1]
|
||||||
|
|
||||||
|
/* Other parameters - tune if necessary */
|
||||||
|
// Tolerance of parts
|
||||||
|
tolerance = .2; // [0:1:.1]
|
||||||
|
|
||||||
|
module _top_post(THICK, AXLE, CLEAR, TOL) {
|
||||||
|
dia = 2*THICK+AXLE;
|
||||||
|
center = AXLE/2+CLEAR;
|
||||||
|
f_diag = (2*AXLE)/sqrt(2);
|
||||||
|
difference() {
|
||||||
|
union() {
|
||||||
|
translate([0, -dia/2, 0]) cube([THICK, dia, AXLE/2+CLEAR]);
|
||||||
|
translate([THICK, 0, center]) rotate([0, -90, 0]) cylinder(h=THICK, d=dia);
|
||||||
|
}
|
||||||
|
translate([THICK, 0, center]) rotate([0, -90, 0]) cylinder(h=THICK, d=AXLE+TOL);
|
||||||
|
translate([0, AXLE/2, CLEAR]) rotate([90, 0, 90]) linear_extrude(THICK) polygon([[0, TOL/2], [0, AXLE-TOL/2], [dia/2, 1.5*AXLE], [dia/2, -0.5*AXLE]]);
|
||||||
|
translate([0, 0, CLEAR+TOL]) cube([THICK, AXLE/2, AXLE-2*TOL]);
|
||||||
|
translate([0, -dia, -dia]) cube([THICK, dia, dia]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module latch_top(WIDTH=width, THICK=thickness, AXLE=axle, CLEAR=clearance, TOL=tolerance) {
|
||||||
|
translate([WIDTH/2+TOL, 0, 0]) _top_post(THICK, AXLE, CLEAR, TOL);
|
||||||
|
translate([-WIDTH/2-THICK-TOL, 0, 0]) _top_post(THICK, AXLE, CLEAR, TOL);
|
||||||
|
}
|
||||||
|
|
||||||
|
module latch_tongue(LENGTH=length, WIDTH=width, THICK=thickness, AXLE=axle, TOL=tolerance) {
|
||||||
|
angle = 50;
|
||||||
|
mid = THICK/2;
|
||||||
|
translate([0, 0, THICK]) linear_extrude(WIDTH) {
|
||||||
|
hull() {
|
||||||
|
translate([mid, 0]) circle(d=THICK);
|
||||||
|
translate([AXLE/2+THICK, 0]) circle(d=AXLE);
|
||||||
|
}
|
||||||
|
hull() {
|
||||||
|
translate([mid, 0]) circle(d=THICK);
|
||||||
|
translate([mid, -LENGTH-3*AXLE]) circle(d=THICK);
|
||||||
|
}
|
||||||
|
difference() {
|
||||||
|
translate([AXLE/2+THICK, -LENGTH+AXLE/2]) circle(d=2*THICK+AXLE);
|
||||||
|
translate([AXLE/2+THICK, -LENGTH+AXLE/2]) circle(d=AXLE+TOL);
|
||||||
|
translate([THICK, -LENGTH+AXLE/2]) square([AXLE, THICK]);
|
||||||
|
translate([AXLE/2+THICK, -LENGTH+AXLE/2]) rotate(-angle) translate([-50, 0]) square(100, 100);
|
||||||
|
}
|
||||||
|
translate([AXLE/2+THICK+sin(angle)*(AXLE+THICK)/2, -LENGTH+AXLE/2-cos(angle)*(AXLE+THICK)/2]) circle(d=THICK);
|
||||||
|
}
|
||||||
|
translate([AXLE/2+THICK, 0]) cylinder(h=WIDTH+2*THICK, d=AXLE);
|
||||||
|
}
|
||||||
|
|
||||||
|
module latch_catch(WIDTH=width, THICK=thickness, AXLE=axle, CLEAR=clearance, TOL=tolerance) {
|
||||||
|
center = AXLE/2+CLEAR;
|
||||||
|
translate([WIDTH/2+THICK+TOL, AXLE/2, center]) rotate([0, -90, 0]) cylinder(h=WIDTH+2*THICK+2*TOL, d=AXLE);
|
||||||
|
translate([WIDTH/2+TOL, 0, 0]) cube([THICK, AXLE, center]);
|
||||||
|
translate([-WIDTH/2-THICK-TOL, 0, 0]) cube([THICK, AXLE, center]);
|
||||||
|
}
|
||||||
|
|
||||||
|
translate([0, 0, 8.2]) rotate([0, 90, 0]) {
|
||||||
|
translate([-8.2, -20, 0]) cube([16.4, 24.25, 3]);
|
||||||
|
translate([0, 0, 3]) latch_top();
|
||||||
|
translate([0, -20, 3]) latch_catch();
|
||||||
|
}
|
||||||
|
translate([20, 0, 0]) latch_tongue();
|
BIN
libclasp.stl
Normal file
BIN
libclasp.stl
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user