2024-12-22 01:07:14 +10:30
include < common.scad >
2024-12-26 13:14:01 +10:30
include < UBassTuner.scad >
2025-01-01 22:33:40 +10:30
include < NylonTuner.scad >
2024-12-22 01:07:14 +10:30
2025-01-02 15:11:48 +10:30
include < CFTubes/common.scad >
// Choose your material by only including one of the below
2025-01-22 19:30:11 +10:30
// include <CFTubes/PLA.scad>
2025-02-03 13:42:15 +10:30
// include <CFTubes/PETG.scad>
include < CFTubes/ABS.scad >
2025-01-26 16:02:07 +10:30
include < EllipticalNeck.scad >
2025-01-01 22:33:40 +10:30
2025-01-02 15:11:48 +10:30
// 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
2024-12-22 01:07:14 +10:30
2025-02-05 18:07:14 +10:30
shumbucker_h = 20.3 ;
shumbucker_l = 23.1 ;
2025-02-17 21:45:22 +10:30
shumbucker_lu = 17.1 ; // Upper
2025-02-05 18:07:14 +10:30
shumbucker_w1 = 66.4 ;
shumbucker_w2 = 82.9 ; // 1.6mm in, a 2.0mm hole on each side
2025-02-10 23:05:32 +10:30
relay_coil_housing_w = 15.2 ;
relay_coil_housing_l = 18.8 ;
relay_coil_housing_h = 15.5 ;
2025-02-13 01:43:15 +10:30
// relay_coil_leg_cavity_h = 5;
relay_coil_leg_cavity_l = 5 ;
2025-02-10 23:05:32 +10:30
2025-02-13 01:43:15 +10:30
module relay_coil_placeholder ( top_clearance = 0 , bottom_leg_clearance = 5 ) {
translate ( [ - relay_coil_housing_w / 2 , - relay_coil_housing_l / 2 ] ) cube ( [ relay_coil_housing_w , relay_coil_housing_l , relay_coil_housing_h + top_clearance ] ) ;
translate ( [ - relay_coil_housing_w / 2 , - relay_coil_housing_l / 2 , - bottom_leg_clearance ] ) cube ( [ relay_coil_housing_w , relay_coil_leg_cavity_l , bottom_leg_clearance ] ) ;
}
2025-02-10 23:05:32 +10:30
2025-02-12 12:25:24 +10:30
output_socket_plate_thickness = 3 ; // The bit with the hole to screw onto
output_socket_cutout_d = 10.4 + 0.5 ;
2025-02-13 01:43:15 +10:30
output_socket_washer_d = 17.0 + 0.5 ;
2025-02-12 12:25:24 +10:30
output_socket_l = 25 ;
output_socket_w = 20 ;
2025-02-13 01:43:15 +10:30
output_socket_h = 15.7 + 0.3 ;
2025-02-12 12:25:24 +10:30
output_socket_protrude = 9.5 ;
2025-02-13 01:43:15 +10:30
module output_socket_placeholder ( rear_clearance = 0 ) {
translate ( [ - output_socket_w / 2 , 0 , 0 ] ) cube ( [ output_socket_w , output_socket_l + rear_clearance , output_socket_h ] ) ;
2025-02-12 12:25:24 +10:30
translate ( [ 0 , 0 , output_socket_h / 2 ] ) rotate ( [ 90 , 0 , 0 ] ) cylinder_outer ( d = output_socket_cutout_d , h = output_socket_protrude , $fn = 72 ) ;
2025-02-13 01:43:15 +10:30
translate ( [ 0 , - output_socket_plate_thickness , output_socket_h / 2 ] ) rotate ( [ 90 , 0 , 0 ] ) cylinder_outer ( d = output_socket_washer_d , h = output_socket_protrude - output_socket_plate_thickness , $fn = 72 ) ;
2025-02-12 12:25:24 +10:30
}
2025-02-05 18:07:14 +10:30
2025-02-18 00:30:23 +10:30
module chromatic_tuner_eq ( extra_depth = 10 , tolerance = 0.5 ) {
w = 40 + tolerance ;
h = 68 + tolerance ;
d = 25 + extra_depth ;
corner_bevel = 6 ;
translate ( [ 0 , 0 , - d / 2 ] ) hull ( ) {
cube ( [ w - corner_bevel * 2 , h , d ] , center = true ) ;
cube ( [ w , h - corner_bevel * 2 , d ] , center = true ) ;
}
hole_spacing_w = 38.7 ;
hole_spacing_h = 66.3 ;
hole_depth = 12 ;
for ( i = [ - 1 , 1 ] ) for ( j = [ - 1 , 1 ] )
translate ( [ i * hole_spacing_w / 2 , j * hole_spacing_h / 2 , - hole_depth ] ) linear_extrude ( hole_depth )
screw_hole_lobe ( ID = 1.5 , OD = 2.5 ) ;
}
module chromatic_tuner_battery_jack ( extra_depth = 10 , tolerance = 0.5 ) {
w = 38.1 + tolerance ;
h = 47.0 + tolerance ;
d = 58 + extra_depth ;
corner_bevel = 6 ;
translate ( [ 0 , 0 , - d / 2 ] ) hull ( ) {
cube ( [ w - corner_bevel * 2 , h , d ] , center = true ) ;
cube ( [ w , h - corner_bevel * 2 , d ] , center = true ) ;
}
hole_spacing_w = 39.5 ;
hole_spacing_h = 49.2 ;
hole_depth = 12 ;
for ( i = [ - 1 , 1 ] ) for ( j = [ - 1 , 1 ] )
translate ( [ i * hole_spacing_w / 2 , j * hole_spacing_h / 2 , - hole_depth ] ) linear_extrude ( hole_depth )
screw_hole_lobe ( ID = 1.5 , OD = 2.5 ) ;
}
2024-12-22 01:07:14 +10:30
// Philippians 4:8
2025-01-01 22:33:40 +10:30
// Gideon (ShinKaiYaku07) 真実な, 尊ぶべき, 正しい, 清い, 愛すべき, 評判の良い, 徳とされる, 称賛に値する
2024-12-22 01:07:14 +10:30
// 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
2025-02-15 01:19:07 +10:30
fret_inlays = [ [ 3 , "真" ] , [ 5 , "尊" ] , [ 7 , "正" ] , [ 9 , "清" ] , [ 12 , "評判" ] , [ 15 , "愛" ] , [ 17 , "徳" ] , [ 19 , "賛" ] , [ 21 , "良" ] , [ 24 , "主イエス" ] , [ 27 , "." ] , [ 29 , "." ] , [ 31 , "." ] , [ 33 , "." ] ] ;
2025-01-11 00:48:14 +10:30
// Galatians 5:22-23
// ShinKaiYaku65 22しかし、御霊の実は、愛、喜び、平安、寛容、親切、善意、誠実、 23柔和、自制です。このようなものを禁ずる律法はありません。
// 愛 喜び 平安 寛容 親切 善意 誠実 柔和 自制
2025-02-12 12:25:24 +10:30
ichthys = "ΙΧΘΥΣ" ; // goes inside the fish symbol
chirho = "☧" ;
khiro = "⳩" ;
2024-12-22 01:07:14 +10:30
2024-12-27 19:06:45 +10:30
module tailpiece ( string_spacing = 18 , string_margin = 4.5 , num_strings = 3 , target_neck_thickness = 15 , scallop_depth = 3 , fret_width = 2.4 * 6 ) {
2024-12-26 13:14:01 +10:30
fw2 = fret_width / 2 ;
2024-12-28 13:43:39 +10:30
neck_length = 84 ;
neck_width = ( num_strings - 1 ) * string_spacing + string_margin * 2 + 6 + 6 ;
2024-12-26 13:14:01 +10:30
module neck_stock ( ) {
angle_excess = asin ( ( scallop_depth + fw2 ) / target_neck_thickness ) ;
a0 = 90 - angle_excess ;
a1 = 270 + angle_excess ;
rotate ( [ - 90 , 0 , 0 ] )
linear_extrude ( neck_length )
polygon ( [ for ( i = [ 0 : 300 ] ) let ( a = lerp ( a0 , a1 , i / 300.0 ) ) [ neck_width * 0.5 * sin ( a ) , - target_neck_thickness * cos ( a ) ] ] ) ;
}
module scallop ( fret ) {
x0 = fret_scale_length ( fret - 1 ) - fw2 ;
x1 = fret_scale_length ( fret ) + fw2 ;
xmid = lerp ( x0 , x1 , 0.5 ) ;
// Radius it?
arc = arc_points ( [ [ x0 , scallop_depth ] , [ x1 , scallop_depth ] , [ xmid , 0 ] ] ) ;
// echo(arc);
rotate ( [ 90 , 0 , 90 ] ) linear_extrude ( neck_width , center = true ) polygon ( arc ) ;
}
module fret_bumps ( ) {
translate ( [ 0 , neck_length - fw2 , scallop_depth ] ) rotate ( [ 0 , 90 ] ) cylinder ( d = fret_width , h = neck_width , center = true , $fn = 200 ) ;
}
module differences ( ) {
2024-12-28 13:43:39 +10:30
t_offset = - 30 ; //2.7;
t_z = - 25 ; //-23;
2024-12-27 19:06:45 +10:30
module tuner ( ) {
hole_r = 3 ;
bend_r = 24 + hole_r + 10 ;
rotate ( [ 90 , - 90 , 90 ] ) UBassTuner ( from_below = true , from_side = true ) ;
2025-02-10 14:47:30 +10:30
$fn = 72 ;
// translate([35,16,0]) cylinder(h=10-t_z, d=7);
2024-12-27 19:10:13 +10:30
translate ( [ 36 - 7 , 7 , 1 ] ) for ( a = [ 10 : 89 ] ) {
2024-12-27 19:06:45 +10:30
hull ( ) {
2025-02-10 14:47:30 +10:30
translate ( [ a / 9 , bend_r - bend_r * sin ( a ) , bend_r * cos ( a ) ] ) sphere ( hole_r ) ;
translate ( [ ( a + 1 ) / 9 , bend_r - bend_r * sin ( a + 1 ) , bend_r * cos ( a + 1 ) ] ) sphere ( hole_r ) ;
translate ( [ 7 , bend_r - bend_r * sin ( a + 1 ) , bend_r * cos ( a + 1 ) ] ) sphere ( hole_r ) ;
2024-12-27 19:06:45 +10:30
}
}
}
2024-12-28 13:43:39 +10:30
translate ( [ t_offset , 49 , t_z ] ) tuner ( ) ;
mirror ( [ 1 , 0 , 0 ] ) translate ( [ t_offset , 27 , t_z ] ) tuner ( ) ;
2024-12-27 19:10:13 +10:30
translate ( [ t_offset , 5 , t_z ] ) tuner ( ) ;
2024-12-26 13:14:01 +10:30
for ( i = [ - 1 : 2 : 1 ] )
translate ( [ i * 15 , 0 , - 4 ] )
2025-01-02 15:11:48 +10:30
CFTubeCutout ( neck_length , 0 , tolerance = 0.4 ) ;
2024-12-26 13:14:01 +10:30
translate ( [ 0 , 0 , - 10 ] )
2025-01-02 15:11:48 +10:30
CFTubeCutout ( neck_length , 0 , tolerance = 0.4 ) ;
2024-12-26 13:14:01 +10:30
}
2024-12-28 13:43:39 +10:30
thick = 34 ;
2024-12-26 19:05:49 +10:30
render ( ) difference ( ) {
2024-12-28 13:43:39 +10:30
color ( [ 1 , 1 , 1 , 0.7 ] ) translate ( [ - neck_width / 2 , 0 , - thick ] ) round_cube ( [ neck_width , neck_length , thick ] , 4 ) ;
2024-12-26 13:14:01 +10:30
differences ( ) ;
}
// color([1,1,1,0.3]) neck_stock();
}
2024-12-22 16:01:41 +10:30
module fret_tube ( from_fret , to_fret , fret_width = 2.4 ) {
fw2 = fret_width / 2 ;
x0 = fret_scale_length ( 0 ) + fw2 ;
x1 = fret_scale_length ( from_fret ) + ( ( from_fret = = 0 ) ? fw2 : ( - fw2 ) ) ;
x2 = fret_scale_length ( to_fret ) - fw2 ;
render ( ) difference ( ) {
neck ( fret_width = fret_width ) ;
for ( i = [ - 1 : 2 : 1 ] )
translate ( [ i * 15 , 0 , - 4 ] )
2025-01-02 15:11:48 +10:30
CFTubeCutout ( x1 , x2 ) ;
2024-12-22 16:01:41 +10:30
for ( i = [ - 1 : 2 : 1 ] )
translate ( [ i * 7.5 , 0 , - 7 ] )
2025-01-02 15:11:48 +10:30
CFSquareCutout ( x1 , x2 ) ;
2024-12-22 16:01:41 +10:30
translate ( [ 0 , 0 , - 10 ] )
2025-01-02 15:11:48 +10:30
CFTubeCutout ( x1 , x2 ) ;
2024-12-22 16:01:41 +10:30
translate ( [ - 50 , 0 , - 50 ] ) cube ( [ 100 , x2 , 100 ] ) ;
translate ( [ - 50 , x1 , - 50 ] ) cube ( [ 100 , x0 - x1 , 100 ] ) ;
2024-12-22 01:07:14 +10:30
2024-12-22 16:01:41 +10:30
// αβγδεζ
2024-12-23 13:36:52 +10:30
rotate ( [ 90 , 0 , 0 ] ) linear_extrude ( ( x2 + 0.3 ) * 2 , center = true ) text ( text = "01β" , font = "Deja Vu Sans" , halign = "center" , valign = "center" , size = 4 ) ;
2024-12-22 16:01:41 +10:30
}
2024-12-22 01:07:14 +10:30
}
2024-12-22 16:01:41 +10:30
2024-12-26 18:42:39 +10:30
module fret_tube_filler ( from_fret , to_fret , fret_width = 2.4 , belthole_length = 140 , VLH = true ) {
2024-12-24 21:31:02 +10:30
fw2 = fret_width / 2 ;
x0 = fret_scale_length ( 0 ) + fw2 ;
x1 = fret_scale_length ( from_fret ) + ( ( from_fret = = 0 ) ? fw2 : ( - fw2 ) ) ;
x2 = ( to_fret < 100 ) ? ( fret_scale_length ( to_fret ) - fw2 ) : 0 ;
render ( ) difference ( ) {
neck ( fret_width = fret_width , filler = true ) ;
2024-12-26 18:42:39 +10:30
for ( i = [ - 1 : 1 ] )
translate ( [ i * 15 , 0 , ( i = = 0 ) ? ( - 10 ) : ( - 4 ) ] )
2025-01-02 15:11:48 +10:30
CFTubeCutout ( x1 , x2 , VLH = VLH ) ;
2024-12-24 21:31:02 +10:30
translate ( [ - 50 , 0 , - 50 ] ) cube ( [ 100 , x2 , 100 ] ) ;
translate ( [ - 50 , x1 , - 50 ] ) cube ( [ 100 , x0 - x1 , 100 ] ) ;
// Add a belt hole
arc = arc_points ( [ [ 16 , - 20 ] , [ - 16 , - 20 ] , [ 0 , - 4 ] ] ) ;
belthole_r = 2.5 ;
belthole_fn = 72 ;
belthole_x0 = x1 - belthole_r - 5 ;
belthole_x1 = belthole_x0 - belthole_length ;
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 ) ;
}
}
// αβγδεζ
2024-12-26 18:42:39 +10:30
t = "01β.β" ;
2024-12-24 21:31:02 +10:30
translate ( [ 0 , 0 , - 3.5 ] ) rotate ( [ 90 , 0 , 0 ] ) linear_extrude ( ( x2 + 0.3 ) * 2 , center = true ) text ( text = t , font = "Deja Vu Sans" , halign = "center" , valign = "center" , size = 4 ) ;
translate ( [ 0 , x1 - 0.3 , - 3 ] ) rotate ( [ 90 , 0 , 180 ] ) linear_extrude ( ( 0.3 ) * 2 , center = true ) text ( text = t , font = "Deja Vu Sans" , halign = "center" , valign = "center" , size = 4 ) ;
}
}
2024-12-23 14:47:47 +10:30
module headpiece ( string_spacing = 18 , string_margin = 4.5 , num_strings = 3 , target_neck_thickness = 15 , scallop_depth = 3 , fret_width = 2.4 ) {
headpiece_length = 36 ;
cf_square_length = 32 ;
fw2 = fret_width / 2 ;
x0 = fret_scale_length ( 0 ) + fw2 ;
neck_width = ( num_strings - 1 ) * string_spacing + string_margin * 2 ;
bend_radius = 24 ;
module stock ( ) {
angle_excess = asin ( scallop_depth / target_neck_thickness ) ;
a0 = 90 - angle_excess ;
a1 = 270 + angle_excess ;
translate ( [ 0 , x0 , 0 ] )
rotate ( [ - 90 , 0 , 0 ] )
linear_extrude ( headpiece_length )
polygon ( [ for ( i = [ 0 : 300 ] ) let ( a = lerp ( a0 , a1 , i / 300.0 ) ) [ neck_width * 0.5 * sin ( a ) , - target_neck_thickness * cos ( a ) ] ] ) ;
}
2024-12-23 19:26:08 +10:30
module string_tubes ( tolerance = 1.0 ) {
2024-12-23 14:47:47 +10:30
string_thicknesses = [ 4.9 , 4.2 , 3.0 ] ;
module string_tube ( diameter , fn = 36 ) {
2025-02-10 14:47:30 +10:30
$fn = fn ;
2024-12-23 14:47:47 +10:30
hole_r = diameter / 2 ;
bend_r = bend_radius + hole_r ;
union ( ) {
for ( a = [ 0 : 89 ] ) {
hull ( ) {
2025-02-10 14:47:30 +10:30
translate ( [ 0 , bend_r * sin ( a ) , bend_r * cos ( a ) ] ) sphere ( hole_r ) ;
translate ( [ 0 , bend_r * sin ( a + 1 ) , bend_r * cos ( a + 1 ) ] ) sphere ( hole_r ) ;
2024-12-23 14:47:47 +10:30
}
}
hull ( ) {
2025-02-10 14:47:30 +10:30
translate ( [ 0 , bend_r * sin ( 90 ) , bend_r * cos ( 90 ) ] ) sphere ( hole_r ) ;
translate ( [ 0 , bend_r * sin ( 90 ) , - target_neck_thickness ] ) sphere ( hole_r ) ;
2024-12-23 14:47:47 +10:30
}
}
} ;
for ( i = [ 0 : num_strings - 1 ] ) {
2024-12-23 19:26:08 +10:30
string_diameter = string_thicknesses [ i ] + tolerance ;
2024-12-23 14:47:47 +10:30
x = - neck_width / 2 + string_margin + ( i * string_spacing ) ;
2024-12-24 03:59:26 +10:30
translate ( [ x , x0 + 2 , - bend_radius + scallop_depth ] ) string_tube ( string_diameter ) ;
2024-12-23 14:47:47 +10:30
}
}
difference ( ) {
stock ( ) ;
string_tubes ( ) ;
for ( i = [ - 1 : 2 : 1 ] )
translate ( [ i * 7.5 , 0 , - 7 ] )
2025-01-02 15:11:48 +10:30
CFSquareCutout ( x0 + cf_square_length , x0 , taper_x1 = false ) ;
2024-12-23 14:47:47 +10:30
// αβγδεζ
2024-12-24 03:59:26 +10:30
translate ( [ 0 , x0 + headpiece_length , - 5 ] ) rotate ( [ 90 , 0 , 180 ] ) linear_extrude ( 0.3 , center = true ) text ( text = "01β.γ " , font = "Deja Vu Sans" , halign = "center" , valign = "center" , size = 4 ) ;
2024-12-23 14:47:47 +10:30
}
}
2024-12-27 19:06:45 +10:30
module bridge ( string_spacing = 18 , string_margin = 4.5 , num_strings = 3 , target_neck_thickness = 15 , scallop_depth = 3 , fret_width = 2.4 ) {
piece_length = 16 ;
cf_square_length = 32 ;
fw2 = fret_width / 2 ;
x0 = 0 ;
neck_width = ( num_strings - 1 ) * string_spacing + string_margin * 2 ;
bend_radius = 24 ;
string_thicknesses = [ 4.9 , 4.2 , 3.0 ] ;
module stock ( ) {
angle_excess = asin ( scallop_depth / target_neck_thickness ) ;
a0 = 90 - angle_excess ;
a1 = 270 + angle_excess ;
translate ( [ 0 , x0 , 0 ] )
rotate ( [ - 90 , 0 , 0 ] )
linear_extrude ( piece_length )
polygon ( [ for ( i = [ 0 : 300 ] ) let ( a = lerp ( a0 , a1 , i / 300.0 ) ) [ neck_width * 0.5 * sin ( a ) , - target_neck_thickness * cos ( a ) ] ] ) ;
intersection ( ) {
r = 14 ;
translate ( [ 0 , 8 , scallop_depth ] ) rotate ( [ 18 , - 90 , 0 ] ) scale ( [ 1 , 0.2 , 1 ] ) cylinder ( r = r , h = neck_width * 1.5 , center = true , $fn = 72 ) ;
a0 = - 90 ;
a1 = 90 ;
translate ( [ 0 , x0 , 0 ] )
rotate ( [ - 90 , 0 , 0 ] )
linear_extrude ( piece_length )
polygon ( [ for ( i = [ 0 : 300 ] ) let ( a = lerp ( a0 , a1 , i / 300.0 ) ) [ neck_width * 0.5 * sin ( a ) , - target_neck_thickness * cos ( a ) * 3 ] ] ) ;
}
}
module string_tubes ( tolerance = 1.0 ) {
module string_tube ( diameter , fn = 36 ) {
hole_r = diameter / 2 ;
bend_r = bend_radius + hole_r ;
union ( ) {
for ( a = [ 0 : 89 ] ) {
hull ( ) {
translate ( [ 0 , bend_r * sin ( a ) , bend_r * cos ( a ) ] ) sphere ( hole_r , $fn = fn ) ;
translate ( [ 0 , bend_r * sin ( a + 1 ) , bend_r * cos ( a + 1 ) ] ) sphere ( hole_r , $fn = fn ) ;
}
}
hull ( ) {
translate ( [ 0 , bend_r * sin ( 90 ) , bend_r * cos ( 90 ) ] ) sphere ( hole_r , $fn = fn ) ;
translate ( [ 0 , bend_r * sin ( 90 ) , - target_neck_thickness ] ) sphere ( hole_r , $fn = fn ) ;
}
}
} ;
for ( i = [ 0 : num_strings - 1 ] ) {
string_diameter = string_thicknesses [ i ] + tolerance ;
x = - neck_width / 2 + string_margin + ( i * string_spacing ) ;
// translate([x, x0+2, -bend_radius+scallop_depth]) string_tube(string_diameter);
translate ( [ x , 0 , scallop_depth + string_diameter / 2 + 8 ] ) rotate ( [ - 90 , 0 , 0 ] ) cylinder ( d = string_diameter , h = 20 , $fn = 72 ) ;
}
}
// string_tubes();
difference ( ) {
stock ( ) ;
string_tubes ( ) ;
for ( i = [ - 1 : 1 ] )
translate ( [ i * 15 , 0 , ( i = = 0 ) ? ( - 10 ) : ( - 4 ) ] )
2025-01-02 15:11:48 +10:30
CFTubeCutout ( piece_length + 0.1 , x0 - 0.1 , VLH = false ) ;
2024-12-27 19:06:45 +10:30
// αβγδεζ
translate ( [ 0 , x0 + piece_length , - 5 ] ) rotate ( [ 90 , 0 , 180 ] ) linear_extrude ( 0.3 , center = true ) text ( text = "01β" , font = "Deja Vu Sans" , halign = "center" , valign = "center" , size = 4 ) ;
}
}
2025-01-12 18:28:13 +10:30
module Nylon6String ( render_colour_0 = true , render_colour_1 = true , render_colour_2 = true , render_colour_3 = true , from_fret = 0 , to_fret = 1 , reference = false ) {
2025-01-11 00:48:14 +10:30
colour_0 = "blue" ;
colour_1 = "white" ; // fret layers
colour_2 = "green" ; // side markers
colour_3 = "yellow" ; // inlays
2025-01-22 19:30:11 +10:30
id_line_0 = "PETG" ;
id_line_1 = "1δ.α " ;
2025-01-01 22:33:40 +10:30
fsl_mm = fret_scale_length ( 0 ) ;
2025-01-03 18:20:30 +10:30
2025-01-22 19:30:11 +10:30
// string_diameters_thous = [28, 32, 40, 30, 36, 42]; // Ernie Ball Earthwoods (seemingly counterfeit from Amazon)
string_diameters_thous = [ 28 , 32 , 40 , 30 , 35 , 43 ] ; // Artist CLST Classical Nylon Guitar Strings
2025-01-03 18:20:30 +10:30
string_diameters_mm = string_diameters_thous * 0.0254 ;
2025-01-01 22:33:40 +10:30
2025-01-11 00:48:14 +10:30
num_frets = 21 ;
2025-01-01 22:33:40 +10:30
num_strings = 6 ;
// 56mm wide neck
string_spacing = 10 ; // 50mm E to e
string_margin = 3 ; // +6
2025-01-03 18:20:30 +10:30
neck_width = string_spacing * ( num_strings - 1 ) + string_margin * 2 ;
2025-01-12 23:45:07 +10:30
body_width = 96 ;
2025-01-02 01:52:19 +10:30
scallop_depth = 2.5 ;
2025-01-02 15:59:23 +10:30
fret_width = 2.4 ;
2025-01-11 00:48:14 +10:30
target_neck_thickness = 16 ; //22;
2025-01-12 21:56:24 +10:30
// echo(fret_scale_length(8));
// echo(fret_scale_length(9));
2025-01-11 00:48:14 +10:30
rx0 = - 40 ; // Reinforcing rods start
rx1 = rx0 + 280 ;
// target_neck_thickness_additional_points = [];
target_neck_thickness_additional_points = [ [ rx0 + CF_Tube_Len + 20 , 22 ] , [ 0 , 22 ] ] ;
2025-01-04 03:09:41 +10:30
// target_neck_thickness_additional_points = [[400.025-fret_width/2, 22], [380, 25], [130, 42], [0, 42]];
2025-01-04 15:37:24 +10:30
// target_neck_thickness_additional_points = [[400.025-fret_width/2, 22], [380, 25], [0, 25]];
2025-01-04 03:09:41 +10:30
// target_neck_thickness_additional_points = [[400.025-fret_width/2, 22], [130, 42], [0, 42]];
2025-01-01 22:33:40 +10:30
2025-01-03 18:20:30 +10:30
echo ( str ( "Making a Nylon 6 String with scale length " , fsl_mm , "mm = " , fsl_mm / 25.4 , "in and neck width " , neck_width , "mm" ) ) ;
assert ( fsl_mm = = Classical_Short_Scale_mm ) ; // Make sure the function correctly uses our changed global
2025-01-01 22:33:40 +10:30
2025-01-03 18:20:30 +10:30
function CF_Span_Coords ( full_length = 700 , ply = 3 ) = [ for ( i = [ 0 : ply - 1 ] ) [ 0 , lerp ( 0 , full_length - CF_Tube_Len , i / ( ply - 1 ) ) , CF_Square_Width * i ] ] ;
2025-01-02 15:11:48 +10:30
module CF_Span ( full_length = 700 , ply = 3 , hole = true ) {
2025-01-03 18:20:30 +10:30
for ( v = CF_Span_Coords ( full_length , ply ) )
translate ( v ) CFSquare ( hole = hole ) ;
2025-01-01 22:33:40 +10:30
}
2025-01-04 15:37:24 +10:30
module MyNeck ( inlays_only = false , side_markers_only = false , fret_layers_only = false , engrave_markers = false , remove_fret_layers = false ) {
render ( ) 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 , target_neck_thickness_additional_points = target_neck_thickness_additional_points , inlays_only = inlays_only , side_markers_only = side_markers_only , fret_layers_only = fret_layers_only , engrave_markers = engrave_markers , remove_fret_layers = remove_fret_layers ) ;
}
module MultiColourNeck ( ) {
2025-01-11 00:48:14 +10:30
if ( render_colour_0 ) color ( colour_0 ) MyNeck ( engrave_markers = true , remove_fret_layers = true ) ;
if ( render_colour_1 ) color ( colour_1 ) MyNeck ( fret_layers_only = true ) ;
if ( render_colour_2 ) color ( colour_2 ) MyNeck ( side_markers_only = true ) ;
if ( render_colour_3 ) color ( colour_3 ) MyNeck ( inlays_only = true ) ;
2025-01-04 03:09:41 +10:30
}
2025-01-03 18:20:30 +10:30
reinforcing_tube_positions = flatten ( [
[
for ( i = [ - 1 , 1 ] ) each [
// Headside reinforcement
2025-01-11 00:48:14 +10:30
[ i * 21.5 , rx1 , - 4 ] ,
2025-01-03 18:20:30 +10:30
// Bridgeside reinforcement
2025-01-11 00:48:14 +10:30
// [i*21.5, rx0, -4],
[ i * 17.25 , rx0 , - 10 ] ,
// [i*17, rx0, -12],
[ i * 3.95 , rx0 , - 16.5 ] ,
2025-01-03 18:20:30 +10:30
]
] ,
[
2025-01-11 00:48:14 +10:30
// Headside reinforcement
[ 0 , rx1 , - 4 ] ,
[ 0 , rx1 , - 11 ] ,
2025-01-03 18:20:30 +10:30
// Bridgeside reinforcement
2025-01-11 00:48:14 +10:30
// [0, rx0, -11],
2025-01-03 18:20:30 +10:30
] ] ) ;
echo ( reinforcing_tube_positions ) ;
// Through span construction
2025-01-04 15:37:24 +10:30
span_coords = CF_Span_Coords ( ply = 2 ) ;
2025-01-03 18:20:30 +10:30
reinforcing_square_positions = [
2025-01-11 00:48:14 +10:30
for ( i = [ - 1 , 1 ] ) each [ for ( v = span_coords ) [ i * 10 , rx0 , - 10 ] + v ]
2025-01-03 18:20:30 +10:30
] ;
echo ( reinforcing_square_positions ) ;
// neck(num_frets=num_frets, num_strings=num_strings, string_margin=string_margin, string_spacing=string_spacing);
2025-01-02 15:59:23 +10:30
// %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);
2025-01-03 18:20:30 +10:30
module NeckFragment ( from_fret , to_fret , to_origin = true , include_from_fret = false , test_tolerances_piece = false ) {
2025-01-02 15:59:23 +10:30
x0 = fret_scale_length ( to_fret ) - fret_width / 2 ;
x1 = fret_scale_length ( from_fret ) + ( ( include_from_fret ) ? 1 : ( - 1 ) ) * fret_width / 2 ;
xn = fsl_mm + fret_width ;
2025-01-03 18:20:30 +10:30
module TestTolerancesPiece ( ) {
2025-01-02 15:59:23 +10:30
for ( m = [ 0 , 11 ] ) mirror ( [ m , 0 , 0 ] ) color ( [ 0.4 , 0.5 , 0.5 ] ) translate ( [ 9 , 0 , - 16 + ( CF_Square_Width * 2 ) ] ) CFSquareCutout ( x0 , x1 , taper_length = 2 ) ;
translate ( [ 12 , 0 , - 14 ] ) CFSquareCutout ( x0 , x1 , taper_length = 2 ) ;
2025-01-03 00:03:47 +10:30
translate ( [ 12 - CF_Square_Width , 0 , - 14 ] ) CFSquareCutout ( x0 , x1 - 8 , taper_length = 2 , taper_x2 = false ) ;
2025-01-02 15:59:23 +10:30
translate ( [ - 12 , 0 , - 14 ] ) CFSquareCutout ( x0 , x1 , taper_length = 2 ) ;
2025-01-03 00:03:47 +10:30
translate ( [ - 12 + CF_Square_Width , 0 , - 14 ] ) CFSquareCutout ( x0 + 8 , x1 , taper_length = 2 , taper_x1 = false ) ;
2025-01-02 15:59:23 +10:30
translate ( [ 20 , 0 , - 6 ] ) CFTubeCutout ( x0 , x1 , taper_length = 2 ) ;
}
2025-01-03 18:20:30 +10:30
translate ( [ 0 , to_origin ? - x0 : 0 , 0 ] ) render ( ) difference ( ) {
2025-01-04 15:37:24 +10:30
MultiColourNeck ( ) ;
color ( colour_1 ) {
translate ( [ - 100 , 0 , - 100 ] ) cube ( [ 200 , x0 , 200 ] ) ;
translate ( [ - 100 , x1 , - 100 ] ) cube ( [ 200 , xn - x1 , 200 ] ) ;
for ( v = reinforcing_tube_positions ) CFTubeCutout2 ( v , x0 , x1 ) ;
for ( v = reinforcing_square_positions ) CFSquareCutout2 ( v , x0 , x1 ) ;
if ( test_tolerances_piece ) TestTolerancesPiece ( ) ;
}
2025-01-03 18:20:30 +10:30
}
2025-01-02 15:59:23 +10:30
}
2025-01-03 18:20:30 +10:30
// Test tolerances piece
module TestTolerancesPiece ( ) {
difference ( ) {
NeckFragment ( 2 , 3 , test_tolerances_piece = true ) ;
2025-01-04 15:37:24 +10:30
translate ( [ - 20 , 0 , - 1 ] ) rotate ( [ - 90 , 180 , 180 ] ) linear_extrude ( 3 , center = true ) text ( id_line_0 , size = 3.5 , halign = "center" , valign = "center" ) ;
translate ( [ - 20 , 0 , - 6 ] ) rotate ( [ - 90 , 180 , 180 ] ) linear_extrude ( 3 , center = true ) text ( id_line_1 , size = 3.5 , halign = "center" , valign = "center" ) ;
2025-01-03 18:20:30 +10:30
}
2025-01-02 15:59:23 +10:30
}
2025-01-03 18:20:30 +10:30
// TestTolerancesPiece();
2025-01-01 22:33:40 +10:30
2025-01-03 18:20:30 +10:30
module RealPiece ( from_fret , to_fret , include_from_fret = false ) {
midpoint = ( fret_scale_length ( from_fret ) - fret_scale_length ( to_fret ) + ( include_from_fret ? fret_width : 0 ) ) / 2 ;
2025-01-04 17:16:21 +10:30
module IDText ( thickness = 0.2 , inset = 0 , extra_line = str ( "F" , to_fret ) ) {
2025-01-11 00:48:14 +10:30
translate ( [ 0 , 0 , - 8 ] ) rotate ( [ - 90 , 180 , 180 ] ) translate ( [ 0 , 0 , - thickness - inset ] ) linear_extrude ( thickness ) {
text ( str ( id_line_0 , id_line_1 ) , size = 2.25 , halign = "center" , valign = "center" , $fn = 100 ) ;
translate ( [ 0 , - 3 ] ) text ( extra_line , size = 2.25 , halign = "center" , valign = "center" , $fn = 100 ) ;
2025-01-04 17:16:21 +10:30
}
}
module BackIDText ( thickness = 0.2 , inset = 0 ) {
rotate_around ( [ 0 , 0 , 180 ] , [ 0 , midpoint , 0 ] )
IDText ( thickness , inset , str ( "F" , from_fret ) ) ;
2025-01-04 15:37:24 +10:30
}
2025-01-03 18:20:30 +10:30
render ( ) difference ( ) {
NeckFragment ( from_fret , to_fret , include_from_fret = include_from_fret ) ;
2025-01-04 17:16:21 +10:30
// Subtract from frets
2025-01-11 00:48:14 +10:30
color ( "red" ) {
2025-01-04 17:16:21 +10:30
IDText ( ) ;
if ( include_from_fret ) BackIDText ( ) ;
}
2025-01-11 00:48:14 +10:30
color ( "red" ) BackIDText ( ) ;
2025-01-03 18:20:30 +10:30
}
2025-01-11 00:48:14 +10:30
// // color("red") IDText(inset=0.0001);
// if (render_colour_0) color(colour_1) IDText();
// if (render_colour_0 && include_from_fret) color(colour_1) BackIDText();
// if (render_colour_1 && !include_from_fret) color("red") BackIDText();
2025-01-03 18:20:30 +10:30
}
2025-01-12 21:56:24 +10:30
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();
}
2025-01-14 00:29:10 +10:30
module TunerPlacement ( cutout = false , ear_extra_diameter = 0 , ear_extra_height = 0 , plate_clearance = 0 , shaft_clearance = 0 , shaft_tolerance = 0 ) {
for ( m = [ 0 , 1 ] ) mirror ( [ m , 0 , 0 ] ) translate ( [ 29 , 3 , - 32 ] ) rotate ( [ 0 , - 90 , 0 ] ) NylonTuner ( cutout , ear_extra_diameter , ear_extra_height , plate_clearance , shaft_clearance , shaft_tolerance ) ;
}
2025-01-12 23:45:07 +10:30
module LoopOrTunerBlock ( tuner_block ) {
y0 = 116 ;
y1 = fret_scale_length ( 22 ) ;
z0 = - 43 ;
z_drop = 6 ;
loop_thick = 8 ;
loop_slot_thick = 6 ;
z1 = z0 + z_drop ;
2025-01-14 00:29:10 +10:30
module TunerBlockCheekVolumes ( ) {
vw = 50 ;
for ( i = [ - 1 , 1 ] ) translate ( [ - vw / 2 + i * 58 , 0 , z0 ] ) cube ( [ vw , y0 , - z0 ] ) ;
2025-01-22 19:30:11 +10:30
for ( i = [ - 1 , 1 ] ) translate ( [ - vw / 2 + i * 46 , 0 , - 14 ] ) cube ( [ vw , y0 , - z0 ] ) ;
2025-01-14 00:29:10 +10:30
}
2025-01-12 23:45:07 +10:30
if ( tuner_block ) {
2025-01-14 00:29:10 +10:30
render ( ) difference ( ) {
translate ( [ - body_width / 2 , 0 , z0 ] ) cube ( [ body_width , y0 , - z0 ] ) ;
// Tuner cutouts
TunerPlacement ( true , 4 , 10 , 10 , 10 , 0.4 ) ;
tw = 16 ;
for ( i = [ - 1 , 1 ] ) translate ( [ - tw / 2 + i * 15 , 0 , z0 ] ) cube ( [ tw , y0 , - z0 - 20 ] ) ;
// Cheek Volumes
TunerBlockCheekVolumes ( ) ;
// CF
for ( v = reinforcing_tube_positions ) CFTubeCutout2 ( v , y0 , y1 ) ;
for ( v = reinforcing_square_positions ) CFSquareCutout2 ( v , y0 , y1 ) ;
// Version stamp
translate ( [ 0 , 0.5 , - 5 ] ) rotate ( [ 90 , 0 , 0 ] ) linear_extrude ( 10 ) {
text ( str ( id_line_0 , id_line_1 ) , size = 2.9 , halign = "center" , valign = "center" , $fn = 100 ) ;
}
translate ( [ 0 , y0 - 0.5 , - 5 ] ) rotate ( [ 90 , 0 , 180 ] ) linear_extrude ( 10 ) {
text ( str ( id_line_0 , id_line_1 ) , size = 2.9 , halign = "center" , valign = "center" , $fn = 100 ) ;
}
}
2025-01-12 23:45:07 +10:30
} else {
render ( ) difference ( ) {
hull ( ) {
translate ( [ - neck_width / 2 , y1 - hull_epsilon , z1 ] ) cube ( [ neck_width , hull_epsilon , - z1 ] ) ;
translate ( [ - body_width / 2 , y0 , z0 ] ) cube ( [ body_width , hull_epsilon , - z0 ] ) ;
}
// Belt loop slot
hull ( ) {
translate ( [ 0 , y1 - loop_slot_thick , z1 + loop_thick ] ) rotate ( [ 0 , 90 , 0 ] ) cylinder ( d = loop_slot_thick , h = body_width , center = true , $fn = cyl_hd_fn ) ;
translate ( [ 0 , y0 + loop_slot_thick , z0 + loop_thick ] ) rotate ( [ 0 , 90 , 0 ] ) cylinder ( d = loop_slot_thick , h = body_width , center = true , $fn = cyl_hd_fn ) ;
}
// Angled belt loop slot
hull ( ) {
extend_factor = 0.8 ;
translate ( [ body_width / 2 , y1 - loop_slot_thick + ( y1 - y0 - loop_slot_thick * 2 ) * extend_factor , z1 + loop_thick + ( z1 - z0 ) * extend_factor ] ) rotate ( [ 0 , 90 , 0 ] ) cylinder ( d = loop_slot_thick , h = hull_epsilon , $fn = cyl_hd_fn ) ;
translate ( [ 0 , y0 + loop_slot_thick , z0 + loop_thick ] ) rotate ( [ 0 , 90 , 0 ] ) cylinder ( d = loop_slot_thick , h = body_width , center = true , $fn = cyl_hd_fn ) ;
}
// Version stamp
translate ( [ - 10 , y0 + 0.5 , - 30 ] ) rotate ( [ 90 , 0 , 0 ] ) linear_extrude ( 10 ) {
text ( str ( id_line_0 , id_line_1 ) , size = 2.9 , halign = "center" , valign = "center" , $fn = 100 ) ;
}
translate ( [ - 10 , y1 - 0.5 , - 30 ] ) rotate ( [ 90 , 0 , 180 ] ) linear_extrude ( 10 ) {
text ( str ( id_line_0 , id_line_1 ) , size = 2.9 , halign = "center" , valign = "center" , $fn = 100 ) ;
}
// CF
for ( v = reinforcing_tube_positions ) CFTubeCutout2 ( v , y0 , y1 ) ;
for ( v = reinforcing_square_positions ) CFSquareCutout2 ( v , y0 , y1 ) ;
}
}
}
2025-01-14 02:16:30 +10:30
bridge_channel_width = 5 ;
bridge_channel_depth = 7 ;
2025-01-12 23:45:07 +10:30
2025-01-12 18:28:13 +10:30
if ( reference ) {
union ( ) {
2025-01-04 15:37:24 +10:30
c_cf = [ 0.4 , 0.5 , 0.5 ] ;
% MyNeck ( ) ;
// CF square stacks
for ( v = reinforcing_tube_positions ) color ( c_cf ) translate ( v ) CFTube ( ) ;
for ( v = reinforcing_square_positions ) color ( c_cf ) translate ( v ) CFSquare ( ) ;
// Approximate tuner placement
2025-01-14 00:29:10 +10:30
TunerPlacement ( ) ;
2025-01-04 15:37:24 +10:30
// Render strings above for spacing reference
string_excess = 80 ;
for ( i = [ 0 : num_strings - 1 ] ) {
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 ) ;
}
2025-01-03 18:20:30 +10:30
}
2025-01-12 21:56:24 +10:30
} else if ( from_fret >= 0 ) {
2025-01-12 18:28:13 +10:30
RealPiece ( from_fret , to_fret , include_from_fret = ( from_fret = = 0 ) ) ;
2025-01-12 21:56:24 +10:30
} else if ( from_fret = = - 1 ) {
// String holding headpiece
echo ( "Making a headpiece" ) ;
HeadPiece ( ) ;
2025-01-12 23:45:07 +10:30
} else if ( from_fret = = - 2 ) {
echo ( "Making a filler belt loop" ) ;
LoopOrTunerBlock ( false ) ;
} else if ( from_fret = = - 3 ) {
echo ( "Making a tuner block" ) ;
LoopOrTunerBlock ( true ) ;
} else if ( from_fret = = - 4 ) {
echo ( "Making a bridge" ) ;
2025-01-22 19:30:11 +10:30
y_len = 9 ;
base_height = 7 ;
saddle_height = 4 ;
pickup_w = 3 ;
pickup_h = 2 ;
render ( ) difference ( ) {
union ( ) {
// Base
translate ( [ - neck_width / 2 , 0 , 0 ] ) cube ( [ neck_width , y_len , base_height ] ) ;
// String saddles - rule of thumb: string diameter multiplied by 4
r0 = 0.85 ;
for ( i = [ 0 : num_strings - 1 ] ) translate ( [ ( num_strings - i - 1 ) * string_spacing - neck_width / 2 + string_margin , y_len - string_diameters_mm [ i ] * 4 , base_height ] ) {
step = ( $ preview ) ? 8 : 2 ;
r = r0 + string_diameters_mm [ i ] * 1.2 ;
translate ( [ 0 , 0 , saddle_height ] ) for ( a = [ 90 : step : 270 - step ] ) hull ( ) {
translate ( [ - sin ( a ) * r , 0 , cos ( a ) * r ] ) sphere ( r = r0 , $fn = cyl_ld_fn ) ;
translate ( [ - sin ( a + step ) * r , 0 , cos ( a + step ) * r ] ) sphere ( r = r0 , $fn = cyl_ld_fn ) ;
translate ( [ - sin ( a ) * r , - 3.7 , - saddle_height - r0 ] ) sphere ( r = r0 , $fn = cyl_ld_fn ) ;
translate ( [ - sin ( a + step ) * r , - 3.7 , - saddle_height - r0 ] ) sphere ( r = r0 , $fn = cyl_ld_fn ) ;
translate ( [ - sin ( a ) * r , 1.2 , - saddle_height - r0 ] ) sphere ( r = r0 , $fn = cyl_ld_fn ) ;
translate ( [ - sin ( a + step ) * r , 1.2 , - saddle_height - r0 ] ) sphere ( r = r0 , $fn = cyl_ld_fn ) ;
}
}
// Bridge channel notch
notch_w = bridge_channel_width - CF_Square_Width_tolerance ; // Shrink a little for tolerance
notch_d = bridge_channel_depth - CF_Square_Width_tolerance / 2 ;
translate ( [ - notch_w / 2 , 0 , - notch_d ] ) cube ( [ notch_w , y_len , notch_d ] ) ;
}
// Pickup notch
tol = 0.25 ;
translate ( [ - neck_width / 2 , 2 , - tol ] ) hull ( ) {
cube ( [ neck_width , pickup_w , pickup_h + tol ] ) ;
translate ( [ 0 , pickup_h * 0.8 , 0 ] ) cube ( [ neck_width , pickup_w , 0.01 ] ) ;
}
// Version stamp
y0 = 0 ;
y1 = y_len ;
translate ( [ - 15 , y0 + 0.5 , 4 ] ) rotate ( [ 90 , 0 , 0 ] ) linear_extrude ( 10 ) {
text ( str ( id_line_0 , id_line_1 ) , size = 2.9 , halign = "center" , valign = "center" , $fn = 100 ) ;
}
translate ( [ - 15 , y1 - 0.5 , 4 ] ) rotate ( [ 90 , 0 , 180 ] ) linear_extrude ( 10 ) {
text ( str ( id_line_0 , id_line_1 ) , size = 2.9 , halign = "center" , valign = "center" , $fn = 100 ) ;
}
}
2025-01-12 23:45:07 +10:30
} else if ( from_fret = = - 5 ) {
echo ( "Making a tailpiece" ) ;
2025-01-14 02:16:30 +10:30
y0 = - 47 ;
y1 = 0 ;
fw_len = 20 ;
total_len = y1 - y0 ;
fw_height = 43 ;
rad_diameter = 20.35 ; //21;
rad_radius = rad_diameter / 2 ;
render ( ) difference ( ) {
hull ( ) {
translate ( [ - body_width / 2 , - fw_len , - fw_height ] ) cube ( [ body_width , fw_len , fw_height ] ) ;
translate ( [ 0 , - total_len + rad_radius , - rad_radius ] ) rotate ( [ 0 , 90 , 0 ] ) cylinder ( h = neck_width , d = rad_diameter , center = true , $fn = cyl_hd_fn ) ;
}
// Tuner cavity line up
tw = 16 ;
z0 = - 43 ;
for ( i = [ - 1 , 1 ] ) translate ( [ - tw / 2 + i * 15 , y0 , z0 + 5 ] ) cube ( [ tw , total_len , - z0 - 25 ] ) ;
// String channels
for ( i = [ 0 : num_strings - 1 ] ) translate ( [ ( num_strings - i - 1 ) * string_spacing - neck_width / 2 + string_margin , y0 + rad_radius , - rad_radius ] ) {
x = [ - 1 , 0 , 1 , - 1 , 0 , 1 ] [ i ] * 4 / 180 ;
r = rad_radius + string_diameters_mm [ i ] * 0.5 ;
for ( a = [ 0 : 180 ] ) hull ( ) {
translate ( [ a * x , - sin ( a ) * r , cos ( a ) * r ] ) sphere ( r = string_diameters_mm [ i ] , $fn = cyl_ld_fn ) ;
translate ( [ a * x , - sin ( a + 1 ) * r , cos ( a + 1 ) * r ] ) sphere ( r = string_diameters_mm [ i ] , $fn = cyl_ld_fn ) ;
}
}
// Bridge channel
translate ( [ - bridge_channel_width / 2 , y0 + rad_radius , - bridge_channel_depth ] ) cube ( [ bridge_channel_width , total_len - rad_radius , bridge_channel_depth ] ) ;
// Version stamp
translate ( [ - 30 , y0 + 0.5 , - 15 ] ) rotate ( [ 90 , 0 , 0 ] ) linear_extrude ( 10 ) {
text ( str ( id_line_0 , id_line_1 ) , size = 2.9 , halign = "center" , valign = "center" , $fn = 100 ) ;
}
translate ( [ - 30 , y1 - 0.5 , - 15 ] ) rotate ( [ 90 , 0 , 180 ] ) linear_extrude ( 10 ) {
text ( str ( id_line_0 , id_line_1 ) , size = 2.9 , halign = "center" , valign = "center" , $fn = 100 ) ;
}
// CF
for ( v = reinforcing_tube_positions ) CFTubeCutout2 ( v , y0 , y1 ) ;
for ( v = reinforcing_square_positions ) CFSquareCutout2 ( v , y0 , y1 ) ;
}
2025-01-03 18:20:30 +10:30
}
2025-01-01 22:33:40 +10:30
// Debug markers to aid part slicing eyeballing
2025-01-03 18:20:30 +10:30
// %for (i = [150:250:1000]) {
% for ( i = [ 0 : 250 : 1000 ] ) {
2025-01-11 00:48:14 +10:30
translate ( [ 35 , i , 0 ] ) union ( ) { linear_extrude ( 1 ) text ( str ( i , "mm" ) ) ; cube ( [ 35 , 1 , 1 ] , center = true ) ; }
2025-01-01 22:33:40 +10:30
}
}
2025-02-02 00:17:00 +10:30
2025-02-18 00:30:23 +10:30
module Steel6String ( include_colours = [ 0 , 1 ] , segment = - 1 , reference = false ) {
2025-02-17 21:45:22 +10:30
// Artist Strat clone has a neck thickness of about 20mm at the 12th fret, where we want to overlap the truss rods
// We will probably have to overlap them horizontally, far from ideal, to achieve the desired thinness.
2025-02-10 16:15:55 +10:30
$ include_colours = include_colours ;
2025-02-17 21:45:22 +10:30
$ id_lines = [ "ABS" , "2" ] ;
2025-02-10 16:15:55 +10:30
$ guitar_scale_length_mm = Fender_Scale_mm ;
$fs l_mm = fret_scale_length ( 0 ) ;
2025-02-02 00:17:00 +10:30
2025-02-10 16:15:55 +10:30
$ string_diameters_thous = [ 9 , 11 , 16 , 24 , 32 , 42 ] ; // Artist ELST942
$ string_diameters_mm = $ string_diameters_thous * 0.0254 ;
2025-02-02 00:17:00 +10:30
2025-02-10 16:15:55 +10:30
$ num_frets = 22 ;
$ num_strings = 6 ;
2025-02-02 00:17:00 +10:30
// 56mm wide neck
2025-02-17 21:45:22 +10:30
$ string_spacing_nut = 9 ; // 45mm E to e
2025-02-10 16:15:55 +10:30
$ string_spacing_bridge = 11.2 ; // 56mm E to e
$ string_margin = 3 ; // +6
$ neck_width_nut = default_neck_width_nut ( ) ;
$ neck_width_bridge = default_neck_width_bridge ( ) ;
2025-02-02 00:17:00 +10:30
body_width = 96 ;
2025-02-10 16:15:55 +10:30
$ scallop_depth = 2.0 ;
$ fret_widths = default_fret_widths ( 3.6 , 2.4 ) ;
2025-02-17 21:45:22 +10:30
$ fret_angle = 50 ;
2025-02-10 16:15:55 +10:30
$t arget_neck_thickness = 16 ;
2025-02-02 00:17:00 +10:30
2025-02-17 21:45:22 +10:30
// Artist Strat has about 18cm of headstock and 10cm past bridge on body
y0 = - 160 ;
headstock_length = 36 ;
y_end = behind_fret ( 0 ) + headstock_length ;
y_fretboard_end = get_end_of_fretboard ( ) ;
2025-02-02 14:52:25 +10:30
2025-02-17 21:45:22 +10:30
$ segment_cuts = [ y0 , 0 , after_fret ( 22 ) , after_fret ( 8 ) , behind_fret ( 0 ) , y_end ] ;
echo ( "Segment cuts:" , $ segment_cuts , "have lengths" , [ for ( i = [ 1 : len ( $ segment_cuts ) - 1 ] ) $ segment_cuts [ i ] - $ segment_cuts [ i - 1 ] ] ) ;
2025-02-02 00:17:00 +10:30
2025-02-17 21:45:22 +10:30
target_neck_thickness_additional_points = [ ] ;
2025-02-02 00:17:00 +10:30
2025-02-17 21:45:22 +10:30
// trussrod_y = 265;
$t russrod_positions = [
[ [ 0 , y_end - 3 , - 9.5 ] , [ 0 , 0 , 180 ] , "TrussRodSingleAction" ] ,
// [[-8, y0, -32], [1.3, 0, 0], "TrussRod"],
] ;
$t russrods_extra = 0 ;
$ dowel_positions = [
[ - 9 , $ segment_cuts [ 4 ] , - 10 ] ,
[ 9 , $ segment_cuts [ 4 ] , - 10 ] ,
[ - 8 , $ segment_cuts [ 3 ] , - 11 ] ,
[ 8 , $ segment_cuts [ 3 ] , - 11 ] ,
[ - 44 , $ segment_cuts [ 2 ] , - 22 ] ,
[ 44 , $ segment_cuts [ 2 ] , - 22 ] ,
[ - 44 , $ segment_cuts [ 2 ] , - 6 ] ,
[ 44 , $ segment_cuts [ 2 ] , - 6 ] ,
[ - 10 , $ segment_cuts [ 1 ] , - 4 ] ,
[ 10 , $ segment_cuts [ 1 ] , - 4 ] ,
[ - 17 , $ segment_cuts [ 1 ] , - 16 ] ,
[ 17 , $ segment_cuts [ 1 ] , - 16 ] ,
] ;
$ reinforcing_tube_positions = [
[ - 17 , y_end - 25 - CF_Tube_Len , - 4.5 ] ,
[ 17 , y_end - 25 - CF_Tube_Len , - 4.5 ] ,
[ 0 , y0 , - 24 ] ,
] ;
$ reinforcing_square_positions = [
[ - 12 , y0 , - 34 ] ,
[ 12 , y0 , - 34 ] ,
[ - 12 , y0 , - 24 ] ,
[ 12 , y0 , - 24 ] ,
[ - 24 , y0 , - 24 ] ,
[ 24 , y0 , - 24 ] ,
] ;
2025-02-02 00:17:00 +10:30
2025-02-18 00:30:23 +10:30
module MyNeck ( ) {
2025-02-17 21:45:22 +10:30
render ( ) TaperNeck ( target_neck_thickness_additional_points = target_neck_thickness_additional_points ) ;
2025-02-02 00:17:00 +10:30
}
2025-02-02 14:52:25 +10:30
module HeadPiece ( label = true ) {
2025-02-17 21:45:22 +10:30
string_offsets = [ - 2.4 , 0 , 2.4 , - 2.4 , 0 , 2.4 ] ;
y0 = behind_fret ( 0 ) ;
2025-02-02 00:17:00 +10:30
end_radius = 12 ;
2025-02-17 21:45:22 +10:30
y1 = y0 + headstock_length ;
z0 = $ scallop_depth ;
z1 = z0 + get_max_fret_height ( ) ;
z2 = z0 + 2.5 ; //get_max_fret_height();
2025-02-02 00:17:00 +10:30
module StringHoles ( ) {
2025-02-17 21:45:22 +10:30
for ( i = [ 0 : $ num_strings - 1 ] ) translate ( [ string_x ( i , y0 ) , y0 , 0 ] ) {
string_v = [ 0 , 0 , z1 + $ string_diameters_mm [ i ] ] ;
ballend_v = [ string_offsets [ i ] , 27 , - 3.5 ] ;
2025-02-02 00:17:00 +10:30
hull ( ) {
2025-02-17 21:45:22 +10:30
translate ( string_v ) sphere ( d = min ( 2.6 , $ string_diameters_mm [ i ] * 1.2 + 1 ) , $fn = 360 ) ;
translate ( ballend_v ) sphere ( d = 2.6 , $fn = 360 ) ;
2025-02-02 14:52:25 +10:30
}
hull ( ) {
// String ball ends are roughly 3mm by 4mm cylinder(d=4, h=3)
2025-02-17 21:45:22 +10:30
translate ( ballend_v ) rotate ( [ 0 , 90 , 0 ] ) cylinder ( d = 4.5 , h = 3.5 , center = true , $fn = 360 ) ;
translate ( ballend_v + ballend_v - string_v ) rotate ( [ 0 , 90 , 0 ] ) cylinder ( d = 6.5 , h = 5.0 , center = true , $fn = 360 ) ;
2025-02-02 00:17:00 +10:30
}
}
}
2025-02-17 21:45:22 +10:30
module Label ( ) {
translate ( [ 0 , lerp ( y0 , y_end , 0.55 ) , z2 - 0.5 ] ) linear_extrude ( 0.5 ) scale ( 1.0 ) import ( file = "svgs/Ichthys.plain.svg" , center = true ) ;
}
2025-02-02 00:17:00 +10:30
render ( ) difference ( ) {
hull ( ) {
2025-02-17 21:45:22 +10:30
translate ( [ 0 , y0 , 0 ] ) scale ( [ neck_width ( y0 ) / 2 , 0.01 , $t arget_neck_thickness ] ) sphere ( r = 1 , $fn = 360 ) ;
translate ( [ 0 , y1 - end_radius , 0 ] ) scale ( [ neck_width ( y1 ) / 2 , end_radius , $t arget_neck_thickness * 1.0 ] ) sphere ( r = 1 , $fn = 360 ) ;
2025-02-02 00:17:00 +10:30
}
2025-02-17 21:45:22 +10:30
// Chop excess
translate ( [ - 500 , y0 , z2 ] ) cube ( [ 1000 , 1000 , 1000 ] ) ;
translate ( [ - 500 , y0 , z0 ] ) rotate ( [ 10 , 0 , 0 ] ) cube ( [ 1000 , 1000 , 1000 ] ) ;
translate ( [ - 500 , y0 - 1000 , - 500 ] ) cube ( [ 1000 , 1000 , 1000 ] ) ;
2025-02-02 00:17:00 +10:30
StringHoles ( ) ;
2025-02-17 21:45:22 +10:30
Label ( ) ;
2025-02-02 00:17:00 +10:30
}
}
module TunerPlacement ( cutout = false , ear_extra_diameter = 0 , ear_extra_height = 0 , plate_clearance = 0 , shaft_clearance = 0 , shaft_tolerance = 0 ) {
for ( m = [ 0 , 1 ] ) mirror ( [ m , 0 , 0 ] ) translate ( [ 29 , 3 , - 32 ] ) rotate ( [ 0 , - 90 , 0 ] ) NylonTuner ( cutout , ear_extra_diameter , ear_extra_height , plate_clearance , shaft_clearance , shaft_tolerance ) ;
}
module LoopOrTunerBlock ( tuner_block ) {
y0 = 116 ;
y1 = fret_scale_length ( 22 ) ;
z0 = - 43 ;
z_drop = 6 ;
loop_thick = 8 ;
loop_slot_thick = 6 ;
z1 = z0 + z_drop ;
module TunerBlockCheekVolumes ( ) {
vw = 50 ;
for ( i = [ - 1 , 1 ] ) translate ( [ - vw / 2 + i * 58 , 0 , z0 ] ) cube ( [ vw , y0 , - z0 ] ) ;
for ( i = [ - 1 , 1 ] ) translate ( [ - vw / 2 + i * 46 , 0 , - 14 ] ) cube ( [ vw , y0 , - z0 ] ) ;
}
if ( tuner_block ) {
render ( ) difference ( ) {
translate ( [ - body_width / 2 , 0 , z0 ] ) cube ( [ body_width , y0 , - z0 ] ) ;
// Tuner cutouts
TunerPlacement ( true , 4 , 10 , 10 , 10 , 0.4 ) ;
tw = 16 ;
for ( i = [ - 1 , 1 ] ) translate ( [ - tw / 2 + i * 15 , 0 , z0 ] ) cube ( [ tw , y0 , - z0 - 20 ] ) ;
// Cheek Volumes
TunerBlockCheekVolumes ( ) ;
// CF
for ( v = reinforcing_tube_positions ) CFTubeCutout2 ( v , y0 , y1 ) ;
for ( v = reinforcing_square_positions ) CFSquareCutout2 ( v , y0 , y1 ) ;
// Version stamp
translate ( [ 0 , 0.5 , - 5 ] ) rotate ( [ 90 , 0 , 0 ] ) linear_extrude ( 10 ) {
text ( str ( id_line_0 , id_line_1 ) , size = 2.9 , halign = "center" , valign = "center" , $fn = 100 ) ;
}
translate ( [ 0 , y0 - 0.5 , - 5 ] ) rotate ( [ 90 , 0 , 180 ] ) linear_extrude ( 10 ) {
text ( str ( id_line_0 , id_line_1 ) , size = 2.9 , halign = "center" , valign = "center" , $fn = 100 ) ;
}
}
} else {
render ( ) difference ( ) {
hull ( ) {
translate ( [ - neck_width / 2 , y1 - hull_epsilon , z1 ] ) cube ( [ neck_width , hull_epsilon , - z1 ] ) ;
translate ( [ - body_width / 2 , y0 , z0 ] ) cube ( [ body_width , hull_epsilon , - z0 ] ) ;
}
// Belt loop slot
hull ( ) {
translate ( [ 0 , y1 - loop_slot_thick , z1 + loop_thick ] ) rotate ( [ 0 , 90 , 0 ] ) cylinder ( d = loop_slot_thick , h = body_width , center = true , $fn = cyl_hd_fn ) ;
translate ( [ 0 , y0 + loop_slot_thick , z0 + loop_thick ] ) rotate ( [ 0 , 90 , 0 ] ) cylinder ( d = loop_slot_thick , h = body_width , center = true , $fn = cyl_hd_fn ) ;
}
// Angled belt loop slot
hull ( ) {
extend_factor = 0.8 ;
translate ( [ body_width / 2 , y1 - loop_slot_thick + ( y1 - y0 - loop_slot_thick * 2 ) * extend_factor , z1 + loop_thick + ( z1 - z0 ) * extend_factor ] ) rotate ( [ 0 , 90 , 0 ] ) cylinder ( d = loop_slot_thick , h = hull_epsilon , $fn = cyl_hd_fn ) ;
translate ( [ 0 , y0 + loop_slot_thick , z0 + loop_thick ] ) rotate ( [ 0 , 90 , 0 ] ) cylinder ( d = loop_slot_thick , h = body_width , center = true , $fn = cyl_hd_fn ) ;
}
// Version stamp
translate ( [ - 10 , y0 + 0.5 , - 30 ] ) rotate ( [ 90 , 0 , 0 ] ) linear_extrude ( 10 ) {
text ( str ( id_line_0 , id_line_1 ) , size = 2.9 , halign = "center" , valign = "center" , $fn = 100 ) ;
}
translate ( [ - 10 , y1 - 0.5 , - 30 ] ) rotate ( [ 90 , 0 , 180 ] ) linear_extrude ( 10 ) {
text ( str ( id_line_0 , id_line_1 ) , size = 2.9 , halign = "center" , valign = "center" , $fn = 100 ) ;
}
// CF
for ( v = reinforcing_tube_positions ) CFTubeCutout2 ( v , y0 , y1 ) ;
for ( v = reinforcing_square_positions ) CFSquareCutout2 ( v , y0 , y1 ) ;
}
}
}
2025-02-17 21:45:22 +10:30
module Shumbucker ( ) {
translate ( [ - shumbucker_w1 / 2 , - shumbucker_l / 2 , 0 ] ) cube ( [ shumbucker_w1 , shumbucker_l , shumbucker_h ] ) ;
translate ( [ - shumbucker_w2 / 2 , - shumbucker_l / 2 , 0 ] ) cube ( [ shumbucker_w2 , shumbucker_l , 4 ] ) ;
}
2025-02-02 00:17:00 +10:30
bridge_channel_width = 5 ;
bridge_channel_depth = 7 ;
if ( reference ) {
2025-02-18 00:30:23 +10:30
c_cf = [ 0.4 , 0.5 , 0.5 ] ;
% MyNeck ( ) ;
% hull ( ) {
r = 5 ;
$fn = 72 ;
for ( m = [ 0 : 1 ] ) mirror ( [ m , 0 , 0 ] ) {
translate ( [ r - 30 , after_fret ( 15 ) - 5 , - r ] ) sphere ( r ) ;
translate ( [ r - 45 , after_fret ( 16 ) - 5 , r - 40 ] ) sphere ( r ) ;
translate ( [ r - 45 , after_fret ( 20 ) - 5 , - r ] ) sphere ( r ) ;
translate ( [ r - 45 , y0 + r , r - 40 ] ) sphere ( r ) ;
translate ( [ r - 45 , y0 + r , - r ] ) sphere ( r ) ;
2025-02-02 00:17:00 +10:30
}
}
2025-02-18 00:30:23 +10:30
color ( c_cf ) Reinforcements ( ) ;
translate ( [ 0 , fret_scale_length ( 24 ) , 1 - shumbucker_h ] ) Shumbucker ( ) ;
// Approximate tuner placement
// TunerPlacement();
// Render strings above for spacing reference
string_excess = 80 ;
for ( i = [ 0 : $ num_strings - 1 ] ) {
hull ( ) {
translate ( [ string_x ( i , - string_excess ) , - string_excess , 5 ] ) sphere ( d = $ string_diameters_mm [ i ] , $fn = cyl_ld_fn ) ;
translate ( [ string_x ( i , $fs l_mm + 5 ) , $fs l_mm + 5 , 5 ] ) sphere ( d = $ string_diameters_mm [ i ] , $fn = cyl_ld_fn ) ;
2025-02-02 14:52:25 +10:30
}
}
2025-02-18 00:30:23 +10:30
% HeadPiece ( false ) ;
} else if ( segment >= 0 ) {
//
} else if ( segment = = - 1 ) {
2025-02-02 00:17:00 +10:30
// String holding headpiece
echo ( "Making a headpiece" ) ;
HeadPiece ( ) ;
2025-02-18 00:30:23 +10:30
} else if ( segment = = - 2 ) {
2025-02-02 00:17:00 +10:30
echo ( "Making a filler belt loop" ) ;
LoopOrTunerBlock ( false ) ;
2025-02-18 00:30:23 +10:30
} else if ( segment = = - 3 ) {
2025-02-02 00:17:00 +10:30
echo ( "Making a tuner block" ) ;
LoopOrTunerBlock ( true ) ;
2025-02-18 00:30:23 +10:30
} else if ( segment = = - 4 ) {
2025-02-02 00:17:00 +10:30
echo ( "Making a bridge" ) ;
y_len = 9 ;
base_height = 7 ;
saddle_height = 4 ;
pickup_w = 3 ;
pickup_h = 2 ;
render ( ) difference ( ) {
union ( ) {
// Base
translate ( [ - neck_width / 2 , 0 , 0 ] ) cube ( [ neck_width , y_len , base_height ] ) ;
// String saddles - rule of thumb: string diameter multiplied by 4
r0 = 0.85 ;
for ( i = [ 0 : num_strings - 1 ] ) translate ( [ ( num_strings - i - 1 ) * string_spacing - neck_width / 2 + string_margin , y_len - string_diameters_mm [ i ] * 4 , base_height ] ) {
step = ( $ preview ) ? 8 : 2 ;
r = r0 + string_diameters_mm [ i ] * 1.2 ;
translate ( [ 0 , 0 , saddle_height ] ) for ( a = [ 90 : step : 270 - step ] ) hull ( ) {
translate ( [ - sin ( a ) * r , 0 , cos ( a ) * r ] ) sphere ( r = r0 , $fn = cyl_ld_fn ) ;
translate ( [ - sin ( a + step ) * r , 0 , cos ( a + step ) * r ] ) sphere ( r = r0 , $fn = cyl_ld_fn ) ;
translate ( [ - sin ( a ) * r , - 3.7 , - saddle_height - r0 ] ) sphere ( r = r0 , $fn = cyl_ld_fn ) ;
translate ( [ - sin ( a + step ) * r , - 3.7 , - saddle_height - r0 ] ) sphere ( r = r0 , $fn = cyl_ld_fn ) ;
translate ( [ - sin ( a ) * r , 1.2 , - saddle_height - r0 ] ) sphere ( r = r0 , $fn = cyl_ld_fn ) ;
translate ( [ - sin ( a + step ) * r , 1.2 , - saddle_height - r0 ] ) sphere ( r = r0 , $fn = cyl_ld_fn ) ;
}
}
// Bridge channel notch
notch_w = bridge_channel_width - CF_Square_Width_tolerance ; // Shrink a little for tolerance
notch_d = bridge_channel_depth - CF_Square_Width_tolerance / 2 ;
translate ( [ - notch_w / 2 , 0 , - notch_d ] ) cube ( [ notch_w , y_len , notch_d ] ) ;
}
// Pickup notch
tol = 0.25 ;
translate ( [ - neck_width / 2 , 2 , - tol ] ) hull ( ) {
cube ( [ neck_width , pickup_w , pickup_h + tol ] ) ;
translate ( [ 0 , pickup_h * 0.8 , 0 ] ) cube ( [ neck_width , pickup_w , 0.01 ] ) ;
}
// Version stamp
y0 = 0 ;
y1 = y_len ;
translate ( [ - 15 , y0 + 0.5 , 4 ] ) rotate ( [ 90 , 0 , 0 ] ) linear_extrude ( 10 ) {
text ( str ( id_line_0 , id_line_1 ) , size = 2.9 , halign = "center" , valign = "center" , $fn = 100 ) ;
}
translate ( [ - 15 , y1 - 0.5 , 4 ] ) rotate ( [ 90 , 0 , 180 ] ) linear_extrude ( 10 ) {
text ( str ( id_line_0 , id_line_1 ) , size = 2.9 , halign = "center" , valign = "center" , $fn = 100 ) ;
}
}
} else if ( from_fret = = - 5 ) {
echo ( "Making a tailpiece" ) ;
y0 = - 47 ;
y1 = 0 ;
fw_len = 20 ;
total_len = y1 - y0 ;
fw_height = 43 ;
rad_diameter = 20.35 ; //21;
rad_radius = rad_diameter / 2 ;
render ( ) difference ( ) {
hull ( ) {
translate ( [ - body_width / 2 , - fw_len , - fw_height ] ) cube ( [ body_width , fw_len , fw_height ] ) ;
translate ( [ 0 , - total_len + rad_radius , - rad_radius ] ) rotate ( [ 0 , 90 , 0 ] ) cylinder ( h = neck_width , d = rad_diameter , center = true , $fn = cyl_hd_fn ) ;
}
// Tuner cavity line up
tw = 16 ;
z0 = - 43 ;
for ( i = [ - 1 , 1 ] ) translate ( [ - tw / 2 + i * 15 , y0 , z0 + 5 ] ) cube ( [ tw , total_len , - z0 - 25 ] ) ;
// String channels
for ( i = [ 0 : num_strings - 1 ] ) translate ( [ ( num_strings - i - 1 ) * string_spacing - neck_width / 2 + string_margin , y0 + rad_radius , - rad_radius ] ) {
x = [ - 1 , 0 , 1 , - 1 , 0 , 1 ] [ i ] * 4 / 180 ;
r = rad_radius + string_diameters_mm [ i ] * 0.5 ;
for ( a = [ 0 : 180 ] ) hull ( ) {
translate ( [ a * x , - sin ( a ) * r , cos ( a ) * r ] ) sphere ( r = string_diameters_mm [ i ] , $fn = cyl_ld_fn ) ;
translate ( [ a * x , - sin ( a + 1 ) * r , cos ( a + 1 ) * r ] ) sphere ( r = string_diameters_mm [ i ] , $fn = cyl_ld_fn ) ;
}
}
// Bridge channel
translate ( [ - bridge_channel_width / 2 , y0 + rad_radius , - bridge_channel_depth ] ) cube ( [ bridge_channel_width , total_len - rad_radius , bridge_channel_depth ] ) ;
// Version stamp
translate ( [ - 30 , y0 + 0.5 , - 15 ] ) rotate ( [ 90 , 0 , 0 ] ) linear_extrude ( 10 ) {
text ( str ( id_line_0 , id_line_1 ) , size = 2.9 , halign = "center" , valign = "center" , $fn = 100 ) ;
}
translate ( [ - 30 , y1 - 0.5 , - 15 ] ) rotate ( [ 90 , 0 , 180 ] ) linear_extrude ( 10 ) {
text ( str ( id_line_0 , id_line_1 ) , size = 2.9 , halign = "center" , valign = "center" , $fn = 100 ) ;
}
// CF
for ( v = reinforcing_tube_positions ) CFTubeCutout2 ( v , y0 , y1 ) ;
for ( v = reinforcing_square_positions ) CFSquareCutout2 ( v , y0 , y1 ) ;
}
}
// Debug markers to aid part slicing eyeballing
// %for (i = [150:250:1000]) {
% for ( i = [ 0 : 250 : 1000 ] ) {
translate ( [ 35 , i , 0 ] ) union ( ) { linear_extrude ( 1 ) text ( str ( i , "mm" ) ) ; cube ( [ 35 , 1 , 1 ] , center = true ) ; }
}
}
2025-01-26 16:02:30 +10:30
// Colour schemes
include < BambuColours.scad >
COLOURSCHEME_ABS_CLOWNFISH = [ BAMBU_ABS_ORANGE , BAMBU_ABS_WHITE , BAMBU_ABS_BLACK , BAMBU_ABS_BLACK ] ;
COLOURSCHEME_ABSGF_CLOWNFISH = [ BAMBU_ABSGF_ORANGE , BAMBU_ABSGF_WHITE , BAMBU_ABSGF_BLACK , BAMBU_ABSGF_BLACK ] ;
COLOURSCHEME_PA6GF_CLOWNFISH = [ BAMBU_PA6GF_ORANGE , BAMBU_PA6GF_WHITE , BAMBU_PA6GF_BLACK , BAMBU_PA6GF_BLACK ] ;
COLOURSCHEME_PETGHF_CLOWNFISH = [ BAMBU_PETGHF_ORANGE , BAMBU_PETGHF_WHITE , BAMBU_PETGHF_BLACK , BAMBU_PETGHF_BLACK ] ;
COLOURSCHEME_ABS_BLUE = [ BAMBU_ABS_NAVY_BLUE , BAMBU_ABS_AZURE , BAMBU_ABS_AZURE , BAMBU_ABS_AZURE ] ;
COLOURSCHEME_PETGHF_BLUE = [ BAMBU_PETGHF_LAKE_BLUE , BAMBU_PETGHF_LAKE_BLUE , "" , "" ] ;
2025-02-06 21:43:59 +10:30
// colour_scheme = COLOURSCHEME_ABSGF_CLOWNFISH;
2025-02-17 21:45:22 +10:30
colour_scheme = COLOURSCHEME_ABS_BLUE ;
2025-02-05 18:07:14 +10:30
// color(colour_scheme[0]) rotate([90,0,0]) Steel6String(from_fret=0, to_fret=23, include_colours=[0]);
// color(colour_scheme[1]) rotate([90,0,0]) Steel6String(from_fret=0, to_fret=23, include_colours=[1]);
// color(colour_scheme[2]) rotate([90,0,0]) Steel6String(from_fret=0, to_fret=23, include_colours=[2]);
// color(colour_scheme[3]) rotate([90,0,0]) Steel6String(from_fret=0, to_fret=23, include_colours=[3]);
2025-02-17 21:45:22 +10:30
// rotate([90,0,0])
2025-02-18 00:30:23 +10:30
Steel6String ( reference = true ) ;
2025-02-01 18:22:58 +10:30
2025-02-05 18:07:14 +10:30
// TrussRodSingleAction();
// translate([20, 0]) TrussRod();
2025-02-06 21:24:51 +10:30
// difference() {
// l = 70;
// w = 20;
// extra = 5;
// translate([-w/2, -extra, 1.6-w/2]) cube([w, l+extra, w]);
// // TrussRod(taper_points=[-extra, l], extra=true, tolerance = 0.24);
// TrussRodSingleAction(taper_points=[-extra, l], extra=true, tolerance = 0.24);
// }
2025-02-06 21:43:59 +10:30
2025-02-10 02:57:30 +10:30
module TwoBangerMk2 ( include_colours = [ 0 , 1 ] , segment = - 1 , preview = false ) {
2025-02-10 16:15:55 +10:30
$ include_colours = include_colours ;
2025-02-10 14:47:30 +10:30
$ guitar_scale_length_mm = PBass_Scale_mm ;
2025-02-17 15:25:36 +10:30
$ id_lines = [ "Zweisaiten" , "250214-1" ] ;
2025-02-10 16:15:55 +10:30
$fs l_mm = fret_scale_length ( 0 ) ;
2025-02-10 02:53:43 +10:30
2025-02-10 16:15:55 +10:30
$ string_diameters_thous = [ 80 , 105 ] ; // Artist BST45130
$ string_diameters_mm = $ string_diameters_thous * 0.0254 ;
2025-02-10 02:53:43 +10:30
2025-02-15 01:19:07 +10:30
$ neck_width_nut = 35 ;
$ neck_width_bridge = 35 ;
$t arget_neck_thickness = $ neck_width_nut / 2 ;
2025-02-10 16:15:55 +10:30
$ num_strings = 2 ;
2025-02-15 01:19:07 +10:30
$ string_spacing_nut = 18 ;
$ string_spacing_bridge = 18 ;
$ string_margin = ( $ neck_width_nut - $ string_spacing_nut ) / 2 ;
2025-02-10 02:53:43 +10:30
2025-02-15 01:19:07 +10:30
$ num_frets = 33 ;
2025-02-10 16:15:55 +10:30
$ fret_widths = default_fret_widths ( 3.6 , 2.4 ) ;
2025-02-15 01:19:07 +10:30
$ fret_angle = 45 ;
2025-02-10 16:15:55 +10:30
$ scallop_depth = 2.5 ;
$ extra_thickness_above_center = 6 ;
2025-02-10 17:36:51 +10:30
y0 = - 100 ;
2025-02-15 01:19:07 +10:30
headstock_length = 30 ;
y_end = behind_fret ( 0 ) + headstock_length ;
y_fretboard_end = get_end_of_fretboard ( ) ;
$ segment_cuts = [ y0 , 0 , after_fret ( 29 ) , after_fret ( 13 ) , after_fret ( 5 ) , y_end ] ;
echo ( $ segment_cuts ) ;
echo ( [ for ( i = [ 1 : len ( $ segment_cuts ) - 1 ] ) $ segment_cuts [ i ] - $ segment_cuts [ i - 1 ] ] ) ;
trussrod_y = 265 ;
$t russrod_positions = [
[ [ 0 , trussrod_y + 630 , - 4 ] , [ 0 , 0 , 180 ] , "TrussRod" ] ,
[ [ 0 , y0 , - 18 ] , [ 0 , 0 , 0 ] , "TrussRodSingleAction" ] ,
] ;
$t russrods_extra = 0 ;
$ dowel_positions = [
[ - 6 , $ segment_cuts [ 4 ] , - 11 ] ,
[ 6 , $ segment_cuts [ 4 ] , - 11 ] ,
[ - 6 , $ segment_cuts [ 3 ] , - 11 ] ,
[ 6 , $ segment_cuts [ 3 ] , - 11 ] ,
[ - 10 , $ segment_cuts [ 3 ] , 0 ] ,
[ 10 , $ segment_cuts [ 3 ] , 0 ] ,
// [ -9, $segment_cuts[2], -17],
// [ 9, $segment_cuts[2], -17],
[ - 10.25 , $ segment_cuts [ 2 ] , 2.5 ] ,
[ 10.25 , $ segment_cuts [ 2 ] , 2.5 ] ,
// [-10, $segment_cuts[1], 0],
// [ 10, $segment_cuts[1], 0],
[ - 7 , $ segment_cuts [ 1 ] , - 21 ] ,
[ 7 , $ segment_cuts [ 1 ] , - 21 ] ,
] ;
$ reinforcing_tube_positions = [
[ - 12 , fret_scale_length ( 0 ) - CF_Tube_Len , 0 ] ,
[ 12 , fret_scale_length ( 0 ) - CF_Tube_Len , 0 ] ,
[ - 12 , y0 + 30 , - 16 ] ,
[ 12 , y0 + 30 , - 16 ] ,
] ;
2025-02-10 02:53:43 +10:30
2025-02-13 01:43:15 +10:30
pickup_y = fret_scale_length ( 36 ) ;
module ElectronicsCavities ( diff = false ) {
2025-02-15 01:19:07 +10:30
if ( diff ) {
l = y_fretboard_end - $ segment_cuts [ 1 ] ;
translate ( [ - 500 , y_fretboard_end - l , - 11 ] ) cube ( [ 1000 , l , 1000 ] ) ;
} else {
// Directly under the strings would hit the second truss rod :(
//for (i=[0,1]) translate([string_x(i, pickup_y), pickup_y, -10]) relay_coil_placeholder();
z_pickup = - 10 ;
for ( i = [ 0 , 1 ] ) mirror ( [ i , 0 , 0 ] ) translate ( [ 8 , pickup_y , z_pickup ] ) relay_coil_placeholder ( top_clearance = diff ? 40 : 0 ) ;
// translate([0, pickup_y-8, -20]) rotate([0, 90, 0]) cylinder_outer(d=6, h=neck_width()+10, center=true);
// translate([5, pickup_y-38, -10]) rotate([0, 90, 0]) output_socket_placeholder();
output_socket_y = pickup_y - 26 ;
translate ( [ output_socket_l / 2 , output_socket_y , - 10 ] ) rotate ( [ 0 , 0 , 90 ] ) output_socket_placeholder ( rear_clearance = diff ? 40 : 0 ) ;
translate ( [ output_socket_l / 2 - 100 , output_socket_y + output_socket_w / 2 - 2 , - 10 - 1 ] ) cube ( [ 100 , 9 , 2 ] ) ;
}
2025-02-13 01:43:15 +10:30
}
2025-02-13 21:39:50 +10:30
module Tuners ( ) {
// Tuners to the side, knobs on top
// for (i=[0:1])
// mirror([i,0,0]) translate([15, (i*32)-66, -26]) rotate([0, -90, 0]) UBassTuner(from_side=false, from_below=true);
// Tuners to the top, knobs pointing out the back
2025-02-15 01:19:07 +10:30
for ( i = [ 0 : 1 ] ) for ( j = [ 0 : 1 ] )
mirror ( [ i , 0 , 0 ] ) translate ( [ - 6 , - 85 , - 34 ] ) mirror ( [ 0 , j , 0 ] ) rotate ( [ 0 , 0 , - 90 ] ) UBassTuner ( from_side = false , from_below = true , hole_tolerance = 0.5 , skip_ear = true ) ;
2025-02-13 21:39:50 +10:30
// rotate([180, -90, 0]) UBassTuner(from_side=false, from_below=true);
}
2025-02-10 02:53:43 +10:30
module MyBodySegment ( ) {
2025-02-15 01:19:07 +10:30
// Truss Rod overlapping - pseudo body joint
body_height = 26 ;
2025-02-10 02:53:43 +10:30
epsilon = 0.000001 ;
radius = 4 ;
2025-02-10 17:36:51 +10:30
w = neck_width ( ) - radius * 2 ;
2025-02-10 02:53:43 +10:30
curve_dist = 40 ;
step = 0.08 ;
steps = curve_dist / step ;
2025-02-15 01:19:07 +10:30
slope_start = 435 ;
slope_end = 485 ;
2025-02-13 21:39:50 +10:30
translate ( [ - neck_width ( ) / 2 , y0 , - body_height ] ) round_cube ( [ neck_width ( ) , slope_start , body_height ] , radius ) ;
2025-02-10 02:53:43 +10:30
hull ( ) {
$fn = 64 ;
for ( i = [ 0 , 1 ] ) mirror ( [ i , 0 , 0 ] ) {
2025-02-10 17:36:51 +10:30
translate ( [ w / 2 , radius + y0 , radius - body_height ] ) sphere ( radius ) ;
2025-02-13 21:39:50 +10:30
translate ( [ w / 2 , radius + y0 , - radius ] ) sphere ( radius ) ;
2025-02-10 17:36:51 +10:30
translate ( [ w / 2 , slope_start + y0 , radius - body_height ] ) sphere ( radius ) ;
2025-02-10 02:53:43 +10:30
}
2025-02-10 17:36:51 +10:30
// translate([+w/2, 495+y0, 0]) sphere(radius);
// translate([-w/2, 495+y0, 0]) sphere(radius);
2025-02-10 02:53:43 +10:30
difference ( ) {
2025-02-15 01:19:07 +10:30
translate ( [ 0 , slope_end + y0 , 0 ] ) sphere ( d = neck_width ( ) , $fn = 360 ) ;
translate ( [ 0 , slope_end + y0 , 50 ] ) cube ( [ 100 , 100 , 100 ] , center = true ) ;
2025-02-10 02:53:43 +10:30
}
}
2025-02-13 01:43:15 +10:30
2025-02-13 21:39:50 +10:30
// Tuner bulge
2025-02-15 01:19:07 +10:30
tuner_bulge_w = 56 ;
tuner_bulge_l = 25 ;
tuner_bulge_taper = 12 ;
2025-02-13 21:39:50 +10:30
hull ( ) {
translate ( [ - tuner_bulge_w / 2 , y0 , - body_height ] ) round_cube ( [ tuner_bulge_w , tuner_bulge_l , body_height ] , r = radius ) ;
translate ( [ - neck_width ( ) / 2 , y0 , - body_height ] ) round_cube ( [ neck_width ( ) , tuner_bulge_l + tuner_bulge_taper , body_height ] , r = radius ) ;
}
2025-02-13 01:43:15 +10:30
// Electronics bulge
2025-02-15 01:19:07 +10:30
// hull() {
// bulge_w = 36;
// bulge_l = 55;
// bulge_y = pickup_y-40;
// translate([-neck_width()/2, bulge_y-15, -body_height]) round_cube([neck_width(), bulge_l+30, body_height+$extra_thickness_above_center], r = radius);
// translate([-bulge_w/2, pickup_y-40, $extra_thickness_above_center-body_height]) round_cube([bulge_w, bulge_l, body_height], r = radius);
// }
2025-02-10 02:53:43 +10:30
}
module HeadPiece ( ) {
2025-02-15 01:19:07 +10:30
y0 = behind_fret ( 0 ) ;
end_radius = 14 ;
y_end = y0 + headstock_length ;
y1 = y_end - end_radius ;
2025-02-10 16:15:55 +10:30
z0 = $ scallop_depth + $ extra_thickness_above_center ;
z1 = $ scallop_depth + get_max_fret_height ( ) + $ extra_thickness_above_center ;
2025-02-10 02:53:43 +10:30
module StringHoles ( ) {
2025-02-10 16:15:55 +10:30
$fn = 360 ;
2025-02-15 01:19:07 +10:30
ballend_v = [ 0 , y0 + 21 , - 3 ] ;
for ( i = [ 0 : $ num_strings - 1 ] ) translate ( [ string_x ( i , y0 ) , 0 , 0 ] ) {
2025-02-12 12:25:24 +10:30
max_dia = 4 ; // ball wrap is like 3.8mm on these strings
hole_dia = min ( 4 , $ string_diameters_mm [ i ] * 1.5 + 1 ) ;
string_v = [ 0 , fret_scale_length ( 0 ) , z1 + hole_dia / 2 ] ;
2025-02-10 02:53:43 +10:30
hull ( ) {
2025-02-12 12:25:24 +10:30
translate ( string_v ) sphere ( d = hole_dia ) ;
translate ( ballend_v ) sphere ( d = 4 ) ;
2025-02-10 02:53:43 +10:30
}
2025-02-12 12:25:24 +10:30
delta_v = ballend_v - string_v ;
2025-02-10 02:53:43 +10:30
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)
2025-02-10 23:05:32 +10:30
translate ( ballend_v ) rotate ( [ 0 , 90 , 0 ] ) cylinder_outer ( d = 6.5 , h = 5.0 , center = true ) ;
2025-02-12 12:25:24 +10:30
translate ( ballend_v + delta_v ) rotate ( [ 0 , 90 , 0 ] ) cylinder_outer ( d = 6.5 , h = 5.0 , center = true ) ;
2025-02-10 02:53:43 +10:30
}
}
}
2025-02-12 12:25:24 +10:30
module Label ( ) {
2025-02-15 01:19:07 +10:30
// translate([0, lerp(y0, y_end, 0.5), z0-0.5]) linear_extrude(0.5) text(ichthys, font="Noto Sans", size=6, halign="center", valign="center");
// translate([0, lerp(y0, y_end, 0.5), z0-0.5]) linear_extrude(0.5) text(chirho, font="DejaVu Sans", size=12, halign="center", valign="center");
2025-02-15 18:03:32 +10:30
// translate([0, lerp(y0, y_end, 0.5), z0-0.5]) linear_extrude(0.5) text(khiro, font="Noto Sans Coptic", size=12, halign="center", valign="center");
// translate([0, lerp(y0, y_end, 0.45), z0-0.5]) linear_extrude(0.5) scale(0.75) rotate(90) import(file = "svgs/Ichthys.plain.svg", center=true);
translate ( [ 0 , lerp ( y0 , y_end , 0.45 ) , z0 - 0.5 ] ) linear_extrude ( 0.5 ) scale ( 0.95 ) import ( file = "svgs/Ichthys.plain.svg" , center = true ) ;
2025-02-12 12:25:24 +10:30
}
2025-02-10 02:53:43 +10:30
if ( list_has ( include_colours , 0 ) ) render ( ) difference ( ) {
2025-02-10 16:15:55 +10:30
$fn = 360 ;
2025-02-10 02:53:43 +10:30
hull ( ) {
2025-02-15 01:19:07 +10:30
translate ( [ 0 , y0 , 0 ] ) scale ( [ neck_width ( y0 ) / 2 , 0.01 , $t arget_neck_thickness ] ) sphere ( r = 1 ) ;
translate ( [ 0 , y1 , 0 ] ) scale ( [ neck_width ( y1 ) / 2 , end_radius , $t arget_neck_thickness * 1.0 ] ) sphere ( r = 1 ) ;
2025-02-10 02:53:43 +10:30
}
2025-02-15 01:19:07 +10:30
translate ( [ - 500 , y0 , z0 ] ) cube ( [ 1000 , 1000 , 1000 ] ) ;
translate ( [ - 500 , y0 - 1000 , - 500 ] ) cube ( [ 1000 , 1000 , 1000 ] ) ;
2025-02-10 02:53:43 +10:30
StringHoles ( ) ;
2025-02-12 12:25:24 +10:30
Label ( ) ;
2025-02-10 02:53:43 +10:30
}
2025-02-12 12:25:24 +10:30
if ( list_has ( include_colours , 2 ) ) Label ( ) ;
2025-02-10 02:53:43 +10:30
// StringHoles();
}
2025-02-09 19:09:39 +10:30
module MyNeck ( ) {
2025-02-10 02:53:43 +10:30
HeadPiece ( ) ;
2025-02-10 23:19:31 +10:30
TaperNeck ( fret_side_marker_x_angle = - 23 , fret_side_marker_y_angle = 15 ) MyBodySegment ( ) ;
2025-02-10 02:53:43 +10:30
}
module MyBody ( ) {
render ( ) difference ( ) {
MyNeck ( ) ;
2025-02-09 19:09:39 +10:30
2025-02-15 01:19:07 +10:30
Reinforcements ( $t russrods_extra = 20 ) ;
2025-02-10 02:53:43 +10:30
2025-02-13 01:43:15 +10:30
ElectronicsCavities ( diff = true ) ;
2025-02-15 01:19:07 +10:30
2025-02-13 21:39:50 +10:30
Tuners ( ) ;
2025-02-13 01:43:15 +10:30
2025-02-10 02:53:43 +10:30
// Add a belt hole
2025-02-10 23:19:31 +10:30
arc = arc_points ( [ [ 23 , - 13 ] , [ - 23 , - 13 ] , [ 0 , - 3 ] ] , 1 ) ;
2025-02-10 02:53:43 +10:30
belthole_r = 3 ;
belthole_fn = 72 ;
2025-02-15 01:19:07 +10:30
belthole_y1 = trussrod_y - 5 ;
2025-02-17 15:25:36 +10:30
belthole_y0 = 160 ;
2025-02-10 02:53:43 +10:30
render ( ) for ( i = [ 0 : len ( arc ) - 2 ] ) {
2025-02-10 16:15:55 +10:30
$fn = belthole_fn ;
2025-02-10 02:53:43 +10:30
hull ( ) {
2025-02-15 01:19:07 +10:30
x0 = arc [ i ] [ 0 ] ;
x1 = arc [ i + 1 ] [ 0 ] ;
m = 20 ;
cx0 = m * ( 1 - cos ( x0 * 120 / neck_width ( ) ) ) ;
cx1 = m * ( 1 - cos ( x1 * 120 / neck_width ( ) ) ) ;
translate ( [ x0 , belthole_y0 - cx0 , arc [ i ] [ 1 ] ] ) sphere ( belthole_r ) ;
translate ( [ x1 , belthole_y0 - cx1 , arc [ i + 1 ] [ 1 ] ] ) sphere ( belthole_r ) ;
translate ( [ x0 , belthole_y1 + cx0 , arc [ i ] [ 1 ] ] ) sphere ( belthole_r ) ;
translate ( [ x1 , belthole_y1 + cx1 , arc [ i + 1 ] [ 1 ] ] ) sphere ( belthole_r ) ;
2025-02-10 02:53:43 +10:30
}
}
}
2025-02-09 19:09:39 +10:30
}
2025-02-10 23:05:32 +10:30
module BottomLabel ( depth = 0.8 ) {
2025-02-15 01:19:07 +10:30
y0 = $ segment_cuts [ segment ] ;
2025-02-10 17:36:51 +10:30
size = 2.7 ;
v_spacing = 0.3 ;
z0 = [ - 4 , - 4 , 4.8 , - 10.8 , - 10.8 ] [ segment ] ;
for ( i = [ 0 : len ( $ id_lines ) - 1 ] ) {
z = z0 - ( size + v_spacing ) * i ;
translate ( [ 0 , y0 + depth , z ] ) rotate ( [ 90 , 0 , 0 ] ) linear_extrude ( depth ) text ( $ id_lines [ i ] , halign = "center" , size = size , font = "Droid Sans" ) ;
}
}
2025-02-09 19:09:39 +10:30
if ( preview ) {
2025-02-15 01:19:07 +10:30
Reinforcements ( ) ;
2025-02-13 01:43:15 +10:30
ElectronicsCavities ( ) ;
2025-02-13 21:39:50 +10:30
Tuners ( ) ;
2025-02-10 02:53:43 +10:30
color ( "#FF000080" ) MyBody ( ) ;
2025-02-13 21:39:50 +10:30
strings_reference ( 30 ) ;
2025-02-10 23:19:31 +10:30
} else render ( ) {
2025-02-14 14:23:52 +10:30
if ( segment = = "bridge" ) {
FlatBridge ( ) ;
} else if ( segment < 0 ) {
2025-02-10 02:57:30 +10:30
MyBody ( ) ;
} else {
2025-02-10 17:36:51 +10:30
difference ( ) {
intersection ( ) {
MyBody ( ) ;
2025-02-15 01:19:07 +10:30
y0 = $ segment_cuts [ segment ] ;
y1 = $ segment_cuts [ segment + 1 ] ;
2025-02-10 17:36:51 +10:30
translate ( [ - 500 , y0 , - 500 ] ) cube ( [ 1000 , y1 - y0 , 1000 ] ) ;
}
if ( ! list_has ( $ include_colours , 4 ) ) BottomLabel ( ) ;
2025-02-10 02:57:30 +10:30
}
2025-02-10 17:36:51 +10:30
if ( list_has ( $ include_colours , 4 ) ) BottomLabel ( ) ;
2025-02-10 02:57:30 +10:30
}
2025-02-09 19:09:39 +10:30
}
2025-02-06 21:43:59 +10:30
}
2025-02-15 01:19:07 +10:30
// colour_scheme = COLOURSCHEME_ABS_BLUE;
2025-02-17 21:45:22 +10:30
// colour_scheme = COLOURSCHEME_ABS_CLOWNFISH;
// // TwoBangerMk2(preview=true);
// segment = 1;
// color(colour_scheme[0]) TwoBangerMk2([0], segment);
// color(colour_scheme[1]) TwoBangerMk2([1], segment);
// color(colour_scheme[2]) TwoBangerMk2([2], segment);
// color(colour_scheme[3]) TwoBangerMk2([3], segment);
// color("red") TwoBangerMk2([4], segment);
2025-02-18 00:30:23 +10:30
// translate([50, 0, 0]) chromatic_tuner_battery_jack();
// translate([-50, 0, 0]) chromatic_tuner_eq();