| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899 |
- // Waveshare e-Paper FPC Adapter — parametric mockup
- //
- // Coordinate system:
- // Origin at PCB Z- face, lower-left corner (X=0, Y=0, Z=0).
- // X: board long axis (width)
- // Y: board short axis (height)
- // Z: 0 = bottom face (Z-); PCB_T = top face (Z+, component side)
- //
- // Two FPC connectors sit on the Z+ face:
- // Connector A (Y+): FPC exits in +Y direction
- // Connector B (Y-): FPC exits in -Y direction
- //
- // fpc_len_a / fpc_len_b control how much cable to show beyond each connector.
- // Set either to 0 to show an empty (no-cable) connector.
- // ── PCB ────────────────────────────────────────────────────────────────
- PCB_W = 32.0; // board width (X)
- PCB_H = 18.0; // board height (Y)
- PCB_T = 1.6; // board thickness (standard; measured ~1.72)
- PCB_R = 3.0; // corner radius ← replace with measured value
- // ── Mounting holes ─────────────────────────────────────────────────────
- HOLE_D = 3.0; // hole diameter
- HOLE_MX = 3.75; // hole center X from nearest X edge (2.25 clearance + 1.5 radius)
- HOLE_MY = 3.75; // hole center Y from nearest Y edge (2.25 clearance + 1.5 radius)
- // ── FPC connectors (simple box approximation) ──────────────────────────
- CON_W = 15.5; // connector width along X
- CON_D = 5.85; // connector depth along Y
- CON_H = 2.05; // connector height above Z+ face (total stack 3.65 - PCB_T)
- CON_T = 0.5; // connector wall / overhang ← replace
- // X centre of both connectors (assumed centred on board)
- CON_CX = PCB_W / 2;
- // Y edge positions of the connector body
- // Connector A sits at Y+ edge; connector B sits at Y- edge.
- CON_A_Y1 = PCB_H - CON_D; // inner face (toward board centre)
- CON_B_Y0 = 0; // outer face (at Y=0 edge)
- // ── FPC cable (simple flat box) ────────────────────────────────────────
- FPC_W = 12.5; // cable width along X
- FPC_T = 0.3; // cable thickness ← replace with measured value
- // FPC stub length at each connector. 0 = no cable shown; >0 = stub that many mm.
- FPC_YP = 20; // cable length beyond Y+ connector
- FPC_YN = 0; // cable length beyond Y- connector
- // ═══════════════════════════════════════════════════════════════════════
- // Modules
- // ═══════════════════════════════════════════════════════════════════════
- module _pcb_shape(h) {
- r = PCB_R;
- linear_extrude(h)
- offset(r=r)
- translate([r, r])
- square([PCB_W - 2*r, PCB_H - 2*r]);
- }
- module fpc_adapter(fpc_yp=FPC_YP, fpc_yn=FPC_YN) {
- // ── PCB body ──────────────────────────────────────────────────────
- color("#1a7abf", 0.85)
- difference() {
- _pcb_shape(PCB_T);
- // Mounting holes
- for (xi = [HOLE_MX, PCB_W - HOLE_MX])
- for (yi = [HOLE_MY, PCB_H - HOLE_MY])
- translate([xi, yi, -0.1])
- cylinder(d=HOLE_D, h=PCB_T + 0.2, $fn=24);
- }
- // ── Connector A (Y+ edge, FPC exits +Y) ──────────────────────────
- color("#d0d0d0")
- translate([CON_CX - CON_W/2, CON_A_Y1, PCB_T])
- cube([CON_W, CON_D, CON_H]);
- // FPC stub out of connector A
- if (fpc_yp > 0)
- color("#e8e8e8")
- translate([CON_CX - FPC_W/2, PCB_H, PCB_T + (CON_H - FPC_T)/2])
- cube([FPC_W, fpc_yp, FPC_T]);
- // ── Connector B (Y- edge, FPC exits -Y) ──────────────────────────
- color("#d0d0d0")
- translate([CON_CX - CON_W/2, CON_B_Y0, PCB_T])
- cube([CON_W, CON_D, CON_H]);
- // FPC stub out of connector B
- if (fpc_yn > 0)
- color("#e8e8e8")
- translate([CON_CX - FPC_W/2, -fpc_yn, PCB_T + (CON_H - FPC_T)/2])
- cube([FPC_W, fpc_yn, FPC_T]);
- }
- // Standalone render
- fpc_adapter(fpc_yp=FPC_YP, fpc_yn=FPC_YN);
|