First Nylon/Classical Tuner attempt

This commit is contained in:
Luke Hubmayer-Werner 2025-01-01 22:33:40 +10:30
parent 5548408077
commit 5c3885c06c
3 changed files with 137 additions and 25 deletions

View File

@ -1,13 +1,32 @@
include <common.scad>
include <UBassTuner.scad>
include <NylonTuner.scad>
// Guitar_Scale_Length_mm = 610; // millimetres, slightly over 24inch (609.6mm) Jaguar scale, should be fine for guitar and u-bass
// assert(fret_scale_length(0) == 610); // Make sure the function correctly uses our changed global
CF_Tube_Dia = 5.0;
CF_Tube_Len = 420; // Convenient Amazon size, longer would be better of course but prices are important
CF_Tube_OD = 5.0; // Outer Diameter
CF_Tube_ID = 3.0;
CF_Square_Width = 6.0;
CF_Square_ID = 5.0; // Inner diameter, sadly doesn't fit the tubes
cyl_hd_fn = $preview ? 32 : 512;
cyl_ld_fn = $preview ? 24 : 72;
module CF_Tube() { // Align +y
rotate([0, 0, 90]) render() difference() {
rotate([0, 90, 0]) cylinder(h=CF_Tube_Len, d=CF_Tube_OD, $fn=cyl_hd_fn);
rotate([0, 90, 0]) cylinder(h=CF_Tube_Len, d=CF_Tube_ID, $fn=cyl_ld_fn);
}
}
module CF_Square() {
rotate([0, 0, 90]) render() difference() {
translate([0, -CF_Square_Width/2, -CF_Square_Width/2]) cube([CF_Tube_Len, CF_Square_Width, CF_Square_Width]);
rotate([0, 90, 0]) cylinder(h=CF_Tube_Len, d=CF_Square_ID, $fn=cyl_ld_fn);
}
}
// Philippians 4:8
// Gideon , , , , , , ,
// Gideon (ShinKaiYaku07) , , , , , , ,
// ShinKaiYaku65
// I swapped and because 12th fret should be the biggest marker, and having only 15 as a 2char marker would be too disorienting
// going with for 21
@ -50,25 +69,29 @@ module neck(string_spacing=18, string_margin=4.5, num_strings=3, target_neck_thi
module fret_inlays() {
for (num_text = fret_inlays) {
fret = num_text[0];
x0 = fret_scale_length(fret-1);
x1 = fret_scale_length(fret);
diff = x0 - x1;
translate([0, lerp(x0, x1, 0.5), -0.5])
linear_extrude(30)
text(text = num_text[1], font = JP_Serif_Font, halign = "center", valign = "center", size = clamp(2, diff-fret_width*2-2, 10));
if (fret <= num_frets) {
x0 = fret_scale_length(fret-1);
x1 = fret_scale_length(fret);
diff = x0 - x1;
translate([0, lerp(x0, x1, 0.5), -0.5])
linear_extrude(30)
text(text = num_text[1], font = JP_Serif_Font, halign = "center", valign = "center", size = clamp(2, diff-fret_width*2-2, 10));
}
}
}
module fret_side_markers() {
for (num_text = fret_inlays) {
fret = num_text[0];
x0 = fret_scale_length(fret-1);
x1 = fret_scale_length(fret);
diff = x0 - x1;
rotate([0, -90, 0])
translate([0, x1, neck_width/2-3])
linear_extrude(50)
rotate(-35)
text(text = str(fret), font = JP_Serif_Font, halign = "right", valign = "center", size = 5);
if (fret <= num_frets) {
x0 = fret_scale_length(fret-1);
x1 = fret_scale_length(fret);
diff = x0 - x1;
rotate([0, -90, 0])
translate([0, x1, neck_width/2-3])
linear_extrude(50)
rotate(-35)
text(text = str(fret), font = JP_Serif_Font, halign = "right", valign = "center", size = 5);
}
}
}
@ -158,22 +181,22 @@ module cf_tube(x1, x2, tolerance = 0.3, VLH = false) {
tolerance = tolerance + (VLH ? 0.3 : 0);
translate([0, x2, 0])
rotate([-90,0,0])
cylinder(h=x1-x2, d=CF_Tube_Dia+tolerance, $fn=360);
cylinder(h=x1-x2, d=CF_Tube_OD+tolerance, $fn=360);
hull() {
translate([0, x2])
rotate([-90,0,0])
cylinder(h=0.2, d=CF_Tube_Dia*1.2+tolerance, $fn=360);
cylinder(h=0.2, d=CF_Tube_OD*1.2+tolerance, $fn=360);
translate([0, x2+5])
rotate([-90,0,0])
cylinder(h=0.2, d=CF_Tube_Dia+tolerance, $fn=360);
cylinder(h=0.2, d=CF_Tube_OD+tolerance, $fn=360);
}
hull() {
translate([0, x1])
rotate([-90,0,0])
cylinder(h=0.2, d=CF_Tube_Dia*1.2+tolerance, $fn=360);
cylinder(h=0.2, d=CF_Tube_OD*1.2+tolerance, $fn=360);
translate([0, x1-5])
rotate([-90,0,0])
cylinder(h=0.2, d=CF_Tube_Dia+tolerance, $fn=360);
cylinder(h=0.2, d=CF_Tube_OD+tolerance, $fn=360);
}
}
@ -375,8 +398,39 @@ module bridge(string_spacing=18, string_margin=4.5, num_strings=3, target_neck_t
}
}
echo(fret_scale_length(0) - fret_scale_length(8)); // 225.724
echo(fret_scale_length(8) - fret_scale_length(24)); // 240.335
module Nylon6String() {
fsl_mm = fret_scale_length(0);
echo(str("Making a Nylon 6 String with scale length ", fsl_mm, "mm = ", fsl_mm/25.4, "in"))
assert(fret_scale_length(0) == Classical_Short_Scale_mm); // Make sure the function correctly uses our changed global
num_frets = 20;
num_strings = 6;
// 56mm wide neck
string_spacing = 10; // 50mm E to e
string_margin = 3; // +6
scallop_depth = 2;
target_neck_thickness = 22;
// neck(num_frets=num_frets, num_strings=num_strings, string_margin=string_margin, string_spacing=string_spacing);
module CF_Span() {
CF_Square();
translate([0, 140, CF_Square_Width]) CF_Square();
translate([0, 280, CF_Square_Width*2]) CF_Square();
}
color([0.4, 0.5, 0.5]) translate([ 12, -40, -16]) CF_Span();
color([0.4, 0.5, 0.5]) translate([-12, -40, -16]) CF_Span();
CF_Tube();
%neck(num_frets=num_frets, num_strings=num_strings, string_margin=string_margin, string_spacing=string_spacing, scallop_depth=scallop_depth, target_neck_thickness=target_neck_thickness);
// Debug markers to aid part slicing eyeballing
for (i = [150:250:1000]) {
%translate([50,i,0]) union() {text(str(i, "mm")); cube([50, 1, 1], center=true);}
}
}
// echo(fret_scale_length(0) - fret_scale_length(8)); // 225.724
// echo(fret_scale_length(8) - fret_scale_length(24)); // 240.335
// fret_tube(0, 8);
// //translate([30, 0, 0])
// fret_tube(8, 24);
@ -385,5 +439,13 @@ echo(fret_scale_length(8) - fret_scale_length(24)); // 240.335
// UBassTuner();
// fret_tube_filler(24, 100);
tailpiece();
// tailpiece();
// bridge();
Guitar_Scale_Length_mm = Classical_Short_Scale_mm;
// Nylon6String();
difference() {
translate([-15, -60, 0]) cube([50, 120, 13]);
translate([0, 55, 8]) rotate([180,0,0]) NylonTuner();
}

