]> git.armaanb.net Git - atreides.git/blobdiff - atreus.rkt
Merge pull request #30 from bergie/vcarve
[atreides.git] / atreus.rkt
index c3ecc4696c8fba7b3fa933beee11c611a60dd832..43c0ae3c156d685461659aba0150059ac2565802 100644 (file)
     (fp_line (start -6.35 6.35) (end -6.35 -6.35)
              (layer F.SilkS) (width 0.381))
     (pad 0 np_thru_hole circle (at 0 0) (size 3.9878 3.9878)
-         (drill 3.9878) (layers *.Cu)) ; switch hole, no copper
-    (pad 0 thru_hole circle (at -5.08 0) (size 1.7018 1.7018)
-         (drill 1.7018) (layers *.Cu)) ; board-mount hole, no copper
-    (pad 0 thru_hole circle (at 5.08 0) (size 1.7018 1.7018)
-         (drill 1.7018) (layers *.Cu)) ; board-mount hole, no copper
+         (drill 3.9878)) ; switch hole, no copper
+    (pad 0 np_thru_hole circle (at -5.08 0) (size 1.7018 1.7018)
+         (drill 1.7018)) ; board-mount hole, no copper
+    (pad 0 np_thru_hole circle (at 5.08 0) (size 1.7018 1.7018)
+         (drill 1.7018)) ; board-mount hole, no copper
     (pad 1 thru_hole circle (at 2.54 -5.08) (size 2.286 2.286) (drill 1.4986)
          (layers *.Cu *.SilkS *.Mask) ,net-pos)
     (pad 1 thru_hole circle (at 3.81 -2.54) (size 2.286 2.286) (drill 1.4986)
              (layer F.SilkS) (width 0.2032))
     (fp_line (start 1.524 -1.143) (end 1.524 1.143)
              (layer F.SilkS) (width 0.2032))
+    (fp_line (start 0 -1.143) (end 0 1.143)
+             (layer F.SilkS) (width 0.2032))
+    (fp_line (start 0 -1.143) (end -1.524 0)
+             (layer F.SilkS) (width 0.2032))
+    (fp_line (start -1.524 0) (end 0 1.143)
+             (layer F.SilkS) (width 0.2032))
     (fp_line (start 1.524 1.143) (end -1.524 1.143)
              (layer F.SilkS) (width 0.2032))
     (fp_line (start -1.524 1.143) (end -1.524 -1.143)
@@ -79,7 +85,6 @@
     (path /543EEB02)
     (fp_text value A-STAR (at -3 0 270) (layer F.SilkS)
              (effects (font (size 3.048 2.54) (thickness 0.4572))))
-    (fp_line (start -15.24 -7.62) (end -15.24 7.62) (layer F.SilkS) (width 0.381))
     (fp_line (start -15.24 7.62) (end 10.1 7.62) (layer F.SilkS) (width 0.381))
     (fp_line (start 10.1 7.62) (end 10.1 -7.62) (layer F.SilkS) (width 0.381))
     (fp_line (start 10.1 -7.62) (end -15.24 -7.62) (layer F.SilkS) (width 0.381))
     (pad B7 thru_hole circle (at -6.35 -6.35 270) (size 1.7526 1.7526)
          (drill 1.0922) (layers *.Cu *.SilkS *.Mask) (net 15 N-col-10))
     (pad D6 thru_hole circle (at -3.81 -6.35 270) (size 1.7526 1.7526)
-         (drill 1.0922) (layers *.Cu *.SilkS *.Mask) (net 14 N-col-9))))
+         (drill 1.0922) (layers *.Cu *.SilkS *.Mask) (net 14 N-col-9))
+    (pad RST thru_hole circle (at -1.27 -6.35 270) (size 1.7526 1.7526)
+       (drill 1.0922) (layers *.Cu *.SilkS *.Mask) (net 0 ""))
+    (pad GND thru_hole circle (at 6.35 -6.35 270) (size 1.7526 1.7526)
+         (drill 1.0922) (layers *.Cu *.SilkS *.Mask) (net 0 ""))))
 
 (define nets
   `((net 0 "")
          [diode-net `(net ,(+ 16 diode)
                       ,(string->symbol (format "N-diode-~s" diode)))]
          [column-net `(net ,(+ net-col 5)
-                       ,(string->symbol (format "N-col-~s" net-col)))])
+                       ,(string->symbol (format "N-col-~s" net-col)))]
+         ;; rotate middle keys additional 90° after calculating position
+         [rotation (cond [(= 5 col) 80]
+                         [(= 6 col) 280]
+                         [true rotation])])
     (switch-module x′ y′ rotation label
                    (if left? diode-net column-net)
                    (if left? column-net diode-net))))
     (list (switch row col) (diode row col))))
 
 (define edge-cuts
-  (for/list [(s '([31 22] [84 22] [128 30] [128 54] [140 54] [140 30] [185 22]
+  (for/list [(s '([31 22] [84 22] [127 30] [127 54] [130 54] [130 60] [138 60]
+                  [138 54] [141 54] [141 30] [185 22]
                   [237 22] [250 95] [161 112] [107 112] [18 95]))
-             (e '([84 22] [128 30] [128 54] [140 54] [140 30] [185 22]
+             (e '([84 22] [127 30] [127 54] [130 54] [130 60] [138 60] [138 54]
+                  [141 54] [141 30] [185 22]
                   [237 22] [250 95] [161 112] [107 112] [18 95] [31 22]))]
     `(gr_line (start ,@s) (end ,@e) (angle 90) (layer Edge.Cuts) (width 0.3))))
 
       (for ([f board])
         (pretty-print f op 1))
       (display (call-with-input-file "traces.rktd"
-                 (curry read-string 99999)) op)
+                 (curry read-string 999999)) op)
       (display ")" op))))
 
-(write-placement "/tmp/atreus.kicad_pcb")
+(write-placement "atreus.kicad_pcb")