"""Board-mounted DC/DC converter module, as its maker draws it: RECOM R-78 switching regulators (SIP3, SIP4) and TRACO POWER TSR 1, TMR 1 (SIP) and TEN 10 / TEN 20 (2" x 1" metal case). Pin 1 is at the origin, the case on the board (XY plane) above it, the pins down through the board. Dimensions from each maker's data sheet in the README.""" from steve import Model model_name = "R-78E-0.5" # Series (maker's name) detail = "full" # full: case and pins; simple: the case only # model: (case length along X, case depth along Y, top above the board, case bottom above the board, pin section ("rect", along X, along Y) or ("round", diameter), # pin length below the board, pins as (number, x from the case's -X face, y from its -Y face), case (or potting) material, colour, metal shell material), mm. # Materials from the sheets' physical specifications: RECOM and TRACO SIP cases are plastic (potted with silicone, R-78S epoxy), modelled as one plastic # block, ptfe; TEN 10 is a chrome-nickel plated steel case potted with epoxy (steel-generic shell, ptfe inside), TEN 20 a nickel-plated copper case # potted with silicone rubber (copper shell, silicone-rubber inside). # RECOM, https://recom-power.com/pdf/Innoline/.pdf, Dimension Drawing: R-78E-0.5 (REV.: 9/2025, p. 3), R-78B-2.0 (REV.: 5/2021, p. 5), # R-78HB-0.5 (REV.: 5/2019, p. 5), R-78S (REV.: 5/2018, p. 4): pin 1 3.21 (R-78S 2.00) from the case's end, 2.54 pitch, the row 2.00 (R-78B 1.2) from one # long face, case 0.51 above the board, pins 4.10 below it. # TRACO POWER, https://www.tracopower.com/products/.pdf, Outline Dimensions: tsr1 (Rev. April 15, 2026, p. 4): 11.7 x 7.5 x 10.1, 0.5 above the # board, pin 3 3.3 from the end, the row 5.5 from one face (2.0 from the other), pins 0.50 x 0.25, 4.1; tmr1 (Rev. April 15, 2026, p. 4): 17.0 x 7.62 x 11.0, # 0.5 above the board, pin 1 2.15 from the end, pins 1, 2, 4, 5, 6 at 0, 2.54, 7.62, 10.16, 12.7, the row 2.5 from one face, pins 0.5 x 0.25, 3.2; ten10 # (p. 3) and ten20 (Rev. September 16, 2025, p. 3): 50.8 x 25.4 x 10.2 on an insulated baseplate, pins 1.0 dia., 6.0, placed from the bottom view # (mirrored here into a top view: x = 50.8 - the drawing's x). MODELS = { "R-78E-0.5": (11.6, 8.5, 10.4, 0.51, ("rect", 0.50, 0.25), 4.10, ((1, 3.21, 6.5), (2, 5.75, 6.5), (3, 8.29, 6.5)), "ptfe", "#1d1f22", None), "R-78B-2.0": (11.5, 8.5, 17.5, 0.51, ("rect", 0.64, 0.64), 4.10, ((1, 3.21, 7.3), (2, 5.75, 7.3), (3, 8.29, 7.3)), "ptfe", "#1d1f22", None), "R-78HB-0.5": (11.5, 8.5, 17.5, 0.51, ("rect", 0.70, 0.25), 4.10, ((1, 3.21, 6.5), (2, 5.75, 6.5), (3, 8.29, 6.5)), "ptfe", "#1d1f22", None), "R-78S-0.1": (11.6, 8.5, 10.4, 0.51, ("rect", 0.70, 0.25), 4.10, ((1, 2.00, 6.5), (2, 4.54, 6.5), (3, 7.08, 6.5), (4, 9.62, 6.5)), "ptfe", "#1d1f22", None), "TSR 1": (11.7, 7.5, 10.1, 0.5, ("rect", 0.50, 0.25), 4.1, ((1, 3.32, 5.5), (2, 5.86, 5.5), (3, 8.4, 5.5)), "ptfe", "#1d1f22", None), "TMR 1 single": (17.0, 7.62, 11.0, 0.5, ("rect", 0.5, 0.25), 3.2, ((1, 2.15, 5.12), (2, 4.69, 5.12), (4, 9.77, 5.12), (6, 14.85, 5.12)), "ptfe", "#1d1f22", None), "TMR 1 dual": (17.0, 7.62, 11.0, 0.5, ("rect", 0.5, 0.25), 3.2, ((1, 2.15, 5.12), (2, 4.69, 5.12), (4, 9.77, 5.12), (5, 12.31, 5.12), (6, 14.85, 5.12)), "ptfe", "#1d1f22", None), "TEN 10 single": (50.8, 25.4, 10.2, 0.0, ("round", 1.0), 6.0, ((1, 35.6, 15.28), (2, 35.6, 10.2), (3, 15.28, 22.82), (5, 15.28, 2.5)), "ptfe", "#b9bcbf", "steel-generic"), "TEN 10 dual": (50.8, 25.4, 10.2, 0.0, ("round", 1.0), 6.0, ((1, 35.6, 15.28), (2, 35.6, 10.2), (3, 15.28, 22.82), (4, 15.28, 12.66), (5, 15.28, 2.5)), "ptfe", "#b9bcbf", "steel-generic"), "TEN 20 single": (50.8, 25.4, 10.2, 0.0, ("round", 1.0), 6.0, ((1, 35.52, 15.24), (2, 35.52, 10.16), (6, 35.52, 2.54), (3, 15.2, 22.86), (5, 15.2, 2.54)), "silicone-rubber", "#b9bcbf", "copper"), "TEN 20 dual": (50.8, 25.4, 10.2, 0.0, ("round", 1.0), 6.0, ((1, 35.52, 15.24), (2, 35.52, 10.16), (6, 35.52, 2.54), (3, 15.2, 22.86), (4, 15.2, 12.7), (5, 15.2, 2.54)), "silicone-rubber", "#b9bcbf", "copper"), } SHELL = 0.3 # the metal case's wall, a proportion (the sheets don't dimension it); its open bottom is the insulated baseplate, part of the potting here L, W, top, standoff, section, pin_length, pins, case_material, colour, shell_material = MODELS[model_name] x1, y1 = pins[0][1], pins[0][2] model = Model() model.plane("case_plane", on="XY", offset=standoff, name="Case bottom") if shell_material: # A metal shell (top and four sides) round the potting, which fills it down to the board. with model.sketch("case_sketch", on="case_plane", name="Potting") as sk: sk.rect("case_rect", (-x1 + SHELL, -y1 + SHELL), (L - x1 - SHELL, W - y1 - SHELL)) model.extrude("case", "case_sketch", distance=top - standoff - SHELL, op="new", body="case_body", name="Potting") model.box("shell", L, W, top - standoff, at=(L / 2 - x1, W / 2 - y1, standoff + (top - standoff) / 2), op="new", body="shell_body", name="Metal case") model.box("shell_room", L - 2 * SHELL, W - 2 * SHELL, top - standoff - SHELL, at=(L / 2 - x1, W / 2 - y1, standoff + (top - standoff - SHELL) / 2), op="cut", body="shell_body", name="Metal case inside") else: with model.sketch("case_sketch", on="case_plane", name="Case") as sk: sk.rect("case_rect", (-x1, -y1), (L - x1, W - y1)) model.extrude("case", "case_sketch", distance=top - standoff, op="new", body="case_body", name="Case") leads = [] if detail == "full": # Each pin is its own copper solid, from its end below the board up to the case's bottom face. run = pin_length + standoff for n, x, y in pins: cx, cy = x - x1, y - y1 if section[0] == "rect": model.box(f"pin_{n}", section[1], section[2], run, at=(cx, cy, standoff - run / 2), op="new", body=f"pin_{n}_body", name=f"Pin {n}") else: model.plane(f"pin_{n}_plane", on="XY", offset=-pin_length, name=f"Pin {n}") with model.sketch(f"pin_{n}_sketch", on=f"pin_{n}_plane", name=f"Pin {n}") as sk: sk.circle(f"pin_{n}_circle", (cx, cy), section[1] / 2) model.extrude(f"pin_{n}", f"pin_{n}_sketch", distance=run, op="new", body=f"pin_{n}_body", name=f"Pin {n}") leads.append(f"pin_{n}_body") # Materials as the sheets name them (above); the mass against the sheets' weights is in the README. Pins: tinned copper. model.material(case_material, bodies=["case_body"], color="#26282b" if shell_material else colour) if shell_material: model.material(shell_material, bodies=["shell_body"], color=colour) if leads: model.material("copper", bodies=leads, color="#c9ccd1") result = model.result()