"""Radial leaded inductor, Fastron's pluggable pin-type coils: 07M (shielded), 07P and 11P (with tube), 07HCP, 09HCP and 07HVP (open drum core, winding showing) and their /T versions with tube. The body stands on the board; lead 1 is at the origin and lead 2 at +X by the pitch; the leads go straight down through the board. Dimensions from Fastron's data sheets, listed in the README.""" from steve import Model series = "07M" # Series (Fastron part number prefix) tail = 3.0 # mm Leads below the board detail = "full" # full: body and leads; simple: the body only # Fastron data sheets, one page each (fastrongroup.com, "Pluggable Inductors (Pin Type Coils)", files under wp-content/uploads/2026/06/), # the drawing's maximum body diameter and height, lead diameter and pitch ("Revision date" printed on each sheet): # 07M (03 Aug 2022): Ø 10 max, 12.5 max, Ø 0.65, 5.0. 07P (29 Jul 2022), Loose / Box [-50]: Ø 7.2 max, 11.0 max, Ø 0.65, 3.5. # 07HCP (26 Aug 2022): Ø 8.3 max, 10.0 max; 07HCP/T Ø 9.2 max, 10.5 max; both Ø 0.70, 5.0. # 09HCP (29 Aug 2022): Ø 12.3 max, 10.8 max; 09HCP/T Ø 12.7 max, 11.5 max; both Ø 0.80, 7.0. # 11P (12 Aug 2022): Ø 10.5 max, 15.0 max, Ø 0.7, 5.0. 07HVP (25 Aug 2022): 07HVP Ø 8.3 max, 10 max; 07HVP/T Ø 9.2 max, 10.5 max; Ø 0.7, 5.0. # Each entry: (body diameter, body height, lead diameter, pitch, kind): can = shielded, tube = drum core under a tube, open = drum core. SIZES = { "07M": (10.0, 12.5, 0.65, 5.0, "can"), "07P": (7.2, 11.0, 0.65, 3.5, "tube"), "07HCP": (8.3, 10.0, 0.70, 5.0, "open"), "07HCP/T": (9.2, 10.5, 0.70, 5.0, "tube"), "09HCP": (12.3, 10.8, 0.80, 7.0, "open"), "09HCP/T": (12.7, 11.5, 0.80, 7.0, "tube"), "07HVP": (8.3, 10.0, 0.7, 5.0, "open"), "07HVP/T": (9.2, 10.5, 0.7, 5.0, "tube"), "11P": (10.5, 15.0, 0.7, 5.0, "tube"), } if series not in SIZES: raise ValueError(f"no series {series!r}: {', '.join(SIZES)}") diameter, height, lead, pitch, kind = SIZES[series] R, r, H = diameter / 2, lead / 2, height cx = pitch / 2 # Body outlines as (radius, z), proportions for looks (the sheets draw the shape but dimension only Ø and height): # can: a plain cylinder, its top edge chamfered by 0.05 x the diameter; # tube: the tube follows the drum core's flanges, 0.2 x the height each at the full diameter, and the waist between at 0.88 x the # diameter, with the end edges rounded by 0.1 x the radius; # open: flanges 0.15 x the height thick at the full diameter, the winding between them at 0.9 x the diameter on a core of 0.5 x it. if kind == "can": c = 0.05 * diameter outline = [(0, 0), (R, 0), (R, H - c), (R - c, H), (0, H)] elif kind == "tube": e, fl, w = 0.1 * R, 0.2 * H, 0.88 * R outline = [(0, 0), (R - e, 0), (R, e), (R, fl), (w, fl + 0.05 * H), (w, H - fl - 0.05 * H), (R, H - fl), (R, H - e), (R - e, H), (0, H)] else: fl = 0.15 * H outline = [(0, 0), (R, 0), (R, fl), (0.5 * R, fl), (0.5 * R, H - fl), (R, H - fl), (R, H), (0, H)] model = Model() with model.sketch("body_sketch", on="XZ", name="Body") as sk: sk.polyline("body_outline", [(cx + u, z) for u, z in outline], closed=True) model.revolve("body", "body_sketch", axis=((cx, 0, 0), (0, 0, 1)), op="new", body="body_body", name="Body") bodies = ["body_body"] if kind == "open" and detail == "full": # The winding: copper between the flanges, 0.9 x the diameter, its turns drawn 0.5 apart and 0.1 deep (proportions; the sheets give no # wire size). rw, turns = 0.9 * R, max(4, int((H - 2 * fl) / 0.5)) step = (H - 2 * fl) / turns wind = [(cx + 0.5 * R, fl), (cx + rw - 0.1, fl)] for i in range(turns): wind += [(cx + rw, fl + (i + 0.5) * step), (cx + rw - 0.1, fl + (i + 1) * step)] wind += [(cx + 0.5 * R, H - fl)] with model.sketch("winding_sketch", on="XZ", name="Winding") as sk: sk.polyline("winding_outline", wind, closed=True) model.revolve("winding", "winding_sketch", axis=((cx, 0, 0), (0, 0, 1)), op="new", body="winding_body", name="Winding") bodies.append("winding_body") if detail == "full": model.plane("leads_start", on="XY", offset=-tail, name="Lead ends") for i, x in enumerate((0.0, pitch), 1): with model.sketch(f"lead_{i}_section", on="leads_start", name=f"Lead {i}") as sk: sk.circle(f"lead_{i}_round", (x, 0), r) model.extrude(f"lead_{i}", f"lead_{i}_section", distance=tail, op="new", body=f"lead_{i}_body", name=f"Lead {i}") bodies.append(f"lead_{i}_body") # Materials, for looks and a rough mass: the material list has no ferrite, so the ferrite can and drum core stand in as alumina (a ceramic, # density about 3.9 against ferrite's 4.8). The tube types' body is one solid, the drum core with its thin tube, and is alumina too. The # winding copper, the leads tinned copper. model.material("alumina", bodies=["body_body"], color="#2e3033" if kind != "open" else "#45474b") if detail == "full": if kind == "open": model.material("copper", bodies=["winding_body"], color="#c8834f") model.material("copper", bodies=[b for b in bodies if b.startswith("lead")], color="#c9ccd1") result = model.result()