mirror of
https://github.com/BelfrySCAD/BOSL2.git
synced 2025-01-01 09:49:45 +00:00
Fix for cuboid() issue #307
This commit is contained in:
parent
1e193a090e
commit
40fde0f2b8
2 changed files with 10 additions and 9 deletions
|
@ -78,14 +78,15 @@ module cuboid(
|
|||
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)];
|
||||
c2 = vmul(corner,c/2);
|
||||
$fn = is_finite(chamfer)? 4 : segs(r);
|
||||
translate(vmul(corner, size/2-c)) {
|
||||
if (cnt == 0) {
|
||||
cube(c*2, center=true);
|
||||
translate(c2) cube(c, center=true);
|
||||
} else if (cnt == 1) {
|
||||
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);
|
||||
if (e.x) right(c2.x) xcyl(l=c.x, r=r);
|
||||
if (e.y) back (c2.y) ycyl(l=c.y, r=r);
|
||||
if (e.z) up (c2.z) zcyl(l=c.z, r=r);
|
||||
} else if (cnt == 2) {
|
||||
if (!e.x) {
|
||||
intersection() {
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
BOSL_VERSION = [2,0,460];
|
||||
BOSL_VERSION = [2,0,461];
|
||||
|
||||
|
||||
// Section: BOSL Library Version Functions
|
||||
|
|
Loading…
Reference in a new issue