Ramblings of an aging IT geek
← Ramblings of an aging IT geek
hardware

the bracket nobody sells, so i drew it myself

Modelling and printing a custom mounting bracket in OpenSCAD because the exact part I needed didn't exist, and why parametric design earns its keep.

A 3D printer mid-print in a home workshop

I needed a bracket to hold a small single-board computer against the underside of a shelf, at an angle, near a specific set of pre-drilled holes I had no intention of re-drilling. Nobody sells that bracket, because nobody else has my shelf. This is the single best argument for owning a 3D printer: not the things you can buy and print anyway, but the things that exist only in your house.

I drew it in OpenSCAD rather than a mouse-driven CAD tool, and for a part like this that's the right call. The thing is mostly defined by numbers I measured with calipers: the board's mounting hole spacing, the screw diameter, the offset to clear a connector, the angle I wanted it to sit at. In OpenSCAD those are just variables at the top of the file, and the geometry falls out of them.

board_w = 56;
board_h = 65;
hole_spacing = 49;
screw_d = 3.2;
wall = 3;
angle = 15;

The advantage of doing it this way only shows up on the second print. My first version had the holes too tight, because I'd used the nominal M3 diameter and forgotten that a printed hole always comes out a touch smaller than modelled. Fixing it was changing one number, screw_d, from 3 to 3.2 and re-rendering. No clicking back through a sketch, no hunting for the constraint I'd set three steps ago. The intent lives in the variable, and the model is just a consequence of it.

A cluttered workbench with tools and a part being measured

It took three prints to get right, which sounds like failure but is really just the loop working. Print, offer it up to the actual shelf, notice the connector fouls by two millimetres, bump the offset, print again. Each iteration was twenty minutes of printing and thirty seconds of editing. By the third one it slotted in, the screws bit cleanly, the board sat at the angle I wanted, and it clears the connector with room to spare.

There's a real lesson under the plastic. The temptation with CAD is to model the shape you want. The better habit is to model the constraints and let the shape be derived, because constraints are what change when reality disagrees with you. My bracket isn't really a 3D model of a bracket. It's a description of how a particular board has to meet a particular shelf, and the bracket is what OpenSCAD prints when you ask it to satisfy that.

The part cost about thirty pence of filament and an hour of my evening. You can't buy it, and now I never need to, because the file will print another one any time the shelf or the board changes. That's the bit a shop-bought bracket can never give you.