Skip to content

Instantly share code, notes, and snippets.

@sfoster
Created February 25, 2025 06:51
Show Gist options
  • Save sfoster/bbedcc0767732ede04ca2b3523037c8c to your computer and use it in GitHub Desktop.
Save sfoster/bbedcc0767732ede04ca2b3523037c8c to your computer and use it in GitHub Desktop.
OpenSCAD thread test
include <../threads.scad>;
// threads library from: https://dkprojects.net/openscad-threads/
// probably updated since, as I downloaded this a while back
od = 30;
id = od - 1;
wall = 4;
$fn=64;
fillet=2;
lid_th=1;
translate([0,od*0.5+wall*2,0]) collar_top();
translate([0,od*-0.5-+wall*2,0]) collar_bottom();
module collar_bottom() {
thread_h=10;
difference() {
cylinder(d=od+wall*2,h=thread_h+lid_th);
translate([0,0,lid_th-0.01]) metric_thread(diameter=od+5, internal=true, pitch=3, leadin=1, length=thread_h*1.01);
}
}
module collar_top() {
fit = 0.5;
difference() {
union() {
cylinder(d=od+wall*2,h=lid_th+fillet);
translate([0,0,lid_th-0.01]) metric_thread(diameter=od+5-fit, pitch=3, leadin=1, length=10);
}
translate([0,0,lid_th+fillet]) cylinder(d=od,h=8.01);
translate([0,0,lid_th]) cylinder(r1=od/2-fillet,r2=od/2,h=fillet);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment