"""Round bar (solid round stock), any diameter and length: EN 10060 hot-rolled round bars and plain round rod. A cylinder of diameter `diameter`, its axis along +Z, one end face on the XY plane centred on the origin. EN 10060 designates a round bar by its nominal diameter; the diameter tolerance of the standard is not modelled. """ from steve import Model diameter = 10 # mm Diameter d length = 100 # mm Length material = "steel" # Material # material choice: (STEVE material library id, appearance colour) MATERIALS = { "steel": ("steel-s235jr", "#8a8d91"), # EN 10025-2 S235JR, hot rolled "stainless-304": ("stainless-304", "#c9ccd0"), # EN 10088 1.4301 "aluminium-6061": ("aluminum-6061-t6", "#d4d7db"), "brass": ("brass", "#c9a54a"), } material_id, colour = MATERIALS[material] model = Model() with model.sketch("section", on="XY", name="Section") as sk: sk.circle("outline", (0, 0), diameter / 2) model.extrude("bar", "section", distance=length, name="Bar") model.material(material_id, color=colour) result = model.result()