@tscircuit/schematic-trace-solver 0.0.98 → 0.0.100

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (26) hide show
  1. package/dist/index.d.ts +1 -0
  2. package/dist/index.js +335 -225
  3. package/lib/solvers/MspConnectionPairSolver/MspConnectionPairSolver.ts +19 -9
  4. package/lib/solvers/SchematicTraceLinesSolver/SchematicTraceSingleLineSolver2/SchematicTraceSingleLineSolver2.ts +43 -1
  5. package/lib/solvers/SchematicTraceLinesSolver/SchematicTraceSingleLineSolver2/generateEndpointCollisionDetours.ts +84 -0
  6. package/lib/solvers/SchematicTraceLinesSolver/SchematicTraceSingleLineSolver2/mid.ts +13 -3
  7. package/package.json +1 -1
  8. package/tests/bug-reports/bug-report-20260706T220324Z/__snapshots__/bug-report-20260706T220324Z.snap.svg +18 -18
  9. package/tests/bug-reports/bug-report-20260707T092615Z/__snapshots__/bug-report-20260707T092615Z.snap.svg +7 -7
  10. package/tests/bug-reports/bug-report-20260707T134549Z/__snapshots__/bug-report-20260707T134549Z.snap.svg +5 -7
  11. package/tests/bug-reports/bug-report-20260707T140410Z/__snapshots__/bug-report-20260707T140410Z.snap.svg +6 -12
  12. package/tests/examples/__snapshots__/example09.snap.svg +9 -13
  13. package/tests/examples/__snapshots__/example21.snap.svg +30 -32
  14. package/tests/examples/__snapshots__/example29.snap.svg +13 -19
  15. package/tests/repros/__snapshots__/repro129-host-custom-symbol-passives.snap.svg +60 -0
  16. package/tests/repros/__snapshots__/repro47-endpoint-obstacle-detour.snap.svg +65 -0
  17. package/tests/repros/__snapshots__/repro5-escape-padded-text-obstacles.snap.svg +74 -0
  18. package/tests/repros/assets/repro129-host-custom-symbol-passives.input.json +94 -0
  19. package/tests/repros/assets/repro47-endpoint-obstacle-detour.input.json +133 -0
  20. package/tests/repros/assets/repro5-escape-padded-text-obstacles.input.json +202 -0
  21. package/tests/repros/repro129-host-custom-symbol-passives.test.ts +16 -0
  22. package/tests/repros/repro47-endpoint-obstacle-detour.test.ts +19 -0
  23. package/tests/repros/repro5-escape-padded-text-obstacles.test.ts +17 -0
  24. package/tests/solvers/MspConnectionPairSolver/msp-connection-pair-solver-direct-connection-distance.test.ts +46 -0
  25. package/tests/solvers/SchematicTraceSingleLineSolver2/candidate-mids-from-set.test.ts +39 -0
  26. package/tests/solvers/SchematicTraceSingleLineSolver2/generate-endpoint-collision-detours.test.ts +38 -0
