"""Hirose FH12 0.5 mm pitch FPC/FFC connector, right angle, bottom contact, flip lock (FH12-**S-0.5SH(55)). Contacts in a row along X, centred on X; the housing's rear edge (the contact tail side) on Y = 0 with the tails toward +Y and the FPC entry and flip-lock actuator toward -Y; sitting on the XY plane (the housing underside). Dimensions from Hirose drawing EDC3-150229-11; see the README.""" from steve import Model contacts = 10 # number of contacts # contacts: (A contact span, B housing length, C FPC opening width, D length over the fitting nails, E width between the nails), mm. Hirose drawing # EDC3-150229-11, FH12-**S-0.5SH(55), sheet 5/5, dimension table (tolerances: A ±0.1, B ±0.2, C +0.1/0, D ±0.3, E ±0.2). SIZES = { 6: (2.5, 6.1, 3.57, 7.1, 4.9), 8: (3.5, 7.1, 4.57, 8.1, 5.9), 10: (4.5, 8.1, 5.57, 9.1, 6.9), 11: (5.0, 8.6, 6.07, 9.6, 7.4), 12: (5.5, 9.1, 6.57, 10.1, 7.9), 13: (6.0, 9.6, 7.07, 10.6, 8.4), 14: (6.5, 10.1, 7.57, 11.1, 8.9), 15: (7.0, 10.6, 8.07, 11.6, 9.4), 16: (7.5, 11.1, 8.57, 12.1, 9.9), 17: (8.0, 11.6, 9.07, 12.6, 10.4), 18: (8.5, 12.1, 9.57, 13.1, 10.9), 19: (9.0, 12.6, 10.07, 13.6, 11.4), 20: (9.5, 13.1, 10.57, 14.1, 11.9), 22: (10.5, 14.1, 11.57, 15.1, 12.9), 24: (11.5, 15.1, 12.57, 16.1, 13.9), 25: (12.0, 15.6, 13.07, 16.6, 14.4), 26: (12.5, 16.1, 13.57, 17.1, 14.9), 28: (13.5, 17.1, 14.57, 18.1, 15.9), 30: (14.5, 18.1, 15.57, 19.1, 16.9), 32: (15.5, 19.1, 16.57, 20.1, 17.9), 33: (16.0, 19.6, 17.07, 20.6, 18.4), 34: (16.5, 20.1, 17.57, 21.1, 18.9), 35: (17.0, 20.6, 18.07, 21.6, 19.4), 36: (17.5, 21.1, 18.57, 22.1, 19.9), 40: (19.5, 23.1, 20.57, 24.1, 21.9), 45: (22.0, 25.6, 23.07, 26.6, 24.4), 50: (24.5, 28.1, 25.57, 29.1, 26.9), 53: (26.0, 29.6, 27.07, 30.6, 28.4), } # Drawing EDC3-150229-11 sheets 1/5 and 2/5 (nominal values): pitch 0.5; contact width (0.2); tails 0.8 beyond the housing's rear edge; housing depth 4.6 # and 5.6 over the actuator; height 2 over the housing underside, actuator 1.85 high; fitting nails 1.2 wide, 2 from the rear edge; FPC t = 0.3 at (0.55) # above the underside, inserted (3.4) from the housing front (detail a). PITCH, TAIL_W, TAIL_OUT = 0.5, 0.2, 0.8 DEPTH, OVER_ACTUATOR, HEIGHT, ACTUATOR_H = 4.6, 5.6, 2.0, 1.85 NAIL_W, NAIL_FROM_REAR = 1.2, 2.0 FPC_T, FPC_Z, FPC_IN = 0.3, 0.55, 3.4 TAIL_T = 0.1 # contact tail thickness: a proportion, for looks NAIL_H = 0.8 # fitting nail height up the housing end: a proportion, for looks GAP = 0.1 # the line between the actuator and the housing on top, width and depth: a proportion, for looks A, B, C, D, E = SIZES[contacts] model = Model() with model.sketch("housing_sketch", on="XY", name="Housing") as sk: sk.rect("housing_rect", (-B / 2, -DEPTH), (B / 2, 0)) model.extrude("housing", "housing_sketch", distance=HEIGHT, name="Housing") model.plane("actuator_plane", on="XY", offset=HEIGHT - ACTUATOR_H, name="Actuator") with model.sketch("actuator_sketch", on="actuator_plane", name="Actuator") as sk: sk.rect("actuator_rect", (-B / 2, -OVER_ACTUATOR), (B / 2, -DEPTH + 0.01)) model.extrude("actuator", "actuator_sketch", distance=ACTUATOR_H, name="Actuator") model.plane("fpc_plane", on="XY", offset=FPC_Z, name="FPC opening") with model.sketch("fpc_sketch", on="fpc_plane", name="FPC opening") as sk: sk.rect("fpc_rect", (-C / 2, -OVER_ACTUATOR), (C / 2, -DEPTH + FPC_IN)) model.extrude("fpc_opening", "fpc_sketch", distance=FPC_T, op="cut", name="FPC opening") model.plane("top_plane", on="XY", offset=HEIGHT, name="Top") with model.sketch("gap_sketch", on="top_plane", name="Actuator line") as sk: sk.rect("gap_rect", (-B / 2, -DEPTH - GAP / 2), (B / 2, -DEPTH + GAP / 2)) model.extrude("gap", "gap_sketch", distance=-GAP, op="cut", name="Actuator line") with model.sketch("tails_sketch", on="XY", name="Contact tails") as sk: for i in range(contacts): x = -A / 2 + i * PITCH sk.rect(f"tail_{i}", (x - TAIL_W / 2, -0.05), (x + TAIL_W / 2, TAIL_OUT)) model.extrude("tails", "tails_sketch", distance=TAIL_T, name="Contact tails") with model.sketch("nails_sketch", on="XY", name="Fitting nails") as sk: sk.rect("nail_left", (-D / 2, -NAIL_FROM_REAR - NAIL_W), (-E / 2, -NAIL_FROM_REAR)) sk.rect("nail_right", (E / 2, -NAIL_FROM_REAR - NAIL_W), (D / 2, -NAIL_FROM_REAR)) model.extrude("nails", "nails_sketch", distance=NAIL_H, name="Fitting nails") model.material("pla", color="#d8c9a8") result = model.result()