This PR changes roundedBox to use hull.
Using hull makes it much more efficient to compute, and the geometry (rounded cube corners) is more correct without mismatched seams between spheres/cylinders in the corners/edges of the rounded cube.
I also thought it would make most sense to stick to the parameter conventions used by OpenSCAD native modules: https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Primitive_Solids#cube so the following changes where made:
1) In addition to size=[x,y,z] the new version optionally accepts a single number for size, which applies to all three dimensions.
2) roundedBox had no center parameter, it was always centered. The new module now provides the option, and defaults to not centered, just as the native cube module does.
3) minor change but parameter name r is more conventional than radius (used by cylinder, sphere etc.) so the new module also uses r.
Since the interface for this module would have changed, I thought it would be best to "deprecate" roundedBox by echoing a "warning" statement and name the new module roundedCube so that old scripts using MCAD can remain backwards compatible.
This PR changes
roundedBox
to use hull. Using hull makes it much more efficient to compute, and the geometry (rounded cube corners) is more correct without mismatched seams between spheres/cylinders in the corners/edges of the rounded cube.I also thought it would make most sense to stick to the parameter conventions used by OpenSCAD native modules: https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Primitive_Solids#cube so the following changes where made: 1) In addition to
size=[x,y,z]
the new version optionally accepts a single number for size, which applies to all three dimensions. 2)roundedBox
had nocenter
parameter, it was always centered. The new module now provides the option, and defaults to not centered, just as the nativecube
module does. 3) minor change but parameter namer
is more conventional thanradius
(used by cylinder, sphere etc.) so the new module also usesr
.Since the interface for this module would have changed, I thought it would be best to "deprecate"
roundedBox
by echoing a "warning" statement and name the new moduleroundedCube
so that old scripts using MCAD can remain backwards compatible.