"""Moulded tantalum chip capacitor, KYOCERA AVX TAJ case sizes, standard (A, B, C, D, E, U, V) and low profile (F, H, K, P, R, S, T, W, X, Y). Centred on the origin with the board on the XY plane and the length along X: the moulded body, the polarity band on top at the anode (-X) end, and a J-lead termination at each end that runs up the end face and under the body (each its own solid). Dimensions from AVX's TAJ data sheet; see the README.""" from steve import Model case = "A" # AVX case code # case: (EIA code, EIA metric code, profile, L, W, H, W1, A, S min.) in mm, the nominal values of AVX's tables. # AVX "TAJ Series, Standard and Low Profile Tantalum Capacitors", catalogue issue 070417, page 6, "STANDARD CASE DIMENSIONS" and "LOW # PROFILE CASE DIMENSIONS: millimeters (inches)". L is +/- 0.20, W +0.20 / -0.10, H +0.20 / -0.10 (standard; low profile: H max.), W1 # +/- 0.20 (P and R: 1.00 +/- 0.10), A +0.30 / -0.20. "W1 dimension applies to the termination width for A dimensional area only." CASES = { "A": ("1206", "3216-18", "standard", 3.20, 1.60, 1.60, 1.20, 0.80, 1.10), "B": ("1210", "3528-21", "standard", 3.50, 2.80, 1.90, 2.20, 0.80, 1.40), "C": ("2312", "6032-28", "standard", 6.00, 3.20, 2.60, 2.20, 1.30, 2.90), "D": ("2917", "7343-31", "standard", 7.30, 4.30, 2.90, 2.40, 1.30, 4.40), "E": ("2917", "7343-43", "standard", 7.30, 4.30, 4.10, 2.40, 1.30, 4.40), "U": ("2924", "7361-43", "standard", 7.30, 6.10, 4.10, 3.10, 1.30, 4.40), "V": ("2924", "7361-38", "standard", 7.30, 6.10, 3.55, 3.10, 1.30, 4.40), "F": ("2312", "6032-20", "low", 6.00, 3.20, 2.00, 2.20, 1.30, 2.90), "H": ("1210", "3528-15", "low", 3.50, 2.80, 1.50, 2.20, 0.80, 1.40), "K": ("1206", "3216-10", "low", 3.20, 1.60, 1.00, 1.20, 0.80, 1.10), "P": ("0805", "2012-15", "low", 2.05, 1.35, 1.50, 1.00, 0.50, 0.85), "R": ("0805", "2012-12", "low", 2.05, 1.30, 1.20, 1.00, 0.50, 0.85), "S": ("1206", "3216-12", "low", 3.20, 1.60, 1.20, 1.20, 0.80, 1.10), "T": ("1210", "3528-12", "low", 3.50, 2.80, 1.20, 2.20, 0.80, 1.40), "W": ("2312", "6032-15", "low", 6.00, 3.20, 1.50, 2.20, 1.30, 2.90), "X": ("2917", "7343-15", "low", 7.30, 4.30, 1.50, 2.40, 1.30, 4.40), "Y": ("2917", "7343-20", "low", 7.30, 4.30, 2.00, 2.40, 1.30, 4.40), } # The middle of each tolerance band: W and A are 0.05 over nominal (+0.20 / -0.10, +0.30 / -0.20), and so is a standard case's H; a low # profile case's H is its maximum, the only value given. W_MID = 0.05 H_MID = 0.05 A_MID = 0.05 # Proportions, for looks (the drawing shows these but don't dimension them): the termination's metal is LEAD thick; it covers the end face # up to UP of the height, outside the moulding (which is 2 x LEAD shorter than L), and lies in a recess under it for A from the end. The # polarity band is BAND_W of the length wide and BAND_IN of it in from the anode end; it stands BAND_T proud of the moulding, whose top is # BAND_T under H. LEAD = 0.1 UP = 0.5 BAND_W = 0.15 BAND_IN = 0.05 BAND_T = 0.03 eia, metric, profile, L, W, H, W1, A, S_MIN = CASES[case] width, length_a = W + W_MID, A + A_MID height = H + H_MID if profile == "standard" else H model = Model() model.box("body", L - 2 * LEAD, width, height - BAND_T, at=(0, 0, (height - BAND_T) / 2), op="new", body="body_body", name="Body") leads = [] for tag, side in (("anode", -1), ("cathode", 1)): end = side * L / 2 inner, wall = end - side * length_a, end - side * LEAD # The termination's side section (x, z): up the end face to UP x height, and along the bottom A in from the end. section = [(end, 0.0), (end, UP * height), (wall, UP * height), (wall, LEAD), (inner, LEAD), (inner, 0.0)] # The XZ plane's normal is -Y: offset -W1 / 2 puts it on the termination's +Y side, and the extrusion runs across it to -Y. model.plane(f"{tag}_plane", on="XZ", offset=-W1 / 2, name="Terminations") with model.sketch(f"{tag}_sketch", on=f"{tag}_plane", name="Terminations") as sk: sk.polyline(f"{tag}_section", section, closed=True) model.extrude(f"{tag}_lead", f"{tag}_sketch", distance=W1, op="new", body=f"{tag}_body", name="Terminations") # The recess under the moulding for the termination's foot, so that no solids overlap. with model.sketch(f"{tag}_room_sketch", on=f"{tag}_plane", name="Room for the terminations") as sk: sk.rect(f"{tag}_room", (min(inner, wall), 0.0), (max(inner, wall), LEAD)) model.extrude(f"{tag}_room", f"{tag}_room_sketch", distance=W1, op="cut", body="body_body", name="Room for the terminations") leads.append(f"{tag}_body") band_x = -L / 2 + (BAND_IN + BAND_W / 2) * L model.box("band", BAND_W * L, width, BAND_T, at=(band_x, 0, height - BAND_T / 2), op="new", body="band_body", name="Polarity band") # Materials, for looks and a rough mass: the moulded case is epoxy compound, mostly silica filler (density about 1.9 to 2.0), ptfe (2.07) # the nearest in the material list, in AVX's orange; the terminations are a tin-plated ("Sn Plating (standard)") lead frame, copper; the # band is marking ink, shown in ptfe. model.material("ptfe", bodies=["body_body"], color="#e8a33a") model.material("ptfe", bodies=["band_body"], color="#8a4a22") model.material("copper", bodies=leads, color="#c9ccd1") result = model.result()