"""10-element LED bar graph array in a 20-pin dual in-line package: Broadcom (Avago, Agilent) HDSP-4820, HDSP-4830, HDSP-4832, HDSP-4836, HDSP-4840, HDSP-4850 and HLCP-J100. The board is the XY plane; the package's length runs along X with pin 1 and segment a at the -X end, the face is up (+Z) and the pins go down through the board. Pins 1 to 10 are the -Y row, pins 11 to 20 come back along the +Y row. The housing, each of the ten segments and each pin are separate solids. Dimensions in the README.""" from steve import Model part_number = "HDSP-4830" # Part number # Package (Avago data sheet AV01-0277EN, June 26, 2006, page 1, "Package Dimensions"; the same drawing for every part number), mm: PACKAGE = { "length": 25.40, # "25.40 (1.000) MAX." "width": 10.16, # "10.16 (0.400) MAX." "body_height": 5.08, # "5.08 (0.200)", the housing's side "top": 6.10, # "6.10 ± 0.25", the face above the seating plane "pitch": 2.54, # "2.54 ± 0.25" between pins; "2.54 (0.100)" between segments "row_spacing": 7.62, # "7.62 ± 0.38" "pin_width": 0.61, # "0.61 (0.024)" "pin_thickness": 0.38, # "0.38 (0.015)" "pin_length": 4.06, # "4.06 (0.160) MIN." below the seating plane "segment_width": 1.52, # "1.52 (0.060)" "segment_length": 5.08, # "5.08 (0.200)" "positions": 10, } # Segment colours a to j (page 1 description, page 3 "Multicolor Array Segment Colors"). COLOURS = { "HDSP-4820": ["red", "red", "red", "red", "red", "red", "red", "red", "red", "red"], "HLCP-J100": ["AlGaAs red", "AlGaAs red", "AlGaAs red", "AlGaAs red", "AlGaAs red", "AlGaAs red", "AlGaAs red", "AlGaAs red", "AlGaAs red", "AlGaAs red"], "HDSP-4830": ["high efficiency red", "high efficiency red", "high efficiency red", "high efficiency red", "high efficiency red", "high efficiency red", "high efficiency red", "high efficiency red", "high efficiency red", "high efficiency red"], "HDSP-4840": ["yellow", "yellow", "yellow", "yellow", "yellow", "yellow", "yellow", "yellow", "yellow", "yellow"], "HDSP-4850": ["green", "green", "green", "green", "green", "green", "green", "green", "green", "green"], "HDSP-4832": ["high efficiency red", "high efficiency red", "high efficiency red", "yellow", "yellow", "yellow", "yellow", "green", "green", "green"], "HDSP-4836": ["high efficiency red", "high efficiency red", "yellow", "yellow", "green", "green", "yellow", "yellow", "high efficiency red", "high efficiency red"], } SHOWN = {"red": "#e03a30", "AlGaAs red": "#ff3030", "high efficiency red": "#f05040", "yellow": "#f2d040", "green": "#6fd060"} PROUD = 0.03 # segments stand this far proud of the face so the renderer draws their edges if part_number not in COLOURS: raise ValueError(f"no part number {part_number!r}: {', '.join(COLOURS)}") P = PACKAGE n = P["positions"] underside = P["top"] - P["body_height"] first = -(n - 1) * P["pitch"] / 2 model = Model() model.box("housing", P["length"], P["width"], P["body_height"], at=(0, 0, underside + P["body_height"] / 2), op="new", body="housing_body", name="Housing") by_colour = {} for i, colour in enumerate(COLOURS[part_number]): letter = "abcdefghij"[i] model.box(f"segment_{letter}", P["segment_width"], P["segment_length"], PROUD, at=(first + i * P["pitch"], 0, P["top"] + PROUD / 2), op="new", body=f"segment_{letter}_body", name=f"Segment {letter}") by_colour.setdefault(colour, []).append(f"segment_{letter}_body") pins = [] run = underside + P["pin_length"] for i in range(n): for number, x, y in ((i + 1, first + i * P["pitch"], -P["row_spacing"] / 2), (2 * n - i, first + i * P["pitch"], P["row_spacing"] / 2)): model.box(f"pin_{number}", P["pin_width"], P["pin_thickness"], run, at=(x, y, underside - run / 2), op="new", body=f"pin_{number}_body", name=f"Pin {number}") pins.append(f"pin_{number}_body") # Materials (the sheet names none and gives no weight; README): housing plastic shown as pc, the light bars as pmma tinted with # the emitting colour, the pins as copper. model.material("pc", bodies=["housing_body"], color="#3a3c3f") for k, (colour, bodies) in enumerate(by_colour.items()): model.material("pmma", bodies=bodies, color=SHOWN[colour]) model.material("copper", bodies=pins, color="#c9ccd1") result = model.result()