Fix compile warnings in Edge & adjust top back for print

Adjusted top-back edge for printing with fdm ears. Perfect print.

Added logic to not error when tn=1 to remove compile errors.
This commit is contained in:
2024-04-07 13:51:55 -04:00
parent b9eacf4bb9
commit 8cf42bafce

View File

@@ -118,12 +118,20 @@ module box_edge(ps=PROFILE_SIZE, l=10, orient=ORIENT_Z, jh = JOINER_H,jw = JOINE
psoff = ps/2 - wl - wt; psoff = ps/2 - wl - wt;
face_off = ((ps+psoff)/4); face_off = ((ps+psoff)/4);
orient_and_align([ps,ps,l], orient=orient, align=align, orig_orient=ORIENT_Z) left(ps/2) fwd(ps/2) { orient_and_align([ps,ps,l], orient=orient, align=align, orig_orient=ORIENT_Z) left(ps/2) fwd(ps/2) {
echo("here");
difference() { difference() {
linear_extrude(height=l, center=true) linear_extrude(height=l, center=true)
profile(flx=flx, fly=true, wx=wx, wy=true); profile(flx=flx, fly=true, wx=wx, wy=true);
if (jup) up(jzoff) back(joiner_off)right(joiner_off)zrot(45)boxjoiner_clear(orient=ORIENT_Y_90, align=V_CENTER, cl="green"); if (jup) up(jzoff) back(joiner_off)right(joiner_off)zrot(45)boxjoiner_clear(orient=ORIENT_Y_90, align=V_CENTER, cl="green");
if (jdown) down(jzoff)back(joiner_off)right(joiner_off)zrot(45)boxjoiner_clear(orient=ORIENT_Y_90, align=V_CENTER, cl="brown"); if (jdown) down(jzoff)back(joiner_off)right(joiner_off)zrot(45)boxjoiner_clear(orient=ORIENT_Y_90, align=V_CENTER, cl="brown");
if (tubepass) zspread(l=l/2, n=tn) zrot(-45)back(face_off*sqrt(2)-.01)pc4M10_clear(orient=ORIENT_Y,align=V_BACK); if (tubepass) {
if (tn > 1) {
zspread(l=l/2, n=tn) zrot(-45)back(face_off*sqrt(2)-.01)pc4M10_clear(orient=ORIENT_Y,align=V_BACK);
} else {
zrot(-45)back(face_off*sqrt(2)-.01)pc4M10_clear(orient=ORIENT_Y,align=V_BACK);
}
}
echo("here");
if (hm) right(face_off)back(face_off)zrot(45)hinge_mount(); if (hm) right(face_off)back(face_off)zrot(45)hinge_mount();
if (iy) back(ps-wl/2)right(wt)yrot(-90) thread_insertM3(bl=5+wt, bz=-wt-2, $die=true); if (iy) back(ps-wl/2)right(wt)yrot(-90) thread_insertM3(bl=5+wt, bz=-wt-2, $die=true);
if (ix && flx ) if (ix && flx )
@@ -136,7 +144,13 @@ module box_edge(ps=PROFILE_SIZE, l=10, orient=ORIENT_Z, jh = JOINER_H,jw = JOINE
} }
} }
if (hm) zrot(45) right(face_off*sqrt(2)) %hinge(); 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) {
if (tn > 1) {
zspread(l=l/2, n=tn) right(0)zrot(-45)back(face_off*sqrt(2))pc4M10(orient=ORIENT_Y,align=V_BACK);
} else {
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);
if (rbfoot) right(ps/2+psoff-2)zrot(180)yrot(90)rb_foot(); if (rbfoot) right(ps/2+psoff-2)zrot(180)yrot(90)rb_foot();
@@ -255,7 +269,13 @@ if (PART == "edge_top_front") {
face_off = ((ps+psoff)/4); face_off = ((ps+psoff)/4);
//xrot(45)yrot(-90)right(face_off+7/2)zrot(180)hinge(); //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") {
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(thick=.2, dis=-2);
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(thick=.2, dis=-2);
up((wt+wl)/sqrt(2)) yrot(45+90)zrot(90)box_edge(l=lx/3, rbfoot=false, hm=false, flx=false, iy=true, 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) {
// Top Corners: // Top Corners: