diff --git a/shapes.scad b/shapes.scad index b13ca2b..4ddd9dd 100644 --- a/shapes.scad +++ b/shapes.scad @@ -77,29 +77,30 @@ module cuboid( e = corner_edges(edges, corner); cnt = sum(e); r = first_defined([chamfer, rounding, 0]); + c = [min(r,size.x/2), min(r,size.y/2), min(r,size.z/2)]; $fn = is_finite(chamfer)? 4 : segs(r); - translate(vmul(corner,size/2-[r,r,r])) { + translate(vmul(corner,size/2-c)) { if (cnt == 0) { - cube(r*2, center=true); + cube(c*2, center=true); } else if (cnt == 1) { - if (e.x) xcyl(l=r*2, r=r); - if (e.y) ycyl(l=r*2, r=r); - if (e.z) zcyl(l=r*2, r=r); + if (e.x) xcyl(l=c.x*2, r=r); + if (e.y) ycyl(l=c.y*2, r=r); + if (e.z) zcyl(l=c.z*2, r=r); } else if (cnt == 2) { if (!e.x) { intersection() { - ycyl(l=r*2, r=r); - zcyl(l=r*2, r=r); + ycyl(l=c.y*2, r=r); + zcyl(l=c.z*2, r=r); } } else if (!e.y) { intersection() { - xcyl(l=r*2, r=r); - zcyl(l=r*2, r=r); + xcyl(l=c.x*2, r=r); + zcyl(l=c.z*2, r=r); } } else { intersection() { - xcyl(l=r*2, r=r); - ycyl(l=r*2, r=r); + xcyl(l=c.x*2, r=r); + ycyl(l=c.y*2, r=r); } } } else { @@ -107,9 +108,9 @@ module cuboid( spheroid(r=r, style="octa"); } else { intersection() { - xcyl(l=r*2, r=r); - ycyl(l=r*2, r=r); - zcyl(l=r*2, r=r); + xcyl(l=c.x*2, r=r); + ycyl(l=c.y*2, r=r); + zcyl(l=c.z*2, r=r); } } } diff --git a/version.scad b/version.scad index 89757d8..23b052c 100644 --- a/version.scad +++ b/version.scad @@ -8,7 +8,7 @@ ////////////////////////////////////////////////////////////////////// -BOSL_VERSION = [2,0,446]; +BOSL_VERSION = [2,0,447]; // Section: BOSL Library Version Functions