From e227dbac0c73450683ed731c3cea7d4f03040ef2 Mon Sep 17 00:00:00 2001
From: Erik Strand <erik.strand@cba.mit.edu>
Date: Thu, 9 May 2019 18:48:40 -0400
Subject: [PATCH] Start drawing cable pads... but actually negatives oops

---
 node_board/main.cpp | 27 +++++++++++++++++++++++----
 1 file changed, 23 insertions(+), 4 deletions(-)

diff --git a/node_board/main.cpp b/node_board/main.cpp
index 35f5433..3db1107 100644
--- a/node_board/main.cpp
+++ b/node_board/main.cpp
@@ -4,6 +4,12 @@
 //--------------------------------------------------------------------------------------------------
 // All length measurements are in mm.
 int main() {
+    // reused vars... dirty C style
+    double pad_x_min;
+    double pad_x_max;
+    double pad_y_min;
+    double pad_y_max;
+
     double ppmm = 50;
     auto const to_px = [ppmm](double x) {
         return static_cast<uint32_t>(ppmm * x);
@@ -34,11 +40,11 @@ int main() {
     double const soic_pos_x = 0.5 * (width - 3 * soic_pitch - pad_width);
     double const soic_pos_y = 0.5 * (height - soic_height);
     for (uint32_t i = 0; i < 4; ++i) {
-        double const pad_x_min = soic_pos_x + i * soic_pitch;
-        double const pad_x_max = pad_x_min + pad_width;
+        pad_x_min = soic_pos_x + i * soic_pitch;
+        pad_x_max = pad_x_min + pad_width;
 
-        double pad_y_min = soic_pos_y;
-        double pad_y_max = pad_y_min + pad_height;
+        pad_y_min = soic_pos_y;
+        pad_y_max = pad_y_min + pad_height;
         for (uint32_t x = to_px(pad_x_min); x < to_px(pad_x_max); ++x) {
             for (uint32_t y = to_px(pad_y_min); y < to_px(pad_y_max); ++y) {
                 set_pixel(x, y);
@@ -54,6 +60,19 @@ int main() {
         }
     }
 
+    // Cable attachment dims
+    double const min_cut_thickness = 0.4;
+    double const cable_pad_height = 2.4;
+    pad_x_min = (width - 2 * min_cut_thickness) / 3;
+    pad_x_max = pad_x_min + min_cut_thickness;
+    pad_y_min = 0;
+    pad_y_max = pad_y_min + cable_pad_height;
+    for (uint32_t x = to_px(pad_x_min); x < to_px(pad_x_max); ++x) {
+        for (uint32_t y = to_px(pad_y_min); y < to_px(pad_y_max); ++y) {
+            set_pixel(x, y);
+        }
+    }
+
     png_writer.write("node_board_traces.png");
 
     return 0;
-- 
GitLab