From 694105eae22a666023525678992570ff3876cb27 Mon Sep 17 00:00:00 2001 From: Luke Hubmayer-Werner Date: Mon, 10 Feb 2025 02:53:43 +1030 Subject: [PATCH] More concept --- CFTubes.scad | 220 ++++++++++++++++++++++++++++++++++++++++----------- common.scad | 8 ++ 2 files changed, 182 insertions(+), 46 deletions(-) diff --git a/CFTubes.scad b/CFTubes.scad index 4b82b2b..40b3851 100644 --- a/CFTubes.scad +++ b/CFTubes.scad @@ -1104,62 +1104,190 @@ COLOURSCHEME_PETGHF_BLUE = [BAMBU_PETGHF_LAKE_BLUE, BAMBU_PETGHF_LAKE_BLUE, "", // } module TwoBangerMk2(include_colours=[0,1], preview=false) { - module MyNeck() { - TaperNeck( - string_spacing_bridge=20, - string_spacing_nut=20, - num_strings=2, - string_margin=5, - target_neck_thickness=15, - scallop_depth=2.5, - extra_height=6, - fret_widths=concat([3.6], [ for (i=[0:50]) 2.4 ]), - num_frets=34, - fret_side_marker_x_angle=-23, - fret_side_marker_y_angle=5, - include_colours=include_colours, - ) { - body_height = 30; - behind_bridge = 100; - epsilon = 0.000001; - radius = 4; - w = 30 - radius*2; - hull() { - // translate([-w/2, 475-behind_bridge-epsilon, -epsilon]) cube([30, epsilon, epsilon]); - // translate([-w/2, -behind_bridge, -body_height]) cube([30, 460, body_height]); - $fn = 64; - translate([-w/2, radius-behind_bridge, radius-body_height]) sphere(radius); - translate([+w/2, radius-behind_bridge, radius-body_height]) sphere(radius); - translate([+w/2, radius-behind_bridge, 0]) sphere(radius); - translate([-w/2, radius-behind_bridge, 0]) sphere(radius); - translate([-w/2, 440-behind_bridge, radius-body_height]) sphere(radius); - translate([+w/2, 440-behind_bridge, radius-body_height]) sphere(radius); - translate([+w/2, 495-behind_bridge, 0]) sphere(radius); - translate([-w/2, 495-behind_bridge, 0]) sphere(radius); + id_line_0 = "ABS"; + id_line_1 = "2"; + fsl_mm = fret_scale_length(0); + + string_diameters_thous = [80, 105]; // Artist BST45130 + string_diameters_mm = string_diameters_thous * 0.0254; + + neck_width_nut = 30; //(num_strings-1)*string_spacing_nut + string_margin*2; + neck_width_bridge = 30; //(num_strings-1)*string_spacing_bridge + string_margin*2; + function neck_width_mm(y) = lerp(neck_width_bridge, neck_width_nut, y/fret_scale_length(0)); + target_neck_thickness = 15; + + num_strings = 2; + string_spacing_nut = 20; + string_spacing_bridge = 20; + function string_spacing(y) = lerp(string_spacing_bridge, string_spacing_nut, y/fret_scale_length(0)); + string_margin = 5; + function string_x(i, y) = (num_strings-i-1)*string_spacing(y) - neck_width_mm(y)/2 + string_margin; + + num_frets = 34; + _zero_fret_width = 3.6; + _fret_width = 2.4; + fret_widths = flatten([[_zero_fret_width], [ for (i = [1:num_frets]) _fret_width ]]); + fret_angle = 60; + function get_fret_width(fret) = fret_widths[clamp(0, fret, num_frets)]; + function get_fret_height(fret) = sin(fret_angle) * get_fret_width(fret)/2; + max_fret_width = max(fret_widths); + max_fret_height = sin(fret_angle) * max_fret_width/2; + scallop_depth = 2.5; + extra_height = 6; + + function behind_fret(fret) = fret_scale_length(fret) + fret_widths[fret]/2; + function after_fret(fret) = fret_scale_length(fret) - fret_widths[fret]/2; + segment_cuts = [-100, after_fret(30), after_fret(13), after_fret(5), behind_fret(0)+35]; + echo(segment_cuts); + echo([ for (i=[1:len(segment_cuts)-1]) segment_cuts[i]-segment_cuts[i-1]]); + + module MyBodySegment() { + body_height = 24; + behind_bridge = 100; + epsilon = 0.000001; + radius = 4; + curve_dist = 40; + step = 0.08; + steps = curve_dist/step; + slope_start = 425; + translate([-w/2, -behind_bridge, -body_height]) round_cube([w, slope_start, body_height], radius); + w = 30 - radius*2; + hull() { + // translate([-w/2, 475-behind_bridge-epsilon, -epsilon]) cube([30, epsilon, epsilon]); + // translate([-w/2, -behind_bridge, -body_height]) cube([30, 460, body_height]); + $fn = 64; + for (i = [0,1]) mirror([i, 0, 0]) { + translate([w/2, radius-behind_bridge, radius-body_height]) sphere(radius); + translate([w/2, radius-behind_bridge, 0]) sphere(radius); + translate([w/2, slope_start-behind_bridge, radius-body_height]) sphere(radius); + } + // translate([+w/2, 495-behind_bridge, 0]) sphere(radius); + // translate([-w/2, 495-behind_bridge, 0]) sphere(radius); + difference() { + translate([0, 490-behind_bridge, 0]) sphere(15, $fn=360); + translate([0, 490-behind_bridge, 50]) cube([100, 100, 100], center=true); } } } - module TrussRods() { - translate([0, 630+270, -4]) rotate([0, 0, 180]) TrussRod(); - translate([0, -100, -14]) TrussRodSingleAction(); + module HeadPiece() { + x0 = behind_fret(0); + end_radius = 25; + x2 = x0 + 30; + x1 = x2 - end_radius; + z0 = scallop_depth + extra_height; + z1 = scallop_depth + max_fret_height + extra_height; + module StringHoles() { + for (i = [0:num_strings-1]) translate([string_x(i, x0),0,0]) { + ballend_v = [0,x1+10,-3]; + hull() { + translate([0,fret_scale_length(0),z1+string_diameters_mm[i]/2]) sphere(d=min(2.6, string_diameters_mm[i]*1.2 + 1), $fn=360); + translate(ballend_v) sphere(d=2.6, $fn=360); + } + hull() { + // String ball ends are roughly 3mm by 4mm cylinder(d=4, h=3) + // Bass string ball ends are roughly 3mm by 4mm cylinder(d=6, h=4.5) + translate(ballend_v) rotate([0, 90, 0]) cylinder(d=4.5, h=3.5, center=true, $fn=360); + translate([0,x2,-30]) rotate([0, 90, 0]) cylinder(d=6.5, h=5.0, center=true, $fn=360); + } + } + } + if (list_has(include_colours, 0)) render() difference(){ + hull() { + translate([0,x0,0]) scale([neck_width_mm(x0)/2, 0.01, target_neck_thickness]) sphere(r=1, $fn=360); + translate([0,x1,0]) scale([neck_width_mm(x1)/2, end_radius, target_neck_thickness*1.0]) sphere(r=1, $fn=360); + } + translate([-500, x0, z0]) cube([1000, 1000, 1000]); + translate([-500, x0-1000, -500]) cube([1000, 1000, 1000]); + StringHoles(); + // if (label) translate([-10,fw2+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(); } - // reinforcing_tube_positions = [ - // [-10, 125, 0], - // [ 10, 125, 0], - // [ 0, 125, -10], - // ]; - // module CFs(x0=-1000, x1=-1000) { - // for (v = reinforcing_tube_positions) CFTubeCutout2(v, x0, x1); - // } + module MyNeck() { + HeadPiece(); + TaperNeck( + string_spacing_bridge=20, + string_spacing_nut=20, + num_strings=num_strings, + string_margin=5, + target_neck_thickness=15, + scallop_depth=scallop_depth, + extra_height=extra_height, + fret_widths=fret_widths, + num_frets=num_frets, + fret_side_marker_x_angle=-23, + fret_side_marker_y_angle=5, + include_colours=include_colours, + ) MyBodySegment(); + } + + module TrussRods(taper_points=[], extra=0) { + translate([0, 630+270, -4]) rotate([0, 0, 180]) TrussRod(taper_points=taper_points, extra=extra); + translate([0, -100, -16]) TrussRodSingleAction(taper_points=taper_points, extra=extra); + } + module Dowel() { + h = 27; + rotate([-90, 0, 0]) { + $fn=72; + translate([0, 0, -h/2]) cylinder_beak(d=5.25, h=h); + hull() { + cylinder(d=6, h=0.00001, center=true); + cylinder(d=5.25, h=3, center=true); + } + } + } + module Dowels() { + translate([-10, segment_cuts[3], 0]) Dowel(); + translate([ 10, segment_cuts[3], 0]) Dowel(); + translate([-10, segment_cuts[2], 0]) Dowel(); + translate([ 10, segment_cuts[2], 0]) Dowel(); + translate([-10, segment_cuts[1], 0]) Dowel(); + translate([ 10, segment_cuts[1], 0]) Dowel(); + } + + module MyBody() { + render() difference() { + MyNeck(); + + TrussRods(extra=20); + Dowels(); + + // Add a belt hole + arc = arc_points([[16, -13], [-16, -13], [0, -3]], 1); + belthole_r = 3; + belthole_fn = 72; + belthole_x0 = 130; + belthole_x1 = 260; + render() for (i = [0:len(arc)-2]) { + hull() { + translate([arc[i][0], belthole_x0, arc[i][1]]) sphere(belthole_r, $fn=belthole_fn); + translate([arc[i+1][0], belthole_x0, arc[i+1][1]]) sphere(belthole_r, $fn=belthole_fn); + translate([arc[i][0], belthole_x1, arc[i][1]]) sphere(belthole_r, $fn=belthole_fn); + translate([arc[i+1][0], belthole_x1, arc[i+1][1]]) sphere(belthole_r, $fn=belthole_fn); + } + } + } + } + + reinforcing_tube_positions = [ + // [-10, 125, 0], + // [ 10, 125, 0], + // [ 0, -95, -24], + ]; + module CFs(x0=-1000, x1=-1000) { + for (v = reinforcing_tube_positions) CFTubeCutout2(v, x0, x1); + } if (preview) { - TrussRods(); + // TrussRods(); // CFs(); - color("#FF000080") MyNeck(); + color("#FF000080") MyBody(); } else { - MyNeck(); + MyBody(); } } Guitar_Scale_Length_mm = PBass_Scale_mm; diff --git a/common.scad b/common.scad index c47fda6..504bca6 100644 --- a/common.scad +++ b/common.scad @@ -52,6 +52,14 @@ function arc_points_angle(tri_points, fragments_per_mm=5) = function list_has(list, value) = len(search(value, list)) > 0; +module sequential_hull() { + // given sequential_hull() {a b c d}, do hull {a b} hull {b c} hull {c d}, etc. + for (i = [0:$children-2]) hull() { + children(i); + children(i+1); + } +} + module round_cube(size, r) { translate([r, r, r]) minkowski() { cube(size-[r*2,r*2,r*2]);