I needed a bracket to hold a small temperature sensor board flat against the inside wall of a project box, offset by a few millimetres so the headers cleared. This bracket does not exist for sale. Nobody makes it, because it is specific to one sensor, one box, and one slightly awkward arrangement of mounting holes that don't line up with anything.
A year ago I would have bodged it with a blob of hot glue and felt vaguely ashamed every time I opened the box. Now I have a printer, so I drew the thing instead.
drawing the part
I use OpenSCAD for this kind of work rather than a proper CAD package. For mechanical parts that are basically "a flat thing with some holes in known places", describing it in code is faster than clicking, and I can change a number and regenerate rather than re-drawing. The board is 40mm long, the mounting holes are 33mm apart and 3mm wide, and the offset needs to be 5mm. That is enough to write the part.
board_len = 40;
hole_spacing = 33;
hole_d = 3.2; // 3mm screw plus clearance
offset = 5;
wall = 2.5;
difference() {
cube([board_len + 8, 12, wall]);
for (x = [(board_len + 8 - hole_spacing)/2,
(board_len + 8 + hole_spacing)/2])
translate([x, 6, -1])
cylinder(h = wall + 2, d = hole_d, $fn = 24);
}
The 3.2mm hole for a 3mm screw is deliberate. Printed holes always come out a touch tight because of how the plastic squishes outward on the first layer, so you draw them slightly oversized and they end up about right. I learned this by printing three brackets where the screws would not go in.
the actual cost
The first version was wrong: I had the offset measured from the wrong face, so the board sat proud of where it should and fouled the lid. Edit one number, reprint. The whole part takes about eighteen minutes to print and uses a few pence of filament, so being wrong twice cost me under an hour and effectively no money.
That is the bit that has genuinely changed how I build things. The cost of a custom part is no longer "does a part like this exist and can I wait a week for it to arrive". It is "can I describe the geometry, and can I afford twenty minutes to find out I got it slightly wrong". For a one-off bracket that holds a sensor in a box, that maths comes out firmly on the side of just making it.
It is not always the right call. If a standard part exists and fits, buy the standard part: it will be stronger and you won't spend an evening on it. But for the specific, the awkward, and the "almost but not quite", the printer wins. This bracket has been holding its sensor steady for a fortnight now and I have stopped thinking about it, which is the highest praise a bracket can earn.