Components / Building blocks
Proven

M3 fastener features

Hole sizes that have been printed and fitted, plus a screw and a screwdriver to check against.

The dull numbers that decide whether a build goes together: the hole for a heat-set insert, a clearance hole, a push-fit nut pocket. Also stand-in solids for a button-head screw and for the space a straight screwdriver needs, so a model can prove every screw can actually be driven.

Proven: Printed and fitted with the real hardware.Insert hole (5.0 x 7.5 mm) and clearance hole (3.4 mm) are proven on two builds. The nut pocket (5.6 x 2.6 mm) has only passed model checks.
3D model: M3 fastener featuresLoading 3D view
block, cut openM3 x 8 screwscrewdriver path

Use it in code

typescript
import { ready, fasteners, checks, geom } from "partkit";
await ready();

boss = boss.cut(geom.moved(fasteners.insertHole(), x, y, top));

const blocked = checks.driverBlocked(
  (tool) => geom.moved(tool, x, y, top), [lid, bezel, posts]);
if (blocked > 0) throw new Error("a screwdriver cannot reach this screw");

What you print

  • Nothing by itself

Hardware

  • M3 x 6 mm long x 5 mm OD brass heat-set inserts
  • M3 button-head screws
  • M3 nuts

Functions

CallWhat it gives you
fasteners.insertHole(depth)Hole for a heat-set insert, entering at z = 0.
fasteners.clearanceHole(length)A 3.4 mm through hole.
fasteners.nutPocket(depth, w, slide)Push-fit pocket for an M3 nut; slide lets one nut serve two screw positions.
fasteners.screw(length)Button-head screw stand-in for fit checks.
fasteners.driverPath()The space a straight screwdriver needs above the head.

Frame. Every tool is built along Z with the surface it enters at z = 0 and the material below. Rotate and translate it into place.

Sizes

Millimetres. These defaults are the sizes that were printed; other values are untested.

NameDefaultMeaning
M3_INSERT_D5Insert hole diameter
M3_INSERT_DEPTH7.5Insert hole depth (6.2 where the wall behind is thin)
M3_CLEAR_D3.4Clearance hole
M3_NUT_POCKET_W5.6Nut pocket across the flats (not yet proven)
M3_NUT_POCKET_T2.6Nut pocket along the screw (not yet proven)
DRIVER_R3.2Radius a screwdriver needs round the screw's axis

Check before you print

  • A straight screwdriver path above every screw head
  • A screw one size longer than specified still misses whatever is behind it
  • At least 2 mm of plastic round a screw slot or nut pocket

Learned the hard way

  • A screw 10 mm in front of a post could not be driven. Check tool access, not just overlap.
  • A screw that ends just short of a part is a trap; put the hole where a longer screw would still miss.
  • Never leave a nut slot open on two sides: nothing holds the nut while you assemble.

Open it in Fusion 360

The scene above as a STEP file: real solid bodies, each part its own named component, in position. In Fusion 360 use File, Open, then Open from my computer. It also opens in FreeCAD, SolidWorks and Onshape. It carries the shapes, not the sizes you can change; for different sizes, use Make it above or change them in code.

Source: ts/src/fasteners.ts
typescript
/** M3 hardware: hole sizes that have been printed and fitted, plus solids for fit checks.
 *  Every tool is built along Z with the surface it enters at z = 0 and the material at z < 0. */
import { box, zcyl, type Solid } from "./geom";

// proven sizes
export const M3_INSERT_D = 5.0; // hole for an M3 x 6 long x 5 OD brass heat-set insert
export const M3_INSERT_DEPTH = 7.5; // 6.2 is enough where the wall behind is thin (hinge leaves)
export const M3_CLEAR_D = 3.4;
export const M3_BOLT_SEAM_D = 3.3;
export const PIN_D = 1.15;
// catalogue values
export const M3_BUTTON_HEAD_D = 5.7;
export const M3_BUTTON_HEAD_H = 1.65;
export const M3_NUT_AF = 5.5;
export const M3_NUT_T = 2.4;
// NOT yet proven
export const M3_NUT_POCKET_W = 5.6;
export const M3_NUT_POCKET_T = 2.6;
export const DRIVER_R = 3.2;

export const insertHole = (depth = M3_INSERT_DEPTH, d = M3_INSERT_D): Solid => zcyl(d / 2, 0, 0, -depth, 0.2);
export const clearanceHole = (length: number, d = M3_CLEAR_D): Solid => zcyl(d / 2, 0, 0, -length - 0.5, 0.5);
/** Button-head screw stand-in for fit checks: shaft down from z = 0, head above. */
export const screw = (length: number, headD = M3_BUTTON_HEAD_D, headH = M3_BUTTON_HEAD_H, d = 3.0): Solid =>
  zcyl(d / 2, 0, 0, -length, 0).fuse(zcyl(headD / 2, 0, 0, 0, headH));
/** The space a straight screwdriver needs above a screw head. */
export const driverPath = (length = 150, r = DRIVER_R, headH = M3_BUTTON_HEAD_H): Solid => zcyl(r, 0, 0, headH, headH + length);
/** Push-fit pocket for an M3 nut, entering at z = 0; slide lengthens it along y. */
export function nutPocket(depth = M3_NUT_POCKET_T, w = M3_NUT_POCKET_W, slide = 0): Solid {
  const half = M3_NUT_AF / 2 / 0.866 + 0.1;
  return box(-w / 2, w / 2, -half, half + slide, -depth, 0.2);
}

View this module on GitHub