GuitarModels/LockingGuitarTuner.scad

83 lines
2.6 KiB
OpenSCAD

include <common.scad>
module LockingGuitarTuner(holes=0) {
tolerance = 0.25;
d_post_cutout = 10.0 + tolerance;
h_post_cutout = 14.0;
d_post = 5.8;
h_post = 26.0; // from bottom of cutout to top
t_base = 9; // Thickness of underside assembly
d_screw_hole = 3;
screw_diameter = 2.0;
screw_depth = 5.0;
d_tag = 15.4;
w_tag = d_tag;
l_tag = 19.0;
// Rest is placeholder from UBassTuner
l_wormshaft_ear = 36;
d_wormshaft_ear = 33.4+0.6;
l_wormshaft_collar = 12;
d_wormshaft_collar = 6.4;
d_wormshaft_collar_max = 7.6;
$fn=72;
module tuner_footprint_extrude(h=t_base, tab_h=0, tolerance=0) {
h2 = (tab_h == 0) ? h : tab_h;
hull() {
translate([0, -l_tag+d_tag/2 - tolerance, h/2]) cube([w_tag + tolerance, 0.00001, h], center=true);
cylinder(h=h, d=d_tag+tolerance);
}
rotate([0, 0, 45]) translate([0,0,h-h2]) hull() {
cylinder(h=h2, d=d_post_cutout + tolerance);
translate([0, 11.25]) cylinder(h=h2, d=screw_diameter+2.7 + tolerance);
}
}
module Holes() {
cylinder_beak(d=d_post_cutout, h=h_post_cutout);
rotate([0, 0, 45]) translate([0, 10.5]) linear_extrude(screw_depth) screw_hole_lobe(screw_diameter, screw_diameter+1, 5, $fn=90);
}
module TunerPreview() {
clear_color = [1,0,0,0.6];
color("grey") translate([0,0,-t_base]) tuner_footprint_extrude(t_base, 2);
// screw
color(clear_color) rotate([0, 0, 45]) translate([0, 10.5]) cylinder(h=screw_depth, d=screw_diameter);
// peg
cylinder(h=h_post_cutout, d=d_post_cutout);
cylinder(h=h_post, d=d_post);
// PLACEHOLDER
// wormshaft and ear
translate([w_tag/2, -6, -t_base/2]) {
hull() {
rotate([0, 90, 0]) cylinder(h=0.1, d=d_wormshaft_collar_max);
translate([8, 0, 0]) rotate([0, 90, 0]) cylinder(h=0.1, d=d_wormshaft_collar);
}
rotate([0, 90, 0]) cylinder(h=l_wormshaft_collar, d=d_wormshaft_collar);
// ear clearance
color(clear_color) hull() {
translate([l_wormshaft_collar, 0, 0]) rotate([0, 90, 0]) cylinder(h=0.1, d=d_wormshaft_collar);
translate([l_wormshaft_ear, 0, 0]) rotate([0, 90, 0]) cylinder(h=0.1, d=d_wormshaft_ear);
}
}
}
if (holes > 0) {
t = t_base + holes;
Holes();
translate([0, 0, -t]) tuner_footprint_extrude(h=t, tolerance=0.5);
translate([0, 0, -t]) cylinder(h=holes+0.5, d=16+1.5); // Locking thumbscrew
translate([w_tag/2, -l_tag+8-tolerance/2, -t]) cube([24, 8+tolerance, t]);
} else {
TunerPreview();
}
}
// translate([-12, 8]) LockingGuitarTuner();
// render() difference() {
// t = 24;
// cube([23, 48, t]);
// translate([12, 10, t-14]) LockingGuitarTuner(holes=10);
// translate([12, 34, t-14]) LockingGuitarTuner(holes=10);
// }