diff --git a/examples/qr-quine.js b/examples/qr-quine.js
new file mode 100644
index 0000000..25aa934
--- /dev/null
+++ b/examples/qr-quine.js
@@ -0,0 +1,169 @@
+const SAMD21E = {"A0":{"shape":"M 0.0276,0.0079L -0.0276,0.0079L -0.0278,0.0079L -0.0281,0.0079L -0.0287,0.0078L -0.0289,0.0077L -0.0292,0.0077L -0.0295,0.0076L -0.0297,0.0076L -0.03,0.0075L -0.0303,0.0074L -0.0305,0.0073L -0.031,0.0071L -0.0317,0.0067L -0.032,0.0065L -0.0324,0.0062L -0.0326,0.006L -0.0328,0.0059L -0.0334,0.0053L -0.0336,0.0051L -0.0338,0.0048L -0.0339,0.0046L -0.0341,0.0044L -0.0342,0.0042L -0.0344,0.0039L -0.0345,0.0037L -0.0346,0.0035L -0.0348,0.0032L -0.0349,0.0029L -0.035,0.0024L -0.0352,0.0019L -0.0353,0.0016L -0.0354,0.0011L -0.0354,0.0005L -0.0354,-0.0005L -0.0354,-0.0011L -0.0353,-0.0016L -0.0352,-0.0019L -0.035,-0.0024L -0.0349,-0.0029L -0.0348,-0.0032L -0.0346,-0.0035L -0.0345,-0.0037L -0.0344,-0.0039L -0.0342,-0.0042L -0.0341,-0.0044L -0.0339,-0.0046L -0.0338,-0.0048L -0.0336,-0.0051L -0.0334,-0.0053L -0.0328,-0.0059L -0.0326,-0.006L -0.0324,-0.0062L -0.032,-0.0065L -0.0317,-0.0067L -0.031,-0.0071L -0.0305,-0.0073L -0.0303,-0.0074L -0.03,-0.0075L -0.0297,-0.0076L -0.0295,-0.0076L -0.0292,-0.0077L -0.0289,-0.0077L -0.0287,-0.0078L -0.0281,-0.0079L -0.0278,-0.0079L -0.0276,-0.0079L 0.0276,-0.0079L 0.0276,0.0079","pos":[-0.1774,0.1102],"layers":["F.Cu"],"index":1},"A01":{"shape":"M -0.0276,0.0079L 0.0276,0.0079L 0.0276,-0.0079L -0.0276,-0.0079L -0.0276,0.0079","pos":[-0.1774,0.0787],"layers":["F.Cu"],"index":2},"A02":{"shape":"M -0.0276,0.0079L 0.0276,0.0079L 0.0276,-0.0079L -0.0276,-0.0079L -0.0276,0.0079","pos":[-0.1774,0.0472],"layers":["F.Cu"],"index":3},"A03":{"shape":"M -0.0276,0.0079L 0.0276,0.0079L 0.0276,-0.0079L -0.0276,-0.0079L -0.0276,0.0079","pos":[-0.1774,0.0157],"layers":["F.Cu"],"index":4},"A04":{"shape":"M -0.0276,0.0079L 0.0276,0.0079L 0.0276,-0.0079L -0.0276,-0.0079L -0.0276,0.0079","pos":[-0.1774,-0.0157],"layers":["F.Cu"],"index":5},"A05":{"shape":"M -0.0276,0.0079L 0.0276,0.0079L 0.0276,-0.0079L -0.0276,-0.0079L -0.0276,0.0079","pos":[-0.1774,-0.0472],"layers":["F.Cu"],"index":6},"A06":{"shape":"M -0.0276,0.0079L 0.0276,0.0079L 0.0276,-0.0079L -0.0276,-0.0079L -0.0276,0.0079","pos":[-0.1774,-0.0787],"layers":["F.Cu"],"index":7},"A07":{"shape":"M -0.0276,0.0079L 0.0276,0.0079L 0.0276,-0.0079L -0.0276,-0.0079L -0.0276,0.0079","pos":[-0.1774,-0.1102],"layers":["F.Cu"],"index":8},"VAN":{"shape":"M -0.0079,0.0276L 0.0079,0.0276L 0.0079,-0.0276L -0.0079,-0.0276L -0.0079,0.0276","pos":[-0.1102,-0.1774],"layers":["F.Cu"],"index":9},"GND1":{"shape":"M -0.0079,0.0276L 0.0079,0.0276L 0.0079,-0.0276L -0.0079,-0.0276L -0.0079,0.0276","pos":[-0.0787,-0.1774],"layers":["F.Cu"],"index":10},"GND2":{"shape":"M -0.0079,0.0276L 0.0079,0.0276L 0.0079,-0.0276L -0.0079,-0.0276L -0.0079,0.0276","pos":[0.0157,0.1774],"layers":["F.Cu"],"index":28},"A08":{"shape":"M -0.0079,0.0276L 0.0079,0.0276L 0.0079,-0.0276L -0.0079,-0.0276L -0.0079,0.0276","pos":[-0.0472,-0.1774],"layers":["F.Cu"],"index":11},"A09":{"shape":"M -0.0079,0.0276L 0.0079,0.0276L 0.0079,-0.0276L -0.0079,-0.0276L -0.0079,0.0276","pos":[-0.0157,-0.1774],"layers":["F.Cu"],"index":12},"A10":{"shape":"M -0.0079,0.0276L 0.0079,0.0276L 0.0079,-0.0276L -0.0079,-0.0276L -0.0079,0.0276","pos":[0.0157,-0.1774],"layers":["F.Cu"],"index":13},"A11":{"shape":"M -0.0079,0.0276L 0.0079,0.0276L 0.0079,-0.0276L -0.0079,-0.0276L -0.0079,0.0276","pos":[0.0472,-0.1774],"layers":["F.Cu"],"index":14},"A14":{"shape":"M -0.0079,0.0276L 0.0079,0.0276L 0.0079,-0.0276L -0.0079,-0.0276L -0.0079,0.0276","pos":[0.0787,-0.1774],"layers":["F.Cu"],"index":15},"A15":{"shape":"M -0.0079,0.0276L 0.0079,0.0276L 0.0079,-0.0276L -0.0079,-0.0276L -0.0079,0.0276","pos":[0.1102,-0.1774],"layers":["F.Cu"],"index":16},"A16":{"shape":"M -0.0276,0.0079L 0.0276,0.0079L 0.0276,-0.0079L -0.0276,-0.0079L -0.0276,0.0079","pos":[0.1774,-0.1102],"layers":["F.Cu"],"index":17},"A17":{"shape":"M -0.0276,0.0079L 0.0276,0.0079L 0.0276,-0.0079L -0.0276,-0.0079L -0.0276,0.0079","pos":[0.1774,-0.0787],"layers":["F.Cu"],"index":18},"A18":{"shape":"M -0.0276,0.0079L 0.0276,0.0079L 0.0276,-0.0079L -0.0276,-0.0079L -0.0276,0.0079","pos":[0.1774,-0.0472],"layers":["F.Cu"],"index":19},"A19":{"shape":"M -0.0276,0.0079L 0.0276,0.0079L 0.0276,-0.0079L -0.0276,-0.0079L -0.0276,0.0079","pos":[0.1774,-0.0157],"layers":["F.Cu"],"index":20},"A22":{"shape":"M -0.0276,0.0079L 0.0276,0.0079L 0.0276,-0.0079L -0.0276,-0.0079L -0.0276,0.0079","pos":[0.1774,0.0157],"layers":["F.Cu"],"index":21},"A23":{"shape":"M -0.0276,0.0079L 0.0276,0.0079L 0.0276,-0.0079L -0.0276,-0.0079L -0.0276,0.0079","pos":[0.1774,0.0472],"layers":["F.Cu"],"index":22},"24-":{"shape":"M -0.0276,0.0079L 0.0276,0.0079L 0.0276,-0.0079L -0.0276,-0.0079L -0.0276,0.0079","pos":[0.1774,0.0787],"layers":["F.Cu"],"index":23},"25+":{"shape":"M -0.0276,0.0079L 0.0276,0.0079L 0.0276,-0.0079L -0.0276,-0.0079L -0.0276,0.0079","pos":[0.1774,0.1102],"layers":["F.Cu"],"index":24},"A27":{"shape":"M -0.0079,0.0276L 0.0079,0.0276L 0.0079,-0.0276L -0.0079,-0.0276L -0.0079,0.0276","pos":[0.1102,0.1774],"layers":["F.Cu"],"index":25},"RST":{"shape":"M -0.0079,0.0276L 0.0079,0.0276L 0.0079,-0.0276L -0.0079,-0.0276L -0.0079,0.0276","pos":[0.0787,0.1774],"layers":["F.Cu"],"index":26},"A28":{"shape":"M -0.0079,0.0276L 0.0079,0.0276L 0.0079,-0.0276L -0.0079,-0.0276L -0.0079,0.0276","pos":[0.0472,0.1774],"layers":["F.Cu"],"index":27},"VCR":{"shape":"M -0.0079,0.0276L 0.0079,0.0276L 0.0079,-0.0276L -0.0079,-0.0276L -0.0079,0.0276","pos":[-0.0157,0.1774],"layers":["F.Cu"],"index":29},"VIN":{"shape":"M -0.0079,0.0276L 0.0079,0.0276L 0.0079,-0.0276L -0.0079,-0.0276L -0.0079,0.0276","pos":[-0.0472,0.1774],"layers":["F.Cu"],"index":30},"CLK":{"shape":"M -0.0079,0.0276L 0.0079,0.0276L 0.0079,-0.0276L -0.0079,-0.0276L -0.0079,0.0276","pos":[-0.0787,0.1774],"layers":["F.Cu"],"index":31},"DIO":{"shape":"M -0.0079,0.0276L 0.0079,0.0276L 0.0079,-0.0276L -0.0079,-0.0276L -0.0079,0.0276","pos":[-0.1102,0.1774],"layers":["F.Cu"],"index":32}};
+const header_SWD = {"VCC":{"shape":"M -0.047,-0.015L 0.0481,-0.015L 0.0491,-0.0149L 0.0496,-0.0148L 0.0506,-0.0146L 0.0512,-0.0144L 0.0516,-0.0142L 0.0521,-0.0141L 0.0526,-0.0139L 0.0536,-0.0135L 0.055,-0.0127L 0.0554,-0.0125L 0.0562,-0.0118L 0.0566,-0.0115L 0.057,-0.0112L 0.0574,-0.0108L 0.0582,-0.0101L 0.0597,-0.008L 0.06,-0.0075L 0.0603,-0.0071L 0.0607,-0.0061L 0.0609,-0.0056L 0.0611,-0.0051L 0.0613,-0.0047L 0.0616,-0.0036L 0.0617,-0.0031L 0.0618,-0.0026L 0.0618,-0.0021L 0.0619,-0.0016L 0.062,-0.001L 0.062,0.001L 0.0619,0.0016L 0.0618,0.0021L 0.0618,0.0026L 0.0617,0.0031L 0.0616,0.0036L 0.0613,0.0047L 0.0611,0.0051L 0.0609,0.0056L 0.0607,0.0061L 0.0603,0.0071L 0.06,0.0075L 0.0597,0.008L 0.0582,0.0101L 0.0574,0.0108L 0.057,0.0112L 0.0566,0.0115L 0.0562,0.0118L 0.0554,0.0125L 0.055,0.0127L 0.0536,0.0135L 0.0526,0.0139L 0.0521,0.0141L 0.0516,0.0142L 0.0512,0.0144L 0.0506,0.0146L 0.0496,0.0148L 0.0491,0.0149L 0.0481,0.015L 0.0475,0.015L 0.047,0.015L -0.047,0.015L -0.047,-0.015","pos":[0.077,-0.1],"layers":["F.Cu"],"index":1},"DIO":{"shape":"M -0.047,0.015L 0.047,0.015L 0.047,-0.015L -0.047,-0.015L -0.047,0.015","pos":[-0.077,-0.1],"layers":["F.Cu"],"index":2},"GND1":{"shape":"M -0.047,0.015L 0.047,0.015L 0.047,-0.015L -0.047,-0.015L -0.047,0.015","pos":[0.077,-0.05],"layers":["F.Cu"],"index":3},"GND2":{"shape":"M -0.047,0.015L 0.047,0.015L 0.047,-0.015L -0.047,-0.015L -0.047,0.015","pos":[0.077,0],"layers":["F.Cu"],"index":5},"GND3":{"shape":"M -0.047,0.015L 0.047,0.015L 0.047,-0.015L -0.047,-0.015L -0.047,0.015","pos":[0.077,0.1],"layers":["F.Cu"],"index":9},"CLK":{"shape":"M -0.047,0.015L 0.047,0.015L 0.047,-0.015L -0.047,-0.015L -0.047,0.015","pos":[-0.077,-0.05],"layers":["F.Cu"],"index":4},"SWO":{"shape":"M -0.047,0.015L 0.047,0.015L 0.047,-0.015L -0.047,-0.015L -0.047,0.015","pos":[-0.077,0],"layers":["F.Cu"],"index":6},"KEY":{"shape":"M -0.047,0.015L 0.047,0.015L 0.047,-0.015L -0.047,-0.015L -0.047,0.015","pos":[0.077,0.05],"layers":["F.Cu"],"index":7},"NC":{"shape":"M -0.047,0.015L 0.047,0.015L 0.047,-0.015L -0.047,-0.015L -0.047,0.015","pos":[-0.077,0.05],"layers":["F.Cu"],"index":8},"RST":{"shape":"M -0.047,0.015L 0.047,0.015L 0.047,-0.015L -0.047,-0.015L -0.047,0.015","pos":[-0.077,0.1],"layers":["F.Cu"],"index":10}};
+const USB_A_plug = {"5V":{"shape":"M -0.05,0.02L 0.242,0.02L 0.242,-0.02L -0.05,-0.02L -0.05,0.02","pos":[0,0.138],"layers":["F.Cu"],"index":1},"D-":{"shape":"M -0.05,0.02L 0.202,0.02L 0.202,-0.02L -0.05,-0.02L -0.05,0.02","pos":[0,0.039],"layers":["F.Cu"],"index":2},"D+":{"shape":"M -0.05,0.02L 0.202,0.02L 0.202,-0.02L -0.05,-0.02L -0.05,0.02","pos":[0,-0.039],"layers":["F.Cu"],"index":3},"GND":{"shape":"M -0.05,0.02L 0.242,0.02L 0.242,-0.02L -0.05,-0.02L -0.05,0.02","pos":[0,-0.138],"layers":["F.Cu"],"index":4}};
+const C_1206 = {"1":{"shape":"M -0.032,0.034L 0.032,0.034L 0.032,-0.034L -0.032,-0.034L -0.032,0.034","pos":[-0.06,0],"layers":["F.Cu"],"index":1},"2":{"shape":"M -0.032,0.034L 0.032,0.034L 0.032,-0.034L -0.032,-0.034L -0.032,0.034","pos":[0.06,0],"layers":["F.Cu"],"index":2}};
+const regulator_SOT23 = {"out":{"shape":"M -0.02,0.012L 0.02,0.012L 0.02,-0.012L -0.02,-0.012L -0.02,0.012","pos":[-0.045,0.0375],"layers":["F.Cu"],"index":1},"in":{"shape":"M -0.02,0.012L 0.02,0.012L 0.02,-0.012L -0.02,-0.012L -0.02,0.012","pos":[-0.045,-0.0375],"layers":["F.Cu"],"index":2},"gnd":{"shape":"M -0.02,0.012L 0.02,0.012L 0.02,-0.012L -0.02,-0.012L -0.02,0.012","pos":[0.045,0],"layers":["F.Cu"],"index":3}};
+
+const qr_code = {
+  "code": {
+    "shape": pipe(
+      "M 0 0 l 5 0 l 0 5 l -5 0 Z M 5 0 l 5 0 l 0 5 l -5 0 Z M 10 0 l 5 0 l 0 5 l -5 0 Z M 15 0 l 5 0 l 0 5 l -5 0 Z M 20 0 l 5 0 l 0 5 l -5 0 Z M 25 0 l 5 0 l 0 5 l -5 0 Z M 30 0 l 5 0 l 0 5 l -5 0 Z M 55 0 l 5 0 l 0 5 l -5 0 Z M 60 0 l 5 0 l 0 5 l -5 0 Z M 65 0 l 5 0 l 0 5 l -5 0 Z M 70 0 l 5 0 l 0 5 l -5 0 Z M 85 0 l 5 0 l 0 5 l -5 0 Z M 90 0 l 5 0 l 0 5 l -5 0 Z M 95 0 l 5 0 l 0 5 l -5 0 Z M 110 0 l 5 0 l 0 5 l -5 0 Z M 115 0 l 5 0 l 0 5 l -5 0 Z M 120 0 l 5 0 l 0 5 l -5 0 Z M 125 0 l 5 0 l 0 5 l -5 0 Z M 130 0 l 5 0 l 0 5 l -5 0 Z M 135 0 l 5 0 l 0 5 l -5 0 Z M 140 0 l 5 0 l 0 5 l -5 0 Z M 0 5 l 5 0 l 0 5 l -5 0 Z M 30 5 l 5 0 l 0 5 l -5 0 Z M 40 5 l 5 0 l 0 5 l -5 0 Z M 50 5 l 5 0 l 0 5 l -5 0 Z M 60 5 l 5 0 l 0 5 l -5 0 Z M 70 5 l 5 0 l 0 5 l -5 0 Z M 75 5 l 5 0 l 0 5 l -5 0 Z M 80 5 l 5 0 l 0 5 l -5 0 Z M 85 5 l 5 0 l 0 5 l -5 0 Z M 100 5 l 5 0 l 0 5 l -5 0 Z M 110 5 l 5 0 l 0 5 l -5 0 Z M 140 5 l 5 0 l 0 5 l -5 0 Z M 0 10 l 5 0 l 0 5 l -5 0 Z M 10 10 l 5 0 l 0 5 l -5 0 Z M 15 10 l 5 0 l 0 5 l -5 0 Z M 20 10 l 5 0 l 0 5 l -5 0 Z M 30 10 l 5 0 l 0 5 l -5 0 Z M 45 10 l 5 0 l 0 5 l -5 0 Z M 55 10 l 5 0 l 0 5 l -5 0 Z M 60 10 l 5 0 l 0 5 l -5 0 Z M 70 10 l 5 0 l 0 5 l -5 0 Z M 75 10 l 5 0 l 0 5 l -5 0 Z M 80 10 l 5 0 l 0 5 l -5 0 Z M 100 10 l 5 0 l 0 5 l -5 0 Z M 110 10 l 5 0 l 0 5 l -5 0 Z M 120 10 l 5 0 l 0 5 l -5 0 Z M 125 10 l 5 0 l 0 5 l -5 0 Z M 130 10 l 5 0 l 0 5 l -5 0 Z M 140 10 l 5 0 l 0 5 l -5 0 Z M 0 15 l 5 0 l 0 5 l -5 0 Z M 10 15 l 5 0 l 0 5 l -5 0 Z M 15 15 l 5 0 l 0 5 l -5 0 Z M 20 15 l 5 0 l 0 5 l -5 0 Z M 30 15 l 5 0 l 0 5 l -5 0 Z M 40 15 l 5 0 l 0 5 l -5 0 Z M 50 15 l 5 0 l 0 5 l -5 0 Z M 65 15 l 5 0 l 0 5 l -5 0 Z M 70 15 l 5 0 l 0 5 l -5 0 Z M 75 15 l 5 0 l 0 5 l -5 0 Z M 85 15 l 5 0 l 0 5 l -5 0 Z M 95 15 l 5 0 l 0 5 l -5 0 Z M 110 15 l 5 0 l 0 5 l -5 0 Z M 120 15 l 5 0 l 0 5 l -5 0 Z M 125 15 l 5 0 l 0 5 l -5 0 Z M 130 15 l 5 0 l 0 5 l -5 0 Z M 140 15 l 5 0 l 0 5 l -5 0 Z M 0 20 l 5 0 l 0 5 l -5 0 Z M 10 20 l 5 0 l 0 5 l -5 0 Z M 15 20 l 5 0 l 0 5 l -5 0 Z M 20 20 l 5 0 l 0 5 l -5 0 Z M 30 20 l 5 0 l 0 5 l -5 0 Z M 55 20 l 5 0 l 0 5 l -5 0 Z M 80 20 l 5 0 l 0 5 l -5 0 Z M 95 20 l 5 0 l 0 5 l -5 0 Z M 100 20 l 5 0 l 0 5 l -5 0 Z M 110 20 l 5 0 l 0 5 l -5 0 Z M 120 20 l 5 0 l 0 5 l -5 0 Z M 125 20 l 5 0 l 0 5 l -5 0 Z M 130 20 l 5 0 l 0 5 l -5 0 Z M 140 20 l 5 0 l 0 5 l -5 0 Z M 0 25 l 5 0 l 0 5 l -5 0 Z M 30 25 l 5 0 l 0 5 l -5 0 Z M 40 25 l 5 0 l 0 5 l -5 0 Z M 65 25 l 5 0 l 0 5 l -5 0 Z M 70 25 l 5 0 l 0 5 l -5 0 Z M 75 25 l 5 0 l 0 5 l -5 0 Z M 85 25 l 5 0 l 0 5 l -5 0 Z M 90 25 l 5 0 l 0 5 l -5 0 Z M 100 25 l 5 0 l 0 5 l -5 0 Z M 110 25 l 5 0 l 0 5 l -5 0 Z M 140 25 l 5 0 l 0 5 l -5 0 Z M 0 30 l 5 0 l 0 5 l -5 0 Z M 5 30 l 5 0 l 0 5 l -5 0 Z M 10 30 l 5 0 l 0 5 l -5 0 Z M 15 30 l 5 0 l 0 5 l -5 0 Z M 20 30 l 5 0 l 0 5 l -5 0 Z M 25 30 l 5 0 l 0 5 l -5 0 Z M 30 30 l 5 0 l 0 5 l -5 0 Z M 40 30 l 5 0 l 0 5 l -5 0 Z M 50 30 l 5 0 l 0 5 l -5 0 Z M 60 30 l 5 0 l 0 5 l -5 0 Z M 70 30 l 5 0 l 0 5 l -5 0 Z M 80 30 l 5 0 l 0 5 l -5 0 Z M 90 30 l 5 0 l 0 5 l -5 0 Z M 100 30 l 5 0 l 0 5 l -5 0 Z M 110 30 l 5 0 l 0 5 l -5 0 Z M 115 30 l 5 0 l 0 5 l -5 0 Z M 120 30 l 5 0 l 0 5 l -5 0 Z M 125 30 l 5 0 l 0 5 l -5 0 Z M 130 30 l 5 0 l 0 5 l -5 0 Z M 135 30 l 5 0 l 0 5 l -5 0 Z M 140 30 l 5 0 l 0 5 l -5 0 Z M 45 35 l 5 0 l 0 5 l -5 0 Z M 75 35 l 5 0 l 0 5 l -5 0 Z M 80 35 l 5 0 l 0 5 l -5 0 Z M 95 35 l 5 0 l 0 5 l -5 0 Z M 100 35 l 5 0 l 0 5 l -5 0 Z M 0 40 l 5 0 l 0 5 l -5 0 Z M 5 40 l 5 0 l 0 5 l -5 0 Z M 10 40 l 5 0 l 0 5 l -5 0 Z M 15 40 l 5 0 l 0 5 l -5 0 Z M 20 40 l 5 0 l 0 5 l -5 0 Z M 30 40 l 5 0 l 0 5 l -5 0 Z M 35 40 l 5 0 l 0 5 l -5 0 Z M 40 40 l 5 0 l 0 5 l -5 0 Z M 50 40 l 5 0 l 0 5 l -5 0 Z M 60 40 l 5 0 l 0 5 l -5 0 Z M 65 40 l 5 0 l 0 5 l -5 0 Z M 70 40 l 5 0 l 0 5 l -5 0 Z M 85 40 l 5 0 l 0 5 l -5 0 Z M 95 40 l 5 0 l 0 5 l -5 0 Z M 105 40 l 5 0 l 0 5 l -5 0 Z M 115 40 l 5 0 l 0 5 l -5 0 Z M 125 40 l 5 0 l 0 5 l -5 0 Z M 135 40 l 5 0 l 0 5 l -5 0 Z M 0 45 l 5 0 l 0 5 l -5 0 Z M 5 45 l 5 0 l 0 5 l -5 0 Z M 10 45 l 5 0 l 0 5 l -5 0 Z M 15 45 l 5 0 l 0 5 l -5 0 Z M 35 45 l 5 0 l 0 5 l -5 0 Z M 45 45 l 5 0 l 0 5 l -5 0 Z M 50 45 l 5 0 l 0 5 l -5 0 Z M 55 45 l 5 0 l 0 5 l -5 0 Z M 80 45 l 5 0 l 0 5 l -5 0 Z M 95 45 l 5 0 l 0 5 l -5 0 Z M 100 45 l 5 0 l 0 5 l -5 0 Z M 105 45 l 5 0 l 0 5 l -5 0 Z M 110 45 l 5 0 l 0 5 l -5 0 Z M 115 45 l 5 0 l 0 5 l -5 0 Z M 120 45 l 5 0 l 0 5 l -5 0 Z M 140 45 l 5 0 l 0 5 l -5 0 Z M 10 50 l 5 0 l 0 5 l -5 0 Z M 15 50 l 5 0 l 0 5 l -5 0 Z M 25 50 l 5 0 l 0 5 l -5 0 Z M 30 50 l 5 0 l 0 5 l -5 0 Z M 40 50 l 5 0 l 0 5 l -5 0 Z M 75 50 l 5 0 l 0 5 l -5 0 Z M 80 50 l 5 0 l 0 5 l -5 0 Z M 85 50 l 5 0 l 0 5 l -5 0 Z M 100 50 l 5 0 l 0 5 l -5 0 Z M 105 50 l 5 0 l 0 5 l -5 0 Z M 115 50 l 5 0 l 0 5 l -5 0 Z M 120 50 l 5 0 l 0 5 l -5 0 Z M 0 55 l 5 0 l 0 5 l -5 0 Z M 5 55 l 5 0 l 0 5 l -5 0 Z M 15 55 l 5 0 l 0 5 l -5 0 Z M 20 55 l 5 0 l 0 5 l -5 0 Z M 25 55 l 5 0 l 0 5 l -5 0 Z M 40 55 l 5 0 l 0 5 l -5 0 Z M 45 55 l 5 0 l 0 5 l -5 0 Z M 50 55 l 5 0 l 0 5 l -5 0 Z M 60 55 l 5 0 l 0 5 l -5 0 Z M 70 55 l 5 0 l 0 5 l -5 0 Z M 75 55 l 5 0 l 0 5 l -5 0 Z M 90 55 l 5 0 l 0 5 l -5 0 Z M 95 55 l 5 0 l 0 5 l -5 0 Z M 110 55 l 5 0 l 0 5 l -5 0 Z M 115 55 l 5 0 l 0 5 l -5 0 Z M 125 55 l 5 0 l 0 5 l -5 0 Z M 135 55 l 5 0 l 0 5 l -5 0 Z M 0 60 l 5 0 l 0 5 l -5 0 Z M 10 60 l 5 0 l 0 5 l -5 0 Z M 15 60 l 5 0 l 0 5 l -5 0 Z M 25 60 l 5 0 l 0 5 l -5 0 Z M 30 60 l 5 0 l 0 5 l -5 0 Z M 45 60 l 5 0 l 0 5 l -5 0 Z M 55 60 l 5 0 l 0 5 l -5 0 Z M 60 60 l 5 0 l 0 5 l -5 0 Z M 65 60 l 5 0 l 0 5 l -5 0 Z M 70 60 l 5 0 l 0 5 l -5 0 Z M 85 60 l 5 0 l 0 5 l -5 0 Z M 125 60 l 5 0 l 0 5 l -5 0 Z M 130 60 l 5 0 l 0 5 l -5 0 Z M 0 65 l 5 0 l 0 5 l -5 0 Z M 10 65 l 5 0 l 0 5 l -5 0 Z M 15 65 l 5 0 l 0 5 l -5 0 Z M 20 65 l 5 0 l 0 5 l -5 0 Z M 25 65 l 5 0 l 0 5 l -5 0 Z M 35 65 l 5 0 l 0 5 l -5 0 Z M 40 65 l 5 0 l 0 5 l -5 0 Z M 55 65 l 5 0 l 0 5 l -5 0 Z M 80 65 l 5 0 l 0 5 l -5 0 Z M 90 65 l 5 0 l 0 5 l -5 0 Z M 95 65 l 5 0 l 0 5 l -5 0 Z M 100 65 l 5 0 l 0 5 l -5 0 Z M 105 65 l 5 0 l 0 5 l -5 0 Z M 110 65 l 5 0 l 0 5 l -5 0 Z M 115 65 l 5 0 l 0 5 l -5 0 Z M 120 65 l 5 0 l 0 5 l -5 0 Z M 140 65 l 5 0 l 0 5 l -5 0 Z M 5 70 l 5 0 l 0 5 l -5 0 Z M 20 70 l 5 0 l 0 5 l -5 0 Z M 30 70 l 5 0 l 0 5 l -5 0 Z M 35 70 l 5 0 l 0 5 l -5 0 Z M 40 70 l 5 0 l 0 5 l -5 0 Z M 60 70 l 5 0 l 0 5 l -5 0 Z M 65 70 l 5 0 l 0 5 l -5 0 Z M 75 70 l 5 0 l 0 5 l -5 0 Z M 85 70 l 5 0 l 0 5 l -5 0 Z M 115 70 l 5 0 l 0 5 l -5 0 Z M 125 70 l 5 0 l 0 5 l -5 0 Z M 130 70 l 5 0 l 0 5 l -5 0 Z M 0 75 l 5 0 l 0 5 l -5 0 Z M 5 75 l 5 0 l 0 5 l -5 0 Z M 10 75 l 5 0 l 0 5 l -5 0 Z M 15 75 l 5 0 l 0 5 l -5 0 Z M 25 75 l 5 0 l 0 5 l -5 0 Z M 40 75 l 5 0 l 0 5 l -5 0 Z M 45 75 l 5 0 l 0 5 l -5 0 Z M 50 75 l 5 0 l 0 5 l -5 0 Z M 55 75 l 5 0 l 0 5 l -5 0 Z M 60 75 l 5 0 l 0 5 l -5 0 Z M 80 75 l 5 0 l 0 5 l -5 0 Z M 95 75 l 5 0 l 0 5 l -5 0 Z M 100 75 l 5 0 l 0 5 l -5 0 Z M 115 75 l 5 0 l 0 5 l -5 0 Z M 135 75 l 5 0 l 0 5 l -5 0 Z M 0 80 l 5 0 l 0 5 l -5 0 Z M 15 80 l 5 0 l 0 5 l -5 0 Z M 25 80 l 5 0 l 0 5 l -5 0 Z M 30 80 l 5 0 l 0 5 l -5 0 Z M 40 80 l 5 0 l 0 5 l -5 0 Z M 45 80 l 5 0 l 0 5 l -5 0 Z M 50 80 l 5 0 l 0 5 l -5 0 Z M 55 80 l 5 0 l 0 5 l -5 0 Z M 65 80 l 5 0 l 0 5 l -5 0 Z M 70 80 l 5 0 l 0 5 l -5 0 Z M 75 80 l 5 0 l 0 5 l -5 0 Z M 85 80 l 5 0 l 0 5 l -5 0 Z M 90 80 l 5 0 l 0 5 l -5 0 Z M 95 80 l 5 0 l 0 5 l -5 0 Z M 125 80 l 5 0 l 0 5 l -5 0 Z M 130 80 l 5 0 l 0 5 l -5 0 Z M 0 85 l 5 0 l 0 5 l -5 0 Z M 10 85 l 5 0 l 0 5 l -5 0 Z M 15 85 l 5 0 l 0 5 l -5 0 Z M 20 85 l 5 0 l 0 5 l -5 0 Z M 35 85 l 5 0 l 0 5 l -5 0 Z M 50 85 l 5 0 l 0 5 l -5 0 Z M 55 85 l 5 0 l 0 5 l -5 0 Z M 65 85 l 5 0 l 0 5 l -5 0 Z M 80 85 l 5 0 l 0 5 l -5 0 Z M 85 85 l 5 0 l 0 5 l -5 0 Z M 90 85 l 5 0 l 0 5 l -5 0 Z M 95 85 l 5 0 l 0 5 l -5 0 Z M 105 85 l 5 0 l 0 5 l -5 0 Z M 110 85 l 5 0 l 0 5 l -5 0 Z M 115 85 l 5 0 l 0 5 l -5 0 Z M 120 85 l 5 0 l 0 5 l -5 0 Z M 130 85 l 5 0 l 0 5 l -5 0 Z M 140 85 l 5 0 l 0 5 l -5 0 Z M 0 90 l 5 0 l 0 5 l -5 0 Z M 20 90 l 5 0 l 0 5 l -5 0 Z M 25 90 l 5 0 l 0 5 l -5 0 Z M 30 90 l 5 0 l 0 5 l -5 0 Z M 35 90 l 5 0 l 0 5 l -5 0 Z M 40 90 l 5 0 l 0 5 l -5 0 Z M 70 90 l 5 0 l 0 5 l -5 0 Z M 75 90 l 5 0 l 0 5 l -5 0 Z M 80 90 l 5 0 l 0 5 l -5 0 Z M 100 90 l 5 0 l 0 5 l -5 0 Z M 110 90 l 5 0 l 0 5 l -5 0 Z M 115 90 l 5 0 l 0 5 l -5 0 Z M 120 90 l 5 0 l 0 5 l -5 0 Z M 130 90 l 5 0 l 0 5 l -5 0 Z M 0 95 l 5 0 l 0 5 l -5 0 Z M 20 95 l 5 0 l 0 5 l -5 0 Z M 35 95 l 5 0 l 0 5 l -5 0 Z M 40 95 l 5 0 l 0 5 l -5 0 Z M 45 95 l 5 0 l 0 5 l -5 0 Z M 50 95 l 5 0 l 0 5 l -5 0 Z M 80 95 l 5 0 l 0 5 l -5 0 Z M 105 95 l 5 0 l 0 5 l -5 0 Z M 115 95 l 5 0 l 0 5 l -5 0 Z M 120 95 l 5 0 l 0 5 l -5 0 Z M 135 95 l 5 0 l 0 5 l -5 0 Z M 0 100 l 5 0 l 0 5 l -5 0 Z M 15 100 l 5 0 l 0 5 l -5 0 Z M 20 100 l 5 0 l 0 5 l -5 0 Z M 30 100 l 5 0 l 0 5 l -5 0 Z M 35 100 l 5 0 l 0 5 l -5 0 Z M 40 100 l 5 0 l 0 5 l -5 0 Z M 45 100 l 5 0 l 0 5 l -5 0 Z M 50 100 l 5 0 l 0 5 l -5 0 Z M 60 100 l 5 0 l 0 5 l -5 0 Z M 65 100 l 5 0 l 0 5 l -5 0 Z M 70 100 l 5 0 l 0 5 l -5 0 Z M 80 100 l 5 0 l 0 5 l -5 0 Z M 85 100 l 5 0 l 0 5 l -5 0 Z M 95 100 l 5 0 l 0 5 l -5 0 Z M 100 100 l 5 0 l 0 5 l -5 0 Z M 105 100 l 5 0 l 0 5 l -5 0 Z M 110 100 l 5 0 l 0 5 l -5 0 Z M 115 100 l 5 0 l 0 5 l -5 0 Z M 120 100 l 5 0 l 0 5 l -5 0 Z M 130 100 l 5 0 l 0 5 l -5 0 Z M 135 100 l 5 0 l 0 5 l -5 0 Z M 140 100 l 5 0 l 0 5 l -5 0 Z M 40 105 l 5 0 l 0 5 l -5 0 Z M 45 105 l 5 0 l 0 5 l -5 0 Z M 55 105 l 5 0 l 0 5 l -5 0 Z M 95 105 l 5 0 l 0 5 l -5 0 Z M 100 105 l 5 0 l 0 5 l -5 0 Z M 120 105 l 5 0 l 0 5 l -5 0 Z M 125 105 l 5 0 l 0 5 l -5 0 Z M 130 105 l 5 0 l 0 5 l -5 0 Z M 135 105 l 5 0 l 0 5 l -5 0 Z M 140 105 l 5 0 l 0 5 l -5 0 Z M 0 110 l 5 0 l 0 5 l -5 0 Z M 5 110 l 5 0 l 0 5 l -5 0 Z M 10 110 l 5 0 l 0 5 l -5 0 Z M 15 110 l 5 0 l 0 5 l -5 0 Z M 20 110 l 5 0 l 0 5 l -5 0 Z M 25 110 l 5 0 l 0 5 l -5 0 Z M 30 110 l 5 0 l 0 5 l -5 0 Z M 40 110 l 5 0 l 0 5 l -5 0 Z M 45 110 l 5 0 l 0 5 l -5 0 Z M 50 110 l 5 0 l 0 5 l -5 0 Z M 60 110 l 5 0 l 0 5 l -5 0 Z M 75 110 l 5 0 l 0 5 l -5 0 Z M 80 110 l 5 0 l 0 5 l -5 0 Z M 90 110 l 5 0 l 0 5 l -5 0 Z M 95 110 l 5 0 l 0 5 l -5 0 Z M 100 110 l 5 0 l 0 5 l -5 0 Z M 110 110 l 5 0 l 0 5 l -5 0 Z M 120 110 l 5 0 l 0 5 l -5 0 Z M 125 110 l 5 0 l 0 5 l -5 0 Z M 130 110 l 5 0 l 0 5 l -5 0 Z M 0 115 l 5 0 l 0 5 l -5 0 Z M 30 115 l 5 0 l 0 5 l -5 0 Z M 45 115 l 5 0 l 0 5 l -5 0 Z M 50 115 l 5 0 l 0 5 l -5 0 Z M 55 115 l 5 0 l 0 5 l -5 0 Z M 60 115 l 5 0 l 0 5 l -5 0 Z M 70 115 l 5 0 l 0 5 l -5 0 Z M 80 115 l 5 0 l 0 5 l -5 0 Z M 90 115 l 5 0 l 0 5 l -5 0 Z M 95 115 l 5 0 l 0 5 l -5 0 Z M 100 115 l 5 0 l 0 5 l -5 0 Z M 120 115 l 5 0 l 0 5 l -5 0 Z M 0 120 l 5 0 l 0 5 l -5 0 Z M 10 120 l 5 0 l 0 5 l -5 0 Z M 15 120 l 5 0 l 0 5 l -5 0 Z M 20 120 l 5 0 l 0 5 l -5 0 Z M 30 120 l 5 0 l 0 5 l -5 0 Z M 40 120 l 5 0 l 0 5 l -5 0 Z M 45 120 l 5 0 l 0 5 l -5 0 Z M 60 120 l 5 0 l 0 5 l -5 0 Z M 65 120 l 5 0 l 0 5 l -5 0 Z M 70 120 l 5 0 l 0 5 l -5 0 Z M 85 120 l 5 0 l 0 5 l -5 0 Z M 100 120 l 5 0 l 0 5 l -5 0 Z M 105 120 l 5 0 l 0 5 l -5 0 Z M 110 120 l 5 0 l 0 5 l -5 0 Z M 115 120 l 5 0 l 0 5 l -5 0 Z M 120 120 l 5 0 l 0 5 l -5 0 Z M 130 120 l 5 0 l 0 5 l -5 0 Z M 0 125 l 5 0 l 0 5 l -5 0 Z M 10 125 l 5 0 l 0 5 l -5 0 Z M 15 125 l 5 0 l 0 5 l -5 0 Z M 20 125 l 5 0 l 0 5 l -5 0 Z M 30 125 l 5 0 l 0 5 l -5 0 Z M 40 125 l 5 0 l 0 5 l -5 0 Z M 45 125 l 5 0 l 0 5 l -5 0 Z M 55 125 l 5 0 l 0 5 l -5 0 Z M 90 125 l 5 0 l 0 5 l -5 0 Z M 95 125 l 5 0 l 0 5 l -5 0 Z M 100 125 l 5 0 l 0 5 l -5 0 Z M 125 125 l 5 0 l 0 5 l -5 0 Z M 130 125 l 5 0 l 0 5 l -5 0 Z M 140 125 l 5 0 l 0 5 l -5 0 Z M 0 130 l 5 0 l 0 5 l -5 0 Z M 10 130 l 5 0 l 0 5 l -5 0 Z M 15 130 l 5 0 l 0 5 l -5 0 Z M 20 130 l 5 0 l 0 5 l -5 0 Z M 30 130 l 5 0 l 0 5 l -5 0 Z M 40 130 l 5 0 l 0 5 l -5 0 Z M 45 130 l 5 0 l 0 5 l -5 0 Z M 65 130 l 5 0 l 0 5 l -5 0 Z M 75 130 l 5 0 l 0 5 l -5 0 Z M 85 130 l 5 0 l 0 5 l -5 0 Z M 90 130 l 5 0 l 0 5 l -5 0 Z M 95 130 l 5 0 l 0 5 l -5 0 Z M 100 130 l 5 0 l 0 5 l -5 0 Z M 110 130 l 5 0 l 0 5 l -5 0 Z M 115 130 l 5 0 l 0 5 l -5 0 Z M 120 130 l 5 0 l 0 5 l -5 0 Z M 125 130 l 5 0 l 0 5 l -5 0 Z M 130 130 l 5 0 l 0 5 l -5 0 Z M 135 130 l 5 0 l 0 5 l -5 0 Z M 0 135 l 5 0 l 0 5 l -5 0 Z M 30 135 l 5 0 l 0 5 l -5 0 Z M 40 135 l 5 0 l 0 5 l -5 0 Z M 50 135 l 5 0 l 0 5 l -5 0 Z M 55 135 l 5 0 l 0 5 l -5 0 Z M 100 135 l 5 0 l 0 5 l -5 0 Z M 105 135 l 5 0 l 0 5 l -5 0 Z M 120 135 l 5 0 l 0 5 l -5 0 Z M 125 135 l 5 0 l 0 5 l -5 0 Z M 135 135 l 5 0 l 0 5 l -5 0 Z M 0 140 l 5 0 l 0 5 l -5 0 Z M 5 140 l 5 0 l 0 5 l -5 0 Z M 10 140 l 5 0 l 0 5 l -5 0 Z M 15 140 l 5 0 l 0 5 l -5 0 Z M 20 140 l 5 0 l 0 5 l -5 0 Z M 25 140 l 5 0 l 0 5 l -5 0 Z M 30 140 l 5 0 l 0 5 l -5 0 Z M 40 140 l 5 0 l 0 5 l -5 0 Z M 45 140 l 5 0 l 0 5 l -5 0 Z M 55 140 l 5 0 l 0 5 l -5 0 Z M 70 140 l 5 0 l 0 5 l -5 0 Z M 75 140 l 5 0 l 0 5 l -5 0 Z M 85 140 l 5 0 l 0 5 l -5 0 Z M 95 140 l 5 0 l 0 5 l -5 0 Z M 105 140 l 5 0 l 0 5 l -5 0 Z M 110 140 l 5 0 l 0 5 l -5 0 Z M 115 140 l 5 0 l 0 5 l -5 0 Z M 130 140 l 5 0 l 0 5 l -5 0 Z",
+      x => geo.pathD([], x),
+      x => geo.scale(x, 0.002),
+      x => geo.originate(x),
+      // x => geo.translate(x, pt(-0.15, 0.3)),
+      geo.getPathData,
+    ),
+    "pos": [0, 0],
+    "origin": [0, 0],
+    "layers": ["F.Cu"]
+  }
+}
+
+// commands:
+//  - SHIFT+ENTER: render
+//  - drap & drop file: kicad import
+
+
+// constants
+const width = 1.03 // board width
+const height = 1.05 // board height
+const x = 1 // x origin
+const y = 1 // y origin
+const zt = 0 // top z
+const zb = -0.06 // bottom z
+const w = .015 // wire width
+const mask = .004 // solder mask size
+const border = 0.05 // rendering border
+
+
+/* -- DECLARE_PCB -- */
+let board = new PCB();
+
+let interior = geo.translate(geo.rectangle(width, height), [x+width/2, y+height/2]);
+
+
+/* -- ADD_COMPONENTS -- */
+let IC1 = board.add(SAMD21E, {translate: pt(x+.37, y+.36), name: 'IC1\nD21E'});
+let J1 = board.add(header_SWD, {translate: pt(IC1.posX, IC1.padY("DIO")+.34), rotate: -90, name: 'J1 SWD'});
+let J2 = board.add(USB_A_plug, {translate: pt(x+width-.29, IC1.padY("25+")+.04), name: 'J2 USB'});
+let C1 = board.add(C_1206, {translate: pt(IC1.padX("GND2"), IC1.padY("A27")+.15), name: 'C1 1uF'});
+let C2 = board.add(C_1206, {translate: pt(IC1.padX("A07")-.02, IC1.padY("VAN")-.08), rotate: 90, name: 'C2\n1uF'});
+let IC2 = board.add(regulator_SOT23, {translate: pt(C2.posX-.11, C2.posY), rotate: -90, name: 'IC2\n3.3V'});
+board.add(qr_code, { translate: pt(0.801, 1.528), rotate: 0, name: "qr_code" })
+
+geo.difference(interior, geo.translate(geo.rectangle(1.05, 9.76), [0.475+J2.posX, 5.12+J2.posY]));
+geo.difference(interior, geo.translate(geo.rectangle(1.05, 9.76), [0.475+J2.posX, -5.12+J2.posY]));
+geo.union(interior, geo.translate(geo.rectangle(0.5, 1.05), pt(0.833, 1.525)));
+
+board.addShape("interior", interior);
+
+
+/* -- ADD_WIRES -- */
+board.wire(path(IC1.pad("VAN"),
+                pt(IC1.padX("VAN"), IC1.posY+.015),
+                pt(IC1.padX("VIN"), IC1.posY+.015),
+                IC1.pad("VIN"),), w);
+
+board.wire(path(IC1.pad("GND1"),
+                pt(IC1.padX("GND1"), IC1.posY-.015),
+                pt(IC1.padX("GND2"), IC1.posY-.015),
+                IC1.pad("GND2"),), w);
+
+board.wire(path(J1.pad("VCC"),
+                pt(J1.padX("VCC"), IC1.padY("VIN")+.09),
+                pt(IC1.padX("VIN"), IC1.padY("VIN")+.09),
+                IC1.pad("VIN"),), w);
+
+board.wire(path(J1.pad("GND1"),
+                J1.pad("GND2"),), w);
+
+board.wire(path(J1.pad("DIO"),
+                pt(J1.padX("DIO")-.08, J1.padY("DIO")),
+                pt(J1.padX("DIO")-.08, IC1.padY("DIO")),
+                IC1.pad("DIO"),), w);
+
+board.wire(path(J1.pad("CLK"),
+                pt(J1.padX("CLK"), J1.posY),
+                pt(J1.padX("VCC")-.05, J1.posY),
+                pt(J1.padX("VCC")-.05, IC1.padY("CLK")+.06),
+                pt(IC1.padX("CLK"), IC1.padY("CLK")+.06),
+                IC1.pad("CLK"),), w);
+
+board.wire(path(J1.pad("GND2"),
+                pt(J1.padX("GND2"), J1.posY),
+                pt(J1.padX("GND3"), J1.posY),
+                J1.pad("GND3"),), w);
+
+board.wire(path(J1.pad("RST"),
+                pt(J1.padX("RST")+.05, J1.padY("RST")),
+                pt(J1.padX("RST")+.05, IC1.padY("RST")+.06),
+                pt(IC1.padX("RST"), IC1.padY("RST")+.06),
+                IC1.pad("RST"),), w);
+
+board.wire(path(pt(J2.padX("D-"), IC1.padY("A27")),
+                pt(IC1.padX("25+"), IC1.padY("A27")),
+                pt(IC1.padX("A27"), IC1.padY("25+")),
+                pt(IC1.padX("A27"), IC1.padY("24-")),
+                IC1.pad("24-"),), w);
+
+board.wire(path(J2.pad("D+"),
+                IC1.pad("25+"),), w);
+
+board.wire(path(C1.pad("1"),
+                pt(IC1.padX("VCR"), C1.posY),
+                IC1.pad("VCR"),), w);
+
+board.wire(path(C1.pad("2"),
+                pt(C1.posX, C1.posY),
+                IC1.pad("GND2"),), w);
+
+board.wire(path(C1.pad("2"),
+                pt(J1.padX("GND3"), C1.posY),
+                J1.pad("GND3"),), w);
+
+board.wire(path(C2.pad("1"),
+                pt(IC1.padX("GND1"), C2.padY("1")),
+                IC1.pad("GND1"),), w);
+
+board.wire(path(C2.pad("1"),
+                pt(IC1.padX("A16")+.06, C2.padY("1")),
+                pt(IC1.padX("A16")+.06, J2.padY("GND")),
+                J2.pad("GND"),), w);
+
+board.wire(path(C2.pad("2"),
+                pt(IC1.padX("VAN"), C2.padY("2")),
+                IC1.pad("VAN"),), w);
+
+board.wire(path(IC2.pad("out"),
+                pt(IC2.padX("out"), C2.padY("2")),
+                C2.pad("2"),), w);
+
+board.wire(path(IC2.pad("in"),
+                pt(IC2.padX("in"), J1.padY("DIO")+.08),
+                pt(J1.padX("RST")+.08, J1.padY("DIO")+.08),
+                pt(J1.padX("RST")+.08, J2.padY("5V")),
+                J2.pad("5V"),), w);
+
+board.wire(path(IC2.pad("gnd"),
+                pt(IC2.padX("gnd"), C2.padY("1")),
+                C2.pad("1"),), w);
+
+
+// rendering
+renderPCB({
+  pcb: board,
+  layerColors: {
+    "interior": "#002d00ff",
+    "B.Cu": "#ff4c007f",
+    "F.Cu": "#ff8c00cc",
+    "drill": "#ff3300e5",
+    // "padLabels": "#ffff99e5",
+    // "componentLabels": "#00e5e5e5",
+  },
+  limits: {
+    x: [x-border - 0.43, x+width+border],
+    y: [y-border, y+height+border]
+  },
+  mm_per_unit: 25.4
+})
diff --git a/examples/scf-qr-spline.js b/examples/scf-qr-spline.js
new file mode 100644
index 0000000..bf104c9
--- /dev/null
+++ b/examples/scf-qr-spline.js
@@ -0,0 +1,207 @@
+/* -- DECLARE_COMPONENTS -- */
+const LED_1206 = {"A":{"shape":"M -0.037 0.034L 0.027 0.034L 0.027 -0.034L -0.037 -0.034L -0.037 0.034","pos":[-0.055,0],"layers":["F.Cu"],"index":1},"C":{"shape":"M -0.027 0.034L 0.037 0.034L 0.037 -0.034L -0.027 -0.034L -0.027 0.034","pos":[0.055,0],"layers":["F.Cu"],"index":2}}
+const R_1206 = {"1":{"shape":"M -0.032 0.034L 0.032 0.034L 0.032 -0.034L -0.032 -0.034L -0.032 0.034","pos":[-0.06,0],"layers":["F.Cu"],"index":1},"2":{"shape":"M -0.032 0.034L 0.032 0.034L 0.032 -0.034L -0.032 -0.034L -0.032 0.034","pos":[0.06,0],"layers":["F.Cu"],"index":2}}
+const SAMD11C = {"A05":{"shape":"M 0.03,0.015L -0.03,0.015L -0.0305,0.015L -0.031,0.015L -0.0321,0.0149L -0.0331,0.0147L -0.0336,0.0146L -0.0347,0.0142L -0.0356,0.0139L -0.0361,0.0137L -0.0366,0.0135L -0.0371,0.0132L -0.0375,0.013L -0.038,0.0127L -0.0384,0.0125L -0.0392,0.0118L -0.0396,0.0115L -0.0401,0.0112L -0.0412,0.0101L -0.0415,0.0096L -0.0418,0.0092L -0.0425,0.0084L -0.0427,0.008L -0.043,0.0075L -0.0432,0.0071L -0.0435,0.0066L -0.0437,0.0061L -0.0439,0.0056L -0.0442,0.0047L -0.0446,0.0036L -0.0447,0.0031L -0.0449,0.0021L -0.045,0.001L -0.045,-0.001L -0.0449,-0.0021L -0.0447,-0.0031L -0.0446,-0.0036L -0.0442,-0.0047L -0.0439,-0.0056L -0.0437,-0.0061L -0.0435,-0.0066L -0.0432,-0.0071L -0.043,-0.0075L -0.0427,-0.008L -0.0425,-0.0084L -0.0418,-0.0092L -0.0415,-0.0096L -0.0412,-0.0101L -0.0401,-0.0112L -0.0396,-0.0115L -0.0392,-0.0118L -0.0384,-0.0125L -0.038,-0.0127L -0.0375,-0.013L -0.0371,-0.0132L -0.0366,-0.0135L -0.0361,-0.0137L -0.0356,-0.0139L -0.0347,-0.0142L -0.0336,-0.0146L -0.0331,-0.0147L -0.0321,-0.0149L -0.031,-0.015L 0.03,-0.015L 0.03,0.015","pos":[-0.11,0.15],"layers":["F.Cu"],"index":1},"A08":{"shape":"M -0.03,0.015L 0.03,0.015L 0.03,-0.015L -0.03,-0.015L -0.03,0.015","pos":[-0.11,0.1],"layers":["F.Cu"],"index":2},"A09":{"shape":"M -0.03,0.015L 0.03,0.015L 0.03,-0.015L -0.03,-0.015L -0.03,0.015","pos":[-0.11,0.05],"layers":["F.Cu"],"index":3},"A14":{"shape":"M -0.03,0.015L 0.03,0.015L 0.03,-0.015L -0.03,-0.015L -0.03,0.015","pos":[-0.11,0],"layers":["F.Cu"],"index":4},"A15":{"shape":"M -0.03,0.015L 0.03,0.015L 0.03,-0.015L -0.03,-0.015L -0.03,0.015","pos":[-0.11,-0.05],"layers":["F.Cu"],"index":5},"RST":{"shape":"M -0.03,0.015L 0.03,0.015L 0.03,-0.015L -0.03,-0.015L -0.03,0.015","pos":[-0.11,-0.1],"layers":["F.Cu"],"index":6},"CLK":{"shape":"M -0.03,0.015L 0.03,0.015L 0.03,-0.015L -0.03,-0.015L -0.03,0.015","pos":[-0.11,-0.15],"layers":["F.Cu"],"index":7},"DIO":{"shape":"M -0.03,0.015L 0.03,0.015L 0.03,-0.015L -0.03,-0.015L -0.03,0.015","pos":[0.11,-0.15],"layers":["F.Cu"],"index":8},"24-":{"shape":"M -0.03,0.015L 0.03,0.015L 0.03,-0.015L -0.03,-0.015L -0.03,0.015","pos":[0.11,-0.1],"layers":["F.Cu"],"index":9},"25+":{"shape":"M -0.03,0.015L 0.03,0.015L 0.03,-0.015L -0.03,-0.015L -0.03,0.015","pos":[0.11,-0.05],"layers":["F.Cu"],"index":10},"GND":{"shape":"M -0.03,0.015L 0.03,0.015L 0.03,-0.015L -0.03,-0.015L -0.03,0.015","pos":[0.11,0],"layers":["F.Cu"],"index":11},"VDD":{"shape":"M -0.03,0.015L 0.03,0.015L 0.03,-0.015L -0.03,-0.015L -0.03,0.015","pos":[0.11,0.05],"layers":["F.Cu"],"index":12},"A02":{"shape":"M -0.03,0.015L 0.03,0.015L 0.03,-0.015L -0.03,-0.015L -0.03,0.015","pos":[0.11,0.1],"layers":["F.Cu"],"index":13},"A04":{"shape":"M -0.03,0.015L 0.03,0.015L 0.03,-0.015L -0.03,-0.015L -0.03,0.015","pos":[0.11,0.15],"layers":["F.Cu"],"index":14}};
+const header_SWD_4_1 = {"CLK":{"shape":"M 0.05,0.025L -0.05,0.025L -0.0509,0.025L -0.0517,0.025L -0.0535,0.0248L -0.0552,0.0244L -0.056,0.0243L -0.0578,0.0237L -0.0593,0.0232L -0.0602,0.0229L -0.061,0.0225L -0.0618,0.0221L -0.0625,0.0216L -0.0633,0.0212L -0.064,0.0208L -0.0654,0.0197L -0.0661,0.0191L -0.0668,0.0186L -0.0686,0.0168L -0.0691,0.0161L -0.0697,0.0154L -0.0708,0.014L -0.0712,0.0133L -0.0716,0.0125L -0.0721,0.0118L -0.0725,0.011L -0.0729,0.0102L -0.0732,0.0093L -0.0737,0.0078L -0.0743,0.006L -0.0744,0.0052L -0.0748,0.0035L -0.075,0.0017L -0.075,0.0009L -0.075,0L -0.075,-0.0009L -0.075,-0.0017L -0.0748,-0.0035L -0.0744,-0.0052L -0.0743,-0.006L -0.0737,-0.0078L -0.0732,-0.0093L -0.0729,-0.0102L -0.0725,-0.011L -0.0721,-0.0118L -0.0716,-0.0125L -0.0712,-0.0133L -0.0708,-0.014L -0.0697,-0.0154L -0.0691,-0.0161L -0.0686,-0.0168L -0.0668,-0.0186L -0.0661,-0.0191L -0.0654,-0.0197L -0.064,-0.0208L -0.0633,-0.0212L -0.0625,-0.0216L -0.0618,-0.0221L -0.061,-0.0225L -0.0602,-0.0229L -0.0593,-0.0232L -0.0578,-0.0237L -0.056,-0.0243L -0.0552,-0.0244L -0.0535,-0.0248L -0.0517,-0.025L 0.05,-0.025L 0.05,0.025","pos":[-0.107,0.05],"layers":["F.Cu"],"index":1},"DIO":{"shape":"M -0.05,0.025L 0.05,0.025L 0.05,-0.025L -0.05,-0.025L -0.05,0.025","pos":[0.107,0.05],"layers":["F.Cu"],"index":2},"RST":{"shape":"M -0.05,0.025L 0.05,0.025L 0.05,-0.025L -0.05,-0.025L -0.05,0.025","pos":[-0.107,-0.05],"layers":["F.Cu"],"index":3},"GND":{"shape":"M -0.05,0.025L 0.05,0.025L 0.05,-0.025L -0.05,-0.025L -0.05,0.025","pos":[0.107,-0.05],"layers":["F.Cu"],"index":4}};
+const USB_A_plug = {"5V":{"shape":"M -0.05 0.02L 0.242 0.02L 0.242 -0.02L -0.05 -0.02L -0.05 0.02","pos":[0,0.138],"layers":["F.Cu"],"index":1},"D-":{"shape":"M -0.05 0.02L 0.202 0.02L 0.202 -0.02L -0.05 -0.02L -0.05 0.02","pos":[0,0.039],"layers":["F.Cu"],"index":2},"D+":{"shape":"M -0.05 0.02L 0.202 0.02L 0.202 -0.02L -0.05 -0.02L -0.05 0.02","pos":[0,-0.039],"layers":["F.Cu"],"index":3},"GND":{"shape":"M -0.05 0.02L 0.242 0.02L 0.242 -0.02L -0.05 -0.02L -0.05 0.02","pos":[0,-0.138],"layers":["F.Cu"],"index":4}};
+const regulator_SOT23 = {"out":{"shape":"M -0.02 0.012L 0.02 0.012L 0.02 -0.012L -0.02 -0.012L -0.02 0.012","pos":[-0.045,0.0375],"layers":["F.Cu"],"index":1},"in":{"shape":"M -0.02 0.012L 0.02 0.012L 0.02 -0.012L -0.02 -0.012L -0.02 0.012","pos":[-0.045,-0.0375],"layers":["F.Cu"],"index":2},"gnd":{"shape":"M -0.02 0.012L 0.02 0.012L 0.02 -0.012L -0.02 -0.012L -0.02 0.012","pos":[0.045,0],"layers":["F.Cu"],"index":3}};
+const C_1206 = {"1":{"shape":"M -0.032 0.034L 0.032 0.034L 0.032 -0.034L -0.032 -0.034L -0.032 0.034","pos":[-0.06,0],"layers":["F.Cu"],"index":1},"2":{"shape":"M -0.032 0.034L 0.032 0.034L 0.032 -0.034L -0.032 -0.034L -0.032 0.034","pos":[0.06,0],"layers":["F.Cu"],"index":2}};
+const test_fablab = {
+  "1": {
+    "shape": "M 0.3605,0.1997 0.3242,0.1798 V 0.0589 l -0.0673,-0.0352 c -0.0025,4.1077e-4 -0.0173,0.0144 -0.0209,0.0163 -0.0477,0.0266 -0.1179,-0.0085 -0.1571,-0.0789 -0.0392,-0.0704 -0.036,-0.1508 0.0119,-0.1774 0.0477,-0.0266 0.1187,0.0053 0.1579,0.0757 0.0065,0.0114 0.0148,0.0377 0.0187,0.0492 l 0.0574,0.0332 -3.4363e-4,-0.1259 -0.3158,-0.1844 1.6199e-4,-0.0416 c 0.0672,0.0019 0.1349,0.0202 0.197,0.0566 0.193,0.113 0.2605,0.3582 0.1547,0.5533 z",
+    "pos":[0.38, 0],
+    "origin": [0, 0],
+    "layers":["F.Cu"]
+  },
+  "2": {
+    "shape": "m -0.3658,0.2015 c -0.0324,-0.0589 -0.0508,-0.1266 -0.0508,-0.1986 0,-0.2237 0.1775,-0.4057 0.3993,-0.4131 l 3.641e-5,0.0426 -0.0849,0.0494 v 0.0986 c 0.0036,0.0014 0.0068,0.003 0.0101,0.0049 0.047,0.0277 0.0519,0.1064 0.0112,0.1758 -0.0409,0.0694 -0.1122,0.1032 -0.1592,0.0755 -0.047,-0.0277 -0.0519,-0.1064 -0.0112,-0.1758 0.0065,-0.0112 0.0141,-0.0214 0.022,-0.0307 v -0.0732 l -0.1013,0.058 v 0.3632 z",
+    "pos":[-0.16, -0.35],
+    "origin": [0, 0],
+    "layers":["F.Cu"]
+  },
+  "3": {
+    "shape": "m 0.0017,0.4166 c -0.1402,0.0016 -0.2773,-0.0684 -0.3559,-0.1952 l 0.036,-0.0227 0.0985,0.0603 0.0619,-0.0367 c -0.0012,-0.0102 -0.0013,-0.0214 -0.0012,-0.0252 5.539e-4,-0.0546 0.0745,-0.0961 0.155,-0.0952 0.0806,8.4458e-4 0.1379,0.0496 0.1375,0.0977 -4.5226e-4,0.0546 -0.0529,0.0973 -0.1335,0.0997 -0.0274,8.492e-4 -0.0536,-0.0047 -0.0655,-0.0069 l -0.0452,0.0289 0.1074,0.0613 0.3167,-0.1841 0.0363,0.0199 c -0.035,0.0575 -0.0844,0.1072 -0.1468,0.1431 -0.0636,0.0366 -0.1329,0.0544 -0.2013,0.0552 z",
+    "pos":[-0.2,0.3],
+    "origin": [0, 0],
+    "layers":["F.Cu"]
+  }
+}
+
+const qr_code = {
+  "code": {
+    "shape": pipe(
+      "M 0 0 l 5 0 l 0 5 l -5 0 Z M 5 0 l 5 0 l 0 5 l -5 0 Z M 10 0 l 5 0 l 0 5 l -5 0 Z M 15 0 l 5 0 l 0 5 l -5 0 Z M 20 0 l 5 0 l 0 5 l -5 0 Z M 25 0 l 5 0 l 0 5 l -5 0 Z M 30 0 l 5 0 l 0 5 l -5 0 Z M 55 0 l 5 0 l 0 5 l -5 0 Z M 60 0 l 5 0 l 0 5 l -5 0 Z M 65 0 l 5 0 l 0 5 l -5 0 Z M 70 0 l 5 0 l 0 5 l -5 0 Z M 85 0 l 5 0 l 0 5 l -5 0 Z M 90 0 l 5 0 l 0 5 l -5 0 Z M 95 0 l 5 0 l 0 5 l -5 0 Z M 110 0 l 5 0 l 0 5 l -5 0 Z M 115 0 l 5 0 l 0 5 l -5 0 Z M 120 0 l 5 0 l 0 5 l -5 0 Z M 125 0 l 5 0 l 0 5 l -5 0 Z M 130 0 l 5 0 l 0 5 l -5 0 Z M 135 0 l 5 0 l 0 5 l -5 0 Z M 140 0 l 5 0 l 0 5 l -5 0 Z M 0 5 l 5 0 l 0 5 l -5 0 Z M 30 5 l 5 0 l 0 5 l -5 0 Z M 40 5 l 5 0 l 0 5 l -5 0 Z M 50 5 l 5 0 l 0 5 l -5 0 Z M 60 5 l 5 0 l 0 5 l -5 0 Z M 70 5 l 5 0 l 0 5 l -5 0 Z M 75 5 l 5 0 l 0 5 l -5 0 Z M 80 5 l 5 0 l 0 5 l -5 0 Z M 85 5 l 5 0 l 0 5 l -5 0 Z M 100 5 l 5 0 l 0 5 l -5 0 Z M 110 5 l 5 0 l 0 5 l -5 0 Z M 140 5 l 5 0 l 0 5 l -5 0 Z M 0 10 l 5 0 l 0 5 l -5 0 Z M 10 10 l 5 0 l 0 5 l -5 0 Z M 15 10 l 5 0 l 0 5 l -5 0 Z M 20 10 l 5 0 l 0 5 l -5 0 Z M 30 10 l 5 0 l 0 5 l -5 0 Z M 45 10 l 5 0 l 0 5 l -5 0 Z M 55 10 l 5 0 l 0 5 l -5 0 Z M 60 10 l 5 0 l 0 5 l -5 0 Z M 70 10 l 5 0 l 0 5 l -5 0 Z M 75 10 l 5 0 l 0 5 l -5 0 Z M 80 10 l 5 0 l 0 5 l -5 0 Z M 100 10 l 5 0 l 0 5 l -5 0 Z M 110 10 l 5 0 l 0 5 l -5 0 Z M 120 10 l 5 0 l 0 5 l -5 0 Z M 125 10 l 5 0 l 0 5 l -5 0 Z M 130 10 l 5 0 l 0 5 l -5 0 Z M 140 10 l 5 0 l 0 5 l -5 0 Z M 0 15 l 5 0 l 0 5 l -5 0 Z M 10 15 l 5 0 l 0 5 l -5 0 Z M 15 15 l 5 0 l 0 5 l -5 0 Z M 20 15 l 5 0 l 0 5 l -5 0 Z M 30 15 l 5 0 l 0 5 l -5 0 Z M 40 15 l 5 0 l 0 5 l -5 0 Z M 50 15 l 5 0 l 0 5 l -5 0 Z M 65 15 l 5 0 l 0 5 l -5 0 Z M 70 15 l 5 0 l 0 5 l -5 0 Z M 75 15 l 5 0 l 0 5 l -5 0 Z M 85 15 l 5 0 l 0 5 l -5 0 Z M 95 15 l 5 0 l 0 5 l -5 0 Z M 110 15 l 5 0 l 0 5 l -5 0 Z M 120 15 l 5 0 l 0 5 l -5 0 Z M 125 15 l 5 0 l 0 5 l -5 0 Z M 130 15 l 5 0 l 0 5 l -5 0 Z M 140 15 l 5 0 l 0 5 l -5 0 Z M 0 20 l 5 0 l 0 5 l -5 0 Z M 10 20 l 5 0 l 0 5 l -5 0 Z M 15 20 l 5 0 l 0 5 l -5 0 Z M 20 20 l 5 0 l 0 5 l -5 0 Z M 30 20 l 5 0 l 0 5 l -5 0 Z M 55 20 l 5 0 l 0 5 l -5 0 Z M 80 20 l 5 0 l 0 5 l -5 0 Z M 95 20 l 5 0 l 0 5 l -5 0 Z M 100 20 l 5 0 l 0 5 l -5 0 Z M 110 20 l 5 0 l 0 5 l -5 0 Z M 120 20 l 5 0 l 0 5 l -5 0 Z M 125 20 l 5 0 l 0 5 l -5 0 Z M 130 20 l 5 0 l 0 5 l -5 0 Z M 140 20 l 5 0 l 0 5 l -5 0 Z M 0 25 l 5 0 l 0 5 l -5 0 Z M 30 25 l 5 0 l 0 5 l -5 0 Z M 40 25 l 5 0 l 0 5 l -5 0 Z M 65 25 l 5 0 l 0 5 l -5 0 Z M 70 25 l 5 0 l 0 5 l -5 0 Z M 75 25 l 5 0 l 0 5 l -5 0 Z M 85 25 l 5 0 l 0 5 l -5 0 Z M 90 25 l 5 0 l 0 5 l -5 0 Z M 100 25 l 5 0 l 0 5 l -5 0 Z M 110 25 l 5 0 l 0 5 l -5 0 Z M 140 25 l 5 0 l 0 5 l -5 0 Z M 0 30 l 5 0 l 0 5 l -5 0 Z M 5 30 l 5 0 l 0 5 l -5 0 Z M 10 30 l 5 0 l 0 5 l -5 0 Z M 15 30 l 5 0 l 0 5 l -5 0 Z M 20 30 l 5 0 l 0 5 l -5 0 Z M 25 30 l 5 0 l 0 5 l -5 0 Z M 30 30 l 5 0 l 0 5 l -5 0 Z M 40 30 l 5 0 l 0 5 l -5 0 Z M 50 30 l 5 0 l 0 5 l -5 0 Z M 60 30 l 5 0 l 0 5 l -5 0 Z M 70 30 l 5 0 l 0 5 l -5 0 Z M 80 30 l 5 0 l 0 5 l -5 0 Z M 90 30 l 5 0 l 0 5 l -5 0 Z M 100 30 l 5 0 l 0 5 l -5 0 Z M 110 30 l 5 0 l 0 5 l -5 0 Z M 115 30 l 5 0 l 0 5 l -5 0 Z M 120 30 l 5 0 l 0 5 l -5 0 Z M 125 30 l 5 0 l 0 5 l -5 0 Z M 130 30 l 5 0 l 0 5 l -5 0 Z M 135 30 l 5 0 l 0 5 l -5 0 Z M 140 30 l 5 0 l 0 5 l -5 0 Z M 45 35 l 5 0 l 0 5 l -5 0 Z M 75 35 l 5 0 l 0 5 l -5 0 Z M 80 35 l 5 0 l 0 5 l -5 0 Z M 95 35 l 5 0 l 0 5 l -5 0 Z M 100 35 l 5 0 l 0 5 l -5 0 Z M 0 40 l 5 0 l 0 5 l -5 0 Z M 5 40 l 5 0 l 0 5 l -5 0 Z M 10 40 l 5 0 l 0 5 l -5 0 Z M 15 40 l 5 0 l 0 5 l -5 0 Z M 20 40 l 5 0 l 0 5 l -5 0 Z M 30 40 l 5 0 l 0 5 l -5 0 Z M 35 40 l 5 0 l 0 5 l -5 0 Z M 40 40 l 5 0 l 0 5 l -5 0 Z M 50 40 l 5 0 l 0 5 l -5 0 Z M 60 40 l 5 0 l 0 5 l -5 0 Z M 65 40 l 5 0 l 0 5 l -5 0 Z M 70 40 l 5 0 l 0 5 l -5 0 Z M 85 40 l 5 0 l 0 5 l -5 0 Z M 95 40 l 5 0 l 0 5 l -5 0 Z M 105 40 l 5 0 l 0 5 l -5 0 Z M 115 40 l 5 0 l 0 5 l -5 0 Z M 125 40 l 5 0 l 0 5 l -5 0 Z M 135 40 l 5 0 l 0 5 l -5 0 Z M 0 45 l 5 0 l 0 5 l -5 0 Z M 5 45 l 5 0 l 0 5 l -5 0 Z M 10 45 l 5 0 l 0 5 l -5 0 Z M 15 45 l 5 0 l 0 5 l -5 0 Z M 35 45 l 5 0 l 0 5 l -5 0 Z M 45 45 l 5 0 l 0 5 l -5 0 Z M 50 45 l 5 0 l 0 5 l -5 0 Z M 55 45 l 5 0 l 0 5 l -5 0 Z M 80 45 l 5 0 l 0 5 l -5 0 Z M 95 45 l 5 0 l 0 5 l -5 0 Z M 100 45 l 5 0 l 0 5 l -5 0 Z M 105 45 l 5 0 l 0 5 l -5 0 Z M 110 45 l 5 0 l 0 5 l -5 0 Z M 115 45 l 5 0 l 0 5 l -5 0 Z M 120 45 l 5 0 l 0 5 l -5 0 Z M 140 45 l 5 0 l 0 5 l -5 0 Z M 10 50 l 5 0 l 0 5 l -5 0 Z M 15 50 l 5 0 l 0 5 l -5 0 Z M 25 50 l 5 0 l 0 5 l -5 0 Z M 30 50 l 5 0 l 0 5 l -5 0 Z M 40 50 l 5 0 l 0 5 l -5 0 Z M 75 50 l 5 0 l 0 5 l -5 0 Z M 80 50 l 5 0 l 0 5 l -5 0 Z M 85 50 l 5 0 l 0 5 l -5 0 Z M 100 50 l 5 0 l 0 5 l -5 0 Z M 105 50 l 5 0 l 0 5 l -5 0 Z M 115 50 l 5 0 l 0 5 l -5 0 Z M 120 50 l 5 0 l 0 5 l -5 0 Z M 0 55 l 5 0 l 0 5 l -5 0 Z M 5 55 l 5 0 l 0 5 l -5 0 Z M 15 55 l 5 0 l 0 5 l -5 0 Z M 20 55 l 5 0 l 0 5 l -5 0 Z M 25 55 l 5 0 l 0 5 l -5 0 Z M 40 55 l 5 0 l 0 5 l -5 0 Z M 45 55 l 5 0 l 0 5 l -5 0 Z M 50 55 l 5 0 l 0 5 l -5 0 Z M 60 55 l 5 0 l 0 5 l -5 0 Z M 70 55 l 5 0 l 0 5 l -5 0 Z M 75 55 l 5 0 l 0 5 l -5 0 Z M 90 55 l 5 0 l 0 5 l -5 0 Z M 95 55 l 5 0 l 0 5 l -5 0 Z M 110 55 l 5 0 l 0 5 l -5 0 Z M 115 55 l 5 0 l 0 5 l -5 0 Z M 125 55 l 5 0 l 0 5 l -5 0 Z M 135 55 l 5 0 l 0 5 l -5 0 Z M 0 60 l 5 0 l 0 5 l -5 0 Z M 10 60 l 5 0 l 0 5 l -5 0 Z M 15 60 l 5 0 l 0 5 l -5 0 Z M 25 60 l 5 0 l 0 5 l -5 0 Z M 30 60 l 5 0 l 0 5 l -5 0 Z M 45 60 l 5 0 l 0 5 l -5 0 Z M 55 60 l 5 0 l 0 5 l -5 0 Z M 60 60 l 5 0 l 0 5 l -5 0 Z M 65 60 l 5 0 l 0 5 l -5 0 Z M 70 60 l 5 0 l 0 5 l -5 0 Z M 85 60 l 5 0 l 0 5 l -5 0 Z M 125 60 l 5 0 l 0 5 l -5 0 Z M 130 60 l 5 0 l 0 5 l -5 0 Z M 0 65 l 5 0 l 0 5 l -5 0 Z M 10 65 l 5 0 l 0 5 l -5 0 Z M 15 65 l 5 0 l 0 5 l -5 0 Z M 20 65 l 5 0 l 0 5 l -5 0 Z M 25 65 l 5 0 l 0 5 l -5 0 Z M 35 65 l 5 0 l 0 5 l -5 0 Z M 40 65 l 5 0 l 0 5 l -5 0 Z M 55 65 l 5 0 l 0 5 l -5 0 Z M 80 65 l 5 0 l 0 5 l -5 0 Z M 90 65 l 5 0 l 0 5 l -5 0 Z M 95 65 l 5 0 l 0 5 l -5 0 Z M 100 65 l 5 0 l 0 5 l -5 0 Z M 105 65 l 5 0 l 0 5 l -5 0 Z M 110 65 l 5 0 l 0 5 l -5 0 Z M 115 65 l 5 0 l 0 5 l -5 0 Z M 120 65 l 5 0 l 0 5 l -5 0 Z M 140 65 l 5 0 l 0 5 l -5 0 Z M 5 70 l 5 0 l 0 5 l -5 0 Z M 20 70 l 5 0 l 0 5 l -5 0 Z M 30 70 l 5 0 l 0 5 l -5 0 Z M 35 70 l 5 0 l 0 5 l -5 0 Z M 40 70 l 5 0 l 0 5 l -5 0 Z M 60 70 l 5 0 l 0 5 l -5 0 Z M 65 70 l 5 0 l 0 5 l -5 0 Z M 75 70 l 5 0 l 0 5 l -5 0 Z M 85 70 l 5 0 l 0 5 l -5 0 Z M 115 70 l 5 0 l 0 5 l -5 0 Z M 125 70 l 5 0 l 0 5 l -5 0 Z M 130 70 l 5 0 l 0 5 l -5 0 Z M 0 75 l 5 0 l 0 5 l -5 0 Z M 5 75 l 5 0 l 0 5 l -5 0 Z M 10 75 l 5 0 l 0 5 l -5 0 Z M 15 75 l 5 0 l 0 5 l -5 0 Z M 25 75 l 5 0 l 0 5 l -5 0 Z M 40 75 l 5 0 l 0 5 l -5 0 Z M 45 75 l 5 0 l 0 5 l -5 0 Z M 50 75 l 5 0 l 0 5 l -5 0 Z M 55 75 l 5 0 l 0 5 l -5 0 Z M 60 75 l 5 0 l 0 5 l -5 0 Z M 80 75 l 5 0 l 0 5 l -5 0 Z M 95 75 l 5 0 l 0 5 l -5 0 Z M 100 75 l 5 0 l 0 5 l -5 0 Z M 115 75 l 5 0 l 0 5 l -5 0 Z M 135 75 l 5 0 l 0 5 l -5 0 Z M 0 80 l 5 0 l 0 5 l -5 0 Z M 15 80 l 5 0 l 0 5 l -5 0 Z M 25 80 l 5 0 l 0 5 l -5 0 Z M 30 80 l 5 0 l 0 5 l -5 0 Z M 40 80 l 5 0 l 0 5 l -5 0 Z M 45 80 l 5 0 l 0 5 l -5 0 Z M 50 80 l 5 0 l 0 5 l -5 0 Z M 55 80 l 5 0 l 0 5 l -5 0 Z M 65 80 l 5 0 l 0 5 l -5 0 Z M 70 80 l 5 0 l 0 5 l -5 0 Z M 75 80 l 5 0 l 0 5 l -5 0 Z M 85 80 l 5 0 l 0 5 l -5 0 Z M 90 80 l 5 0 l 0 5 l -5 0 Z M 95 80 l 5 0 l 0 5 l -5 0 Z M 125 80 l 5 0 l 0 5 l -5 0 Z M 130 80 l 5 0 l 0 5 l -5 0 Z M 0 85 l 5 0 l 0 5 l -5 0 Z M 10 85 l 5 0 l 0 5 l -5 0 Z M 15 85 l 5 0 l 0 5 l -5 0 Z M 20 85 l 5 0 l 0 5 l -5 0 Z M 35 85 l 5 0 l 0 5 l -5 0 Z M 50 85 l 5 0 l 0 5 l -5 0 Z M 55 85 l 5 0 l 0 5 l -5 0 Z M 65 85 l 5 0 l 0 5 l -5 0 Z M 80 85 l 5 0 l 0 5 l -5 0 Z M 85 85 l 5 0 l 0 5 l -5 0 Z M 90 85 l 5 0 l 0 5 l -5 0 Z M 95 85 l 5 0 l 0 5 l -5 0 Z M 105 85 l 5 0 l 0 5 l -5 0 Z M 110 85 l 5 0 l 0 5 l -5 0 Z M 115 85 l 5 0 l 0 5 l -5 0 Z M 120 85 l 5 0 l 0 5 l -5 0 Z M 130 85 l 5 0 l 0 5 l -5 0 Z M 140 85 l 5 0 l 0 5 l -5 0 Z M 0 90 l 5 0 l 0 5 l -5 0 Z M 20 90 l 5 0 l 0 5 l -5 0 Z M 25 90 l 5 0 l 0 5 l -5 0 Z M 30 90 l 5 0 l 0 5 l -5 0 Z M 35 90 l 5 0 l 0 5 l -5 0 Z M 40 90 l 5 0 l 0 5 l -5 0 Z M 70 90 l 5 0 l 0 5 l -5 0 Z M 75 90 l 5 0 l 0 5 l -5 0 Z M 80 90 l 5 0 l 0 5 l -5 0 Z M 100 90 l 5 0 l 0 5 l -5 0 Z M 110 90 l 5 0 l 0 5 l -5 0 Z M 115 90 l 5 0 l 0 5 l -5 0 Z M 120 90 l 5 0 l 0 5 l -5 0 Z M 130 90 l 5 0 l 0 5 l -5 0 Z M 0 95 l 5 0 l 0 5 l -5 0 Z M 20 95 l 5 0 l 0 5 l -5 0 Z M 35 95 l 5 0 l 0 5 l -5 0 Z M 40 95 l 5 0 l 0 5 l -5 0 Z M 45 95 l 5 0 l 0 5 l -5 0 Z M 50 95 l 5 0 l 0 5 l -5 0 Z M 80 95 l 5 0 l 0 5 l -5 0 Z M 105 95 l 5 0 l 0 5 l -5 0 Z M 115 95 l 5 0 l 0 5 l -5 0 Z M 120 95 l 5 0 l 0 5 l -5 0 Z M 135 95 l 5 0 l 0 5 l -5 0 Z M 0 100 l 5 0 l 0 5 l -5 0 Z M 15 100 l 5 0 l 0 5 l -5 0 Z M 20 100 l 5 0 l 0 5 l -5 0 Z M 30 100 l 5 0 l 0 5 l -5 0 Z M 35 100 l 5 0 l 0 5 l -5 0 Z M 40 100 l 5 0 l 0 5 l -5 0 Z M 45 100 l 5 0 l 0 5 l -5 0 Z M 50 100 l 5 0 l 0 5 l -5 0 Z M 60 100 l 5 0 l 0 5 l -5 0 Z M 65 100 l 5 0 l 0 5 l -5 0 Z M 70 100 l 5 0 l 0 5 l -5 0 Z M 80 100 l 5 0 l 0 5 l -5 0 Z M 85 100 l 5 0 l 0 5 l -5 0 Z M 95 100 l 5 0 l 0 5 l -5 0 Z M 100 100 l 5 0 l 0 5 l -5 0 Z M 105 100 l 5 0 l 0 5 l -5 0 Z M 110 100 l 5 0 l 0 5 l -5 0 Z M 115 100 l 5 0 l 0 5 l -5 0 Z M 120 100 l 5 0 l 0 5 l -5 0 Z M 130 100 l 5 0 l 0 5 l -5 0 Z M 135 100 l 5 0 l 0 5 l -5 0 Z M 140 100 l 5 0 l 0 5 l -5 0 Z M 40 105 l 5 0 l 0 5 l -5 0 Z M 45 105 l 5 0 l 0 5 l -5 0 Z M 55 105 l 5 0 l 0 5 l -5 0 Z M 95 105 l 5 0 l 0 5 l -5 0 Z M 100 105 l 5 0 l 0 5 l -5 0 Z M 120 105 l 5 0 l 0 5 l -5 0 Z M 125 105 l 5 0 l 0 5 l -5 0 Z M 130 105 l 5 0 l 0 5 l -5 0 Z M 135 105 l 5 0 l 0 5 l -5 0 Z M 140 105 l 5 0 l 0 5 l -5 0 Z M 0 110 l 5 0 l 0 5 l -5 0 Z M 5 110 l 5 0 l 0 5 l -5 0 Z M 10 110 l 5 0 l 0 5 l -5 0 Z M 15 110 l 5 0 l 0 5 l -5 0 Z M 20 110 l 5 0 l 0 5 l -5 0 Z M 25 110 l 5 0 l 0 5 l -5 0 Z M 30 110 l 5 0 l 0 5 l -5 0 Z M 40 110 l 5 0 l 0 5 l -5 0 Z M 45 110 l 5 0 l 0 5 l -5 0 Z M 50 110 l 5 0 l 0 5 l -5 0 Z M 60 110 l 5 0 l 0 5 l -5 0 Z M 75 110 l 5 0 l 0 5 l -5 0 Z M 80 110 l 5 0 l 0 5 l -5 0 Z M 90 110 l 5 0 l 0 5 l -5 0 Z M 95 110 l 5 0 l 0 5 l -5 0 Z M 100 110 l 5 0 l 0 5 l -5 0 Z M 110 110 l 5 0 l 0 5 l -5 0 Z M 120 110 l 5 0 l 0 5 l -5 0 Z M 125 110 l 5 0 l 0 5 l -5 0 Z M 130 110 l 5 0 l 0 5 l -5 0 Z M 0 115 l 5 0 l 0 5 l -5 0 Z M 30 115 l 5 0 l 0 5 l -5 0 Z M 45 115 l 5 0 l 0 5 l -5 0 Z M 50 115 l 5 0 l 0 5 l -5 0 Z M 55 115 l 5 0 l 0 5 l -5 0 Z M 60 115 l 5 0 l 0 5 l -5 0 Z M 70 115 l 5 0 l 0 5 l -5 0 Z M 80 115 l 5 0 l 0 5 l -5 0 Z M 90 115 l 5 0 l 0 5 l -5 0 Z M 95 115 l 5 0 l 0 5 l -5 0 Z M 100 115 l 5 0 l 0 5 l -5 0 Z M 120 115 l 5 0 l 0 5 l -5 0 Z M 0 120 l 5 0 l 0 5 l -5 0 Z M 10 120 l 5 0 l 0 5 l -5 0 Z M 15 120 l 5 0 l 0 5 l -5 0 Z M 20 120 l 5 0 l 0 5 l -5 0 Z M 30 120 l 5 0 l 0 5 l -5 0 Z M 40 120 l 5 0 l 0 5 l -5 0 Z M 45 120 l 5 0 l 0 5 l -5 0 Z M 60 120 l 5 0 l 0 5 l -5 0 Z M 65 120 l 5 0 l 0 5 l -5 0 Z M 70 120 l 5 0 l 0 5 l -5 0 Z M 85 120 l 5 0 l 0 5 l -5 0 Z M 100 120 l 5 0 l 0 5 l -5 0 Z M 105 120 l 5 0 l 0 5 l -5 0 Z M 110 120 l 5 0 l 0 5 l -5 0 Z M 115 120 l 5 0 l 0 5 l -5 0 Z M 120 120 l 5 0 l 0 5 l -5 0 Z M 130 120 l 5 0 l 0 5 l -5 0 Z M 0 125 l 5 0 l 0 5 l -5 0 Z M 10 125 l 5 0 l 0 5 l -5 0 Z M 15 125 l 5 0 l 0 5 l -5 0 Z M 20 125 l 5 0 l 0 5 l -5 0 Z M 30 125 l 5 0 l 0 5 l -5 0 Z M 40 125 l 5 0 l 0 5 l -5 0 Z M 45 125 l 5 0 l 0 5 l -5 0 Z M 55 125 l 5 0 l 0 5 l -5 0 Z M 90 125 l 5 0 l 0 5 l -5 0 Z M 95 125 l 5 0 l 0 5 l -5 0 Z M 100 125 l 5 0 l 0 5 l -5 0 Z M 125 125 l 5 0 l 0 5 l -5 0 Z M 130 125 l 5 0 l 0 5 l -5 0 Z M 140 125 l 5 0 l 0 5 l -5 0 Z M 0 130 l 5 0 l 0 5 l -5 0 Z M 10 130 l 5 0 l 0 5 l -5 0 Z M 15 130 l 5 0 l 0 5 l -5 0 Z M 20 130 l 5 0 l 0 5 l -5 0 Z M 30 130 l 5 0 l 0 5 l -5 0 Z M 40 130 l 5 0 l 0 5 l -5 0 Z M 45 130 l 5 0 l 0 5 l -5 0 Z M 65 130 l 5 0 l 0 5 l -5 0 Z M 75 130 l 5 0 l 0 5 l -5 0 Z M 85 130 l 5 0 l 0 5 l -5 0 Z M 90 130 l 5 0 l 0 5 l -5 0 Z M 95 130 l 5 0 l 0 5 l -5 0 Z M 100 130 l 5 0 l 0 5 l -5 0 Z M 110 130 l 5 0 l 0 5 l -5 0 Z M 115 130 l 5 0 l 0 5 l -5 0 Z M 120 130 l 5 0 l 0 5 l -5 0 Z M 125 130 l 5 0 l 0 5 l -5 0 Z M 130 130 l 5 0 l 0 5 l -5 0 Z M 135 130 l 5 0 l 0 5 l -5 0 Z M 0 135 l 5 0 l 0 5 l -5 0 Z M 30 135 l 5 0 l 0 5 l -5 0 Z M 40 135 l 5 0 l 0 5 l -5 0 Z M 50 135 l 5 0 l 0 5 l -5 0 Z M 55 135 l 5 0 l 0 5 l -5 0 Z M 100 135 l 5 0 l 0 5 l -5 0 Z M 105 135 l 5 0 l 0 5 l -5 0 Z M 120 135 l 5 0 l 0 5 l -5 0 Z M 125 135 l 5 0 l 0 5 l -5 0 Z M 135 135 l 5 0 l 0 5 l -5 0 Z M 0 140 l 5 0 l 0 5 l -5 0 Z M 5 140 l 5 0 l 0 5 l -5 0 Z M 10 140 l 5 0 l 0 5 l -5 0 Z M 15 140 l 5 0 l 0 5 l -5 0 Z M 20 140 l 5 0 l 0 5 l -5 0 Z M 25 140 l 5 0 l 0 5 l -5 0 Z M 30 140 l 5 0 l 0 5 l -5 0 Z M 40 140 l 5 0 l 0 5 l -5 0 Z M 45 140 l 5 0 l 0 5 l -5 0 Z M 55 140 l 5 0 l 0 5 l -5 0 Z M 70 140 l 5 0 l 0 5 l -5 0 Z M 75 140 l 5 0 l 0 5 l -5 0 Z M 85 140 l 5 0 l 0 5 l -5 0 Z M 95 140 l 5 0 l 0 5 l -5 0 Z M 105 140 l 5 0 l 0 5 l -5 0 Z M 110 140 l 5 0 l 0 5 l -5 0 Z M 115 140 l 5 0 l 0 5 l -5 0 Z M 130 140 l 5 0 l 0 5 l -5 0 Z",
+      x => geo.pathD([], x),
+      x => geo.scale(x, 0.002),
+      x => geo.originate(x),
+      x => geo.translate(x, pt(0, 0)),
+      geo.getPathData,
+    ),
+    "pos": [0, 0],
+    "origin": [0, 0],
+    "layers": ["F.Cu"]
+  }
+}
+
+// commands:
+//  - SHIFT+ENTER: render
+//  - drap & drop file: kicad import
+
+
+// constants
+const width = 2.54 // board width
+const height = 1.78 // board height
+const [x, y] = pt(-1.85,-1.4); // x origin
+// const y = -height/2 // y origin
+const zt = 0 // top z
+const zb = -0.06 // bottom z
+const rv = 0.017 // via size
+const rp = 0.031 // pad size
+const w = .015 // wire width
+const mask = .004 // solder mask size
+const border = 0 // rendering border
+
+
+/* -- DECLARE_PCB -- */
+let board = new PCB();
+
+/* -- ADD_COMPONENTS -- */
+board.add(qr_code, { translate: pt(-1.5, -0.6), rotate: 0, name: "qr_code" })
+let R1 = board.add(R_1206, { translate: pt(-0.02482028, -0.8121274), rotate: 24, name: "R1" })
+let LED1 = board.add(LED_1206, { translate: pt(-0.19264138, -0.81919355), rotate: 295, name: "LED1" })
+let fab = board.add(test_fablab, { translate: pt(-0.81171559, -0.57349695)});
+let IC1 = board.add(SAMD11C, {translate: pt(-0.04403899, -0.31184937), name: 'IC1\nD11C'});
+let J1 = board.add(header_SWD_4_1, {translate: pt(IC1.posX+0, IC1.padY("CLK")-0.15), name: 'J1 SWD'});
+let J2 = board.add(USB_A_plug, {translate: pt(-0.05916114, 0.01358479), rotate: 90, name: 'J2\nUSB'});
+let IC2 = board.add(regulator_SOT23, {translate: pt(IC1.padX("A04")+.15, IC1.padY("A08")-.005), rotate: 90, name: 'IC2\n3.3V'});
+let C1 = board.add(C_1206, {translate: pt(IC2.posX, IC2.posY-0.2), rotate: 90, name: 'C1\n1uF'});
+
+let interior = geo.translate(geo.rectangle(0.48, 0.58), [J2.posX, J2.posY]);
+
+
+let interior2 = path([-0.2, -0.04],
+                     ["bezier", [-3.7, -0.10],
+                                [0.42, 0.17],
+                                [-4.89,  -4.05],
+                                [3.27, -0.84],
+                                [0.10, -0.4],
+                                [0.62, -0.04],
+                                [0.0, -0.04]],
+                    [0.2, -0.04]);
+
+board.addShape("interior", interior);
+board.addShape("interior", interior2);
+
+/* -- ADD_WIRES -- */
+board.wire(path(J1.pad("CLK"),
+            ["bezier", [IC1.padX("CLK")-0.05, J1.padY("CLK")+0.08]],
+            IC1.pad("CLK"),), w)
+
+board.wire(path(J1.pad("DIO"),
+            ["bezier", [IC1.padX("DIO")+0.05, J1.padY("DIO")+0.08]],
+            IC1.pad("DIO"),), w)
+
+board.wire(path(J1.pad("RST"),
+            ["bezier", [IC1.padX("RST")-0.17, J1.padY("RST")-0.06],
+                        [IC1.padX("RST")-0.14, IC1.padY("RST")+0.05],],
+            IC1.pad("RST"),), w)
+
+board.wire(path(J2.pad("D-"),
+            ["bezier", [J2.padX("D-")+0.023, J2.padY("D-")-0.09],
+                        [IC1.posX-0.054, J2.padY("D-")-0.109],
+                        [IC1.posX-0.097, IC1.padY("24-")-0.027]],
+            IC1.pad("24-"),), w)
+
+board.wire(path(J2.pad("D+"),
+            ["bezier", [J2.padX("D+")+0.01, J2.padY("D+")-0.15],
+                        [IC1.posX-0.059, J2.padY("D+")-0.1],
+                        [IC1.posX-0.016, IC1.padY("25+")-0.06]],
+            IC1.pad("25+"),), w)
+
+board.wire(path(J2.pad("GND"),
+            ["bezier", [J2.padX("GND"), J2.padY("GND")-0.29],
+                        [IC1.posX+0.01, J2.padY("GND")+0.09],
+                        [IC1.posX-0.005, IC1.padY("GND")-0.09]],
+            IC1.pad("GND"),), w)
+
+board.wire(path(IC1.pad("VDD"),
+            [IC2.padX("out"), IC1.padY("VDD")],
+            IC2.pad("out"),), w)
+
+board.wire(path(J2.pad("GND"),
+            ["bezier", [J2.padX("GND"), J2.padY("GND")-0.19],
+                        [IC2.padX("gnd"), J2.padY("GND")-0.1]],
+            IC2.pad("gnd"),), w)
+
+board.wire(path(IC1.pad("VDD"),
+            ["bezier", [C1.padX("1")-0.01, IC1.padY("VDD")],
+                        [C1.padX("1")-0.15, C1.padY("1")],
+                        ],
+            C1.pad("1"),), w)
+
+board.wire(path(IC2.pad("gnd"),
+            C1.pad("2"),), w)
+
+board.wire(path(C1.pad("2"),
+            ["bezier", [C1.padX("2")+0.11, C1.padY("2")-0.05],
+                        [C1.padX("2")+0.16, J1.padY("GND")-0.03],
+                        [J1.padX("GND"), J1.padY("GND")-0.01]],
+            J1.pad("GND"),), w)
+
+board.wire(path(fab.pad("3"),
+            ["bezier", [fab.padX("3")+0.21, fab.padY("3")+0.4],
+                        [fab.padX("3")+0.64, fab.padY("3")-0.15],
+                        [IC1.padX("A05")-0.32, IC1.padY("A05")]],
+            IC1.pad("A05"),), w);
+
+board.wire(path(fab.pad("1"),
+            ["bezier", [fab.padX("1")+0.2, fab.padY("1")+0.04],
+                        [IC1.padX("A14")-0.29, IC1.padY("A14")-0.01]],
+            IC1.pad("A14"),), w);
+
+board.wire(path(R1.pad("2"),
+            ["bezier", [R1.padX("2")+0.12, R1.padY("2")+0.01]],
+            J1.pad("GND"),), w);
+
+board.wire(path(R1.pad("1"),
+            LED1.pad("C"),), w);
+
+
+board.wire(path(LED1.pad("A"),
+            ["bezier", [LED1.padX("A")+0.34, LED1.padY("A")+0.03],
+                        [J1.padX("DIO")-0.21, J1.padY("DIO")+0.02]],
+            J1.pad("DIO"),), w);
+
+board.wire(path(fab.pad("2"),
+            ["bezier", [fab.padX("2")+0.42, fab.padY("2")-0.43],
+                        [fab.padX("1")+0.37, fab.padY("1")+0.11],
+                        [IC1.padX("A15")-0.3, IC1.padY("A15")-0.01]],
+            IC1.pad("A15"),), w);
+
+board.wire(path(J2.pad("5V"),
+            ["bezier", [J2.padX("5V"), J2.padY("5V")-0.44],
+                        [fab.posX-0.27, fab.padY("1")+0.92]],
+            [fab.posX-0.47, fab.padY("1")+0.1],
+            ["bezier", [fab.posX-0.56, fab.padY("1")-0.91],
+                        [IC2.padX("in")+0.06, IC2.padY("in")-0.79],
+                        [J1.padX("GND")-1.07, J1.padY("GND")-0.26],
+                        [IC2.padX("in")+0.54, IC2.padY("in")-0.74]],
+            IC2.pad("in"),), w);
+
+/* -- RENDER_PCB -- */
+renderPCB({
+  pcb: board,
+  layerColors: {
+    "interior": "#002d00ff",
+    "B.Cu": "#ff4c007f",
+    "F.Cu": "#ff8c00cc",
+    "drill": "#ff3300e5",
+    // "padLabels": "#ffff99e5",
+    // "componentLabels": "#00e5e5e5",
+  },
+  limits: {
+    x: [x-border, x+width+border],
+    y: [y-border, y+height+border]
+  },
+  mm_per_unit: 25.4
+})
diff --git a/js/events/download.js b/js/events/download.js
index e66c62c..7894dc0 100644
--- a/js/events/download.js
+++ b/js/events/download.js
@@ -78,7 +78,7 @@ export function downloadGerber(state) {
     else return x;
   }).flat();
 
-  const drill = layers["drill"].flat().map( x => {
+  const drill = (layers["drill"] ? layers["drill"] : []).flat().map( x => {
 
     const getCenter = (pts) => {
       let totalX = 0;
diff --git a/js/view.js b/js/view.js
index ac3f8c4..e35ee69 100644
--- a/js/view.js
+++ b/js/view.js
@@ -64,7 +64,7 @@ const menu = state => html`
 					</div class="menu-item">
 					<div class="menu-item"
 						@click=${() => downloadGerber(state)}>
-						gerber
+						gerber (WIP)
 					</div class="menu-item">
 					<input 
 						class="input-item"