create_threaded_shaft
Create a cylindrical shaft with helical external threads for use as a threaded fastener or for boolean union with a screw head. Specify diameter, length, pitch, and thread depth to generate a single mesh object.
Instructions
Create a cylindrical shaft with helical external threads.
Produces a single mesh object — a threaded rod at the given diameter and length, with helical thread ridges following the specified pitch. Suitable for boolean-union onto a screw-head or direct use as a threaded fastener.
Thread geometry: a 60-degree V profile swept along a Z-axis helix via the Screw modifier.
Args: diameter: Major diameter of the shaft (outer thread peaks). Must be > 0. length: Axial length of the shaft (under-head length, like real fastener spec). Must be > 0. pitch: Distance between thread peaks along the axis. Must be > 0 and <= length. thread_depth: Radial depth of the thread (major radius - minor radius). If 0 (default), auto-computed as pitch * 0.54. segments: Rotational resolution of the helix (steps per revolution). Range: 3-256. Higher = smoother helix, more geometry. thread_runout: Smooth (unthreaded) region at the top of the shaft. Defaults to 0 (full-length threads) — gives the strongest print because threads under the head form a continuous stress path. Leaving a smooth runout creates a thin-walled neck at minor_r that snaps under torque in FDM prints. Pass a positive value only if a head's deep hex socket would otherwise reach thread peaks. name: Optional name for the object. Auto-generated if empty. location: XYZ position of the shaft base as a 3-element list/tuple.
Returns: Dict with the created object's name, diameter, length, pitch, and the number of thread iterations actually generated.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| diameter | Yes | ||
| length | Yes | ||
| pitch | Yes | ||
| thread_depth | No | ||
| segments | No | ||
| thread_runout | No | ||
| name | No | ||
| location | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||