July 9, 2023
Description
Someone was looking for a way to model an enclosure similar to the Pi Holder (rectangular box with rounded lobes at each corner). That got me thinking about how to parametrically generate one. The resulting OpenSCAD code will generate a solid from the following parameters:
w - width of inner rectangle
l - length of inner rectangle
h - height
r1 - radius or corner lobes
r2 - radius of side cuts
r3 - radius of front/back cuts
fillet - rounded edge
dx - offset of corner lobe relative to length (must be >= -r1)
dy - offset of corner lobe relative to width (must be >= -r1)
Note: This is just a solid object. To turn it into a case, you'd need to hollow it out, cut holes, etc. Should be able to do this either in OpenSCAD itself, or by importing the STL into another modeling app and subtracting volumes from it.
License:
Creative Commons — Attribution
10