Neale Pickett
·
2025-12-28
nut.scad
1// Size of the nut
2size = [30, 9, 5];
3
4// Strings you're putting on it, in mils (aka thous)
5string_gauges = [11, 16, 30, 40];
6
7difference() {
8 $fn = 180; // 180 faces per complete circle is good enough for printing
9 inch = 25.4; // mm per inch
10 mil = inch / 1000; // mm per mil
11
12 intersection() {
13 cube(size);
14 rotate([0, 90, 0]) cylinder(h=size.x, r=size.y);
15 }
16
17 strings = string_gauges * mil;
18 spacing = size.x / len(strings);
19 for (n = [0:len(strings)-1]) {
20 d = strings[n];
21 pos = [spacing * (n + 1/2), size.y, 0];
22 translate(pos) rotate([5, 0, 0]) hull() {
23 translate([0, 0, 0]) cylinder(h=size.z*2, d=d, center=true);
24 translate([0, 10, 0]) cylinder(h=size.z*2, d=d, center=true);
25 }
26 }
27}