Hairspring

Hairspring render

springs/hairspring.pyOBJECT_OT_add_hairspring (object.add_hairspring, "Add Hairspring")

A flat Archimedean-spiral ribbon — the kind of spring used in mechanical clock balance wheels. See README.md for family-wide notes.

The spiral formula

r(theta) = r_inner + (gap / 2*pi) * theta,   theta in [0, 2*pi*turns]

sampled at N = round(resolution * turns) + 1 points (minimum 2).

Properties

Property Type Default Range Notes
input_modeEnumMODE_AMODE_A (Inner/Turns/Gap) / MODE_B (Inner/Outer/Turns)
r_innerFloat (mm)10.00.1–500 (soft)
turnsFloat5.00.5–50 (soft)
gapFloat (mm)2.00.1–50 (soft)Radial gap between adjacent coil passes. Mode A only.
r_outerFloat (mm)20.00.2–500 (soft)Radius of the outermost coil. Mode B only.
strip_widthFloat (mm)1.00.4–20 (soft)Ribbon dimension in Z. FDM floor: 0.4mm.
strip_thicknessFloat (mm)0.40.2–10 (soft)Ribbon dimension radially. FDM floor: 0.2mm.
resolutionInt1288–512 (soft)Sample points per full turn

Mode A vs Mode B

Panel warnings — only one actually blocks

Build method

build_manual_ribbon() walks the sampled centerline points, computes a tangent at each (central difference, forward/backward at the ends), and a binormal tangent × Z as the local "width" direction — a hand-rolled sweep frame, not Blender's built-in curve-bevel machinery (hence "manual" in the function name). Each point gets 4 verts (outer/inner × top/bottom in the local frame); the ribbon is closed with start and end cap quads. strip_width becomes ribbon depth in Z; strip_thickness becomes ribbon width radially — there's no Solidify modifier involved, the thickness is built directly into the mesh.

Output

One object per call, Hairspring (mesh data HairspringMesh), placed at the 3D cursor. No success report message is printed (unlike the other two generators in this family). No bmech_* stamping.