From f482acaf6b1dd8ef3a0367ae290dc004eba163df Mon Sep 17 00:00:00 2001
From: Jochen Vothknecht <jochen3120@gmail.com>
Date: Thu, 24 Feb 2022 08:37:49 +0100
Subject: [PATCH] =?UTF-8?q?Adding=20PCB=20mockup=E2=80=A6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 pcb/10W/TransportProtection.scad | 29 +++++++++++++++++++++++++++--
 1 file changed, 27 insertions(+), 2 deletions(-)

diff --git a/pcb/10W/TransportProtection.scad b/pcb/10W/TransportProtection.scad
index d169651..3de154f 100644
--- a/pcb/10W/TransportProtection.scad
+++ b/pcb/10W/TransportProtection.scad
@@ -1,5 +1,6 @@
 
-use <../WebWeaver/scad/Util.scad>;
+use <../../WebWeaver/scad/Util.scad>;
+
 
 
 $fs = 0.5;
@@ -12,6 +13,7 @@ pcb_h      = 67.5;
 pcb_r      =    5;  // edge radius
 pcb_off    =  0.4;
 pcb_t      =    5;  // thickness including LED and inductor
+pcb_sc_off =    5;  // offset of screw holes from edge
 pcb_conn_w =   20;
 pcb_conn_h =    3;
 
@@ -32,11 +34,13 @@ module pcb(w=pcb_w, h=pcb_h, r=pcb_r, off=pcb_off) {
   }
 }
 
+
 module pcbBox(wi, hi, ri, _str) {
 
   linear_extrude(hi) pcb();
 }
 
+
 module body(wi, hi, ri, _str) {
   difference() {
     pcbBox(wi, hi, ri, _str);
@@ -44,4 +48,25 @@ module body(wi, hi, ri, _str) {
   }
 }
 
-body(pcb_w, pcb_h, pcb_r, pcb_off);
+
+module PCBMockUp(w=pcb_w, h=pcb_h, r=pcb_r, off_xy=pcb_sc_off) {
+  
+  w2 = w / 2;
+  h2 = h / 2;
+  
+  color([0.1, 0.1, 0.1], 1.0) difference() {
+    roundRect(w, h, r, true, true);
+    
+    for (tx=[-w2 + off_xy, w2 - off_xy], ty=[-h2 + off_xy, h2 - off_xy]) translate([tx, ty, 0]) circle(d=3.2);
+  }
+}
+
+
+
+// body(pcb_w, pcb_h, pcb_r, pcb_off);
+
+PCBMockUp();
+
+
+
+
-- 
GitLab