mirror of
https://github.com/BelfrySCAD/BOSL2.git
synced 2025-01-04 03:09:45 +00:00
commit
07556ba759
2 changed files with 16 additions and 15 deletions
29
shapes.scad
29
shapes.scad
|
@ -77,29 +77,30 @@ module cuboid(
|
||||||
e = corner_edges(edges, corner);
|
e = corner_edges(edges, corner);
|
||||||
cnt = sum(e);
|
cnt = sum(e);
|
||||||
r = first_defined([chamfer, rounding, 0]);
|
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);
|
$fn = is_finite(chamfer)? 4 : segs(r);
|
||||||
translate(vmul(corner,size/2-[r,r,r])) {
|
translate(vmul(corner,size/2-c)) {
|
||||||
if (cnt == 0) {
|
if (cnt == 0) {
|
||||||
cube(r*2, center=true);
|
cube(c*2, center=true);
|
||||||
} else if (cnt == 1) {
|
} else if (cnt == 1) {
|
||||||
if (e.x) xcyl(l=r*2, r=r);
|
if (e.x) xcyl(l=c.x*2, r=r);
|
||||||
if (e.y) ycyl(l=r*2, r=r);
|
if (e.y) ycyl(l=c.y*2, r=r);
|
||||||
if (e.z) zcyl(l=r*2, r=r);
|
if (e.z) zcyl(l=c.z*2, r=r);
|
||||||
} else if (cnt == 2) {
|
} else if (cnt == 2) {
|
||||||
if (!e.x) {
|
if (!e.x) {
|
||||||
intersection() {
|
intersection() {
|
||||||
ycyl(l=r*2, r=r);
|
ycyl(l=c.y*2, r=r);
|
||||||
zcyl(l=r*2, r=r);
|
zcyl(l=c.z*2, r=r);
|
||||||
}
|
}
|
||||||
} else if (!e.y) {
|
} else if (!e.y) {
|
||||||
intersection() {
|
intersection() {
|
||||||
xcyl(l=r*2, r=r);
|
xcyl(l=c.x*2, r=r);
|
||||||
zcyl(l=r*2, r=r);
|
zcyl(l=c.z*2, r=r);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
intersection() {
|
intersection() {
|
||||||
xcyl(l=r*2, r=r);
|
xcyl(l=c.x*2, r=r);
|
||||||
ycyl(l=r*2, r=r);
|
ycyl(l=c.y*2, r=r);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -107,9 +108,9 @@ module cuboid(
|
||||||
spheroid(r=r, style="octa");
|
spheroid(r=r, style="octa");
|
||||||
} else {
|
} else {
|
||||||
intersection() {
|
intersection() {
|
||||||
xcyl(l=r*2, r=r);
|
xcyl(l=c.x*2, r=r);
|
||||||
ycyl(l=r*2, r=r);
|
ycyl(l=c.y*2, r=r);
|
||||||
zcyl(l=r*2, r=r);
|
zcyl(l=c.z*2, r=r);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
BOSL_VERSION = [2,0,446];
|
BOSL_VERSION = [2,0,447];
|
||||||
|
|
||||||
|
|
||||||
// Section: BOSL Library Version Functions
|
// Section: BOSL Library Version Functions
|
||||||
|
|
Loading…
Reference in a new issue