"""PCB screw terminal block with the wire entry at 45 degrees to the board, PTR HARTMANN AK300 at 5.0 mm (sold by Altech as AK300). Pin 1 is at the origin, the row along +X, the housing on the XY plane with the wire entries on the -Y side, the solder pins down through the board, each its own solid. Dimensions from PTR's data sheet in the README.""" from steve import Model positions = 2 # Positions (poles) detail = "full" # full: sloped wire-entry face, wire entries and solder pins; simple: the housing's outline # PTR data sheet "Lift | Spacing 5.0 mm, AK300/..-5.0-GREY" (PDF dated 2013-02-28), drawing: width P x 5 + 0.6 (order table: 10.60 for 2 poles to # 60.60 for 12), height 12.5, depth 12.5, pins 4.5 below the housing, 1 across the row x 0.8, the first pin 2.7 from the end, the row 6.5 from # the face on the wire side, pitch 5. Insulating material PA 6.6, solder tag copper alloy. # Altech's catalogue (Fixed Printed Circuit, Metric Pin Spacing, p. 138) lists AK300/2 to AK300/24. PITCH = 5.0 WIDTH_EXTRA = 0.6 HEIGHT = 12.5 DEPTH = 12.5 PIN_LENGTH = 4.5 PIN_ALONG = 1.0 PIN_ACROSS = 0.8 PIN_FROM_END = 2.7 PIN_FROM_WIRE_SIDE = 6.5 if not 2 <= positions <= 24: raise ValueError("AK300 comes with 2 to 24 positions.") width = positions * PITCH + WIDTH_EXTRA x0 = -PIN_FROM_END front = -PIN_FROM_WIRE_SIDE back = front + DEPTH # Proportions, for looks: the 45 degree wire-entry face starts 0.4 of the height up the wire side and meets the top 0.6 of the height in. if detail == "full": profile = [(front, 0), (back, 0), (back, HEIGHT), (front + 0.6 * HEIGHT, HEIGHT), (front, 0.4 * HEIGHT)] else: profile = [(front, 0), (back, 0), (back, HEIGHT), (front, HEIGHT)] model = Model() model.plane("side_plane", on="YZ", offset=x0, name="Side") with model.sketch("body_sketch", on="side_plane", name="Housing") as sk: sk.polyline("body_outline", profile, closed=True) model.extrude("body", "body_sketch", distance=width, op="new", body="housing_body", name="Housing") pins = [] if detail == "full": entry = 0.6 * PITCH # the wire entries' size, height and depth are proportions, for looks model.plane("front_plane", on="XZ", offset=-front, name="Wire entries") with model.sketch("entries_sketch", on="front_plane", name="Wire entries") as sk: for i in range(positions): sk.rect(f"entry_{i}", (i * PITCH - entry / 2, 0.5 * HEIGHT), (i * PITCH + entry / 2, 0.5 * HEIGHT + entry)) model.extrude("entries", "entries_sketch", distance=-0.5 * DEPTH, op="cut", name="Wire entries") # Each solder pin is its own solid, from its end below the board up to the housing's bottom face. model.plane("pin_plane", on="XY", offset=-PIN_LENGTH, name="Solder pins") for i in range(positions): with model.sketch(f"pin_{i + 1}_sketch", on="pin_plane", name=f"Pin {i + 1}") as sk: sk.rect(f"pin_{i + 1}_rect", (i * PITCH - PIN_ALONG / 2, -PIN_ACROSS / 2), (i * PITCH + PIN_ALONG / 2, PIN_ACROSS / 2)) model.extrude(f"pin_{i + 1}", f"pin_{i + 1}_sketch", distance=PIN_LENGTH, op="new", body=f"pin_{i + 1}_body", name=f"Pin {i + 1}") pins.append(f"pin_{i + 1}_body") # Housing: PA 6.6 (pa6 is the nearest in the materials list), grey. Solder tags: copper alloy. model.material("pa6", bodies=["housing_body"], color="#4a5055") if pins: model.material("copper", bodies=pins, color="#c9ccd1") result = model.result()