46
NylonTuner.scad Normal file
View File

@ -0,0 +1,46 @@
// Classical Guitar style headstock tuners, comes in a mirrored pair of 3 machine heads with a metal plate
module NylonTuner() {
cyl_hd_fn = $preview ? 32 : 512;
cyl_ld_fn = $preview ? 24 : 72;
earshaft_diameter = 6;
ear_height = 13;
ear_diameter = 22.1;
peg_diameter = 6.0; // Closer to 5.7mm
peg_length = 28;
peg_spacing = 35.0;
peg_string_diameter = 2.2+0.1;
plate_width = 16.6 + 1.4;
plate_length = 111;
plate_thickness = 1.1; // Not really used for our purposes
outer_thickness = 10;
// screwhole_diameter = 3;
screwtap_diameter = 1.7;
screw_length = 7.1 - plate_thickness;
module peg() {
render() difference() {
cylinder(h=peg_length, d=peg_diameter, $fn=cyl_hd_fn);
translate([0, 0, 14.1]) rotate([90, 0, 0]) cylinder(h=peg_diameter, d=peg_string_diameter, $fn=cyl_ld_fn, center=true);
translate([0, 0, 22.7]) rotate([90, 0, 0]) cylinder(h=peg_diameter, d=peg_string_diameter, $fn=cyl_ld_fn, center=true);
}
}
module ear() {
rotate([0, 90, 0]) cylinder(h=22.6, d=earshaft_diameter, $fn=cyl_ld_fn);
rotate([0, 90, 0]) translate([0,0,22.6-ear_height]) cylinder(h=ear_height, d=ear_diameter, $fn=cyl_hd_fn);
}
// Plate and clearance
translate([-plate_width/2, 0, -outer_thickness]) cube([plate_width, plate_length, outer_thickness]);
// Pegs
for (i = [0:2]) {
// Peg
translate([0, i*peg_spacing + 16, 0]) peg();
// Ear
translate([plate_width/2, i*peg_spacing + 22.5, -earshaft_diameter/2-2.5]) ear();
}
// Mounting holes
for (i = [6, 39, 75, 105]) {
translate([0, i, 0]) cylinder(h=screw_length, d=screwtap_diameter, $fn=cyl_ld_fn);
}
}

View File

@ -1,4 +1,8 @@
Guitar_Scale_Length_mm = 648;
Fender_Scale_mm = 648; // Actually 25.5inch = 647.7mm
Classical_Normal_Scale_mm = 650; // about 25.59inch
Classical_Short_Scale_mm = 635; // = 25inch
Guitar_Scale_Length_mm = Fender_Scale_mm;
ln2 = ln(2);
function log2(x) = ln(x)/ln2;
function fret_scale_length(n) = Guitar_Scale_Length_mm * 2^(-n/12);