diff --git a/CFTubes.scad b/CFTubes.scad index 57511b3..c10a6b8 100644 --- a/CFTubes.scad +++ b/CFTubes.scad @@ -406,8 +406,8 @@ module Nylon6String(render_colour_0=true, render_colour_1=true, render_colour_2= scallop_depth = 2.5; fret_width=2.4; target_neck_thickness = 16; //22; - echo(fret_scale_length(8)); - echo(fret_scale_length(9)); + // echo(fret_scale_length(8)); + // echo(fret_scale_length(9)); rx0 = -40; // Reinforcing rods start rx1 = rx0+280; @@ -528,6 +528,39 @@ module Nylon6String(render_colour_0=true, render_colour_1=true, render_colour_2= // if (render_colour_1 && !include_from_fret) color("red") BackIDText(); } + module HeadPiece() { + x0 = fret_scale_length(0) + fret_width/2; + end_radius = 12; + x1 = x0 - rx0 + end_radius; + module StringHoles() { + for (i = [0:num_strings-1]) translate([(num_strings-i-1)*string_spacing - neck_width/2 + string_margin,0,0]) { + translate([0,0,scallop_depth+fret_width/2+string_diameters_mm[i]]) rotate([-105,0,0]) cylinder(h=30, d=string_diameters_mm[i]*2, $fn=cyl_ld_fn); + // translate([0,23,-4]) rotate([-150,0,0]) translate([0,0,0]) cylinder(h=20, d=4, $fn=cyl_ld_fn); + hull() { + translate([0,29,-3.5]) sphere(d=5.5, $fn=360); + translate([0,29+11,-17]) sphere(d=7, $fn=360); + } + } + } + render() difference(){ + hull() { + translate([0,fret_width/2,0]) scale([neck_width/2, 0.01, target_neck_thickness]) sphere(r=1, $fn=360); + translate([0,-rx0-end_radius,0]) scale([neck_width/2, end_radius, target_neck_thickness*0.93]) sphere(r=1, $fn=360); + } + translate([-500, 0, scallop_depth]) cube([1000, 1000, 1000]); + translate([-500, fret_width/2 - 1000, -500]) cube([1000, 1000, 1000]); + translate([0, -fret_scale_length(0), 0]) { + for (v = reinforcing_tube_positions) CFTubeCutout2(v, x0, x1); + for (v = reinforcing_square_positions) CFSquareCutout2(v, x0, x1); + } + StringHoles(); + translate([-10,fret_width/2+1,-10]) rotate([90,0,0]) linear_extrude(10) { + text(str(id_line_0, id_line_1), size=2.9, halign="center", valign="center", $fn=100); + } + } + // StringHoles(); + } + if (reference) { union() { c_cf = [0.4, 0.5, 0.5]; @@ -544,8 +577,12 @@ module Nylon6String(render_colour_0=true, render_colour_1=true, render_colour_2= translate([(num_strings-i-1)*string_spacing - neck_width/2 + string_margin,0,5]) rotate([-90,0,0]) translate([0,0,-string_excess/2]) cylinder(h=fsl_mm+string_excess, d=string_diameters_mm[i], $fn=cyl_ld_fn); } } - } else { + } else if (from_fret >= 0) { RealPiece(from_fret, to_fret, include_from_fret = (from_fret==0)); + } else if (from_fret == -1) { + // String holding headpiece + echo("Making a headpiece"); + HeadPiece(); } // Debug markers to aid part slicing eyeballing // %for (i = [150:250:1000]) { @@ -568,7 +605,8 @@ module Nylon6String(render_colour_0=true, render_colour_1=true, render_colour_2= // bridge(); Guitar_Scale_Length_mm = Classical_Short_Scale_mm; -// Nylon6String(reference=true); +// translate([0, Guitar_Scale_Length_mm, 0]) rotate([0,0,180]) Nylon6String(reference=true); +rotate([0,0,180]) Nylon6String(from_fret=-1); // difference() { // translate([-15, -60, 0]) cube([50, 120, 8]); diff --git a/CFTubes/common.scad b/CFTubes/common.scad index 8fcd7ad..0adff81 100644 --- a/CFTubes/common.scad +++ b/CFTubes/common.scad @@ -74,7 +74,7 @@ module CFSquareCutout(x1, x2, tolerance = CF_Square_Width_tolerance, taper_x1 = } } -module CFTubeCutout2(v, block_y0, block_y1, tolerance = CF_Tube_OD_tolerance, VLH = false, taper_length = 2, taper_mul = 1.1, notch = true) { +module CFTubeCutout2(v, block_y0, block_y1, tolerance = CF_Tube_OD_tolerance, VLH = false, taper_length = 2, taper_mul = 1.1, notch = true, tolerance_length = CF_Square_Width_tolerance) { // Alternate approach: supply start vector v, and the bounding y values of the piece, taper on entry points only. tolerance = tolerance + (VLH ? 0.3 : 0); tube_y0 = v[1]; @@ -84,8 +84,8 @@ module CFTubeCutout2(v, block_y0, block_y1, tolerance = CF_Tube_OD_tolerance, VL fn = 360; // Full cylinder, unconditional - translate(v) hull() { - rotate([-90,0,0]) cylinder(h=CF_Tube_Len, d=OD, $fn=fn); + translate(v) translate([0, -tolerance_length, 0]) hull() { + rotate([-90,0,0]) cylinder(h=CF_Tube_Len+tolerance_length*2, d=OD, $fn=fn); if (notch) translate([-OD*0.02, 0, -OD*0.6]) cube([OD*0.04, CF_Tube_Len, OD*0.6]); } @@ -106,14 +106,14 @@ module CFTubeCutout2(v, block_y0, block_y1, tolerance = CF_Tube_OD_tolerance, VL } } -module CFSquareCutout2(v, block_y0, block_y1, tolerance = CF_Square_Width_tolerance, taper_length = 2, taper_mul = 1.1) { +module CFSquareCutout2(v, block_y0, block_y1, tolerance = CF_Square_Width_tolerance, taper_length = 2, taper_mul = 1.1, tolerance_length = CF_Square_Width_tolerance) { w = CF_Square_Width + tolerance; taper_w = (CF_Square_Width * taper_mul) + tolerance; tube_y0 = v[1]; tube_y1 = tube_y0 + CF_Tube_Len; // Full square rod, unconditional - translate([v[0]-w/2, v[1], v[2]-w/2]) cube([w, CF_Tube_Len, w]); + translate([v[0]-w/2, v[1] - tolerance_length, v[2]-w/2]) cube([w, CF_Tube_Len + tolerance_length*2, w]); // Check for tapered holes if ((block_y0 >= tube_y0) && (block_y0 < tube_y1)) // Tube protrudes through start of block hull() {