@tscircuit/schematic-trace-solver 0.0.56 → 0.0.60

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.
@@ -0,0 +1,124 @@
1
+ {
2
+ "chips": [
3
+ {
4
+ "chipId": "schematic_component_0",
5
+ "center": {
6
+ "x": 0,
7
+ "y": 0
8
+ },
9
+ "width": 1.3,
10
+ "height": 1,
11
+ "pins": [
12
+ {
13
+ "pinId": "U1.1",
14
+ "x": -1.05,
15
+ "y": 0.30000000000000004
16
+ },
17
+ {
18
+ "pinId": "U1.2",
19
+ "x": -1.05,
20
+ "y": 0.10000000000000003
21
+ },
22
+ {
23
+ "pinId": "U1.3",
24
+ "x": -1.05,
25
+ "y": -0.09999999999999998
26
+ },
27
+ {
28
+ "pinId": "U1.4",
29
+ "x": -1.05,
30
+ "y": -0.30000000000000004
31
+ },
32
+ {
33
+ "pinId": "U1.5",
34
+ "x": 1.05,
35
+ "y": -0.30000000000000004
36
+ },
37
+ {
38
+ "pinId": "U1.6",
39
+ "x": 1.05,
40
+ "y": -0.10000000000000003
41
+ },
42
+ {
43
+ "pinId": "U1.7",
44
+ "x": 1.05,
45
+ "y": 0.09999999999999998
46
+ },
47
+ {
48
+ "pinId": "U1.8",
49
+ "x": 1.05,
50
+ "y": 0.30000000000000004
51
+ }
52
+ ]
53
+ },
54
+ {
55
+ "chipId": "schematic_component_1",
56
+ "center": {
57
+ "x": 2,
58
+ "y": 2
59
+ },
60
+ "width": 1.3,
61
+ "height": 1,
62
+ "pins": [
63
+ {
64
+ "pinId": "U2.1",
65
+ "x": 0.95,
66
+ "y": 2.3
67
+ },
68
+ {
69
+ "pinId": "U2.2",
70
+ "x": 0.95,
71
+ "y": 2.1
72
+ },
73
+ {
74
+ "pinId": "U2.3",
75
+ "x": 0.95,
76
+ "y": 1.9
77
+ },
78
+ {
79
+ "pinId": "U2.4",
80
+ "x": 0.95,
81
+ "y": 1.7
82
+ },
83
+ {
84
+ "pinId": "U2.5",
85
+ "x": 3.05,
86
+ "y": 1.7
87
+ },
88
+ {
89
+ "pinId": "U2.6",
90
+ "x": 3.05,
91
+ "y": 1.9
92
+ },
93
+ {
94
+ "pinId": "U2.7",
95
+ "x": 3.05,
96
+ "y": 2.1
97
+ },
98
+ {
99
+ "pinId": "U2.8",
100
+ "x": 3.05,
101
+ "y": 2.3
102
+ }
103
+ ]
104
+ }
105
+ ],
106
+ "directConnections": [
107
+ {
108
+ "pinIds": ["U1.6", "U2.8"],
109
+ "netId": "U1.CLK to U2.VCC",
110
+ "netLabelWidth": 1
111
+ }
112
+ ],
113
+ "netConnections": [
114
+ {
115
+ "netId": "VCC",
116
+ "pinIds": ["U1.5", "U1.8"],
117
+ "netLabelWidth": 0.48
118
+ }
119
+ ],
120
+ "availableNetLabelOrientations": {
121
+ "VCC": ["y+"]
122
+ },
123
+ "maxMspPairDistance": 2.4
124
+ }
@@ -0,0 +1,113 @@
1
+ <svg width="640" height="640" viewBox="0 0 640 640" xmlns="http://www.w3.org/2000/svg">
2
+ <rect width="100%" height="100%" fill="white" />
3
+ <g>
4
+ <circle data-type="point" data-label="U1.1
5
+ x+" data-x="1.1" data-y="0.30000000000000004" cx="487.83715012722644" cy="248.75318066157763" r="3" fill="hsl(319, 100%, 50%, 0.8)" />
6
+ </g>
7
+ <g>
8
+ <circle data-type="point" data-label="U1.2
9
+ x+" data-x="1.1" data-y="0.09999999999999998" cx="487.83715012722644" cy="289.46564885496184" r="3" fill="hsl(320, 100%, 50%, 0.8)" />
10
+ </g>
11
+ <g>
12
+ <circle data-type="point" data-label="U1.3
13
+ x+" data-x="1.1" data-y="-0.10000000000000003" cx="487.83715012722644" cy="330.17811704834605" r="3" fill="hsl(321, 100%, 50%, 0.8)" />
14
+ </g>
15
+ <g>
16
+ <circle data-type="point" data-label="U1.4
17
+ x+" data-x="1.1" data-y="-0.30000000000000004" cx="487.83715012722644" cy="370.89058524173026" r="3" fill="hsl(322, 100%, 50%, 0.8)" />
18
+ </g>
19
+ <g>
20
+ <circle data-type="point" data-label="" data-x="1.1" data-y="0.30000000000000004" cx="487.83715012722644" cy="248.75318066157763" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
21
+ </g>
22
+ <g>
23
+ <circle data-type="point" data-label="" data-x="1.1" data-y="0.09999999999999998" cx="487.83715012722644" cy="289.46564885496184" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
24
+ </g>
25
+ <g>
26
+ <circle data-type="point" data-label="" data-x="1.5510000000000002" data-y="0.4009999999999999" cx="579.6437659033079" cy="228.1933842239186" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
27
+ </g>
28
+ <g>
29
+ <circle data-type="point" data-label="" data-x="1.201" data-y="-0.5010000000000001" cx="508.39694656488547" cy="411.80661577608146" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
30
+ </g>
31
+ <g>
32
+ <polyline data-points="1.1,-0.10000000000000003 1.5510000000000002,-0.10000000000000003 1.5510000000000002,0.4009999999999999" data-type="line" data-label="" points="487.83715012722644,330.17811704834605 579.6437659033079,330.17811704834605 579.6437659033079,228.1933842239186" fill="none" stroke="purple" stroke-width="1" />
33
+ </g>
34
+ <g>
35
+ <polyline data-points="1.1,-0.30000000000000004 1.201,-0.30000000000000004 1.201,-0.5010000000000001" data-type="line" data-label="" points="487.83715012722644,370.89058524173026 508.39694656488547,370.89058524173026 508.39694656488547,411.80661577608146" fill="none" stroke="purple" stroke-width="1" />
36
+ </g>
37
+ <g>
38
+ <rect data-type="rect" data-label="schematic_component_0" data-x="0" data-y="0" x="40" y="208.04071246819342" width="447.83715012722644" height="203.56234096692106" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.004912500000000001" />
39
+ </g>
40
+ <g>
41
+ <rect data-type="rect" data-label="netId: SCL
42
+ globalConnNetId: connectivity_net0" data-x="1.326" data-y="0.30000000000000004" x="488.0407124681933" y="228.39694656488552" width="91.60305343511459" height="40.71246819338421" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.004912500000000001" />
43
+ </g>
44
+ <g>
45
+ <rect data-type="rect" data-label="netId: SDA
46
+ globalConnNetId: connectivity_net1" data-x="1.326" data-y="0.09999999999999998" x="488.0407124681933" y="269.10941475826974" width="91.60305343511459" height="40.71246819338421" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.004912500000000001" />
47
+ </g>
48
+ <g>
49
+ <rect data-type="rect" data-label="netId: V3_3
50
+ globalConnNetId: connectivity_net2" data-x="1.5510000000000002" data-y="0.6259999999999999" x="559.2875318066158" y="136.59033078880412" width="40.71246819338421" height="91.60305343511448" fill="#ef444466" stroke="#ef4444" stroke-width="0.004912500000000001" />
51
+ </g>
52
+ <g>
53
+ <rect data-type="rect" data-label="netId: GND
54
+ globalConnNetId: connectivity_net3" data-x="1.201" data-y="-0.7260000000000001" x="488.0407124681933" y="411.80661577608146" width="40.71246819338421" height="91.60305343511448" fill="#00000066" stroke="#000000" stroke-width="0.004912500000000001" />
55
+ </g>
56
+ <g id="crosshair" style="display: none">
57
+ <line id="crosshair-h" y1="0" y2="640" stroke="#666" stroke-width="0.5" />
58
+ <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>
59
+ </g>
60
+ <script>
61
+ <![CDATA[
62
+ document.currentScript.parentElement.addEventListener('mousemove', (e) => {
63
+ const svg = e.currentTarget;
64
+ const rect = svg.getBoundingClientRect();
65
+ const x = e.clientX - rect.left;
66
+ const y = e.clientY - rect.top;
67
+ const crosshair = svg.getElementById('crosshair');
68
+ const h = svg.getElementById('crosshair-h');
69
+ const v = svg.getElementById('crosshair-v');
70
+ const coords = svg.getElementById('coordinates');
71
+
72
+ crosshair.style.display = 'block';
73
+ h.setAttribute('x1', '0');
74
+ h.setAttribute('x2', '640');
75
+ h.setAttribute('y1', y);
76
+ h.setAttribute('y2', y);
77
+ v.setAttribute('x1', x);
78
+ v.setAttribute('x2', x);
79
+ v.setAttribute('y1', '0');
80
+ v.setAttribute('y2', '640');
81
+
82
+ // Calculate real coordinates using inverse transformation
83
+ const matrix = {
84
+ "a": 203.56234096692108,
85
+ "c": 0,
86
+ "e": 263.9185750636132,
87
+ "b": 0,
88
+ "d": -203.56234096692108,
89
+ "f": 309.82188295165395
90
+ };
91
+ // Manually invert and apply the affine transform
92
+ // Since we only use translate and scale, we can directly compute:
93
+ // x' = (x - tx) / sx
94
+ // y' = (y - ty) / sy
95
+ const sx = matrix.a;
96
+ const sy = matrix.d;
97
+ const tx = matrix.e;
98
+ const ty = matrix.f;
99
+ const realPoint = {
100
+ x: (x - tx) / sx,
101
+ y: (y - ty) / sy // Flip y back since we used negative scale
102
+ }
103
+
104
+ coords.textContent = `(${realPoint.x.toFixed(2)}, ${realPoint.y.toFixed(2)})`;
105
+ coords.setAttribute('x', (x + 5).toString());
106
+ coords.setAttribute('y', (y - 5).toString());
107
+ });
108
+ document.currentScript.parentElement.addEventListener('mouseleave', () => {
109
+ document.currentScript.parentElement.getElementById('crosshair').style.display = 'none';
110
+ });
111
+ ]]>
112
+ </script>
113
+ </svg>
@@ -0,0 +1,177 @@
1
+ <svg width="640" height="640" viewBox="0 0 640 640" xmlns="http://www.w3.org/2000/svg">
2
+ <rect width="100%" height="100%" fill="white" />
3
+ <g>
4
+ <circle data-type="point" data-label="U1.1
5
+ x-" data-x="-1.05" data-y="0.30000000000000004" cx="40" cy="406.1349154032081" r="3" fill="hsl(319, 100%, 50%, 0.8)" />
6
+ </g>
7
+ <g>
8
+ <circle data-type="point" data-label="U1.2
9
+ x-" data-x="-1.05" data-y="0.10000000000000003" cx="40" cy="430.74489123269615" r="3" fill="hsl(320, 100%, 50%, 0.8)" />
10
+ </g>
11
+ <g>
12
+ <circle data-type="point" data-label="U1.3
13
+ x-" data-x="-1.05" data-y="-0.09999999999999998" cx="40" cy="455.35486706218416" r="3" fill="hsl(321, 100%, 50%, 0.8)" />
14
+ </g>
15
+ <g>
16
+ <circle data-type="point" data-label="U1.4
17
+ x-" data-x="-1.05" data-y="-0.30000000000000004" cx="40" cy="479.9648428916722" r="3" fill="hsl(322, 100%, 50%, 0.8)" />
18
+ </g>
19
+ <g>
20
+ <circle data-type="point" data-label="U1.5
21
+ x+" data-x="1.05" data-y="-0.30000000000000004" cx="298.40474620962425" cy="479.9648428916722" r="3" fill="hsl(323, 100%, 50%, 0.8)" />
22
+ </g>
23
+ <g>
24
+ <circle data-type="point" data-label="U1.6
25
+ x+" data-x="1.05" data-y="-0.10000000000000003" cx="298.40474620962425" cy="455.35486706218416" r="3" fill="hsl(324, 100%, 50%, 0.8)" />
26
+ </g>
27
+ <g>
28
+ <circle data-type="point" data-label="U1.7
29
+ x+" data-x="1.05" data-y="0.09999999999999998" cx="298.40474620962425" cy="430.74489123269615" r="3" fill="hsl(325, 100%, 50%, 0.8)" />
30
+ </g>
31
+ <g>
32
+ <circle data-type="point" data-label="U1.8
33
+ x+" data-x="1.05" data-y="0.30000000000000004" cx="298.40474620962425" cy="406.1349154032081" r="3" fill="hsl(326, 100%, 50%, 0.8)" />
34
+ </g>
35
+ <g>
36
+ <circle data-type="point" data-label="U2.1
37
+ x-" data-x="0.95" data-y="2.3" cx="286.09975829488025" cy="160.0351571083279" r="3" fill="hsl(200, 100%, 50%, 0.8)" />
38
+ </g>
39
+ <g>
40
+ <circle data-type="point" data-label="U2.2
41
+ x-" data-x="0.95" data-y="2.1" cx="286.09975829488025" cy="184.6451329378159" r="3" fill="hsl(201, 100%, 50%, 0.8)" />
42
+ </g>
43
+ <g>
44
+ <circle data-type="point" data-label="U2.3
45
+ x-" data-x="0.95" data-y="1.9" cx="286.09975829488025" cy="209.25510876730394" r="3" fill="hsl(202, 100%, 50%, 0.8)" />
46
+ </g>
47
+ <g>
48
+ <circle data-type="point" data-label="U2.4
49
+ x-" data-x="0.95" data-y="1.7" cx="286.09975829488025" cy="233.86508459679195" r="3" fill="hsl(203, 100%, 50%, 0.8)" />
50
+ </g>
51
+ <g>
52
+ <circle data-type="point" data-label="U2.5
53
+ x+" data-x="3.05" data-y="1.7" cx="544.5045045045044" cy="233.86508459679195" r="3" fill="hsl(204, 100%, 50%, 0.8)" />
54
+ </g>
55
+ <g>
56
+ <circle data-type="point" data-label="U2.6
57
+ x+" data-x="3.05" data-y="1.9" cx="544.5045045045044" cy="209.25510876730394" r="3" fill="hsl(205, 100%, 50%, 0.8)" />
58
+ </g>
59
+ <g>
60
+ <circle data-type="point" data-label="U2.7
61
+ x+" data-x="3.05" data-y="2.1" cx="544.5045045045044" cy="184.6451329378159" r="3" fill="hsl(206, 100%, 50%, 0.8)" />
62
+ </g>
63
+ <g>
64
+ <circle data-type="point" data-label="U2.8
65
+ x+" data-x="3.05" data-y="2.3" cx="544.5045045045044" cy="160.0351571083279" r="3" fill="hsl(207, 100%, 50%, 0.8)" />
66
+ </g>
67
+ <g>
68
+ <circle data-type="point" data-label="" data-x="1.6010000000000002" data-y="0.3" cx="366.20522961986376" cy="406.13491540320814" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
69
+ </g>
70
+ <g>
71
+ <circle data-type="point" data-label="" data-x="1.05" data-y="-0.10000000000000003" cx="298.40474620962425" cy="455.35486706218416" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
72
+ </g>
73
+ <g>
74
+ <circle data-type="point" data-label="" data-x="3.05" data-y="2.3" cx="544.5045045045044" cy="160.0351571083279" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
75
+ </g>
76
+ <g>
77
+ <circle data-type="point" data-label="" data-x="1.05" data-y="0.09999999999999998" cx="298.40474620962425" cy="430.74489123269615" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
78
+ </g>
79
+ <g>
80
+ <circle data-type="point" data-label="" data-x="3.05" data-y="2.1" cx="544.5045045045044" cy="184.6451329378159" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
81
+ </g>
82
+ <g>
83
+ <polyline data-points="1.05,0.09999999999999998 3.05,2.1" data-type="line" data-label="" points="298.40474620962425,430.74489123269615 544.5045045045044,184.6451329378159" fill="none" stroke="hsl(312, 100%, 50%, 0.8)" stroke-width="1" />
84
+ </g>
85
+ <g>
86
+ <polyline data-points="1.05,-0.10000000000000003 3.05,2.3" data-type="line" data-label="" points="298.40474620962425,455.35486706218416 544.5045045045044,160.0351571083279" fill="none" stroke="hsl(88, 100%, 50%, 0.8)" stroke-width="1" />
87
+ </g>
88
+ <g>
89
+ <polyline data-points="1.05,-0.30000000000000004 1.05,0.30000000000000004" data-type="line" data-label="" points="298.40474620962425,479.9648428916722 298.40474620962425,406.1349154032081" fill="none" stroke="hsl(190, 100%, 50%, 0.8)" stroke-width="1" stroke-dasharray="4 2" />
90
+ </g>
91
+ <g>
92
+ <polyline data-points="1.05,-0.30000000000000004 1.6010000000000002,-0.30000000000000004 1.6010000000000002,0.3 1.05,0.30000000000000004" data-type="line" data-label="" points="298.40474620962425,479.9648428916722 366.20522961986376,479.9648428916722 366.20522961986376,406.13491540320814 298.40474620962425,406.1349154032081" fill="none" stroke="purple" stroke-width="1" />
93
+ </g>
94
+ <g>
95
+ <rect data-type="rect" data-label="schematic_component_0" data-x="0" data-y="0" x="40" y="381.5249395737201" width="258.40474620962425" height="123.04987914744015" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.008126785714285715" />
96
+ </g>
97
+ <g>
98
+ <rect data-type="rect" data-label="schematic_component_1" data-x="2" data-y="2" x="286.09975829488025" y="135.42518127883983" width="258.4047462096242" height="123.04987914744015" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.008126785714285715" />
99
+ </g>
100
+ <g>
101
+ <rect data-type="rect" data-label="netId: VCC
102
+ globalConnNetId: connectivity_net2" data-x="1.6010000000000002" data-y="0.54" x="353.90024170511975" y="347.07097341243684" width="24.609975829488064" height="59.06394199077124" fill="#ef444466" stroke="#ef4444" stroke-width="0.008126785714285715" />
103
+ </g>
104
+ <g>
105
+ <rect data-type="rect" data-label="netId: U1.CLK to U2.VCC
106
+ globalConnNetId: connectivity_net1" data-x="1.276" data-y="-0.10000000000000003" x="298.52779608877165" y="443.04987914744015" width="55.3724456163481" height="24.609975829488008" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.008126785714285715" />
107
+ </g>
108
+ <g>
109
+ <rect data-type="rect" data-label="netId: U1.CLK to U2.VCC
110
+ globalConnNetId: connectivity_net1" data-x="3.276" data-y="2.3" x="544.6275543836518" y="147.7301691935839" width="55.37244561634816" height="24.609975829488008" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.008126785714285715" />
111
+ </g>
112
+ <g>
113
+ <rect data-type="rect" data-label="netId: U1.IO3 to U2.IO3
114
+ globalConnNetId: connectivity_net0" data-x="1.276" data-y="0.09999999999999998" x="298.52779608877165" y="418.43990331795214" width="55.3724456163481" height="24.609975829488008" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.008126785714285715" />
115
+ </g>
116
+ <g>
117
+ <rect data-type="rect" data-label="netId: U1.IO3 to U2.IO3
118
+ globalConnNetId: connectivity_net0" data-x="3.276" data-y="2.1" x="544.6275543836518" y="172.34014502307184" width="55.37244561634816" height="24.609975829488064" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.008126785714285715" />
119
+ </g>
120
+ <g id="crosshair" style="display: none">
121
+ <line id="crosshair-h" y1="0" y2="640" stroke="#666" stroke-width="0.5" />
122
+ <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>
123
+ </g>
124
+ <script>
125
+ <![CDATA[
126
+ document.currentScript.parentElement.addEventListener('mousemove', (e) => {
127
+ const svg = e.currentTarget;
128
+ const rect = svg.getBoundingClientRect();
129
+ const x = e.clientX - rect.left;
130
+ const y = e.clientY - rect.top;
131
+ const crosshair = svg.getElementById('crosshair');
132
+ const h = svg.getElementById('crosshair-h');
133
+ const v = svg.getElementById('crosshair-v');
134
+ const coords = svg.getElementById('coordinates');
135
+
136
+ crosshair.style.display = 'block';
137
+ h.setAttribute('x1', '0');
138
+ h.setAttribute('x2', '640');
139
+ h.setAttribute('y1', y);
140
+ h.setAttribute('y2', y);
141
+ v.setAttribute('x1', x);
142
+ v.setAttribute('x2', x);
143
+ v.setAttribute('y1', '0');
144
+ v.setAttribute('y2', '640');
145
+
146
+ // Calculate real coordinates using inverse transformation
147
+ const matrix = {
148
+ "a": 123.04987914744012,
149
+ "c": 0,
150
+ "e": 169.20237310481212,
151
+ "b": 0,
152
+ "d": -123.04987914744012,
153
+ "f": 443.04987914744015
154
+ };
155
+ // Manually invert and apply the affine transform
156
+ // Since we only use translate and scale, we can directly compute:
157
+ // x' = (x - tx) / sx
158
+ // y' = (y - ty) / sy
159
+ const sx = matrix.a;
160
+ const sy = matrix.d;
161
+ const tx = matrix.e;
162
+ const ty = matrix.f;
163
+ const realPoint = {
164
+ x: (x - tx) / sx,
165
+ y: (y - ty) / sy // Flip y back since we used negative scale
166
+ }
167
+
168
+ coords.textContent = `(${realPoint.x.toFixed(2)}, ${realPoint.y.toFixed(2)})`;
169
+ coords.setAttribute('x', (x + 5).toString());
170
+ coords.setAttribute('y', (y - 5).toString());
171
+ });
172
+ document.currentScript.parentElement.addEventListener('mouseleave', () => {
173
+ document.currentScript.parentElement.getElementById('crosshair').style.display = 'none';
174
+ });
175
+ ]]>
176
+ </script>
177
+ </svg>
@@ -0,0 +1,160 @@
1
+ <svg width="640" height="640" viewBox="0 0 640 640" xmlns="http://www.w3.org/2000/svg">
2
+ <rect width="100%" height="100%" fill="white" />
3
+ <g>
4
+ <circle data-type="point" data-label="U1.1
5
+ x-" data-x="-1.05" data-y="0.30000000000000004" cx="39.999999999999986" cy="396.8476769260929" r="3" fill="hsl(319, 100%, 50%, 0.8)" />
6
+ </g>
7
+ <g>
8
+ <circle data-type="point" data-label="U1.2
9
+ x-" data-x="-1.05" data-y="0.10000000000000003" cx="39.999999999999986" cy="418.80415604783377" r="3" fill="hsl(320, 100%, 50%, 0.8)" />
10
+ </g>
11
+ <g>
12
+ <circle data-type="point" data-label="U1.3
13
+ x-" data-x="-1.05" data-y="-0.09999999999999998" cx="39.999999999999986" cy="440.7606351695746" r="3" fill="hsl(321, 100%, 50%, 0.8)" />
14
+ </g>
15
+ <g>
16
+ <circle data-type="point" data-label="U1.4
17
+ x-" data-x="-1.05" data-y="-0.30000000000000004" cx="39.999999999999986" cy="462.71711429131545" r="3" fill="hsl(322, 100%, 50%, 0.8)" />
18
+ </g>
19
+ <g>
20
+ <circle data-type="point" data-label="U1.5
21
+ x+" data-x="1.05" data-y="-0.30000000000000004" cx="270.54303077827876" cy="462.71711429131545" r="3" fill="hsl(323, 100%, 50%, 0.8)" />
22
+ </g>
23
+ <g>
24
+ <circle data-type="point" data-label="U1.6
25
+ x+" data-x="1.05" data-y="-0.10000000000000003" cx="270.54303077827876" cy="440.7606351695746" r="3" fill="hsl(324, 100%, 50%, 0.8)" />
26
+ </g>
27
+ <g>
28
+ <circle data-type="point" data-label="U1.7
29
+ x+" data-x="1.05" data-y="0.09999999999999998" cx="270.54303077827876" cy="418.80415604783377" r="3" fill="hsl(325, 100%, 50%, 0.8)" />
30
+ </g>
31
+ <g>
32
+ <circle data-type="point" data-label="U1.8
33
+ x+" data-x="1.05" data-y="0.30000000000000004" cx="270.54303077827876" cy="396.8476769260929" r="3" fill="hsl(326, 100%, 50%, 0.8)" />
34
+ </g>
35
+ <g>
36
+ <circle data-type="point" data-label="U2.1
37
+ x-" data-x="0.95" data-y="2.3" cx="259.56479121740836" cy="177.28288570868457" r="3" fill="hsl(200, 100%, 50%, 0.8)" />
38
+ </g>
39
+ <g>
40
+ <circle data-type="point" data-label="U2.2
41
+ x-" data-x="0.95" data-y="2.1" cx="259.56479121740836" cy="199.2393648304254" r="3" fill="hsl(201, 100%, 50%, 0.8)" />
42
+ </g>
43
+ <g>
44
+ <circle data-type="point" data-label="U2.3
45
+ x-" data-x="0.95" data-y="1.9" cx="259.56479121740836" cy="221.19584395216626" r="3" fill="hsl(202, 100%, 50%, 0.8)" />
46
+ </g>
47
+ <g>
48
+ <circle data-type="point" data-label="U2.4
49
+ x-" data-x="0.95" data-y="1.7" cx="259.56479121740836" cy="243.15232307390707" r="3" fill="hsl(203, 100%, 50%, 0.8)" />
50
+ </g>
51
+ <g>
52
+ <circle data-type="point" data-label="U2.5
53
+ x+" data-x="3.05" data-y="1.7" cx="490.1078219956871" cy="243.15232307390707" r="3" fill="hsl(204, 100%, 50%, 0.8)" />
54
+ </g>
55
+ <g>
56
+ <circle data-type="point" data-label="U2.6
57
+ x+" data-x="3.05" data-y="1.9" cx="490.1078219956871" cy="221.19584395216626" r="3" fill="hsl(205, 100%, 50%, 0.8)" />
58
+ </g>
59
+ <g>
60
+ <circle data-type="point" data-label="U2.7
61
+ x+" data-x="3.05" data-y="2.1" cx="490.1078219956871" cy="199.2393648304254" r="3" fill="hsl(206, 100%, 50%, 0.8)" />
62
+ </g>
63
+ <g>
64
+ <circle data-type="point" data-label="U2.8
65
+ x+" data-x="3.05" data-y="2.3" cx="490.1078219956871" cy="177.28288570868457" r="3" fill="hsl(207, 100%, 50%, 0.8)" />
66
+ </g>
67
+ <g>
68
+ <circle data-type="point" data-label="" data-x="2.1510000000000002" data-y="0.30000000000000004" cx="391.4134483434621" cy="396.8476769260929" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
69
+ </g>
70
+ <g>
71
+ <circle data-type="point" data-label="" data-x="1.05" data-y="-0.10000000000000003" cx="270.54303077827876" cy="440.7606351695746" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
72
+ </g>
73
+ <g>
74
+ <circle data-type="point" data-label="" data-x="3.05" data-y="2.3" cx="490.1078219956871" cy="177.28288570868457" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
75
+ </g>
76
+ <g>
77
+ <polyline data-points="1.05,-0.10000000000000003 3.05,2.3" data-type="line" data-label="" points="270.54303077827876,440.7606351695746 490.1078219956871,177.28288570868457" fill="none" stroke="hsl(88, 100%, 50%, 0.8)" stroke-width="1" />
78
+ </g>
79
+ <g>
80
+ <polyline data-points="1.05,-0.30000000000000004 1.05,0.30000000000000004" data-type="line" data-label="" points="270.54303077827876,462.71711429131545 270.54303077827876,396.8476769260929" fill="none" stroke="hsl(190, 100%, 50%, 0.8)" stroke-width="1" stroke-dasharray="4 2" />
81
+ </g>
82
+ <g>
83
+ <polyline data-points="1.05,-0.30000000000000004 2.1510000000000002,-0.30000000000000004 2.1510000000000002,0.30000000000000004 1.05,0.30000000000000004" data-type="line" data-label="" points="270.54303077827876,462.71711429131545 391.4134483434621,462.71711429131545 391.4134483434621,396.8476769260929 270.54303077827876,396.8476769260929" fill="none" stroke="purple" stroke-width="1" />
84
+ </g>
85
+ <g>
86
+ <rect data-type="rect" data-label="schematic_component_0" data-x="0" data-y="0" x="39.999999999999986" y="374.8911978043521" width="230.54303077827876" height="109.78239560870418" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.009108928571428572" />
87
+ </g>
88
+ <g>
89
+ <rect data-type="rect" data-label="schematic_component_1" data-x="2" data-y="2" x="259.56479121740836" y="155.32640658694373" width="230.54303077827876" height="109.78239560870418" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.009108928571428572" />
90
+ </g>
91
+ <g>
92
+ <rect data-type="rect" data-label="netId: VCC
93
+ globalConnNetId: connectivity_net1" data-x="2.1510000000000002" data-y="0.54" x="380.43520878259164" y="344.1521270339149" width="21.95647912174087" height="52.69554989217801" fill="#ef444466" stroke="#ef4444" stroke-width="0.009108928571428572" />
94
+ </g>
95
+ <g>
96
+ <rect data-type="rect" data-label="netId: U1.CLK to U2.VCC
97
+ globalConnNetId: connectivity_net0" data-x="1.551" data-y="-0.10000000000000003" x="270.65281317388747" y="429.7823956087042" width="109.78239560870418" height="21.956479121740813" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.009108928571428572" />
98
+ </g>
99
+ <g>
100
+ <rect data-type="rect" data-label="netId: U1.CLK to U2.VCC
101
+ globalConnNetId: connectivity_net0" data-x="3.5509999999999997" data-y="2.3" x="490.2176043912958" y="166.30464614781414" width="109.78239560870418" height="21.95647912174087" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.009108928571428572" />
102
+ </g>
103
+ <g id="crosshair" style="display: none">
104
+ <line id="crosshair-h" y1="0" y2="640" stroke="#666" stroke-width="0.5" />
105
+ <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>
106
+ </g>
107
+ <script>
108
+ <![CDATA[
109
+ document.currentScript.parentElement.addEventListener('mousemove', (e) => {
110
+ const svg = e.currentTarget;
111
+ const rect = svg.getBoundingClientRect();
112
+ const x = e.clientX - rect.left;
113
+ const y = e.clientY - rect.top;
114
+ const crosshair = svg.getElementById('crosshair');
115
+ const h = svg.getElementById('crosshair-h');
116
+ const v = svg.getElementById('crosshair-v');
117
+ const coords = svg.getElementById('coordinates');
118
+
119
+ crosshair.style.display = 'block';
120
+ h.setAttribute('x1', '0');
121
+ h.setAttribute('x2', '640');
122
+ h.setAttribute('y1', y);
123
+ h.setAttribute('y2', y);
124
+ v.setAttribute('x1', x);
125
+ v.setAttribute('x2', x);
126
+ v.setAttribute('y1', '0');
127
+ v.setAttribute('y2', '640');
128
+
129
+ // Calculate real coordinates using inverse transformation
130
+ const matrix = {
131
+ "a": 109.78239560870418,
132
+ "c": 0,
133
+ "e": 155.27151538913938,
134
+ "b": 0,
135
+ "d": -109.78239560870418,
136
+ "f": 429.7823956087042
137
+ };
138
+ // Manually invert and apply the affine transform
139
+ // Since we only use translate and scale, we can directly compute:
140
+ // x' = (x - tx) / sx
141
+ // y' = (y - ty) / sy
142
+ const sx = matrix.a;
143
+ const sy = matrix.d;
144
+ const tx = matrix.e;
145
+ const ty = matrix.f;
146
+ const realPoint = {
147
+ x: (x - tx) / sx,
148
+ y: (y - ty) / sy // Flip y back since we used negative scale
149
+ }
150
+
151
+ coords.textContent = `(${realPoint.x.toFixed(2)}, ${realPoint.y.toFixed(2)})`;
152
+ coords.setAttribute('x', (x + 5).toString());
153
+ coords.setAttribute('y', (y - 5).toString());
154
+ });
155
+ document.currentScript.parentElement.addEventListener('mouseleave', () => {
156
+ document.currentScript.parentElement.getElementById('crosshair').style.display = 'none';
157
+ });
158
+ ]]>
159
+ </script>
160
+ </svg>
@@ -0,0 +1,12 @@
1
+ import { test, expect } from "bun:test"
2
+ import { SchematicTracePipelineSolver } from "lib/solvers/SchematicTracePipelineSolver/SchematicTracePipelineSolver"
3
+ import inputProblem from "../assets/example34.json"
4
+ import "tests/fixtures/matcher"
5
+
6
+ test("example34", () => {
7
+ const solver = new SchematicTracePipelineSolver(inputProblem as any)
8
+
9
+ solver.solve()
10
+
11
+ expect(solver).toMatchSolverSnapshot(import.meta.path)
12
+ })
@@ -0,0 +1,12 @@
1
+ import { test, expect } from "bun:test"
2
+ import { SchematicTracePipelineSolver } from "lib/solvers/SchematicTracePipelineSolver/SchematicTracePipelineSolver"
3
+ import inputProblem from "../assets/example35.json"
4
+ import "tests/fixtures/matcher"
5
+
6
+ test("example35", () => {
7
+ const solver = new SchematicTracePipelineSolver(inputProblem as any)
8
+
9
+ solver.solve()
10
+
11
+ expect(solver).toMatchSolverSnapshot(import.meta.path)
12
+ })
@@ -0,0 +1,12 @@
1
+ import { test, expect } from "bun:test"
2
+ import { SchematicTracePipelineSolver } from "lib/solvers/SchematicTracePipelineSolver/SchematicTracePipelineSolver"
3
+ import inputProblem from "../assets/example36.json"
4
+ import "tests/fixtures/matcher"
5
+
6
+ test("example36", () => {
7
+ const solver = new SchematicTracePipelineSolver(inputProblem as any)
8
+
9
+ solver.solve()
10
+
11
+ expect(solver).toMatchSolverSnapshot(import.meta.path)
12
+ })