"""Spring plungers, steel, Elesa+Ganter: GN 615-K ball spring plungers and GN 615.1-B bolt spring plungers. A threaded body (drawn as a cylinder at the thread's nominal diameter d1; thread and screwdriver slot not modelled) of length l, axis along +Z from z = 0, and at its top the plunger standing out by w: a ball of diameter d2 (its top at l + w) or a bolt of diameter d2 (a cylinder to l + w; its rounded end is not dimensioned and drawn flat). """ from steve import Model size = "M6" # Thread d1 style = "ball" # Plunger material = "steel" # Material NOMINAL = {"M3": 3.0, "M4": 4.0, "M5": 5.0, "M6": 6.0, "M8": 8.0, "M10": 10.0} # mm. GN 615-K (11/2025): (ball d2, body l, protrusion w) BALL = {"M3": (1.5, 7, 0.4), "M4": (2.5, 9, 0.8), "M5": (3, 12, 0.9), "M6": (3.5, 14, 1.0), "M8": (4.5, 16, 1.5), "M10": (6, 19, 2.0)} # mm. GN 615.1-B (10/2025): (bolt d2, body l, protrusion w) BOLT = {"M4": (1.8, 9, 1.5), "M5": (2.4, 12, 2.0), "M6": (2.7, 14, 2.0), "M8": (3.8, 16, 2.0), "M10": (4.5, 19, 2.5)} MATERIALS = {"steel": ("steel-generic", "#2f3134")} # black-oxide steel d1 = NOMINAL[size] d2, l, w = {"ball": BALL, "bolt": BOLT}[style][size] material_id, colour = MATERIALS[material] model = Model() model.cylinder("body", d1 / 2, l, name="Body") if style == "ball": model.sphere("ball", d2 / 2, at=(0, 0, l + w - d2 / 2), op="join", name="Ball") else: model.cylinder("bolt", d2 / 2, w, at=(0, 0, l), op="join", name="Bolt") model.material(material_id, color=colour) result = model.result()