@@ -0,0 +1,60 @@
1
+ <svg width="640" height="640" viewBox="0 0 640 640" xmlns="http://www.w3.org/2000/svg"><rect width="100%" height="100%" fill="white"/><g><polyline data-points="0.9000000000000004,1.25 1.9700000000000002,1.1099999999999999" data-type="line" data-label="" points="312.06477732793525,134.84480431848863 473.7921727395411,156.00539811066136" fill="none" stroke="hsl(248, 100%, 50%, 0.8)" stroke-width="1px"/></g><g><polyline data-points="0.9000000000000004,0.8499999999999999 1.9000000000000004,-0.7" data-type="line" data-label="" points="312.06477732793525,195.30364372469646 463.2118758434548,429.5816464237517" fill="none" stroke="hsl(248, 100%, 50%, 0.8)" stroke-width="1px"/></g><g><polyline data-points="0.9000000000000004,0.44999999999999996 1.9700000000000002,0.3500000000000001" data-type="line" data-label="" points="312.06477732793525,255.76248313090423 473.7921727395411,270.87719298245617" fill="none" stroke="hsl(248, 100%, 50%, 0.8)" stroke-width="1px"/></g><g><polyline data-points="0.9000000000000004,-1.3000000000000003 1.9000000000000004,-1.3" data-type="line" data-label="" points="312.06477732793525,520.2699055330635 463.2118758434548,520.2699055330634" fill="none" stroke="hsl(248, 100%, 50%, 0.8)" stroke-width="1px"/></g><g><polyline data-points="0.9000000000000004,1.25 1.9700000000000002,1.25 1.9700000000000002,1.1099999999999999" data-type="line" data-label="" points="312.06477732793525,134.84480431848863 473.7921727395411,134.84480431848863 473.7921727395411,156.00539811066136" fill="none" stroke="purple" stroke-width="1px"/></g><g><polyline data-points="0.9000000000000004,0.8499999999999999 1.2725000000000004,0.8499999999999999 1.2725000000000004,0.05000000000000007 1.9000000000000004,0.05000000000000007 1.9000000000000004,-0.7" data-type="line" data-label="" points="312.06477732793525,195.30364372469646 368.36707152496626,195.30364372469646 368.36707152496626,316.22132253711203 463.2118758434548,316.22132253711203 463.2118758434548,429.5816464237517" fill="none" stroke="purple" stroke-width="1px"/></g><g><polyline data-points="0.9000000000000004,0.44999999999999996 1.4350000000000003,0.44999999999999996 1.4350000000000003,0.2500000000000001 1.9700000000000002,0.2500000000000001 1.9700000000000002,0.3500000000000001" data-type="line" data-label="" points="312.06477732793525,255.76248313090423 392.9284750337382,255.76248313090423 392.9284750337382,285.9919028340081 473.7921727395411,285.9919028340081 473.7921727395411,270.87719298245617" fill="none" stroke="purple" stroke-width="1px"/></g><g><polyline data-points="0.9000000000000004,-1.3000000000000003 1.9000000000000004,-1.3" data-type="line" data-label="" points="312.06477732793525,520.2699055330635 463.2118758434548,520.2699055330634" fill="none" stroke="purple" stroke-width="1px"/></g><g><rect data-type="rect" data-label="schematic_component_0" data-x="1.9975000000000005" data-y="-1" x="414.08906882591106" y="429.58164642375175" width="127.71929824561391" height="90.68825910931167" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.00661607142857143"/></g><g><rect data-type="rect" data-label="schematic_component_1" data-x="2.2250000000000005" data-y="0.73" x="424.66936572199734" y="156.00539811066136" width="175.33063427800266" height="114.8717948717948" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.00661607142857143"/></g><g><rect data-type="rect" data-label="schematic_component_2" data-x="0" data-y="0" x="40" y="74.3859649122808" width="272.06477732793525" height="498.78542510121446" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.00661607142857143"/></g><g><rect data-type="rect" data-label="netId: .HOST &gt; .pin2 to R1.pin1
2
+ globalConnNetId: connectivity_net1" data-x="1.2725000000000004" data-y="-0.17499999999999993" x="353.25236167341427" y="316.22132253711203" width="30.22941970310393" height="68.0161943319838" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.00661607142857143"/></g><g><rect data-type="rect" data-label="netId: .HOST &gt; .pin4 to R1.pin2
3
+ globalConnNetId: connectivity_net3" data-x="1.4000000000000004" data-y="-1.0750000000000002" x="372.52361673414305" y="452.2537112010797" width="30.22941970310393" height="68.0161943319838" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.00661607142857143"/></g><g><rect data-type="rect" data-label="netId: .HOST &gt; .pin1 to C1.pin1
4
+ globalConnNetId: connectivity_net0" data-x="1.9700000000000002" data-y="1.475" x="458.6774628879891" y="66.82860998650477" width="30.229419703103986" height="68.01619433198385" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.00661607142857143"/></g><g><rect data-type="rect" data-label="netId: .HOST &gt; .pin3 to C1.pin2
5
+ globalConnNetId: connectivity_net2" data-x="1.4000000000000004" data-y="0.6749999999999999" x="372.52361673414305" y="187.7462887989205" width="30.22941970310393" height="68.01619433198377" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.00661607142857143"/></g><g><circle data-type="point" data-label="R1.1
6
+ y+" data-x="1.9000000000000004" data-y="-0.7" cx="463.2118758434548" cy="429.5816464237517" r="3" fill="hsl(226, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="R1.2
7
+ y-" data-x="1.9000000000000004" data-y="-1.3" cx="463.2118758434548" cy="520.2699055330634" r="3" fill="hsl(227, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="C1.1
8
+ y+" data-x="1.9700000000000002" data-y="1.1099999999999999" cx="473.7921727395411" cy="156.00539811066136" r="3" fill="hsl(121, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="C1.2
9
+ y-" data-x="1.9700000000000002" data-y="0.3500000000000001" cx="473.7921727395411" cy="270.87719298245617" r="3" fill="hsl(122, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="HOST.pin1
10
+ x+" data-x="0.9000000000000004" data-y="1.25" cx="312.06477732793525" cy="134.84480431848863" r="3" fill="hsl(50, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="HOST.pin2
11
+ x+" data-x="0.9000000000000004" data-y="0.8499999999999999" cx="312.06477732793525" cy="195.30364372469646" r="3" fill="hsl(51, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="HOST.pin3
12
+ x+" data-x="0.9000000000000004" data-y="0.44999999999999996" cx="312.06477732793525" cy="255.76248313090423" r="3" fill="hsl(52, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="HOST.pin4
13
+ x+" data-x="0.9000000000000004" data-y="-1.3000000000000003" cx="312.06477732793525" cy="520.2699055330635" r="3" fill="hsl(53, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="anchorPoint
14
+ orientation: y-" data-x="1.2725000000000004" data-y="0.05000000000000007" cx="368.36707152496626" cy="316.22132253711203" r="3" fill="hsl(40, 100%, 50%, 0.9)"/></g><g><circle data-type="point" data-label="anchorPoint
15
+ orientation: y+" data-x="1.4000000000000004" data-y="-1.3000000000000003" cx="387.63832658569504" cy="520.2699055330635" r="3" fill="hsl(40, 100%, 50%, 0.9)"/></g><g><circle data-type="point" data-label="anchorPoint
16
+ orientation: y+" data-x="1.9700000000000002" data-y="1.25" cx="473.7921727395411" cy="134.84480431848863" r="3" fill="hsl(40, 100%, 50%, 0.9)"/></g><g><circle data-type="point" data-label="anchorPoint
17
+ orientation: y+" data-x="1.4000000000000004" data-y="0.44999999999999996" cx="387.63832658569504" cy="255.76248313090423" r="3" fill="hsl(40, 100%, 50%, 0.9)"/></g><g id="crosshair" style="display: none"><line id="crosshair-h" y1="0" y2="640" stroke="#666" stroke-width="0.5"/><line id="crosshair-v" x1="0" x2="640" stroke="#666" stroke-width="0.5"/><text id="coordinates" font-family="monospace" font-size="12" fill="#666"></text></g><script><![CDATA[
18
+ document.currentScript.parentElement.addEventListener('mousemove', (e) => {
19
+ const svg = e.currentTarget;
20
+ const rect = svg.getBoundingClientRect();
21
+ const x = e.clientX - rect.left;
22
+ const y = e.clientY - rect.top;
23
+ const crosshair = svg.getElementById('crosshair');
24
+ const h = svg.getElementById('crosshair-h');
25
+ const v = svg.getElementById('crosshair-v');
26
+ const coords = svg.getElementById('coordinates');
27
+
28
+ crosshair.style.display = 'block';
29
+ h.setAttribute('x1', '0');
30
+ h.setAttribute('x2', '640');
31
+ h.setAttribute('y1', y);
32
+ h.setAttribute('y2', y);
33
+ v.setAttribute('x1', x);
34
+ v.setAttribute('x2', x);
35
+ v.setAttribute('y1', '0');
36
+ v.setAttribute('y2', '640');
37
+
38
+ // Calculate real coordinates using inverse transformation
39
+ const matrix = {"a":151.14709851551953,"c":0,"e":176.03238866396762,"b":0,"d":-151.14709851551953,"f":323.778677462888};
40
+ // Manually invert and apply the affine transform
41
+ // Since we only use translate and scale, we can directly compute:
42
+ // x' = (x - tx) / sx
43
+ // y' = (y - ty) / sy
44
+ const sx = matrix.a;
45
+ const sy = matrix.d;
46
+ const tx = matrix.e;
47
+ const ty = matrix.f;
48
+ const realPoint = {
49
+ x: (x - tx) / sx,
50
+ y: (y - ty) / sy // Flip y back since we used negative scale
51
+ }
52
+
53
+ coords.textContent = `(${realPoint.x.toFixed(2)}, ${realPoint.y.toFixed(2)})`;
54
+ coords.setAttribute('x', (x + 5).toString());
55
+ coords.setAttribute('y', (y - 5).toString());
56
+ });
57
+ document.currentScript.parentElement.addEventListener('mouseleave', () => {
58
+ document.currentScript.parentElement.getElementById('crosshair').style.display = 'none';
59
+ });
60
+ ]]></script></svg>
@@ -0,0 +1,65 @@
1
+ <svg width="640" height="640" viewBox="0 0 640 640" xmlns="http://www.w3.org/2000/svg"><rect width="100%" height="100%" fill="white"/><g><polyline data-points="0.6499999999999999,0.825 -0.6499999999999999,-0.825" data-type="line" data-label="" points="410.65315315315314,198.6036036036036 205.6981981981982,458.7387387387388" fill="none" stroke="hsl(224, 100%, 50%, 0.8)" stroke-width="1px"/></g><g><polyline data-points="1.25,0.825 -1.25,-0.825" data-type="line" data-label="" points="505.2477477477478,198.6036036036036 111.1036036036036,458.7387387387388" fill="none" stroke="hsl(224, 100%, 50%, 0.8)" stroke-width="1px"/></g><g><polyline data-points="0.49999999999999994,-0.725 -1.25,0.825" data-type="line" data-label="" points="387.0045045045045,442.97297297297297 111.1036036036036,198.6036036036036" fill="none" stroke="hsl(168, 100%, 50%, 0.8)" stroke-width="1px"/></g><g><polyline data-points="1.4,-0.725 -0.6499999999999999,0.825" data-type="line" data-label="" points="528.8963963963964,442.97297297297297 205.6981981981982,198.6036036036036" fill="none" stroke="hsl(168, 100%, 50%, 0.8)" stroke-width="1px"/></g><g><polyline data-points="0.6499999999999999,0.825 0,0.825 0,-0.825 -0.6499999999999999,-0.825" data-type="line" data-label="" points="410.65315315315314,198.6036036036036 308.1756756756757,198.6036036036036 308.1756756756757,458.7387387387388 205.6981981981982,458.7387387387388" fill="none" stroke="purple" stroke-width="1px"/></g><g><polyline data-points="1.25,0.825 1.4500000000000002,0.825 1.4500000000000002,0 -1.45,0 -1.45,-0.825 -1.25,-0.825" data-type="line" data-label="" points="505.2477477477478,198.6036036036036 536.7792792792793,198.6036036036036 536.7792792792793,328.6711711711712 79.57207207207207,328.6711711711712 79.57207207207207,458.7387387387388 111.1036036036036,458.7387387387388" fill="none" stroke="purple" stroke-width="1px"/></g><g><rect data-type="rect" data-label="schematic_component_0" data-x="-0.95" data-y="0.825" x="111.10360360360359" y="145" width="94.59459459459461" height="107.20720720720723" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.006342857142857142"/></g><g><rect data-type="rect" data-label="schematic_component_1" data-x="0.95" data-y="0.825" x="410.6531531531532" y="145" width="94.59459459459464" height="107.20720720720723" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.006342857142857142"/></g><g><rect data-type="rect" data-label="schematic_component_2" data-x="-0.95" data-y="-0.825" x="111.10360360360359" y="405.13513513513516" width="94.59459459459461" height="107.20720720720726" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.006342857142857142"/></g><g><rect data-type="rect" data-label="schematic_component_3" data-x="0.95" data-y="-0.825" x="387.00450450450455" y="414.9290282263514" width="141.89189189189193" height="87.61942102477474" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.006342857142857142"/></g><g><rect data-type="rect" data-label="netId: .J1 &gt; .pin1 to .R1 &gt; .pin1
2
+ globalConnNetId: connectivity_net2" data-x="0.2739999999999999" data-y="-0.725" x="315.9009009009009" y="427.20720720720715" width="70.94594594594594" height="31.531531531531584" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.006342857142857142"/></g><g><rect data-type="rect" data-label="netId: .J1 &gt; .pin1 to .R1 &gt; .pin1
3
+ globalConnNetId: connectivity_net2" data-x="-1.476" data-y="0.825" x="39.999999999999986" y="182.8378378378378" width="70.94594594594597" height="31.531531531531556" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.006342857142857142"/></g><g><rect data-type="rect" data-label="netId: .J1 &gt; .pin3 to .R1 &gt; .pin2
4
+ globalConnNetId: connectivity_net3" data-x="1.626" data-y="-0.725" x="529.0540540540542" y="427.20720720720715" width="70.94594594594594" height="31.531531531531584" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.006342857142857142"/></g><g><rect data-type="rect" data-label="netId: .J1 &gt; .pin3 to .R1 &gt; .pin2
5
+ globalConnNetId: connectivity_net3" data-x="-0.42399999999999993" data-y="0.825" x="205.85585585585585" y="182.8378378378378" width="70.94594594594594" height="31.531531531531556" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.006342857142857142"/></g><g><rect data-type="rect" data-label="netId: .R2 &gt; .pin1 to .R3 &gt; .pin2
6
+ globalConnNetId: connectivity_net0" data-x="0.32499999999999996" data-y="1.05" x="343.64864864864865" y="127.65765765765765" width="31.531531531531527" height="70.94594594594597" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.006342857142857142"/></g><g><rect data-type="rect" data-label="netId: .R2 &gt; .pin2 to .R3 &gt; .pin1
7
+ globalConnNetId: connectivity_net1" data-x="1.4500000000000002" data-y="1.05" x="521.0135135135135" y="127.65765765765765" width="31.531531531531527" height="70.94594594594597" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.006342857142857142"/></g><g><circle data-type="point" data-label="R1.1
8
+ x-" data-x="-1.25" data-y="0.825" cx="111.1036036036036" cy="198.6036036036036" r="3" fill="hsl(226, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="R1.2
9
+ x+" data-x="-0.6499999999999999" data-y="0.825" cx="205.6981981981982" cy="198.6036036036036" r="3" fill="hsl(227, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="R2.1
10
+ x-" data-x="0.6499999999999999" data-y="0.825" cx="410.65315315315314" cy="198.6036036036036" r="3" fill="hsl(107, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="R2.2
11
+ x+" data-x="1.25" data-y="0.825" cx="505.2477477477478" cy="198.6036036036036" r="3" fill="hsl(108, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="R3.1
12
+ x-" data-x="-1.25" data-y="-0.825" cx="111.1036036036036" cy="458.7387387387388" r="3" fill="hsl(348, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="R3.2
13
+ x+" data-x="-0.6499999999999999" data-y="-0.825" cx="205.6981981981982" cy="458.7387387387388" r="3" fill="hsl(349, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="J1.1
14
+ x-" data-x="0.49999999999999994" data-y="-0.725" cx="387.0045045045045" cy="442.97297297297297" r="3" fill="hsl(218, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="J1.2
15
+ y-" data-x="0.95" data-y="-1.1028787352499998" cx="457.9504504504505" cy="502.5484492511261" r="3" fill="hsl(219, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="J1.3
16
+ x+" data-x="1.4" data-y="-0.725" cx="528.8963963963964" cy="442.97297297297297" r="3" fill="hsl(220, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="anchorPoint
17
+ orientation: x-" data-x="0.49999999999999994" data-y="-0.725" cx="387.0045045045045" cy="442.97297297297297" r="3" fill="hsl(40, 100%, 50%, 0.9)"/></g><g><circle data-type="point" data-label="anchorPoint
18
+ orientation: x-" data-x="-1.25" data-y="0.825" cx="111.1036036036036" cy="198.6036036036036" r="3" fill="hsl(40, 100%, 50%, 0.9)"/></g><g><circle data-type="point" data-label="anchorPoint
19
+ orientation: x+" data-x="1.4" data-y="-0.725" cx="528.8963963963964" cy="442.97297297297297" r="3" fill="hsl(40, 100%, 50%, 0.9)"/></g><g><circle data-type="point" data-label="anchorPoint
20
+ orientation: x+" data-x="-0.6499999999999999" data-y="0.825" cx="205.6981981981982" cy="198.6036036036036" r="3" fill="hsl(40, 100%, 50%, 0.9)"/></g><g><circle data-type="point" data-label="anchorPoint
21
+ orientation: y+" data-x="0.32499999999999996" data-y="0.825" cx="359.4144144144144" cy="198.6036036036036" r="3" fill="hsl(40, 100%, 50%, 0.9)"/></g><g><circle data-type="point" data-label="anchorPoint
22
+ orientation: y+" data-x="1.4500000000000002" data-y="0.825" cx="536.7792792792793" cy="198.6036036036036" r="3" fill="hsl(40, 100%, 50%, 0.9)"/></g><g id="crosshair" style="display: none"><line id="crosshair-h" y1="0" y2="640" stroke="#666" stroke-width="0.5"/><line id="crosshair-v" x1="0" x2="640" stroke="#666" stroke-width="0.5"/><text id="coordinates" font-family="monospace" font-size="12" fill="#666"></text></g><script><![CDATA[
23
+ document.currentScript.parentElement.addEventListener('mousemove', (e) => {
24
+ const svg = e.currentTarget;
25
+ const rect = svg.getBoundingClientRect();
26
+ const x = e.clientX - rect.left;
27
+ const y = e.clientY - rect.top;
28
+ const crosshair = svg.getElementById('crosshair');
29
+ const h = svg.getElementById('crosshair-h');
30
+ const v = svg.getElementById('crosshair-v');
31
+ const coords = svg.getElementById('coordinates');
32
+
33
+ crosshair.style.display = 'block';
34
+ h.setAttribute('x1', '0');
35
+ h.setAttribute('x2', '640');
36
+ h.setAttribute('y1', y);
37
+ h.setAttribute('y2', y);
38
+ v.setAttribute('x1', x);
39
+ v.setAttribute('x2', x);
40
+ v.setAttribute('y1', '0');
41
+ v.setAttribute('y2', '640');
42
+
43
+ // Calculate real coordinates using inverse transformation
44
+ const matrix = {"a":157.65765765765767,"c":0,"e":308.1756756756757,"b":0,"d":-157.65765765765767,"f":328.6711711711712};
45
+ // Manually invert and apply the affine transform
46
+ // Since we only use translate and scale, we can directly compute:
47
+ // x' = (x - tx) / sx
48
+ // y' = (y - ty) / sy
49
+ const sx = matrix.a;
50
+ const sy = matrix.d;
51
+ const tx = matrix.e;
52
+ const ty = matrix.f;
53
+ const realPoint = {
54
+ x: (x - tx) / sx,
55
+ y: (y - ty) / sy // Flip y back since we used negative scale
56
+ }
57
+
58
+ coords.textContent = `(${realPoint.x.toFixed(2)}, ${realPoint.y.toFixed(2)})`;
59
+ coords.setAttribute('x', (x + 5).toString());
60
+ coords.setAttribute('y', (y - 5).toString());
61
+ });
62
+ document.currentScript.parentElement.addEventListener('mouseleave', () => {
63
+ document.currentScript.parentElement.getElementById('crosshair').style.display = 'none';
64
+ });
65
+ ]]></script></svg>
@@ -0,0 +1,74 @@
1
+ <svg width="640" height="640" viewBox="0 0 640 640" xmlns="http://www.w3.org/2000/svg"><rect width="100%" height="100%" fill="white"/><g><polyline data-points="2.52,1 -0.9,0.7999999999999999" data-type="line" data-label="" points="476.7266775777414,259.0507364975451 163.27332242225856,277.3813420621932" fill="none" stroke="hsl(248, 100%, 50%, 0.8)" stroke-width="1px"/></g><g><polyline data-points="2.5200000000000005,1 2.7200000000000006,1 2.7200000000000006,3.3900000000000006 -1.1,3.3900000000000006 -1.1,0.7999999999999999 -0.9,0.7999999999999999" data-type="line" data-label="" points="476.7266775777414,259.0507364975451 495.0572831423895,259.0507364975451 495.0572831423895,40 144.94271685761043,40 144.94271685761043,277.3813420621932 163.27332242225856,277.3813420621932" fill="none" stroke="purple" stroke-width="1px"/></g><g><rect data-type="rect" data-label="schematic_component_0" data-x="0" data-y="0" x="163.27332242225856" y="121.57119476268417" width="164.97545008183306" height="458.26513911620293" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.010910714285714287"/></g><g><rect data-type="rect" data-label="schematic_component_1" data-x="2" data-y="1.0699999999999998" x="381.40752864157116" y="221.4729950900164" width="95.31914893617022" height="62.324058919803605" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.010910714285714287"/></g><g><rect data-type="rect" data-label="part-number" data-x="0.15999999999999992" data-y="-2.63" x="199.93453355155478" y="583.5024549918166" width="120.98199672667755" height="16.49754500818335" fill="rgba(160, 0, 220, 0.14)" stroke="black" stroke-width="0.010910714285714287"/></g><g><rect data-type="rect" data-label="U1" data-x="-0.38" data-y="2.615" x="194.43535188216038" y="99.57446808510645" width="32.99509001636659" height="22.91325695581014" fill="rgba(160, 0, 220, 0.14)" stroke="black" stroke-width="0.010910714285714287"/></g><g><rect data-type="rect" data-label="netId: .LED1 &gt; port.right to .U1 &gt; .pin20
2
+ globalConnNetId: connectivity_net0" data-x="2.6200000000000006" data-y="0.775" x="476.7266775777414" y="259.0507364975451" width="18.330605564648124" height="41.243862520458265" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.010910714285714287"/></g><g><circle data-type="point" data-label="U1.1
3
+ x+" data-x="0.9" data-y="1.2" cx="328.2487725040916" cy="240.72013093289695" r="3" fill="hsl(319, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="U1.2
4
+ x+" data-x="0.9" data-y="0.3999999999999999" cx="328.2487725040916" cy="314.04255319148945" r="3" fill="hsl(320, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="U1.3
5
+ x+" data-x="0.9" data-y="0.5999999999999999" cx="328.2487725040916" cy="295.7119476268413" r="3" fill="hsl(321, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="U1.4
6
+ x-" data-x="-0.9" data-y="0.3999999999999999" cx="163.27332242225856" cy="314.04255319148945" r="3" fill="hsl(322, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="U1.5
7
+ x+" data-x="0.9" data-y="0.9999999999999998" cx="328.2487725040916" cy="259.0507364975451" r="3" fill="hsl(323, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="U1.6
8
+ x+" data-x="0.9" data-y="-0.19999999999999996" cx="328.2487725040916" cy="369.03436988543376" r="3" fill="hsl(324, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="U1.7
9
+ x-" data-x="-0.9" data-y="-0.7999999999999998" cx="163.27332242225856" cy="424.0261865793781" r="3" fill="hsl(325, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="U1.9
10
+ x+" data-x="0.9" data-y="0.19999999999999996" cx="328.2487725040916" cy="332.3731587561375" r="3" fill="hsl(327, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="U1.10
11
+ x+" data-x="0.9" data-y="0" cx="328.2487725040916" cy="350.70376432078564" r="3" fill="hsl(217, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="U1.11
12
+ x+" data-x="0.9" data-y="0.7999999999999998" cx="328.2487725040916" cy="277.3813420621932" r="3" fill="hsl(218, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="U1.12
13
+ x+" data-x="0.9" data-y="-1.2" cx="328.2487725040916" cy="460.6873977086743" r="3" fill="hsl(219, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="U1.13
14
+ x+" data-x="0.9" data-y="-1" cx="328.2487725040916" cy="442.3567921440262" r="3" fill="hsl(220, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="U1.14
15
+ x+" data-x="0.9" data-y="-0.7999999999999999" cx="328.2487725040916" cy="424.0261865793781" r="3" fill="hsl(221, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="U1.15
16
+ x-" data-x="-0.9" data-y="1" cx="163.27332242225856" cy="259.0507364975451" r="3" fill="hsl(222, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="U1.16
17
+ x-" data-x="-0.9" data-y="1.2" cx="163.27332242225856" cy="240.72013093289695" r="3" fill="hsl(223, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="U1.17
18
+ x-" data-x="-0.9" data-y="0.5999999999999999" cx="163.27332242225856" cy="295.7119476268413" r="3" fill="hsl(224, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="U1.18
19
+ x-" data-x="-0.9" data-y="-0.9999999999999998" cx="163.27332242225856" cy="442.3567921440262" r="3" fill="hsl(225, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="U1.19
20
+ x-" data-x="-0.9" data-y="-0.19999999999999996" cx="163.27332242225856" cy="369.03436988543376" r="3" fill="hsl(226, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="U1.20
21
+ x-" data-x="-0.9" data-y="0.7999999999999999" cx="163.27332242225856" cy="277.3813420621932" r="3" fill="hsl(248, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="U1.21
22
+ x-" data-x="-0.9" data-y="-1.2" cx="163.27332242225856" cy="460.6873977086743" r="3" fill="hsl(249, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="U1.22
23
+ x+" data-x="0.9" data-y="-0.5999999999999999" cx="328.2487725040916" cy="405.69558101472995" r="3" fill="hsl(250, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="U1.23
24
+ x+" data-x="0.9" data-y="-0.3999999999999999" cx="328.2487725040916" cy="387.36497545008183" r="3" fill="hsl(251, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="U1.25
25
+ x-" data-x="-0.9" data-y="-0.5999999999999999" cx="163.27332242225856" cy="405.69558101472995" r="3" fill="hsl(253, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="U1.26
26
+ x-" data-x="-0.9" data-y="-0.3999999999999999" cx="163.27332242225856" cy="387.36497545008183" r="3" fill="hsl(254, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="U1.27
27
+ x-" data-x="-0.9" data-y="0.19999999999999996" cx="163.27332242225856" cy="332.3731587561375" r="3" fill="hsl(255, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="U1.28
28
+ x-" data-x="-0.9" data-y="0" cx="163.27332242225856" cy="350.70376432078564" r="3" fill="hsl(256, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="LED1.1
29
+ x-" data-x="1.48" data-y="1" cx="381.40752864157116" cy="259.0507364975451" r="3" fill="hsl(57, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="LED1.2
30
+ x+" data-x="2.52" data-y="1" cx="476.7266775777414" cy="259.0507364975451" r="3" fill="hsl(58, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="anchorPoint
31
+ orientation: y-" data-x="2.6200000000000006" data-y="1" cx="485.8919803600654" cy="259.0507364975451" r="3" fill="hsl(40, 100%, 50%, 0.9)"/></g><g id="crosshair" style="display: none"><line id="crosshair-h" y1="0" y2="640" stroke="#666" stroke-width="0.5"/><line id="crosshair-v" x1="0" x2="640" stroke="#666" stroke-width="0.5"/><text id="coordinates" font-family="monospace" font-size="12" fill="#666"></text></g><script><![CDATA[
32
+ document.currentScript.parentElement.addEventListener('mousemove', (e) => {
33
+ const svg = e.currentTarget;
34
+ const rect = svg.getBoundingClientRect();
35
+ const x = e.clientX - rect.left;
36
+ const y = e.clientY - rect.top;
37
+ const crosshair = svg.getElementById('crosshair');
38
+ const h = svg.getElementById('crosshair-h');
39
+ const v = svg.getElementById('crosshair-v');
40
+ const coords = svg.getElementById('coordinates');
41
+
42
+ crosshair.style.display = 'block';
43
+ h.setAttribute('x1', '0');
44
+ h.setAttribute('x2', '640');
45
+ h.setAttribute('y1', y);
46
+ h.setAttribute('y2', y);
47
+ v.setAttribute('x1', x);
48
+ v.setAttribute('x2', x);
49
+ v.setAttribute('y1', '0');
50
+ v.setAttribute('y2', '640');
51
+
52
+ // Calculate real coordinates using inverse transformation
53
+ const matrix = {"a":91.65302782324058,"c":0,"e":245.7610474631751,"b":0,"d":-91.65302782324058,"f":350.70376432078564};
54
+ // Manually invert and apply the affine transform
55
+ // Since we only use translate and scale, we can directly compute:
56
+ // x' = (x - tx) / sx
57
+ // y' = (y - ty) / sy
58
+ const sx = matrix.a;
59
+ const sy = matrix.d;
60
+ const tx = matrix.e;
61
+ const ty = matrix.f;
62
+ const realPoint = {
63
+ x: (x - tx) / sx,
64
+ y: (y - ty) / sy // Flip y back since we used negative scale
65
+ }
66
+
67
+ coords.textContent = `(${realPoint.x.toFixed(2)}, ${realPoint.y.toFixed(2)})`;
68
+ coords.setAttribute('x', (x + 5).toString());
69
+ coords.setAttribute('y', (y - 5).toString());
70
+ });
71
+ document.currentScript.parentElement.addEventListener('mouseleave', () => {
72
+ document.currentScript.parentElement.getElementById('crosshair').style.display = 'none';
73
+ });
74
+ ]]></script></svg>
@@ -0,0 +1,94 @@
1
+ {
2
+ "chips": [
3
+ {
4
+ "chipId": "schematic_component_0",
5
+ "center": { "x": 1.9975000000000005, "y": -1 },
6
+ "width": 0.845,
7
+ "height": 0.6000000000000001,
8
+ "pins": [
9
+ {
10
+ "pinId": "R1.1",
11
+ "x": 1.9000000000000004,
12
+ "y": -0.7,
13
+ "_facingDirection": "y+"
14
+ },
15
+ {
16
+ "pinId": "R1.2",
17
+ "x": 1.9000000000000004,
18
+ "y": -1.3,
19
+ "_facingDirection": "y-"
20
+ }
21
+ ]
22
+ },
23
+ {
24
+ "chipId": "schematic_component_1",
25
+ "center": { "x": 2.2250000000000005, "y": 0.73 },
26
+ "width": 1.1600000000000004,
27
+ "height": 0.7599999999999998,
28
+ "pins": [
29
+ {
30
+ "pinId": "C1.1",
31
+ "x": 1.9700000000000002,
32
+ "y": 1.1099999999999999,
33
+ "_facingDirection": "y+"
34
+ },
35
+ {
36
+ "pinId": "C1.2",
37
+ "x": 1.9700000000000002,
38
+ "y": 0.3500000000000001,
39
+ "_facingDirection": "y-"
40
+ }
41
+ ]
42
+ },
43
+ {
44
+ "chipId": "schematic_component_2",
45
+ "center": { "x": 0, "y": 0 },
46
+ "width": 1.8000000000000007,
47
+ "height": 3.3,
48
+ "pins": [
49
+ {
50
+ "pinId": "HOST.pin1",
51
+ "x": 0.9000000000000004,
52
+ "y": 1.25
53
+ },
54
+ {
55
+ "pinId": "HOST.pin2",
56
+ "x": 0.9000000000000004,
57
+ "y": 0.8499999999999999
58
+ },
59
+ {
60
+ "pinId": "HOST.pin3",
61
+ "x": 0.9000000000000004,
62
+ "y": 0.44999999999999996
63
+ },
64
+ {
65
+ "pinId": "HOST.pin4",
66
+ "x": 0.9000000000000004,
67
+ "y": -1.3000000000000003
68
+ }
69
+ ]
70
+ }
71
+ ],
72
+ "directConnections": [
73
+ {
74
+ "pinIds": ["HOST.pin1", "C1.1"],
75
+ "netId": ".HOST > .pin1 to C1.pin1"
76
+ },
77
+ {
78
+ "pinIds": ["HOST.pin2", "R1.1"],
79
+ "netId": ".HOST > .pin2 to R1.pin1"
80
+ },
81
+ {
82
+ "pinIds": ["HOST.pin3", "C1.2"],
83
+ "netId": ".HOST > .pin3 to C1.pin2"
84
+ },
85
+ {
86
+ "pinIds": ["HOST.pin4", "R1.2"],
87
+ "netId": ".HOST > .pin4 to R1.pin2"
88
+ }
89
+ ],
90
+ "netConnections": [],
91
+ "textBoxes": [],
92
+ "availableNetLabelOrientations": {},
93
+ "maxMspPairDistance": 2.4
94
+ }
@@ -0,0 +1,133 @@
1
+ {
2
+ "chips": [
3
+ {
4
+ "chipId": "schematic_component_0",
5
+ "center": {
6
+ "x": -0.95,
7
+ "y": 0.825
8
+ },
9
+ "width": 0.6000000000000001,
10
+ "height": 0.6800000000000002,
11
+ "pins": [
12
+ {
13
+ "pinId": "R1.1",
14
+ "x": -1.25,
15
+ "y": 0.825,
16
+ "_facingDirection": "x-"
17
+ },
18
+ {
19
+ "pinId": "R1.2",
20
+ "x": -0.6499999999999999,
21
+ "y": 0.825,
22
+ "_facingDirection": "x+"
23
+ }
24
+ ]
25
+ },
26
+ {
27
+ "chipId": "schematic_component_1",
28
+ "center": {
29
+ "x": 0.95,
30
+ "y": 0.825
31
+ },
32
+ "width": 0.6000000000000001,
33
+ "height": 0.6800000000000002,
34
+ "pins": [
35
+ {
36
+ "pinId": "R2.1",
37
+ "x": 0.6499999999999999,
38
+ "y": 0.825,
39
+ "_facingDirection": "x-"
40
+ },
41
+ {
42
+ "pinId": "R2.2",
43
+ "x": 1.25,
44
+ "y": 0.825,
45
+ "_facingDirection": "x+"
46
+ }
47
+ ]
48
+ },
49
+ {
50
+ "chipId": "schematic_component_2",
51
+ "center": {
52
+ "x": -0.95,
53
+ "y": -0.825
54
+ },
55
+ "width": 0.6000000000000001,
56
+ "height": 0.6800000000000002,
57
+ "pins": [
58
+ {
59
+ "pinId": "R3.1",
60
+ "x": -1.25,
61
+ "y": -0.825,
62
+ "_facingDirection": "x-"
63
+ },
64
+ {
65
+ "pinId": "R3.2",
66
+ "x": -0.6499999999999999,
67
+ "y": -0.825,
68
+ "_facingDirection": "x+"
69
+ }
70
+ ]
71
+ },
72
+ {
73
+ "chipId": "schematic_component_3",
74
+ "center": {
75
+ "x": 0.95,
76
+ "y": -0.825
77
+ },
78
+ "width": 0.9,
79
+ "height": 0.5557574704999997,
80
+ "pins": [
81
+ {
82
+ "pinId": "J1.1",
83
+ "x": 0.49999999999999994,
84
+ "y": -0.725
85
+ },
86
+ {
87
+ "pinId": "J1.2",
88
+ "x": 0.95,
89
+ "y": -1.1028787352499998
90
+ },
91
+ {
92
+ "pinId": "J1.3",
93
+ "x": 1.4,
94
+ "y": -0.725
95
+ }
96
+ ]
97
+ }
98
+ ],
99
+ "directConnections": [
100
+ {
101
+ "pinIds": [
102
+ "R2.1",
103
+ "R3.2"
104
+ ],
105
+ "netId": ".R2 > .pin1 to .R3 > .pin2"
106
+ },
107
+ {
108
+ "pinIds": [
109
+ "R2.2",
110
+ "R3.1"
111
+ ],
112
+ "netId": ".R2 > .pin2 to .R3 > .pin1"
113
+ },
114
+ {
115
+ "pinIds": [
116
+ "J1.1",
117
+ "R1.1"
118
+ ],
119
+ "netId": ".J1 > .pin1 to .R1 > .pin1"
120
+ },
121
+ {
122
+ "pinIds": [
123
+ "J1.3",
124
+ "R1.2"
125
+ ],
126
+ "netId": ".J1 > .pin3 to .R1 > .pin2"
127
+ }
128
+ ],
129
+ "netConnections": [],
130
+ "textBoxes": [],
131
+ "availableNetLabelOrientations": {},
132
+ "maxMspPairDistance": 5
133
+ }