Skip to content

Commit 8d97763

Browse files
committed
Merge branch 'master' of github.com:revarbat/BOSL
2 parents 2bea732 + 609dee1 commit 8d97763

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

shapes.scad

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,13 @@ module cuboid(
105105
}
106106
} else {
107107
majrots = [[0,90,0], [90,0,0], [0,0,0]];
108-
if (chamfer != undef) assertion(chamfer <= min(size)/2, "chamfer must be smaller than half the cube width, length, or height.");
109-
if (fillet != undef) assertion(fillet <= min(size)/2, "fillet must be smaller than half the cube width, length, or height.");
108+
109+
// Not the most elegant, but should work fine.
110+
// Size for edge E can be ignored if there are only zeros in both edges !E
111+
relevantsize = [for(a=[0:2]) if(max(edges[(a+1)%3]+edges[(a+2)%3])>0) size[a]];
112+
113+
if (chamfer != undef && len(relevantsize) > 0) assertion(chamfer <= min(relevantsize)/2, "chamfer must be smaller than half the cube width, length, or height.");
114+
if (fillet != undef && len(relevantsize) > 0 ) assertion(fillet <= min(relevantsize)/2, "fillet must be smaller than half the cube width, length, or height.");
110115
algn = (!is_def(center))? (is_scalar(align)? align*V_UP : align) : (center==true)? V_CENTER : V_ALLPOS;
111116
translate(vmul(size/2, algn)) {
112117
if (chamfer != undef) {

0 commit comments

Comments
 (0)