Work on hinge

This commit is contained in:
2024-04-03 19:09:38 -04:00
parent 14f7e84755
commit b9eacf4bb9

View File

@@ -10,7 +10,7 @@ include <fdmouse.scad>
/* [Part] */ /* [Part] */
PART = ""; // [ all_corners, corner_top, corner_bottom, edge_back_bottom, edge_side_top, edge_side_foot, edge_top_front, edge_top_back, edge_test, full_box, joiner_top, joiner_bottom, profile, side_edge, rbfoot ] PART = ""; // [ all_corners, corner_top, corner_bottom, edge_back_bottom, edge_side_top, edge_side_foot, edge_top_front, edge_top_back, edge_test, full_box, joiner_top, joiner_bottom, profile, side_edge, rbfoot, hinge ]
/* [Dimensions] */ /* [Dimensions] */
@@ -99,13 +99,15 @@ module rb_foot(fw=RB_MOUNT_WIDTH, rl=RB_MOUNT_LEN, rh=RB_MOUNT_OUT_H, fl=10) {
module hinge_mount(bz=WIN_THICK, bl=10) { module hinge_mount(bz=WIN_THICK, bl=10) {
zspread(l=40) { zspread(l=40) {
zrot(-90)xrot(90)right(5) { zrot(-90)xrot(90)right(5) {
thread_insertM3(bl=8,bz=-5, $die=true); up(3+2) cyl(d1=7, d2=9,h=7, align=V_TOP);
%thread_insertM3(bl=8,bz=-5); thread_insertM3(bl=10,bz=-7, $die=true);
//%thread_insertM3(bl=10,bz=-7);
} }
} }
zrot(-90)xrot(90)left(5) { zrot(-90)xrot(90)left(5) {
up(3+2) cyl(d1=7, d2=9,h=7, align=V_TOP);
thread_insertM3(bl=10,bz=-7, $die=true); thread_insertM3(bl=10,bz=-7, $die=true);
%thread_insertM3(bl=10,bz=-7); //%thread_insertM3(bl=10,bz=-7);
} }
} }
@@ -133,6 +135,7 @@ module box_edge(ps=PROFILE_SIZE, l=10, orient=ORIENT_Z, jh = JOINER_H,jw = JOINE
%thread_insertM3(bl=6, bz=-4, $die=false); %thread_insertM3(bl=6, bz=-4, $die=false);
} }
} }
if (hm) zrot(45) right(face_off*sqrt(2)) %hinge();
if (tubepass) zspread(l=l/2, n=tn) right(0)zrot(-45)back(face_off*sqrt(2))pc4M10(orient=ORIENT_Y,align=V_BACK); if (tubepass) zspread(l=l/2, n=tn) right(0)zrot(-45)back(face_off*sqrt(2))pc4M10(orient=ORIENT_Y,align=V_BACK);
if (jup) up(l/2 - jw/2)back(joiner_off)right(joiner_off)zrot(45)boxjoiner(orient=ORIENT_Y_90, align=V_CENTER); if (jup) up(l/2 - jw/2)back(joiner_off)right(joiner_off)zrot(45)boxjoiner(orient=ORIENT_Y_90, align=V_CENTER);
if (jdown) down(l/2 - jw/2)back(joiner_off)right(joiner_off)zrot(45)xrot(180)boxjoiner(orient=ORIENT_Y_90, align=V_CENTER); if (jdown) down(l/2 - jw/2)back(joiner_off)right(joiner_off)zrot(45)xrot(180)boxjoiner(orient=ORIENT_Y_90, align=V_CENTER);
@@ -195,6 +198,18 @@ module boxjoiner_clear(inset=5, slop=.01, jh=JOINER_H, jw=JOINER_W, align=V_FRON
} }
} }
module hinge(theta=90) {
x=7;
difference() {
left(x/2)cuboid([x,20,50], fillet=2, edges=EDGES_X_ALL);
hinge_mount($die=true);
}
zrot(theta)back(11+5){
cylinder(r=5, h=6);
back(10+5)cuboid([x,20,50], fillet=2, edges=EDGES_X_ALL);
}
}
wt=WIN_TRIM; wt=WIN_TRIM;
wl=WIN_LIP; wl=WIN_LIP;
ps = PROFILE_SIZE; ps = PROFILE_SIZE;
@@ -209,6 +224,8 @@ echo(str("Edge Len X: ", lx, " (3 x ", lx/3, ")"));
echo(str("Edge Len Y: ", ly, " (1 x ", ly, ")")); echo(str("Edge Len Y: ", ly, " (1 x ", ly, ")"));
echo(str("Edge Len Z: ", lz, " (1 x ", lz, ")")); echo(str("Edge Len Z: ", lz, " (1 x ", lz, ")"));
echo(str("Window Size: ", lx + 2* (ps-WIN_THICK-1), "mm x ", ly + 2*(ps-WIN_THICK-1), "mm"));
if (PART == "profile") { if (PART == "profile") {
profile(flx=true); profile(flx=true);
} }
@@ -217,15 +234,27 @@ if (PART == "all_corners")
if (PART == "corner_top") box_corner(zw=true, zfl=false); if (PART == "corner_top") box_corner(zw=true, zfl=false);
if (PART == "corner_bottom") box_corner(zw=false, zfl=true); if (PART == "corner_bottom") box_corner(zw=false, zfl=true);
if (PART == "edge_back_bottom") { if (PART == "edge_back_bottom") {
left(coff/2-2*psoff) back(lx/3/2)zrot(315)ear(); left(coff/2-2*psoff) back(lx/3/2)zrot(315)ear(thick=.2, dis=-2);
right(coff/2-2*psoff) back(lx/3/2)zrot(225)ear(); right(coff/2-2*psoff) back(lx/3/2)zrot(225)ear(thick=.2, dis=-2);
left(coff/2-2*psoff) fwd(lx/3/2)zrot(45)ear(); left(coff/2-2*psoff) fwd(lx/3/2)zrot(45)ear(thick=.2, dis=-2);
right(coff/2-2*psoff) fwd(lx/3/2)zrot(135)ear(); right(coff/2-2*psoff) fwd(lx/3/2)zrot(135)ear(thick=.2, dis=-2);
up((wt+wl)/sqrt(2))xrot(90) zrot(45) box_edge(l=lx/3, jup=true, jdown=true, flx=true, wx=false, tubepass=true, orient=ORIENT_Z); up((wt+wl)/sqrt(2))xrot(90) zrot(45) box_edge(l=lx/3, jup=true, jdown=true, flx=true, wx=false, tubepass=true, orient=ORIENT_Z);
} }
if (PART == "edge_side_foot") box_edge(l=ly, rbfoot=true, flx=true, wx=false, jup=true, jdown=true, cm=true, orient=ORIENT_Y); if (PART == "edge_side_foot") {
if (PART == "edge_side_top") box_edge(l=ly, rbfoot=false, flx=true, wx=false, jup=true, jdown=true, cm=true, orient=ORIENT_Y); box_edge(l=ly, rbfoot=true, flx=true, wx=false, jup=true, jdown=true, cm=true, orient=ORIENT_Y);
if (PART == "edge_top_front") box_edge(l=lx/3, rbfoot=false, hm=true, flx=false, iy=false, wx=true, jup=true, jdown=true, cm=true, orient=ORIENT_XNEG_180); }
if (PART == "edge_side_top") {
left(coff/2-2*psoff) back(ly/2)zrot(315)ear(thick=.2, dis=-2);
right(coff/2-2*psoff) back(ly/2)zrot(225)ear(thick=.2, dis=-2);
left(coff/2-2*psoff) fwd(ly/2)zrot(45)ear(thick=.2, dis=-2);
right(coff/2-2*psoff) fwd(ly/2)zrot(135)ear(thick=.2, dis=-2);
up((wt+wl)/sqrt(2))yrot(45)box_edge(l=ly, rbfoot=false, flx=false, wx=true, jup=true, jdown=true, cm=true, orient=ORIENT_Y);
}
if (PART == "edge_top_front") {
box_edge(l=lx/3, rbfoot=false, hm=true, flx=false, iy=false, wx=true, jup=true, jdown=true, cm=true, orient=ORIENT_XNEG_180);
face_off = ((ps+psoff)/4);
//xrot(45)yrot(-90)right(face_off+7/2)zrot(180)hinge();
}
if (PART == "edge_top_back") box_edge(l=lx/3, rbfoot=false, hm=false, flx=false, iy=false, wx=true, jup=true, jdown=true, cm=true, orient=ORIENT_XNEG_180); if (PART == "edge_top_back") box_edge(l=lx/3, rbfoot=false, hm=false, flx=false, iy=false, wx=true, jup=true, jdown=true, cm=true, orient=ORIENT_XNEG_180);
if (PART == "full_box") { if (PART == "full_box") {
up(lz/2+ps) { up(lz/2+ps) {
@@ -284,6 +313,10 @@ if (PART == "rbfoot") rb_foot();
if (PART == "edge_test") box_edge(l=35, tubepass=true, jup=true, jdown=true, tn=1, flx=true, wx = false, orient=ORIENT_Y); if (PART == "edge_test") box_edge(l=35, tubepass=true, jup=true, jdown=true, tn=1, flx=true, wx = false, orient=ORIENT_Y);
if (PART == "hinge") {
box_edge(l=lx/3, rbfoot=false, hm=true, flx=false, iy=false, wx=true, jup=true, jdown=true, cm=true);
//hinge();
}
//down(BOX_Y/2 + 40)color("red") cube([BOX_X-22, BOX_Y, 1], center=true); //down(BOX_Y/2 + 40)color("red") cube([BOX_X-22, BOX_Y, 1], center=true);
//down(BOX_Y/2 + 0*40)color("blue") cube([BOX_X, BOX_Y/2, 1], center=true); //down(BOX_Y/2 + 0*40)color("blue") cube([BOX_X, BOX_Y/2, 1], center=true);