From 011345c68d06a13586c66b55f6f8ed1011d78f2a Mon Sep 17 00:00:00 2001 From: Luke Hubmayer-Werner Date: Tue, 2 Apr 2024 13:38:10 +1030 Subject: [PATCH] Fix neck width scaling --- T-riple.scad | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/T-riple.scad b/T-riple.scad index a06351e..7003de4 100644 --- a/T-riple.scad +++ b/T-riple.scad @@ -6,14 +6,10 @@ octave_strings = ["", "˙", "¨", "¯"]; octave_scales = [1.1, 1, 0.9, 0.8]; z_resolution = $preview ? 0.5 : 0.1; -profile_arc_steps_backside = $preview ? 8 : 180; -profile_arc_steps_topside = $preview ? 8 : 20; -// $fn = $preview ? 32 : 512; -// mink_fn = $preview ? 12 : 128; -// mink_fn_2d = $preview ? 32 : 256; -// $fn = 32; -// mink_fn = 12; -// mink_fn_2d = 32; +$fs = $preview ? 1 : 0.01; +$fa = $preview ? 5 : 0.1; +profile_arc_steps_backside = $preview ? 8 : 360; +profile_arc_steps_topside = $preview ? 8 : 60; fret_width = 2.4; //2.8; // Jumbo = 0.11", 0.055" tall zero_fret_width = fret_width*1.5; @@ -22,13 +18,17 @@ fret_angle = 60; //Fret angle of 45° is normal, anything over 60 will not work tube_radius = Cap_Spine + T_circumcenter[0]; standard_profile_center_x = T_circumcenter[0]; x_min = standard_profile_center_x - tube_radius; -standard_y_width = 26.4517; - +minimum_y_width = 26.4517; +standard_y_width = 28; +nut_spacing = 10; +bridge_spacing = 20; +y_width_extra_mm = standard_y_width - (2 * nut_spacing); +y_width_extra = y_width_extra_mm / (2 * nut_spacing); module tube(from_fret, to_fret, scale_offset = 0, fingerboard_min_thick = 2.5, fingerboard_max_thick = 5) { function fsl(fret_number) = fret_scale_length(fret_number + scale_offset); z0 = fsl(0); - function get_desired_width_scale(z) = 2.0-(z/z0); + function get_desired_width_scale(z) = let (spacing = 2.0-(z/z0)) (spacing + y_width_extra)/(1 + y_width_extra); function get_desired_profile_radius(ws) = let ( x = fingerboard_max_thick, @@ -73,7 +73,7 @@ module tube(from_fret, to_fret, scale_offset = 0, fingerboard_min_thick = 2.5, f polygon(points = concat(topside_points_1, backside_points, topside_points_2)); top_width = pt(a_topside_start)[1] * 2; - echo(str("WScale=", width_scale, " PScale=", profile_radius_scale, " r=", profile_radius, " has top width of ", top_width, " divides to ", top_width/width_scale, " (goal is 26.4517)")); + echo(WScale=width_scale, PScale=profile_radius_scale, r=profile_radius, TopWidth=top_width, StringSpacing=(top_width-y_width_extra_mm)/2, dv=top_width/width_scale, goal=standard_y_width); } module fret_bumps(w=100) { translate([fingerboard_max_thick - fret_width/2, w/2, -z_offset + fsl(from_fret)]) @@ -101,7 +101,7 @@ module tube(from_fret, to_fret, scale_offset = 0, fingerboard_min_thick = 2.5, f ) { translate([0,-w/2,0]) rotate([-90,-90,0]) - translate(cc) cylinder(h = w, r = r); + translate(cc) cylinder(h = w, r = r, $fn=max(8*ceil(r), 32)); } }