"""Leaded disc varistor (metal oxide varistor), TDK SIOV StandarD series S05 to S20: an epoxy-coated zinc oxide disc standing on two straight radial leads. Lead 1 at the origin, lead 2 at +X by the lead spacing e and at -Y by the lead offset a (the leads are fixed to the disc's two faces); the leads go straight down through the board. Dimensions from TDK's data sheet, listed in the README.""" from steve import Model size = "S10" # SIOV size class (disc diameter class) voltage = 275 # Voltage class, the K number in the type name (rated RMS voltage; K1000 is rated 1100 V) tail = 3.0 # mm Leads below the board detail = "full" # full: disc and leads; simple: the disc only # TDK Electronics, "SIOV metal oxide varistors, Leaded varistors, StandarD series", B722*, March 2018 # (www.tdk-electronics.tdk.com/inf/70/db/var/SIOV_Leaded_StandarD.pdf), pages 14 to 18, table "Dimensions" (with the type names from the # ordering-code tables): (ordering code, VRMS in V, lead spacing e +/-1, lead offset a typical, disc diameter w max, thickness th max, # height over the seating plane h max, lead diameter d +/-0.05), lengths in mm. Page 14's "Dimensional drawings" (VAR0408-C-E) shows the # shape: the leads leave the disc 3 max above the seating plane (IEC 60717). TYPES = { "S05K11": ("B72205S0110K101", 11, 5.0, 1.2, 7.0, 3.3, 8.5, 0.6), "S07K11": ("B72207S0110K101", 11, 5.0, 1.2, 9.0, 3.4, 11.0, 0.6), "S10K11": ("B72210S0110K101", 11, 7.5, 1.4, 12.0, 4.0, 14.5, 0.8), "S14K11": ("B72214S0110K101", 11, 7.5, 1.4, 15.5, 4.0, 18.5, 0.8), "S20K11": ("B72220S0110K101", 11, 10.0, 1.5, 21.5, 4.5, 25.5, 1.0), "S05K14": ("B72205S0140K101", 14, 5.0, 1.3, 7.0, 3.4, 8.5, 0.6), "S07K14": ("B72207S0140K101", 14, 5.0, 1.3, 9.0, 3.5, 11.0, 0.6), "S10K14": ("B72210S0140K101", 14, 7.5, 1.5, 12.0, 4.2, 14.5, 0.8), "S14K14": ("B72214S0140K101", 14, 7.5, 1.5, 15.5, 4.2, 18.5, 0.8), "S20K14": ("B72220S0140K101", 14, 10.0, 1.6, 21.5, 4.6, 25.5, 1.0), "S05K17": ("B72205S0170K101", 17, 5.0, 1.4, 7.0, 3.5, 8.5, 0.6), "S07K17": ("B72207S0170K101", 17, 5.0, 1.4, 9.0, 3.6, 11.0, 0.6), "S10K17": ("B72210S0170K101", 17, 7.5, 1.6, 12.0, 4.4, 14.5, 0.8), "S14K17": ("B72214S0170K101", 17, 7.5, 1.7, 15.5, 4.4, 18.5, 0.8), "S20K17": ("B72220S0170K101", 17, 10.0, 1.8, 21.5, 4.8, 25.5, 1.0), "S05K20": ("B72205S0200K101", 20, 5.0, 1.2, 7.0, 3.5, 8.5, 0.6), "S07K20": ("B72207S0200K101", 20, 5.0, 1.2, 9.0, 3.6, 11.0, 0.6), "S10K20": ("B72210S0200K101", 20, 7.5, 1.6, 12.0, 4.5, 14.5, 0.8), "S14K20": ("B72214S0200K101", 20, 7.5, 1.6, 15.5, 4.6, 18.5, 0.8), "S20K20": ("B72220S0200K101", 20, 10.0, 2.1, 21.5, 5.1, 25.5, 1.0), "S05K25": ("B72205S0250K101", 25, 5.0, 1.3, 7.0, 3.6, 8.5, 0.6), "S07K25": ("B72207S0250K101", 25, 5.0, 1.3, 9.0, 3.7, 11.0, 0.6), "S10K25": ("B72210S0250K101", 25, 7.5, 1.4, 12.0, 4.2, 14.5, 0.8), "S14K25": ("B72214S0250K101", 25, 7.5, 1.4, 15.5, 4.2, 18.5, 0.8), "S20K25": ("B72220S0250K101", 25, 10.0, 1.8, 21.5, 4.7, 25.5, 1.0), "S05K30": ("B72205S0300K101", 30, 5.0, 1.5, 7.0, 3.6, 8.5, 0.6), "S07K30": ("B72207S0300K101", 30, 5.0, 1.5, 9.0, 3.7, 11.0, 0.6), "S10K30": ("B72210S0300K101", 30, 7.5, 1.5, 12.0, 4.4, 14.5, 0.8), "S14K30": ("B72214S0300K101", 30, 7.5, 1.5, 15.5, 4.4, 18.5, 0.8), "S20K30": ("B72220S0300K101", 30, 10.0, 2.0, 21.5, 4.9, 25.5, 1.0), "S05K35": ("B72205S0350K101", 35, 5.0, 1.6, 7.0, 3.7, 8.5, 0.6), "S07K35": ("B72207S0350K101", 35, 5.0, 1.6, 9.0, 3.9, 11.0, 0.6), "S10K35": ("B72210S0350K101", 35, 7.5, 1.6, 12.0, 4.4, 14.5, 0.8), "S14K35": ("B72214S0350K101", 35, 7.5, 1.6, 15.5, 4.5, 18.5, 0.8), "S20K35": ("B72220S0350K101", 35, 10.0, 2.2, 21.5, 5.1, 25.5, 1.0), "S05K40": ("B72205S0400K101", 40, 5.0, 1.8, 7.0, 3.9, 8.5, 0.6), "S07K40": ("B72207S0400K101", 40, 5.0, 1.8, 9.0, 4.1, 11.0, 0.6), "S10K40": ("B72210S0400K101", 40, 7.5, 1.7, 12.0, 4.8, 14.5, 0.8), "S14K40": ("B72214S0400K101", 40, 7.5, 1.7, 15.5, 4.9, 18.5, 0.8), "S20K40": ("B72220S0400K101", 40, 10.0, 2.4, 21.5, 5.4, 25.5, 1.0), "S05K50": ("B72205S0500K101", 50, 5.0, 1.3, 7.0, 3.3, 8.5, 0.6), "S07K50": ("B72207S0500K101", 50, 5.0, 1.3, 9.0, 3.3, 11.0, 0.6), "S10K50": ("B72210S0500K101", 50, 7.5, 1.4, 12.0, 3.9, 14.5, 0.8), "S14K50": ("B72214S0500K101", 50, 7.5, 1.4, 15.5, 3.9, 18.5, 0.8), "S20K50": ("B72220S0500K101", 50, 10.0, 1.6, 21.5, 4.3, 25.5, 1.0), "S05K60": ("B72205S0600K101", 60, 5.0, 1.4, 7.0, 3.3, 8.5, 0.6), "S07K60": ("B72207S0600K101", 60, 5.0, 1.4, 9.0, 3.3, 11.0, 0.6), "S10K60": ("B72210S0600K101", 60, 7.5, 1.4, 12.0, 4.0, 14.5, 0.8), "S14K60": ("B72214S0600K101", 60, 7.5, 1.5, 15.5, 4.0, 18.5, 0.8), "S20K60": ("B72220S0600K101", 60, 10.0, 1.7, 21.5, 4.4, 25.5, 1.0), "S05K75": ("B72205S0750K101", 75, 5.0, 1.5, 7.0, 3.4, 8.5, 0.6), "S07K75": ("B72207S0750K101", 75, 5.0, 1.5, 9.0, 3.6, 11.0, 0.6), "S10K75": ("B72210S0750K101", 75, 7.5, 1.5, 12.0, 4.2, 14.5, 0.8), "S14K75": ("B72214S0750K101", 75, 7.5, 1.5, 15.5, 4.2, 18.5, 0.8), "S20K75": ("B72220S0750K101", 75, 10.0, 1.8, 21.5, 4.6, 25.5, 1.0), "S05K95": ("B72205S0950K101", 95, 5.0, 1.5, 7.0, 3.4, 8.5, 0.6), "S07K95": ("B72207S0950K101", 95, 5.0, 1.5, 9.0, 3.4, 11.0, 0.6), "S10K95": ("B72210S0950K101", 95, 7.5, 1.5, 12.0, 4.0, 14.5, 0.8), "S14K95": ("B72214S0950K101", 95, 7.5, 1.5, 15.5, 4.0, 18.5, 0.8), "S20K95": ("B72220S0950K101", 95, 10.0, 1.8, 21.5, 4.5, 25.5, 1.0), "S05K115": ("B72205S0111K101", 115, 5.0, 1.5, 7.0, 3.6, 8.5, 0.6), "S07K115": ("B72207S0111K101", 115, 5.0, 1.5, 9.0, 3.6, 11.0, 0.6), "S10K115": ("B72210S0111K101", 115, 7.5, 1.6, 12.0, 4.2, 14.5, 0.8), "S14K115": ("B72214S0111K101", 115, 7.5, 1.7, 15.5, 4.2, 18.5, 0.8), "S20K115": ("B72220S0111K101", 115, 10.0, 1.9, 21.5, 4.6, 25.5, 1.0), "S05K130": ("B72205S0131K101", 130, 5.0, 1.6, 7.0, 3.6, 8.5, 0.6), "S07K130": ("B72207S0131K101", 130, 5.0, 1.6, 9.0, 3.6, 11.0, 0.6), "S10K130": ("B72210S0131K101", 130, 7.5, 1.8, 12.0, 4.2, 14.5, 0.8), "S14K130": ("B72214S0131K101", 130, 7.5, 1.9, 15.5, 4.2, 18.5, 0.8), "S20K130": ("B72220S0131K101", 130, 10.0, 2.0, 21.5, 4.7, 25.5, 1.0), "S05K140": ("B72205S0141K101", 140, 5.0, 1.7, 7.0, 3.7, 8.5, 0.6), "S07K140": ("B72207S0141K101", 140, 5.0, 1.7, 9.0, 3.7, 11.0, 0.6), "S10K140": ("B72210S0141K101", 140, 7.5, 1.9, 12.0, 4.3, 14.5, 0.8), "S14K140": ("B72214S0141K101", 140, 7.5, 2.0, 15.5, 4.3, 18.5, 0.8), "S20K140": ("B72220S0141K101", 140, 10.0, 2.1, 21.5, 4.8, 25.5, 1.0), "S05K150": ("B72205S0151K101", 150, 5.0, 1.8, 7.0, 3.8, 8.5, 0.6), "S07K150": ("B72207S0151K101", 150, 5.0, 1.8, 9.0, 3.8, 11.0, 0.6), "S10K150": ("B72210S0151K101", 150, 7.5, 2.0, 12.0, 4.4, 14.5, 0.8), "S14K150": ("B72214S0151K101", 150, 7.5, 2.1, 15.5, 4.4, 18.5, 0.8), "S20K150": ("B72220S0151K101", 150, 10.0, 2.2, 21.5, 4.9, 25.5, 1.0), "S05K175": ("B72205S0171K101", 175, 5.0, 2.0, 7.0, 3.9, 8.5, 0.6), "S07K175": ("B72207S0171K101", 175, 5.0, 2.0, 9.0, 4.0, 11.0, 0.6), "S10K175": ("B72210S0171K101", 175, 7.5, 2.2, 12.0, 4.6, 14.5, 0.8), "S14K175": ("B72214S0171K101", 175, 7.5, 2.2, 15.5, 4.6, 18.5, 0.8), "S20K175": ("B72220S0171K101", 175, 10.0, 2.3, 21.5, 5.0, 25.5, 1.0), "S05K230": ("B72205S0231K101", 230, 5.0, 1.5, 7.0, 4.0, 8.5, 0.6), "S07K230": ("B72207S0231K101", 230, 5.0, 1.5, 9.0, 4.0, 11.0, 0.6), "S10K230": ("B72210S0231K101", 230, 7.5, 1.7, 12.0, 4.7, 14.5, 0.8), "S14K230": ("B72214S0231K101", 230, 7.5, 1.7, 15.5, 4.7, 18.5, 0.8), "S20K230": ("B72220S0231K101", 230, 10.0, 1.8, 21.5, 5.1, 25.5, 1.0), "S05K250": ("B72205S0251K101", 250, 5.0, 1.5, 7.0, 4.2, 8.5, 0.6), "S07K250": ("B72207S0251K101", 250, 5.0, 1.5, 9.0, 4.2, 11.0, 0.6), "S10K250": ("B72210S0251K101", 250, 7.5, 1.7, 12.0, 4.8, 14.5, 0.8), "S14K250": ("B72214S0251K101", 250, 7.5, 1.7, 15.5, 4.8, 18.5, 0.8), "S20K250": ("B72220S0251K101", 250, 10.0, 1.9, 21.5, 5.3, 25.5, 1.0), "S05K275": ("B72205S0271K101", 275, 5.0, 1.6, 7.0, 4.3, 8.5, 0.6), "S07K275": ("B72207S0271K101", 275, 5.0, 1.6, 9.0, 4.4, 11.0, 0.6), "S10K275": ("B72210S0271K101", 275, 7.5, 1.8, 12.0, 5.0, 14.5, 0.8), "S14K275": ("B72214S0271K101", 275, 7.5, 1.8, 15.5, 5.0, 18.5, 0.8), "S20K275": ("B72220S0271K101", 275, 10.0, 2.0, 21.5, 5.4, 25.5, 1.0), "S05K300": ("B72205S0301K101", 300, 5.0, 1.7, 7.0, 4.5, 8.5, 0.6), "S07K300": ("B72207S0301K101", 300, 5.0, 1.7, 9.0, 4.5, 11.0, 0.6), "S10K300": ("B72210S0301K101", 300, 7.5, 1.9, 12.0, 5.1, 14.5, 0.8), "S14K300": ("B72214S0301K101", 300, 7.5, 1.9, 15.5, 5.2, 18.5, 0.8), "S20K300": ("B72220S0301K101", 300, 10.0, 2.1, 21.5, 5.6, 25.5, 1.0), "S05K320": ("B72205S0321K101", 320, 5.0, 1.9, 7.0, 4.8, 9.0, 0.6), "S07K320": ("B72207S0321K101", 320, 5.0, 1.9, 9.0, 4.8, 11.5, 0.6), "S10K320": ("B72210S0321K101", 320, 7.5, 2.1, 12.0, 5.4, 15.0, 0.8), "S14K320": ("B72214S0321K101", 320, 7.5, 2.1, 15.5, 5.4, 19.0, 0.8), "S20K320": ("B72220S0321K101", 320, 10.0, 2.3, 21.5, 5.8, 25.5, 1.0), "S05K350": ("B72205S0351K101", 350, 5.0, 2.0, 7.0, 4.9, 9.0, 0.6), "S07K350": ("B72207S0351K101", 350, 5.0, 2.0, 9.0, 4.9, 11.5, 0.6), "S10K350": ("B72210S0351K101", 350, 7.5, 2.2, 12.0, 5.6, 15.0, 0.8), "S14K350": ("B72214S0351K101", 350, 7.5, 2.2, 15.5, 5.6, 19.0, 0.8), "S20K350": ("B72220S0351K101", 350, 10.0, 2.4, 21.5, 6.0, 25.5, 1.0), "S05K385": ("B72205S0381K101", 385, 5.0, 2.1, 7.0, 5.1, 9.0, 0.6), "S07K385": ("B72207S0381K101", 385, 5.0, 2.1, 9.0, 5.2, 11.5, 0.6), "S10K385": ("B72210S0381K101", 385, 7.5, 2.4, 12.0, 5.8, 15.0, 0.8), "S14K385": ("B72214S0381K101", 385, 7.5, 2.4, 15.5, 5.9, 19.0, 0.8), "S20K385": ("B72220S0381K101", 385, 10.0, 2.5, 21.5, 6.3, 26.0, 1.0), "S05K420": ("B72205S0421K101", 420, 5.0, 2.4, 7.0, 5.4, 9.0, 0.6), "S07K420": ("B72207S0421K101", 420, 5.0, 2.4, 9.0, 5.4, 11.5, 0.6), "S10K420": ("B72210S0421K101", 420, 7.5, 2.6, 12.0, 6.1, 15.0, 0.8), "S14K420": ("B72214S0421K101", 420, 7.5, 2.6, 15.5, 6.1, 19.0, 0.8), "S20K420": ("B72220S0421K101", 420, 10.0, 2.7, 21.5, 6.5, 26.0, 1.0), "S05K440": ("B72205S0441K101", 440, 5.0, 2.4, 7.0, 5.5, 9.0, 0.6), "S07K440": ("B72207S0441K101", 440, 5.0, 2.4, 9.0, 5.5, 11.5, 0.6), "S10K440": ("B72210S0441K101", 440, 7.5, 2.7, 12.0, 6.2, 15.0, 0.8), "S14K440": ("B72214S0441K101", 440, 7.5, 2.7, 15.5, 6.3, 19.0, 0.8), "S20K440": ("B72220S0441K101", 440, 10.0, 2.8, 21.5, 6.7, 26.0, 1.0), "S05K460": ("B72205S0461K101", 460, 5.0, 2.6, 7.0, 5.7, 9.0, 0.6), "S07K460": ("B72207S0461K101", 460, 5.0, 2.6, 9.0, 5.7, 11.5, 0.6), "S10K460": ("B72210S0461K101", 460, 7.5, 2.8, 12.0, 6.3, 15.0, 0.8), "S14K460": ("B72214S0461K101", 460, 7.5, 2.8, 15.5, 6.4, 19.0, 0.8), "S20K460": ("B72220S0461K101", 460, 10.0, 3.0, 21.5, 6.8, 26.0, 1.0), "S10K510": ("B72210S0511K101", 510, 7.5, 3.1, 12.0, 6.7, 15.0, 0.8), "S14K510": ("B72214S0511K101", 510, 7.5, 3.1, 15.5, 6.8, 19.0, 0.8), "S20K510": ("B72220S0511K101", 510, 10.0, 3.2, 21.5, 7.1, 26.0, 1.0), "S10K550": ("B72210S0551K101", 550, 7.5, 3.4, 12.0, 7.1, 15.0, 0.8), "S14K550": ("B72214S0551K101", 550, 7.5, 3.4, 15.5, 7.2, 19.0, 0.8), "S20K550": ("B72220S0551K101", 550, 10.0, 3.6, 21.5, 7.5, 26.0, 1.0), "S10K625": ("B72210S0621K101", 625, 7.5, 3.7, 12.0, 7.5, 15.0, 0.8), "S14K625": ("B72214S0621K101", 625, 7.5, 3.7, 15.5, 7.5, 19.0, 0.8), "S20K625": ("B72220S0621K101", 625, 10.0, 3.9, 21.5, 7.9, 26.0, 1.0), "S10K680": ("B72210S0681K101", 680, 7.5, 4.1, 12.0, 7.9, 15.0, 0.8), "S14K680": ("B72214S0681K101", 680, 7.5, 4.1, 15.5, 8.0, 19.0, 0.8), "S20K680": ("B72220S0681K101", 680, 10.0, 4.2, 21.5, 8.4, 26.0, 1.0), "S14K1000": ("B72214S0102K101", 1100, 7.5, 6.3, 15.5, 11.0, 20.5, 0.8), "S20K1000": ("B72220S0102K101", 1100, 10.0, 6.4, 21.5, 11.4, 28.5, 1.0), } # Proportions, for looks: the disc's rim is rounded with a radius of 0.4 x the thickness, at most 0.1 x the diameter; the disc's top is at h, so its underside sits # h - w above the board; each lead runs from its end up into the disc's underside. siov = f"{size}K{voltage}" if siov not in TYPES: raise ValueError(f"no type {siov!r}: {', '.join(TYPES)}") _code, vrms, e, a, w, th, h, d = TYPES[siov] R = w / 2 cx, cy = e / 2, -a / 2 cz = h - R rim = min(0.4 * th, 0.1 * w) import math model = Model() # The disc: revolve a half-section (radius along X, thickness along Y) about the disc's axis, which runs along Y through (cx, cz). model.plane("disc_plane", on="XY", offset=cz, name="Disc section") with model.sketch("disc_sketch", on="disc_plane", name="Disc") as sk: arc = [(rim * math.sin(math.pi / 2 * k / 6), rim * (1 - math.cos(math.pi / 2 * k / 6))) for k in range(7)] lower = [(cx + R - rim + u, cy - th / 2 + v) for u, v in arc] upper = [(cx + R - rim + u, cy + th / 2 - v) for u, v in reversed(arc)] sk.polyline("disc_outline", [(cx, cy - th / 2), *lower, *upper, (cx, cy + th / 2)], closed=True) model.revolve("disc", "disc_sketch", axis=((cx, cy, cz), (0, 1, 0)), op="new", body="disc_body", name="Disc") bodies = ["disc_body"] if detail == "full": top = cz - math.sqrt(R * R - (e / 2) ** 2) # where the disc's underside is over each lead model.plane("leads_start", on="XY", offset=-tail, name="Lead ends") for i, (x, y) in enumerate(((0.0, 0.0), (e, -a)), 1): with model.sketch(f"lead_{i}_section", on="leads_start", name=f"Lead {i}") as sk: sk.circle(f"lead_{i}_round", (x, y), d / 2) model.extrude(f"lead_{i}", f"lead_{i}_section", distance=tail + top, 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 disc is zinc oxide ceramic (density about 5.6) under a thin epoxy coat; titanium nitride, the # ceramic in the material list nearest in density (5.2), stands in for it, in SIOV's blue. The leads are tinned copper. model.material("titanium-nitride", bodies=["disc_body"], color="#2f5fa6") if detail == "full": model.material("copper", bodies=bodies[1:], color="#c9ccd1") result = model.result()