Просмотр исходного кода

lid: add FPC adapter board mount and preview

Adds adapter bosses (half-stud, half-screw diagonal) hanging from
ceiling underside, and a preview of the fpc_adapter board positioned
near the FPC slot. ADAPT_SLOT_GAP controls the gap between the adapter
Y+ edge and the slot for tuning.
ZiB 4 месяцев назад
Родитель
Сommit
f00595f32c
1 измененных файлов с 54 добавлено и 2 удалено
  1. 54 2
      lid.scad

+ 54 - 2
lid.scad

@@ -3,9 +3,46 @@
 include <params.scad>
 use <epd_case.scad>
 use <GDEY0583T81.scad>
+use <fpc_adapter.scad>
 
 /* [Preview] */
-SHOW_DISP = true;
+SHOW_DISP     = true;
+SHOW_ADAPTER  = true;
+
+/* [FPC Adapter Mount] */
+ADAPT_SLOT_GAP = 2.0;  // gap: adapter Y+ edge to slot Y- edge ← tune
+
+// Adapter board constants (mirror fpc_adapter.scad defaults)
+_adpt_w       = 32.0;
+_adpt_h       = 18.0;
+_adpt_hole_mx = 3.75;
+_adpt_hole_my = 3.75;
+
+// Derived adapter position in lid XY space
+_slot_y    = LID_Y_LEN - 3 - FPC_U_DEPTH + FPC_U_T;  // slot Y- edge
+_adapt_ox  = PCB_OX + FPC_CX - _adpt_w / 2;           // adapter PCB X- edge
+_adapt_oy  = _slot_y - ADAPT_SLOT_GAP - _adpt_h;       // adapter PCB Y- edge
+
+// ============================================================
+//  FPC ADAPTER BOSS
+//  Boss hangs downward from ceiling (z=FLANGE_H); stud tip points down
+//  so PCB presses up against boss bottoms and stud snaps through PCB hole.
+// ============================================================
+module adapt_boss(px, py, stud=false) {
+  translate([_adapt_ox + px, _adapt_oy + py, FLANGE_H - BOSS_H]) {
+    difference() {
+      cylinder(d=BOSS_D, h=BOSS_H, $fn=24);
+      if (!stud)
+        translate([0, 0, -0.1])
+          cylinder(d=SCREW_D * 0.7, h=BOSS_H + 0.2, $fn=18);
+    }
+    if (stud)
+      translate([0, 0, -STUD_H]) {
+        cylinder(r=STUD_R, h=STUD_H, $fn=24);
+        sphere(r=STUD_R, $fn=24);
+      }
+  }
+}
 
 // ============================================================
 //  LID  (slide-on; enters from Y- face, closes toward Y+)
@@ -90,7 +127,7 @@ module lid() {
     }
   }
 
-  color("#004B49")
+  color("#004B49") {
   difference() {
     union() {
       if (!EPD_IS_LID)
@@ -122,6 +159,14 @@ module lid() {
       cube([FPC_NOTCH_W, FPC_SLOT_W, LID_T + 0.2]);
   }
 
+  // Adapter bosses — stud diagonal: (X1,Y1) and (X2,Y2); screw diagonal: (X1,Y2) and (X2,Y1)
+  adapt_boss(_adpt_hole_mx,            _adpt_hole_my,            stud=true);
+  adapt_boss(_adpt_w - _adpt_hole_mx,  _adpt_h - _adpt_hole_my, stud=true);
+  adapt_boss(_adpt_hole_mx,            _adpt_h - _adpt_hole_my,  stud=false);
+  adapt_boss(_adpt_w - _adpt_hole_mx,  _adpt_hole_my,            stud=false);
+
+  } // end color("#004B49")
+
   // Display mockup — seated inside epd_case, preview only
   if ($preview && EPD_IS_LID && SHOW_DISP)
     translate([
@@ -130,6 +175,13 @@ module lid() {
       LID_T + WALL
     ])
       GDEY0583T81(fpc_bend_start=0, fpc_bend_r=FPC_BEND_R, fpc_post_clip=2);
+
+  // FPC adapter board — Z- face against boss bottoms; component side (Z+) faces down into cavity
+  // rotate([0,180,0]) flips Z without disturbing ±Y connector exits; +_adpt_w re-centres X.
+  if ($preview && SHOW_ADAPTER)
+    translate([_adapt_ox + _adpt_w, _adapt_oy, FLANGE_H - BOSS_H])
+      rotate([0, 180, 0])
+        fpc_adapter(fpc_yp=15, fpc_yn=0);
 }
 
 // ============================================================