"""Thick film chip resistor array with convex terminals, Vishay CRA04S, CRA06E/S and CRA12E/S. Centred on the origin with the board on the XY plane and the length along X: the ceramic body, the protective coating on top, and the terminals along both long sides, each its own solid, wrapping over the side from the top to the bottom. Pin 1 is at the -X end of the -Y side. Dimensions from Vishay's data sheets; see the README.""" from steve import Model array = "CRA06S-8" # model and terminal count: CRA04S-4, CRA04S-8, CRA06S-4, CRA06S-8, CRA06E-8, CRA12E-8, CRA12E-10 or CRA12S-10 # array: (terminals, corners, L, A, A*, B, B*, P, T, W) in mm, the nominal values of the data sheets' DIMENSIONS tables. L length, W width, # T height, P terminal pitch, A terminal width, A* corner terminal width (square corners, S version; None for the scalloped E version, # whose end terminals are A wide on the pitch like the others), B terminal length on top, B* on the bottom. # CRA04S: Vishay "CRA04S Thick Film Resistor Array", document number 31043, revision 13-Oct-08, page 249, DIMENSIONS (A* is A1; the # 4-terminal part has no A, only corner terminals). # CRA06E/S: Vishay Dale "CRA06E and S Thick Film, Resistor Array", document number 31002, revision 16-Aug-05, page 7, DIMENSIONS. # CRA12E/S: Vishay "CRA12E, CRA12S Thick Film Resistor Array", document number 31003, revision 10-Dec-10, page 250, DIMENSIONS. ARRAYS = { "CRA04S-4": (4, "square", 1.0, None, 0.33, 0.15, 0.25, 0.65, 0.35, 1.0), "CRA04S-8": (8, "square", 2.0, 0.30, 0.4, 0.15, 0.25, 0.50, 0.45, 1.0), "CRA06S-4": (4, "square", 1.6, 0.38, 0.61, 0.3, 0.3, 0.8, 0.5, 1.5), "CRA06S-8": (8, "square", 3.2, 0.38, 0.61, 0.3, 0.3, 0.8, 0.5, 1.5), "CRA06E-8": (8, "scalloped", 3.2, 0.38, None, 0.3, 0.3, 0.8, 0.5, 1.5), "CRA12E-8": (8, "scalloped", 5.08, 0.79, None, 0.51, 0.38, 1.27, 0.55, 3.05), "CRA12E-10": (10, "scalloped", 6.40, 0.79, None, 0.51, 0.38, 1.27, 0.55, 3.05), "CRA12S-10": (10, "square", 6.40, 0.79, 0.89, 0.51, 0.38, 1.27, 0.55, 3.05), } # Proportions, for looks (the drawings show these but don't dimension them): the terminals' metal is METAL thick, wrapped around a ceramic # body METAL smaller on each side, top and bottom; the coating on top is METAL thick too and stops MARGIN x W short of the ends and of the # terminals. So the terminals and the coating stand METAL proud of the ceramic. METAL = 0.03 MARGIN = 0.05 n, corners, L, A, A_END, B, B_LOW, P, T, W = ARRAYS[array] per_side = n // 2 model = Model() model.box("body", L, W - 2 * METAL, T - 2 * METAL, at=(0, 0, T / 2), op="new", body="body_body", name="Body") # Terminal positions along X: on the pitch, centred; with square corners the end terminals are A* wide and reach the body's ends. spans = [] for i in range(per_side): centre = (i - (per_side - 1) / 2) * P if corners == "square" and i in (0, per_side - 1): x0 = -L / 2 if i == 0 else L / 2 - A_END spans.append((x0, A_END)) else: spans.append((centre - A / 2, A)) terminals = [] for side_tag, side in (("a", -1), ("b", 1)): # The terminal's section (y, z) on a YZ plane: along the top B in from the side, down the side, and B* in along the bottom. edge = side * W / 2 inner_top, inner_low, wall = edge - side * B, edge - side * B_LOW, edge - side * METAL section = [(inner_top, T), (edge, T), (edge, 0.0), (inner_low, 0.0), (inner_low, METAL), (wall, METAL), (wall, T - METAL), (inner_top, T - METAL)] for i, (x0, width) in enumerate(spans): tag = f"t{side_tag}{i + 1}" model.plane(f"{tag}_plane", on="YZ", offset=x0, name="Terminals") with model.sketch(f"{tag}_sketch", on=f"{tag}_plane", name="Terminals") as sk: sk.polyline(f"{tag}_section", section, closed=True) model.extrude(tag, f"{tag}_sketch", distance=width, op="new", body=f"{tag}_body", name="Terminals") terminals.append(f"{tag}_body") model.box("coat", L - 2 * MARGIN * W, W - 2 * B - 2 * MARGIN * W, METAL, at=(0, 0, T - METAL / 2), op="new", body="coat_body", name="Coating") # Materials, for looks and a rough mass (the sheets: a thick film on "a high grade ceramic" body or substrate, "covered by a protective # coating", terminals of tin on a nickel barrier): the body alumina, the coating ptfe (an epoxy-like layer, nearest density in the list), # the terminals tin. model.material("alumina", bodies=["body_body"], color="#e9e7e1") model.material("ptfe", bodies=["coat_body"], color="#1d1d1f") model.material("tin", bodies=terminals, color="#c9ccd1") result = model.result()