revarbat / BOSL

The Belfry OpenScad Library - A library of tools, shapes, and helpers to make OpenScad easier to use.
https://github.com/revarbat/BOSL/wiki
BSD 2-Clause "Simplified" License
571 stars 62 forks source link

[BUG] Cuboid rejecting valid fillet value #54

Closed limitz closed 4 years ago

limitz commented 5 years ago

When applying fillet to a cuboid, it fails if the value is larger than half the size of any of the edges. However, I ran into a case where the fillet value is valid for some of the edges, and edges that would cause issues are excluded. The error:

ERROR: Assertion 'FAILED' failed: "fillet must be smaller than half the cube width, length, or height." in file ../../Program Files/OpenSCAD/libraries/BOSL/compat.scad, line 199

Code To Reproduce Bug

cuboid([21, 21, 1], fillet=4, edges=EDGES_Z_ALL);

Expected behavior Since only the edges aligned with Z axis are going to have fillet, the module should only check if the fillet value is in range for the X and Y edges. It would then see that applying a fillet on the 21x21 square is acceptable.

Additional context OpenSCAD Version: 2019.05

Possible temporary workaround

zscale(0.125) 
cuboid([21, 21, 8], fillet=4, edges=EDGES_Z_ALL);