"""Trapezoidal lead screw envelope: a plain shaft at the major diameter d, axis along Z, centred on the origin. The thread itself is not modelled, as in the library's threaded rods; `lead` only names the screw.""" from steve import Model size = "Tr8" # Nominal diameter lead = 2 # mm Lead per turn length = 300 # mm Length # nominal: major diameter d. ISO 2904:2020 Table 1 (d of Tr10, Tr12, Tr16, with P and minor diameter d3 in the README); # the Tr8 x 2, 4 and 8 screws are commercial (ISO 2904 tabulates Tr8 x 1.5): d = 8 is their designation. SCREWS = {"Tr8": 8, "Tr10": 10, "Tr12": 12, "Tr16": 16} d = SCREWS[size] model = Model() with model.sketch("section", on="XY", name="Section") as sk: sk.circle("outer", (0, 0), d / 2) model.extrude("screw", "section", distance=length, both=True, name="Screw") model.material("steel-generic", color="#b9bdc2") result = model.result()