Adjusted box and corner size
Corner size was calculated too large. Box should be correctly sized now. Feet should be Repbox compatible.
This commit is contained in:
83
box.scad
83
box.scad
@@ -5,10 +5,11 @@ include <BOSL/shapes.scad>
|
|||||||
include <BOSL/transforms.scad>
|
include <BOSL/transforms.scad>
|
||||||
include <BOSL/joiners.scad>
|
include <BOSL/joiners.scad>
|
||||||
include <./pc4m10.scad>
|
include <./pc4m10.scad>
|
||||||
|
include <inserts/inserts.scad>
|
||||||
|
|
||||||
/* [Part] */
|
/* [Part] */
|
||||||
|
|
||||||
PART = ""; // [ all_corners, corner, edge_back, edge_side_foot, edge_test, full_box, beamjoiner, profile, side_edge, rbfoot ]
|
PART = ""; // [ all_corners, corner_top, corner_bottom, edge_back, edge_side_foot, edge_test, full_box, joiner_top, joiner_bottom, profile, side_edge, rbfoot ]
|
||||||
|
|
||||||
/* [Dimensions] */
|
/* [Dimensions] */
|
||||||
|
|
||||||
@@ -90,7 +91,7 @@ module rb_foot(fw=RB_MOUNT_WIDTH, rl=RB_MOUNT_LEN, rh=RB_MOUNT_OUT_H, fl=10) {
|
|||||||
bmax = back + (fw-1);
|
bmax = back + (fw-1);
|
||||||
|
|
||||||
fwd(bmax)up(fw-1)
|
fwd(bmax)up(fw-1)
|
||||||
yrot(90)linear_extrude(height=rl, center=true) polygon([[0,0],[0,bmax],[fw-1,bmax]]);
|
yrot(90)linear_extrude(height=rl, center=true) polygon([[0,bmax-fw+1],[0,bmax],[fw-1,bmax]]);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -107,7 +108,7 @@ module hinge_mount(bz=WIN_THICK, bl=10) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module box_edge(ps=PROFILE_SIZE, l=10, orient=ORIENT_Z, jh = JOINER_H,jw = JOINER_W, jb=5, jup = false, jdown=false, flx=false, ft=FLOOR_THICK, wl=WIN_LIP, wx=true, wt=WIN_THICK, wtr = WIN_TRIM, hm=false, tubepass=false, tn = 2, ix=true, iy=true, align=V_CENTER) {
|
module box_edge(ps=PROFILE_SIZE, l=10, orient=ORIENT_Z, jh = JOINER_H,jw = JOINER_W, jb=5, jup = false, jdown=false, flx=false, ft=FLOOR_THICK, wl=WIN_LIP, wx=true, wt=WIN_THICK, wtr = WIN_TRIM, hm=false, tubepass=false, tn = 2, ix=true, iy=true, rbfoot=false, align=V_CENTER) {
|
||||||
joiner_off = ps/2 + wt - jb/sqrt(2);
|
joiner_off = ps/2 + wt - jb/sqrt(2);
|
||||||
jzoff = l/2-jw/2;
|
jzoff = l/2-jw/2;
|
||||||
psoff = ps/2 - wl - wt;
|
psoff = ps/2 - wl - wt;
|
||||||
@@ -129,23 +130,25 @@ module box_edge(ps=PROFILE_SIZE, l=10, orient=ORIENT_Z, jh = JOINER_H,jw = JOINE
|
|||||||
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);
|
||||||
|
if (rbfoot) right(ps/2+psoff-2)zrot(180)yrot(90)rb_foot();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module box_corner(ps = PROFILE_SIZE, l=0, zfl = true, zw = false, wl=WIN_LIP, wt=WIN_THICK, align=V_CENTER, orient=ORIENT_Z) {
|
module box_corner(ps = PROFILE_SIZE, l=0, zfl = true, zw = false, wl=WIN_LIP, wt=WIN_THICK, align=V_CENTER, orient=ORIENT_Z) {
|
||||||
sz = 2*ps;
|
|
||||||
psoff = ps/2 - wl - wt;
|
psoff = ps/2 - wl - wt;
|
||||||
coff = ps + psoff;
|
coff = ps + psoff;
|
||||||
|
sz = 3*ps/2 + psoff;
|
||||||
orient_and_align([sz,sz,sz], orient=orient, align=align) {
|
orient_and_align([sz,sz,sz], orient=orient, align=align) {
|
||||||
|
// %up(2.5+psoff)back(2.5+psoff)left(2.5+psoff)cuboid([sz,sz,sz]);
|
||||||
intersection() {
|
intersection() {
|
||||||
// Cap
|
// Cap
|
||||||
fwd(ps)right(4)down(4)right(ps/2)box_edge(l=PROFILE_SIZE, orient=ORIENT_Y, align=V_BACK+V_LEFT, flx=zfl, wx=zw);
|
fwd(ps)right(psoff)down(psoff)right(ps/2)box_edge(l=PROFILE_SIZE, orient=ORIENT_Y, align=V_BACK+V_LEFT, flx=zfl, wx=zw);
|
||||||
right(ps)fwd(4)down(4)fwd(ps/2)box_edge(l=PROFILE_SIZE, orient=ORIENT_X, align=V_BACK+V_LEFT, flx=zfl, wx=zw);
|
right(ps)fwd(psoff)down(psoff)fwd(ps/2)box_edge(l=PROFILE_SIZE, orient=ORIENT_X, align=V_BACK+V_LEFT, flx=zfl, wx=zw);
|
||||||
down(ps/2+WIN_TRIM)fwd(4)right(4)box_edge(l=PROFILE_SIZE, orient=ORIENT_Z_90, align=V_TOP, flx=false, wx=true);
|
down(ps/2+WIN_TRIM)fwd(psoff)right(psoff)box_edge(l=PROFILE_SIZE, orient=ORIENT_Z_90, align=V_TOP, flx=false, wx=true);
|
||||||
}
|
}
|
||||||
fwd(1)right(4)down(4)right(ps/2)box_edge(l=ps+1, orient=ORIENT_Y, jup=true, align=V_BACK+V_LEFT, flx=zfl, wx=zw);
|
fwd(1)right(psoff)down(psoff)right(ps/2)box_edge(l=ps+1, orient=ORIENT_Y, jup=true, align=V_BACK+V_LEFT, flx=zfl, wx=zw);
|
||||||
right(1)fwd(4)down(4)fwd(ps/2)box_edge(l=ps+1, orient=ORIENT_X, jdown=true, align=V_BACK+V_LEFT, flx=zfl, wx=zw);
|
right(1)fwd(psoff)down(psoff)fwd(ps/2)box_edge(l=ps+1, orient=ORIENT_X, jdown=true, align=V_BACK+V_LEFT, flx=zfl, wx=zw);
|
||||||
down(1)fwd(4)right(4)box_edge(l=ps+1, orient=ORIENT_Z_90, align=V_TOP, jup=true, flx=false, wx=true);
|
down(1)fwd(psoff)right(psoff)box_edge(l=ps+1, orient=ORIENT_Z_90, align=V_TOP, jup=true, flx=false, wx=true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -186,38 +189,39 @@ module boxjoiner_clear(inset=5, slop=.01, jh=JOINER_H, jw=JOINER_W, align=V_FRON
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (PART == "profile") {
|
|
||||||
profile(flx=true);
|
|
||||||
}
|
|
||||||
if (PART == "corner")
|
|
||||||
box_corner();
|
|
||||||
if (PART == "back_edge") {
|
|
||||||
xbeam = BOX_X - 2 * PROFILE_SIZE;
|
|
||||||
xrot(90) zrot(0) box_edge(l=xbeam/3, jup=true, jdown=true, flx=true, wx=false, tubepass=true, orient=ORIENT_Z);
|
|
||||||
}
|
|
||||||
if (PART == "all_corners")
|
|
||||||
box_all_corners(ex=30);
|
|
||||||
if (PART == "full_box") {
|
|
||||||
lx = BOX_X - 2 * PROFILE_SIZE;
|
|
||||||
ly = BOX_Y - 2 * PROFILE_SIZE;
|
|
||||||
lz = BOX_Z - 2 * PROFILE_SIZE;
|
|
||||||
ps = PROFILE_SIZE;
|
ps = PROFILE_SIZE;
|
||||||
psoff = ps/2 - WIN_LIP - WIN_THICK;
|
psoff = ps/2 - WIN_LIP - WIN_THICK;
|
||||||
coff = ps + psoff;
|
coff = ps + psoff;
|
||||||
|
sz = 3*ps/2;
|
||||||
|
lx = BOX_X - 2* sz - 2*psoff;
|
||||||
|
ly = BOX_Y - sz;
|
||||||
|
lz = BOX_Z - sz;
|
||||||
|
|
||||||
echo(str("Edge Len X: ", lx, " (3 x ", lx/3, ")"));
|
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, ")"));
|
||||||
|
|
||||||
|
if (PART == "profile") {
|
||||||
|
profile(flx=true);
|
||||||
|
}
|
||||||
|
if (PART == "all_corners")
|
||||||
|
box_all_corners(ex=30);
|
||||||
|
if (PART == "corner_top") box_corner(zw=true, zfl=false);
|
||||||
|
if (PART == "corner_bottom") box_corner(zw=false, zfl=true);
|
||||||
|
if (PART == "edge_back") {
|
||||||
|
xrot(90) zrot(0) 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=false, wx=true, jup=true, jdown=true, orient=ORIENT_Y);
|
||||||
|
if (PART == "full_box") {
|
||||||
up(lz/2+ps) {
|
up(lz/2+ps) {
|
||||||
// Top Corners:
|
// Top Corners:
|
||||||
right(lx/2) fwd(ps+ly/2) box_corner(orient=ORIENT_ZNEG_270, zfl=false, align=V_RIGHT);
|
right(ps+lx/2) fwd(ps+ly/2) box_corner(orient=ORIENT_ZNEG_270, zfl=false);
|
||||||
right(ps+lx/2) back(ps+ly/2) box_corner(orient=ORIENT_ZNEG_180);
|
right(ps+lx/2) back(ps+ly/2) box_corner(orient=ORIENT_ZNEG_180);
|
||||||
left(ps+lx/2) back(ps+ly/2) box_corner(orient=ORIENT_ZNEG_90);
|
left(ps+lx/2) back(ps+ly/2) box_corner(orient=ORIENT_ZNEG_90);
|
||||||
left(ps+lx/2) fwd(ps+ly/2) box_corner(orient=ORIENT_ZNEG);
|
left(ps+lx/2) fwd(ps+ly/2) box_corner(orient=ORIENT_ZNEG);
|
||||||
}
|
}
|
||||||
up(lz/2+coff) { // Top Edges
|
up(lz/2+coff) { // Top Edges
|
||||||
fwd(coff + ly/2) xspread(n=3, lx/3) box_edge(l=lx/3, hm=true, jup=true, jdown=true, flx=true, wx=false, orient=ORIENT_XNEG_180);
|
fwd(coff + ly/2) xspread(n=3, lx/3) box_edge(l=lx/3, hm=true, jup=true, jdown=true, iy=false, flx=true, wx=false, orient=ORIENT_XNEG_180);
|
||||||
back(coff + ly/2) {
|
back(coff + ly/2) {
|
||||||
xspread(n=3, lx/3)box_edge(l=lx/3, jup=true, jdown=true, flx=true, wx=false, tubepass=false, orient=ORIENT_X_180);
|
xspread(n=3, lx/3)box_edge(l=lx/3, jup=true, jdown=true, flx=true, wx=false, tubepass=false, orient=ORIENT_X_180);
|
||||||
}
|
}
|
||||||
@@ -226,26 +230,25 @@ if (PART == "full_box") {
|
|||||||
}
|
}
|
||||||
{ // vertical
|
{ // vertical
|
||||||
left(coff+lx/2)fwd(coff+ly/2)
|
left(coff+lx/2)fwd(coff+ly/2)
|
||||||
box_edge(l=lz,jup=true, jdown=true);
|
box_edge(l=lz,jup=true, ix=false, jdown=true);
|
||||||
right(coff+lx/2)fwd(coff+ly/2)
|
right(coff+lx/2)fwd(coff+ly/2)
|
||||||
box_edge(l=lz,jup=true, jdown=true, orient=ORIENT_Z_90);
|
box_edge(l=lz,jup=true, iy=false, jdown=true, orient=ORIENT_Z_90);
|
||||||
right(coff+lx/2)back(coff+ly/2)
|
right(coff+lx/2)back(coff+ly/2)
|
||||||
box_edge(l=lz,jup=true, jdown=true, orient=ORIENT_Z_180);
|
box_edge(l=lz,jup=true, jdown=true, orient=ORIENT_Z_180);
|
||||||
left(coff+lx/2)back(coff+ly/2)
|
left(coff+lx/2)back(coff+ly/2)
|
||||||
box_edge(l=lz,jup=true, jdown=true, orient=ORIENT_Z_270);
|
box_edge(l=lz,jup=true, jdown=true, orient=ORIENT_Z_270);
|
||||||
}
|
}
|
||||||
down(lz/2+coff) { // Bottom Edges, XXX: down to align with corner. This may be an issue when we add feet.
|
down(lz/2+coff) {
|
||||||
fwd(coff + ly/2) box_edge(l=lx, jup=true, jdown=true, flx=true, wx=false, orient=ORIENT_X);
|
fwd(coff + ly/2) xspread(n=3, lx/3) box_edge(l=lx/3, iy=false, jup=true, jdown=true, flx=true, wx=false, orient=ORIENT_X);
|
||||||
back(coff + ly/2) zrot(180) { // rear
|
back(coff + ly/2) zrot(180) { // rear
|
||||||
xspread(n=3, lx/3)box_edge(l=lx/3, jup=true, jdown=true, flx=true, wx=false, tubepass=true, orient=ORIENT_X);
|
xspread(n=3, lx/3)box_edge(l=lx/3, jup=true, jdown=true, flx=true, wx=false, tubepass=true, orient=ORIENT_X);
|
||||||
}
|
}
|
||||||
// Sides - XXX: Add feet
|
right(coff + lx/2) box_edge(l=ly, jup=true, jdown=true, flx=true, wx=false, rbfoot=true, orient=ORIENT_Y);
|
||||||
right(coff + lx/2) box_edge(l=ly, jup=true, jdown=true, flx=true, wx=false, orient=ORIENT_Y);
|
left(coff + lx/2) zrot(180)box_edge(l=ly, jup=true, jdown=true, flx=true, wx=false, rbfoot=true, orient=ORIENT_Y);
|
||||||
left(coff + lx/2) zrot(180)box_edge(l=ly, jup=true, jdown=true, flx=true, wx=false, orient=ORIENT_Y);
|
|
||||||
}
|
}
|
||||||
down(lz/2+ps) {
|
down(lz/2+ps) {
|
||||||
// Bottom Corners:
|
// Bottom Corners:
|
||||||
right(lx/2) fwd(ps+ly/2)box_corner(align=V_RIGHT);
|
right(ps+lx/2) fwd(ps+ly/2)box_corner();
|
||||||
right(ps+lx/2) back(ps+ly/2)box_corner(orient=ORIENT_Z_90);
|
right(ps+lx/2) back(ps+ly/2)box_corner(orient=ORIENT_Z_90);
|
||||||
left(ps+lx/2) back(ps+ly/2)box_corner(orient=ORIENT_Z_180);
|
left(ps+lx/2) back(ps+ly/2)box_corner(orient=ORIENT_Z_180);
|
||||||
left(ps+lx/2) fwd(ps+ly/2)box_corner(orient=ORIENT_Z_270);
|
left(ps+lx/2) fwd(ps+ly/2)box_corner(orient=ORIENT_Z_270);
|
||||||
@@ -253,9 +256,13 @@ if (PART == "full_box") {
|
|||||||
|
|
||||||
xspread(n=6, l=70*6) %cyl(d=200, l=70, orient=ORIENT_X);
|
xspread(n=6, l=70*6) %cyl(d=200, l=70, orient=ORIENT_X);
|
||||||
}
|
}
|
||||||
if (PART == "beamjoiner") beam_joiner(fl=true);
|
if (PART == "joiner_top") beam_joiner(fl=false);
|
||||||
if (PART == "edge_side_foot") box_edge(l=BOX_Y-2*PROFILE_SIZE, flx=false, wx=true, jup=true, jdown=true);
|
if (PART == "joiner_bottom") beam_joiner(fl=true);
|
||||||
|
|
||||||
if (PART == "rbfoot") rb_foot();
|
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);
|
||||||
|
|
||||||
|
//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);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user