GuitarModels/PBassPickupHolder.scad

233 lines
6.1 KiB
OpenSCAD
Raw Normal View History

2023-06-13 21:21:33 +09:30
Pickup_Length = 58; // Tolerance
Pickup_Width = 28.5; // Tolerance
Pickup_Height = 20;
Pickup_Offset = -37.5;
Magnet_Height = 3;
Corner_Radius = 1.5; // Half-guessed
Hole_Spacing = 65;
Cavity_Width = 64; // Tolerance
Tang_Height = 1.5;
Tang_Groove_Height = Tang_Height + 0.25;
body_h = 20;
Engrave_String = "P01β²";
Font = "GFS Didot";
// Font_JP = "New Tegomin";
Font_JP = "Yuji Boku";
module cyl(d=10, z0=-100, z1=100, $fn=128)
translate([0,0,z0])
cylinder(h=z1-z0, r=d/2, $fn=$fn);
module circ(r=10) circle(r=r, $fn=128);
pl1 = Pickup_Length/2 - Corner_Radius;
pw1 = Pickup_Width/2 - Corner_Radius;
module half_pickup() {
difference() {
union() {
// translate([-Pickup_Length/2, -Pickup_Width/2, 0]) cube([Pickup_Length, Pickup_Width, Pickup_Height]);
color([0.3, 0.3, 0.3]) hull()
for (x = [-pl1, pl1])
for (y = [-pw1, pw1])
translate([x, y, 0])
cyl(d=Corner_Radius*2, z0=Magnet_Height, z1=Pickup_Height);
for (x = [-29, 29])
color([0.3, 0.3, 0.3])
translate([x, 0, 0])
cyl(d=12, z0=6, z1=16);
color([0.5, 0.5, 0.6])
translate([-20, -5, 0])
cube([40, 10, Magnet_Height]);
for (x = [-14.25:9.5:14.25])
color([0.7, 0.75, 0.8])
translate([x, 0, 0])
cyl(d=4, z0=Pickup_Height, z1=Pickup_Height+2);
}
for (x = [-Hole_Spacing/2, Hole_Spacing/2])
translate([x, 0, 0])
cyl(d=3);
}
}
module for_each_pickup() {
for (off = [[0, 0], [Pickup_Offset, Pickup_Width]]) translate(off) children();
}
module split_pickup() {
for_each_pickup() half_pickup();
}
module pickup_outline(grow=0.5) {
union() {
hull() {
for (x = [-pl1-grow, pl1+grow])
for (y = [-pw1-grow, pw1+grow])
translate([x, y])
circ(r=Corner_Radius);
}
for (x = [-29, 29])
translate([x, 0])
circ(r=6+grow);
}
}
module body_outline(shrink=0, body_r=8) {
union() {
hull() {
// Base Plate
for (x = [-60+body_r, 20-body_r])
for (y = [-18+body_r, Cavity_Width-18-body_r])
translate([x,y])
circ(body_r - shrink);
for (off = [[0, 0], [Pickup_Offset, Pickup_Width]]) translate(off)
for (x = [-29, 29]) translate([x, 0])
circ((12+5)/2 - shrink);
// Jack Plate
translate([-67, 20]) circ(6 - shrink);
// Pad pickup corners
dist = Pickup_Length/2 + 5 - body_r;
translate([dist, -18+body_r]) circ(body_r - shrink);
translate([Pickup_Offset - dist, Cavity_Width-18-body_r]) circ(body_r - shrink);
}
hull() {
translate([-67, 20]) circ(6 - shrink);
translate([-67, -9]) circ(6 - shrink);
translate([-60+body_r, -18+body_r]) circ(body_r - shrink);
}
}
}
module tang(margin=0.1) { // Negative margin as subtraction for the slot
difference() {
body_outline(shrink=1+margin);
body_outline(shrink=2-margin);
translate([45, 0]) square(40+margin, center=true);
translate([-83, 32]) square(40+margin, center=true);
};
translate([-60,11.5]) square([27-margin, 1-margin]);
translate([-6,17]) square([27-margin, 1-margin]);
}
// color("blue") translate([-60, -18, -1]) cube([80, Cavity_Width, 1]);
module lower() {
difference() {
union() {
taper = 5;
translate([0,0,taper]) minkowski($fn = $preview ? 8 : 64) {
sphere(r = taper, $fn = $preview ? 8 : 64);
linear_extrude(0.0001) body_outline(shrink=taper);
}
// hull() {
// linear_extrude(taper) body_outline(shrink=3);
translate([0,0,taper]) linear_extrude(body_h-taper) body_outline();
// }
// tang
color("blue")
translate([0,0,body_h])
linear_extrude(Tang_Height)
tang();
}
// Subtractions
// Jack cavity
hull() {
translate([-69, -10, 2.5]) cube([15, 20, 20]);
translate([-69, -10, 10]) cube([35, 20, 20]);
}
// Jack hole
translate([0,0,14]) rotate([0,-90,0]) cyl(d=11,z0=60);
// Wire channels
translate([0,0,5]) linear_extrude(body_h) union() {
translate([-35, 7]) square([25,6], center=true);
translate([-66, 13]) square([6,20], center=true);
}
// M4 holes to mount to body
for (off = [[Pickup_Offset-5, 0], [5, Pickup_Width]]) translate(off) {
cyl(d=4);
cyl(d=9.5, z0=5);
}
for_each_pickup() {
// Pickup adjustment brass insert holes
for (x = [-Hole_Spacing/2, Hole_Spacing/2])
translate([x, 0, 0]) {
cyl(5.1);
hull(){
cyl(5.25, z0=7, z1=10);
cyl(6, z0=9, z1=20);
}
}
// Pickup outlines
translate([0,0,10]) linear_extrude(100) pickup_outline();
}
translate([4, 38, body_h-2]) linear_extrude(5)
text(text = Engrave_String, size = 6, halign="center", valign="center", font=Font);
translate([14, 28, body_h-2]) linear_extrude(5)
text(text = "下", size = 8, halign="center", valign="center", font=Font_JP);
}
}
module upper(wall_height=3.5, roof_height=2.5) {
module elec_cavity() {
hull() {
for (off = [[-27, -11], [-52, -11], [-66, -8], [-66, 7], [-27, 7]])
translate(off) circ(r=2.5);
}
}
module walls() {
difference() {
body_outline();
for_each_pickup() pickup_outline();
elec_cavity();
}
}
module roof() {
difference() {
body_outline();
for_each_pickup() pickup_outline();
}
}
difference() {
union() {
linear_extrude(Tang_Groove_Height) difference() {
walls();
tang(-0.1);
}
h = wall_height - Tang_Groove_Height;
translate([0, 0, Tang_Groove_Height])
linear_extrude(h)
walls();
intersection() {
translate([0,0,wall_height]) linear_extrude(roof_height) roof();
translate([0,0,wall_height])
minkowski($fn = $preview ? 8 : 64) {
sphere(roof_height, $fn = $preview ? 8 : 64);
linear_extrude(0.001) body_outline(shrink=roof_height);
}
}
}
linear_extrude(100) for_each_pickup() pickup_outline();
// Engravings
translate([0, 0, wall_height+0.5]) linear_extrude(100) {
translate([-2,22])
text(text = "LHW", size = 4, font=Font);
translate([-6,17])
text(text = "2023-03-29", size = 4, font=Font);
translate([-50,0])
text(text = Engrave_String, size = 6, halign="center", valign="center", font=Font);
translate([-50,-8])
text(text = "上", size = 8, halign="center", valign="center", font=Font_JP);
}
// Jack hole
translate([0,0,14-body_h]) rotate([0,-90,0]) cyl(d=11+2,z0=60);
}
}
// lower();
upper();
// translate([0,0,10]) split_pickup();