Threaded bolt + nut
helical sweep + slice engagement
`extrudeHelical` triangular thread profile on both bolt and nut, with slice exposing engagement.
What it is
An ISO-style metric hex bolt with a hex nut threaded partway up the shaft. Both threads come from the same triangular cross-section swept around Z by extrudeHelical — the bolt’s external thread runs from minorRadius outward to majorRadius; the nut’s internal thread is the same shape offset by a small radial clearance and subtracted from a hex prism.
Why visual feedback matters
Threads are the canonical "looks right from a parameter table, looks wrong when you render it" geometry. Pitch sign, helix start angle, radial clearance, and the nut-vs-bolt radial offset all have similar-looking failure modes (thread doesn’t engage, thread runs backward, thread is wedged into the wall). The slice along the bolt axis tells you instantly whether the crests and roots actually interlock.
Screenshots
Slice cuts the assembly in half along Y — cyan cut faces show the thread profile interleaved between bolt and nut.
Parameters
Parameters 10
| Name | Default | Description |
|---|---|---|
majorDiameter | 8 mm | Bolt major (crest) diameter. |
pitch | 1.25 mm | Axial distance per thread. |
threadLength | — mm | Length of threaded section. |
shankLength | — mm | Unthreaded shank length. |
headHeight | — mm | Hex-head height. |
headAcross | — mm | Hex-head across-flats distance. |
nutHeight | — mm | Hex-nut height. |
nutAcross | — mm | Hex-nut across-flats distance. |
nutPosition | — mm | Z height of the nut bottom. |
clearance | 0.2 mm | Radial clearance between bolt-major and nut-minor. |
Try it
- Open in your browser → openjscad.xyz, bundled single-file
- Source on GitHub →
- Full walkthrough on GitHub →