Skip to content

Commit

Permalink
button mount including bottom rubber brace
Browse files Browse the repository at this point in the history
  • Loading branch information
gluap committed Mar 23, 2024
1 parent 0ccf89e commit 9ffd065
Showing 1 changed file with 74 additions and 27 deletions.
101 changes: 74 additions & 27 deletions src/LiteCase/buttonmount_cherry.scad
Original file line number Diff line number Diff line change
@@ -1,40 +1,87 @@
$fn=150;
z=[0,0,1];
y=[0,1,0];
cz=1.2;
h=15;
cxy=13.7;
size=[cxy,cxy,h];
z1=-h/2;
sizeb=[cxy+1,cxy,cz];
z2=-cz*1.5;
sizet=[cxy+2,cxy+2,4];
sizef=[cxy+5,cxy+5,h];
z4=-sizef[2]/2;
$fn = $preview ? 20 : 60;
z = [0, 0, 1];
y = [0, 1, 0];
x = [1,0,0];
cz = 1.2;
h = 15;
cxy = 13.7;
size = [cxy, cxy, h];
z1 = -h / 2;
sizeb = [cxy + 1, cxy, cz];
z2 = -cz * 1.5;
sizet = [cxy + 2, cxy + 2, 4];
sizef = [cxy + 5, cxy + 5, h];
z4 = -sizef[2] / 2;

if ($preview) import("/home/paulg/Downloads/kailh_low.stl");
module hole() {
translate(z1*z)cube(size,center=true);
translate(z2*z)cube(sizeb,center=true);
translate(2*z)cube(sizet,center=true);
translate(z1 * z)cube(size, center = true);
translate(z2 * z)cube(sizeb, center = true);
translate(2 * z)cube(sizet, center = true);
}

module handlebar()
{
translate((25)/2*y-18.5*z)rotate([90,0,0])cylinder(d=25.4,h=50);
}

module cable() {hull() {
translate([4.5,0,-5])rotate([90,0,0])cylinder(d=4,h=20);
translate([4.5,0,-12])rotate([90,0,0])cylinder(d=4,h=20);
# translate((50) / 2 * y - 18.5 * z)rotate([90, 0, 0])cylinder(d = 25.4, h = 50);
}

module cable() {
hull() {
translate([4.5, 0, -5])rotate([90, 0, 0])cylinder(d = 4, h = 20);
translate([4.5, 0, -12])rotate([90, 0, 0])cylinder(d = 4, h = 20);
}
}
}
difference() {
translate(z4*z)cube(sizef,center=true);
hole();

handlebar();
difference() {
union() {
translate(z4 * z)cube(sizef, center = true);
translate(-4*z)cube([5, cxy+16, 8],center=true);
}
hole();
#for (i=[-1,1]) translate((cxy + 8) / 2 * y*i) rubber_ring();
handlebar();
cable();
}

module rubber_ring() {
translate(-18.5 * z)
rotate([90, 0, 0])
rotate_extrude()
translate([25.4 / 2 + 1.5 + 1, 0, 0])
{
hull() {
circle(d = 3);
translate([5, 0, 0])circle(d = 3);}
}
}


module bottom_shape(diam=5) {
difference() {
translate([0, 0, -7.5])cube([15, 15, 15], center = true);
translate(2 * z)handlebar();
for (i = [-1, 1])rotate([0, 25 * i, 0])translate([i * (diam+1.5), 0, 0])rotate_extrude() hull() {
translate([4, 0, 0]) circle(d = 3);
translate([4, 4, 0]) circle(d = 3);
}

}

}

//rotate(-x*90)linear_extrude(cxy-5*3)
module bottom(width=cxy, diam=5) {
rotate(-x * 90)linear_extrude(cxy - diam) projection(cut = true) {
rotate(x * 90)bottom_shape(diam);
}
difference() {
bottom_shape(diam);
translate(y * 20)cube([40, 40, 40], center = true);
}
translate(y * (width - diam))difference() {
bottom_shape(diam);
translate(-y * 20)cube([40, 40, 40], center = true);
}
}

translate(y*40) bottom();

0 comments on commit 9ffd065

Please sign in to comment.