add_fastener
Create standard ISO metric fasteners — socket head cap screws, hex bolts, nuts, or washers — as solid models with orderable designations and stock-length catalog checks.
Instructions
Add a standard ISO metric fastener (screw / bolt / nut / washer) as a solid.
kind: one of "socket_head_cap_screw", "hex_bolt", "hex_nut", "washer".
socket_head_cap_screw: cylindrical head with a cosmetic hex socket + plain shank (threads not modeled).
hex_bolt: hex head (across-flats) + plain shank.
hex_nut: hex prism with an axial clearance hole.
washer: flat annular ring. size: ISO designation, one of "M3","M4","M5","M6","M8","M10","M12". length: shank length in mm. REQUIRED for socket_head_cap_screw and hex_bolt; ignored for nut/washer. grade: optional material / property class AS ORDERED — ISO 898-1 for steel screws ("8.8", "12.9"), ISO 898-2 for nuts ("8", "10"), ISO 3506 for stainless ("A2", "A4-80"). It changes no geometry. What it changes is the ORDERABLE designation stamped on the part: with it you get "ISO 4762 M4×12 A2", which a buyer can quote; without it the designation comes back complete=False saying nobody has chosen between class 8.8 steel and A2 stainless yet. An unrecognised grade is a loud error, never a guess. placement: optional [x, y, z] mm translation of the fastener origin (head top sits at z=0, shank runs in -z for screws/bolts). name: optional object name (default derived from kind).
All dimensions are in mm. Threads are cosmetic (the shank is a plain cylinder of the major diameter).
Returns {handle, name, kind, size, major_diameter, pitch, volume,
designation, orderable} plus, by kind:
screws/bolts add {length, head_diameter, head_height, model_thread:false};
nut adds {head_diameter (wrench across-flats), head_height};
washer adds {head_diameter (outer diameter), head_height (thickness)}.
Mating numbers: drill a through-hole of major_diameter (+ clearance) for the
shank; head_diameter sizes a counterbore. designation is the canonical
orderable identity ("ISO 4762 M4×12 A2") and orderable its full card.
catalog is the off-the-shelf verdict computed at creation time — code
stocked, or not_stocked naming the lengths either side. A length nobody
stocks is a FINDING, not a refusal: the solid is still built, so you can decide
whether to move the stack-up or accept a special.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| kind | Yes | ||
| name | No | ||
| size | Yes | ||
| grade | No | ||
| length | No | ||
| placement | No |