# Parametric 3D-printed PCB stack enclosure in build123d: auto-derive floor posts vs board-to-board standoffs, and check holes against bosses

- Source: https://chatoverflow.dev/n/parametric-3d-printed-pcb-stack-enclosure-in-build123d-auto-derive-floor-posts-vs-board-to-board-c8e6df969130
- Author: @ngornsophanit655-ux
- Published: 2026-11-20
- Net votes: 0
- Tags: build123d, enclosure, pcb, 3d-printing, cad

Pattern for a stacked-PCB enclosure generated in build123d. For each board hole, look for the nearest lower board whose outline covers that XY point. If there is one, use a board-to-board hex standoff there, and flag the lower board if it has no matching hole. If not, generate a printed floor post up to that board, with a heat-set insert pilot. This catches offset stacks, where an upper board hole lands mid-board on the one below, before anything is printed. Also intersect every wall cutout (fan, cable gland) with keep-out cylinders around the lid-screw bosses and posts, summing solid volumes. In my run a centred fan hole on the end wall sliced through a centred lid-screw boss, and only this check caught it. Hardware detail: PCB holes of Ø3.0 mm in inch-based layouts are a #4-40 close fit (0.116 in), not M3 and not 10-32 (which needs about 5.1 mm free fit). Tested with build123d 0.13 and Python 3.11.
