@tscircuit/schematic-trace-solver 0.0.39 → 0.0.40

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.
package/dist/index.js CHANGED
@@ -3009,7 +3009,9 @@ var TraceLabelOverlapAvoidanceSolver = class extends BaseSolver {
3009
3009
  )
3010
3010
  });
3011
3011
  finalLabelPlacementSolver.solve();
3012
- this.netLabelPlacements = finalLabelPlacementSolver.netLabelPlacements;
3012
+ if (!finalLabelPlacementSolver.failed) {
3013
+ this.netLabelPlacements = finalLabelPlacementSolver.netLabelPlacements;
3014
+ }
3013
3015
  this.solved = true;
3014
3016
  }
3015
3017
  getOutput() {
@@ -194,7 +194,9 @@ export class TraceLabelOverlapAvoidanceSolver extends BaseSolver {
194
194
  ),
195
195
  })
196
196
  finalLabelPlacementSolver.solve()
197
- this.netLabelPlacements = finalLabelPlacementSolver.netLabelPlacements
197
+ if (!finalLabelPlacementSolver.failed) {
198
+ this.netLabelPlacements = finalLabelPlacementSolver.netLabelPlacements
199
+ }
198
200
 
199
201
  this.solved = true
200
202
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/schematic-trace-solver",
3
3
  "main": "dist/index.js",
4
- "version": "0.0.39",
4
+ "version": "0.0.40",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "start": "cosmos",
@@ -0,0 +1,281 @@
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
+ y+" data-x="-0.2" data-y="1.4" cx="307.82608695652175" cy="228.69565217391306" 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.3" data-y="0.09999999999999998" cx="240.8695652173913" cy="307.82608695652175" 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.3" data-y="-0.10000000000000009" cx="240.8695652173913" cy="320" 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.3" data-y="-0.30000000000000004" cx="240.8695652173913" cy="332.17391304347825" 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.3" data-y="-0.5" cx="240.8695652173913" cy="344.3478260869565" r="3" fill="hsl(323, 100%, 50%, 0.8)" />
22
+ </g>
23
+ <g>
24
+ <circle data-type="point" data-label="U1.7
25
+ y-" data-x="0" data-y="-1.4" cx="320" cy="399.1304347826087" r="3" fill="hsl(325, 100%, 50%, 0.8)" />
26
+ </g>
27
+ <g>
28
+ <circle data-type="point" data-label="U1.8
29
+ x-" data-x="-1.3" data-y="0.5" cx="240.8695652173913" cy="283.47826086956525" r="3" fill="hsl(326, 100%, 50%, 0.8)" />
30
+ </g>
31
+ <g>
32
+ <circle data-type="point" data-label="U1.10
33
+ x+" data-x="1.3" data-y="-0.5" cx="399.1304347826087" cy="344.3478260869565" r="3" fill="hsl(217, 100%, 50%, 0.8)" />
34
+ </g>
35
+ <g>
36
+ <circle data-type="point" data-label="U1.11
37
+ x+" data-x="1.3" data-y="-0.3" cx="399.1304347826087" cy="332.17391304347825" r="3" fill="hsl(218, 100%, 50%, 0.8)" />
38
+ </g>
39
+ <g>
40
+ <circle data-type="point" data-label="U1.12
41
+ x+" data-x="1.3" data-y="-0.09999999999999998" cx="399.1304347826087" cy="320" r="3" fill="hsl(219, 100%, 50%, 0.8)" />
42
+ </g>
43
+ <g>
44
+ <circle data-type="point" data-label="U1.13
45
+ x+" data-x="1.3" data-y="0.10000000000000009" cx="399.1304347826087" cy="307.82608695652175" r="3" fill="hsl(220, 100%, 50%, 0.8)" />
46
+ </g>
47
+ <g>
48
+ <circle data-type="point" data-label="U1.14
49
+ y+" data-x="0.2" data-y="1.4" cx="332.17391304347825" cy="228.69565217391306" r="3" fill="hsl(221, 100%, 50%, 0.8)" />
50
+ </g>
51
+ <g>
52
+ <circle data-type="point" data-label="JP1.1
53
+ x+" data-x="-3.4" data-y="-0.8999999999999999" cx="113.04347826086953" cy="368.69565217391306" r="3" fill="hsl(358, 100%, 50%, 0.8)" />
54
+ </g>
55
+ <g>
56
+ <circle data-type="point" data-label="JP1.2
57
+ x+" data-x="-3.4" data-y="-0.7" cx="113.04347826086953" cy="356.5217391304348" r="3" fill="hsl(359, 100%, 50%, 0.8)" />
58
+ </g>
59
+ <g>
60
+ <circle data-type="point" data-label="JP1.3
61
+ x+" data-x="-3.4" data-y="-0.49999999999999994" cx="113.04347826086953" cy="344.3478260869565" r="3" fill="hsl(0, 100%, 50%, 0.8)" />
62
+ </g>
63
+ <g>
64
+ <circle data-type="point" data-label="JP1.4
65
+ x+" data-x="-3.4" data-y="-0.2999999999999999" cx="113.04347826086953" cy="332.17391304347825" r="3" fill="hsl(1, 100%, 50%, 0.8)" />
66
+ </g>
67
+ <g>
68
+ <circle data-type="point" data-label="JP1.5
69
+ x+" data-x="-3.4" data-y="-0.09999999999999992" cx="113.04347826086953" cy="320" r="3" fill="hsl(2, 100%, 50%, 0.8)" />
70
+ </g>
71
+ <g>
72
+ <circle data-type="point" data-label="JP1.6
73
+ x+" data-x="-3.4" data-y="0.10000000000000003" cx="113.04347826086953" cy="307.82608695652175" r="3" fill="hsl(3, 100%, 50%, 0.8)" />
74
+ </g>
75
+ <g>
76
+ <circle data-type="point" data-label="JP1.7
77
+ x+" data-x="-3.4" data-y="0.3" cx="113.04347826086953" cy="295.6521739130435" r="3" fill="hsl(4, 100%, 50%, 0.8)" />
78
+ </g>
79
+ <g>
80
+ <circle data-type="point" data-label="JP2.1
81
+ x-" data-x="3.4" data-y="-0.8999999999999999" cx="526.9565217391305" cy="368.69565217391306" r="3" fill="hsl(239, 100%, 50%, 0.8)" />
82
+ </g>
83
+ <g>
84
+ <circle data-type="point" data-label="JP2.2
85
+ x-" data-x="3.4" data-y="-0.7" cx="526.9565217391305" cy="356.5217391304348" r="3" fill="hsl(240, 100%, 50%, 0.8)" />
86
+ </g>
87
+ <g>
88
+ <circle data-type="point" data-label="JP2.3
89
+ x-" data-x="3.4" data-y="-0.5" cx="526.9565217391305" cy="344.3478260869565" r="3" fill="hsl(241, 100%, 50%, 0.8)" />
90
+ </g>
91
+ <g>
92
+ <circle data-type="point" data-label="JP2.4
93
+ x-" data-x="3.4" data-y="-0.3000000000000001" cx="526.9565217391305" cy="332.17391304347825" r="3" fill="hsl(242, 100%, 50%, 0.8)" />
94
+ </g>
95
+ <g>
96
+ <circle data-type="point" data-label="JP2.5
97
+ x-" data-x="3.4" data-y="-0.10000000000000003" cx="526.9565217391305" cy="320" r="3" fill="hsl(243, 100%, 50%, 0.8)" />
98
+ </g>
99
+ <g>
100
+ <circle data-type="point" data-label="JP2.6
101
+ x-" data-x="3.4" data-y="0.09999999999999998" cx="526.9565217391305" cy="307.82608695652175" r="3" fill="hsl(244, 100%, 50%, 0.8)" />
102
+ </g>
103
+ <g>
104
+ <circle data-type="point" data-label="JP2.7
105
+ x-" data-x="3.4" data-y="0.3" cx="526.9565217391305" cy="295.6521739130435" r="3" fill="hsl(245, 100%, 50%, 0.8)" />
106
+ </g>
107
+ <g>
108
+ <circle data-type="point" data-label="" data-x="-3.4" data-y="-0.09999999999999992" cx="113.04347826086953" cy="320" r="3" fill="red" />
109
+ </g>
110
+ <g>
111
+ <circle data-type="point" data-label="" data-x="-3.4" data-y="-0.09999999999999992" cx="113.04347826086953" cy="320" r="3" fill="red" />
112
+ </g>
113
+ <g>
114
+ <circle data-type="point" data-label="" data-x="-2.35" data-y="-0.1" cx="176.9565217391304" cy="320" r="3" fill="orange" />
115
+ </g>
116
+ <g>
117
+ <circle data-type="point" data-label="" data-x="-2.35" data-y="-0.1" cx="176.9565217391304" cy="320" r="3" fill="orange" />
118
+ </g>
119
+ <g>
120
+ <circle data-type="point" data-label="" data-x="-1.3" data-y="-0.10000000000000009" cx="240.8695652173913" cy="320" r="3" fill="red" />
121
+ </g>
122
+ <g>
123
+ <circle data-type="point" data-label="" data-x="-1.3" data-y="-0.10000000000000009" cx="240.8695652173913" cy="320" r="3" fill="red" />
124
+ </g>
125
+ <g>
126
+ <polyline data-points="-3.4,-0.8999999999999999 0,-1.4" data-type="line" data-label="" points="113.04347826086953,368.69565217391306 320,399.1304347826087" fill="none" stroke="hsl(336, 100%, 50%, 0.8)" stroke-width="1" />
127
+ </g>
128
+ <g>
129
+ <polyline data-points="-3.4,-0.49999999999999994 -1.3,-0.5" data-type="line" data-label="" points="113.04347826086953,344.3478260869565 240.8695652173913,344.3478260869565" fill="none" stroke="hsl(336, 100%, 50%, 0.8)" stroke-width="1" />
130
+ </g>
131
+ <g>
132
+ <polyline data-points="-3.4,-0.2999999999999999 -1.3,-0.30000000000000004" data-type="line" data-label="" points="113.04347826086953,332.17391304347825 240.8695652173913,332.17391304347825" fill="none" stroke="hsl(336, 100%, 50%, 0.8)" stroke-width="1" />
133
+ </g>
134
+ <g>
135
+ <polyline data-points="-3.4,-0.09999999999999992 -1.3,-0.10000000000000009" data-type="line" data-label="" points="113.04347826086953,320 240.8695652173913,320" fill="none" stroke="hsl(336, 100%, 50%, 0.8)" stroke-width="1" />
136
+ </g>
137
+ <g>
138
+ <polyline data-points="-3.4,0.10000000000000003 -1.3,0.09999999999999998" data-type="line" data-label="" points="113.04347826086953,307.82608695652175 240.8695652173913,307.82608695652175" fill="none" stroke="hsl(336, 100%, 50%, 0.8)" stroke-width="1" />
139
+ </g>
140
+ <g>
141
+ <polyline data-points="3.4,-0.5 1.3,-0.5" data-type="line" data-label="" points="526.9565217391305,344.3478260869565 399.1304347826087,344.3478260869565" fill="none" stroke="hsl(24, 100%, 50%, 0.8)" stroke-width="1" />
142
+ </g>
143
+ <g>
144
+ <polyline data-points="3.4,-0.3000000000000001 1.3,-0.3" data-type="line" data-label="" points="526.9565217391305,332.17391304347825 399.1304347826087,332.17391304347825" fill="none" stroke="hsl(24, 100%, 50%, 0.8)" stroke-width="1" />
145
+ </g>
146
+ <g>
147
+ <polyline data-points="3.4,-0.10000000000000003 1.3,-0.09999999999999998" data-type="line" data-label="" points="526.9565217391305,320 399.1304347826087,320" fill="none" stroke="hsl(24, 100%, 50%, 0.8)" stroke-width="1" />
148
+ </g>
149
+ <g>
150
+ <polyline data-points="3.4,0.09999999999999998 1.3,0.10000000000000009" data-type="line" data-label="" points="526.9565217391305,307.82608695652175 399.1304347826087,307.82608695652175" fill="none" stroke="hsl(24, 100%, 50%, 0.8)" stroke-width="1" />
151
+ </g>
152
+ <g>
153
+ <polyline data-points="-0.2,1.4 -3.4,-0.7" data-type="line" data-label="" points="307.82608695652175,228.69565217391306 113.04347826086953,356.5217391304348" fill="none" stroke="hsl(73, 100%, 50%, 0.8)" stroke-width="1" stroke-dasharray="4 2" />
154
+ </g>
155
+ <g>
156
+ <polyline data-points="0,-1.4 -3.4,-0.8999999999999999" data-type="line" data-label="" points="320,399.1304347826087 113.04347826086953,368.69565217391306" fill="none" stroke="hsl(157, 100%, 50%, 0.8)" stroke-width="1" stroke-dasharray="4 2" />
157
+ </g>
158
+ <g>
159
+ <polyline data-points="0,-1.4 3.4,-0.8999999999999999" data-type="line" data-label="" points="320,399.1304347826087 526.9565217391305,368.69565217391306" fill="none" stroke="hsl(157, 100%, 50%, 0.8)" stroke-width="1" stroke-dasharray="4 2" />
160
+ </g>
161
+ <g>
162
+ <polyline data-points="-3.4,-0.8999999999999999 3.4,-0.8999999999999999" data-type="line" data-label="" points="113.04347826086953,368.69565217391306 526.9565217391305,368.69565217391306" fill="none" stroke="hsl(157, 100%, 50%, 0.8)" stroke-width="1" stroke-dasharray="4 2" />
163
+ </g>
164
+ <g>
165
+ <polyline data-points="0.2,1.4 3.4,-0.7" data-type="line" data-label="" points="332.17391304347825,228.69565217391306 526.9565217391305,356.5217391304348" fill="none" stroke="hsl(199, 100%, 50%, 0.8)" stroke-width="1" stroke-dasharray="4 2" />
166
+ </g>
167
+ <g>
168
+ <polyline data-points="0,-1.4 0,-1.5999999999999999 -1.7,-1.5999999999999999 -1.7,-0.8999999999999999 -3.4,-0.8999999999999999" data-type="line" data-label="" points="320,399.1304347826087 320,411.304347826087 216.52173913043475,411.304347826087 216.52173913043475,368.69565217391306 113.04347826086953,368.69565217391306" fill="none" stroke="black" stroke-width="1" />
169
+ </g>
170
+ <g>
171
+ <polyline data-points="3.4,-0.8999999999999999 1.6999999999999997,-0.8999999999999999 1.6999999999999997,-1.5999999999999999 0,-1.5999999999999999 0,-1.4" data-type="line" data-label="" points="526.9565217391305,368.69565217391306 423.47826086956525,368.69565217391306 423.47826086956525,411.304347826087 320,411.304347826087 320,399.1304347826087" fill="none" stroke="black" stroke-width="1" />
172
+ </g>
173
+ <g>
174
+ <polyline data-points="-3.4,-0.49999999999999994 -1.3,-0.5" data-type="line" data-label="" points="113.04347826086953,344.3478260869565 240.8695652173913,344.3478260869565" fill="none" stroke="black" stroke-width="1" />
175
+ </g>
176
+ <g>
177
+ <polyline data-points="-3.4,-0.2999999999999999 -1.3,-0.30000000000000004" data-type="line" data-label="" points="113.04347826086953,332.17391304347825 240.8695652173913,332.17391304347825" fill="none" stroke="black" stroke-width="1" />
178
+ </g>
179
+ <g>
180
+ <polyline data-points="-3.4,-0.09999999999999992 -1.3,-0.10000000000000009" data-type="line" data-label="" points="113.04347826086953,320 240.8695652173913,320" fill="none" stroke="black" stroke-width="1" />
181
+ </g>
182
+ <g>
183
+ <polyline data-points="-3.4,0.10000000000000003 -1.3,0.09999999999999998" data-type="line" data-label="" points="113.04347826086953,307.82608695652175 240.8695652173913,307.82608695652175" fill="none" stroke="black" stroke-width="1" />
184
+ </g>
185
+ <g>
186
+ <polyline data-points="3.4,-0.5 1.3,-0.5" data-type="line" data-label="" points="526.9565217391305,344.3478260869565 399.1304347826087,344.3478260869565" fill="none" stroke="black" stroke-width="1" />
187
+ </g>
188
+ <g>
189
+ <polyline data-points="3.4,-0.3000000000000001 1.3,-0.3" data-type="line" data-label="" points="526.9565217391305,332.17391304347825 399.1304347826087,332.17391304347825" fill="none" stroke="black" stroke-width="1" />
190
+ </g>
191
+ <g>
192
+ <polyline data-points="3.4,-0.10000000000000003 1.3,-0.09999999999999998" data-type="line" data-label="" points="526.9565217391305,320 399.1304347826087,320" fill="none" stroke="black" stroke-width="1" />
193
+ </g>
194
+ <g>
195
+ <polyline data-points="3.4,0.09999999999999998 1.3,0.10000000000000009" data-type="line" data-label="" points="526.9565217391305,307.82608695652175 399.1304347826087,307.82608695652175" fill="none" stroke="black" stroke-width="1" />
196
+ </g>
197
+ <g>
198
+ <rect data-type="rect" data-label="schematic_component_0" data-x="0" data-y="0" x="240.8695652173913" y="228.69565217391306" width="158.26086956521738" height="170.43478260869563" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.016428571428571428" />
199
+ </g>
200
+ <g>
201
+ <rect data-type="rect" data-label="schematic_component_1" data-x="-4" data-y="-0.3" x="40" y="283.47826086956525" width="73.04347826086953" height="97.39130434782606" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.016428571428571428" />
202
+ </g>
203
+ <g>
204
+ <rect data-type="rect" data-label="schematic_component_2" data-x="4" data-y="-0.3" x="526.9565217391305" y="283.47826086956525" width="73.0434782608695" height="97.39130434782606" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.016428571428571428" />
205
+ </g>
206
+ <g>
207
+ <rect data-type="rect" data-label="" data-x="-3.4" data-y="0.12510000000000007" x="106.95652173913041" y="292.6026086956522" width="12.17391304347828" height="27.391304347826065" fill="rgba(220, 0, 0, 0.25)" stroke="black" stroke-width="0.016428571428571428" />
208
+ </g>
209
+ <g>
210
+ <rect data-type="rect" data-label="" data-x="-3.4" data-y="-0.32509999999999994" x="106.95652173913041" y="320.00608695652176" width="12.17391304347828" height="27.391304347826065" fill="rgba(220, 0, 0, 0.25)" stroke="black" stroke-width="0.016428571428571428" />
211
+ </g>
212
+ <g>
213
+ <rect data-type="rect" data-label="" data-x="-2.35" data-y="0.1251" x="170.86956521739128" y="292.6026086956522" width="12.17391304347828" height="27.391304347826065" fill="rgba(220, 140, 0, 0.25)" stroke="black" stroke-width="0.016428571428571428" />
214
+ </g>
215
+ <g>
216
+ <rect data-type="rect" data-label="" data-x="-2.35" data-y="-0.3251" x="170.86956521739128" y="320.00608695652176" width="12.17391304347828" height="27.391304347826065" fill="rgba(220, 140, 0, 0.25)" stroke="black" stroke-width="0.016428571428571428" />
217
+ </g>
218
+ <g>
219
+ <rect data-type="rect" data-label="" data-x="-1.3" data-y="0.1250999999999999" x="234.78260869565216" y="292.6026086956522" width="12.17391304347828" height="27.39130434782612" fill="rgba(220, 0, 0, 0.25)" stroke="black" stroke-width="0.016428571428571428" />
220
+ </g>
221
+ <g>
222
+ <rect data-type="rect" data-label="" data-x="-1.3" data-y="-0.32510000000000006" x="234.78260869565216" y="320.00608695652176" width="12.17391304347828" height="27.391304347826065" fill="rgba(220, 0, 0, 0.25)" stroke="black" stroke-width="0.016428571428571428" />
223
+ </g>
224
+ <g id="crosshair" style="display: none">
225
+ <line id="crosshair-h" y1="0" y2="640" stroke="#666" stroke-width="0.5" />
226
+ <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>
227
+ </g>
228
+ <script>
229
+ <![CDATA[
230
+ document.currentScript.parentElement.addEventListener('mousemove', (e) => {
231
+ const svg = e.currentTarget;
232
+ const rect = svg.getBoundingClientRect();
233
+ const x = e.clientX - rect.left;
234
+ const y = e.clientY - rect.top;
235
+ const crosshair = svg.getElementById('crosshair');
236
+ const h = svg.getElementById('crosshair-h');
237
+ const v = svg.getElementById('crosshair-v');
238
+ const coords = svg.getElementById('coordinates');
239
+
240
+ crosshair.style.display = 'block';
241
+ h.setAttribute('x1', '0');
242
+ h.setAttribute('x2', '640');
243
+ h.setAttribute('y1', y);
244
+ h.setAttribute('y2', y);
245
+ v.setAttribute('x1', x);
246
+ v.setAttribute('x2', x);
247
+ v.setAttribute('y1', '0');
248
+ v.setAttribute('y2', '640');
249
+
250
+ // Calculate real coordinates using inverse transformation
251
+ const matrix = {
252
+ "a": 60.86956521739131,
253
+ "c": 0,
254
+ "e": 320,
255
+ "b": 0,
256
+ "d": -60.86956521739131,
257
+ "f": 313.9130434782609
258
+ };
259
+ // Manually invert and apply the affine transform
260
+ // Since we only use translate and scale, we can directly compute:
261
+ // x' = (x - tx) / sx
262
+ // y' = (y - ty) / sy
263
+ const sx = matrix.a;
264
+ const sy = matrix.d;
265
+ const tx = matrix.e;
266
+ const ty = matrix.f;
267
+ const realPoint = {
268
+ x: (x - tx) / sx,
269
+ y: (y - ty) / sy // Flip y back since we used negative scale
270
+ }
271
+
272
+ coords.textContent = `(${realPoint.x.toFixed(2)}, ${realPoint.y.toFixed(2)})`;
273
+ coords.setAttribute('x', (x + 5).toString());
274
+ coords.setAttribute('y', (y - 5).toString());
275
+ });
276
+ document.currentScript.parentElement.addEventListener('mouseleave', () => {
277
+ document.currentScript.parentElement.getElementById('crosshair').style.display = 'none';
278
+ });
279
+ ]]>
280
+ </script>
281
+ </svg>
@@ -0,0 +1,241 @@
1
+ import { test, expect } from "bun:test"
2
+ import type { InputProblem } from "lib/index"
3
+ import { SchematicTracePipelineSolver } from "lib/solvers/SchematicTracePipelineSolver/SchematicTracePipelineSolver"
4
+ import "tests/fixtures/matcher"
5
+
6
+ const inputProblem: InputProblem = {
7
+ chips: [
8
+ {
9
+ chipId: "schematic_component_0",
10
+ center: {
11
+ x: 0,
12
+ y: 0,
13
+ },
14
+ width: 1.8,
15
+ height: 2,
16
+ pins: [
17
+ {
18
+ pinId: "U1.1",
19
+ x: -0.2,
20
+ y: 1.4,
21
+ },
22
+ {
23
+ pinId: "U1.2",
24
+ x: -1.3,
25
+ y: 0.09999999999999998,
26
+ },
27
+ {
28
+ pinId: "U1.3",
29
+ x: -1.3,
30
+ y: -0.10000000000000009,
31
+ },
32
+ {
33
+ pinId: "U1.4",
34
+ x: -1.3,
35
+ y: -0.30000000000000004,
36
+ },
37
+ {
38
+ pinId: "U1.5",
39
+ x: -1.3,
40
+ y: -0.5,
41
+ },
42
+ {
43
+ pinId: "U1.7",
44
+ x: 0,
45
+ y: -1.4,
46
+ },
47
+ {
48
+ pinId: "U1.8",
49
+ x: -1.3,
50
+ y: 0.5,
51
+ },
52
+ {
53
+ pinId: "U1.10",
54
+ x: 1.3,
55
+ y: -0.5,
56
+ },
57
+ {
58
+ pinId: "U1.11",
59
+ x: 1.3,
60
+ y: -0.3,
61
+ },
62
+ {
63
+ pinId: "U1.12",
64
+ x: 1.3,
65
+ y: -0.09999999999999998,
66
+ },
67
+ {
68
+ pinId: "U1.13",
69
+ x: 1.3,
70
+ y: 0.10000000000000009,
71
+ },
72
+ {
73
+ pinId: "U1.14",
74
+ x: 0.2,
75
+ y: 1.4,
76
+ },
77
+ ],
78
+ },
79
+ {
80
+ chipId: "schematic_component_1",
81
+ center: {
82
+ x: -4,
83
+ y: -0.3,
84
+ },
85
+ width: 0.4,
86
+ height: 1.6,
87
+ pins: [
88
+ {
89
+ pinId: "JP1.1",
90
+ x: -3.4,
91
+ y: -0.8999999999999999,
92
+ },
93
+ {
94
+ pinId: "JP1.2",
95
+ x: -3.4,
96
+ y: -0.7,
97
+ },
98
+ {
99
+ pinId: "JP1.3",
100
+ x: -3.4,
101
+ y: -0.49999999999999994,
102
+ },
103
+ {
104
+ pinId: "JP1.4",
105
+ x: -3.4,
106
+ y: -0.2999999999999999,
107
+ },
108
+ {
109
+ pinId: "JP1.5",
110
+ x: -3.4,
111
+ y: -0.09999999999999992,
112
+ },
113
+ {
114
+ pinId: "JP1.6",
115
+ x: -3.4,
116
+ y: 0.10000000000000003,
117
+ },
118
+ {
119
+ pinId: "JP1.7",
120
+ x: -3.4,
121
+ y: 0.3,
122
+ },
123
+ ],
124
+ },
125
+ {
126
+ chipId: "schematic_component_2",
127
+ center: {
128
+ x: 4,
129
+ y: -0.3,
130
+ },
131
+ width: 0.4,
132
+ height: 1.6,
133
+ pins: [
134
+ {
135
+ pinId: "JP2.1",
136
+ x: 3.4,
137
+ y: -0.8999999999999999,
138
+ },
139
+ {
140
+ pinId: "JP2.2",
141
+ x: 3.4,
142
+ y: -0.7,
143
+ },
144
+ {
145
+ pinId: "JP2.3",
146
+ x: 3.4,
147
+ y: -0.5,
148
+ },
149
+ {
150
+ pinId: "JP2.4",
151
+ x: 3.4,
152
+ y: -0.3000000000000001,
153
+ },
154
+ {
155
+ pinId: "JP2.5",
156
+ x: 3.4,
157
+ y: -0.10000000000000003,
158
+ },
159
+ {
160
+ pinId: "JP2.6",
161
+ x: 3.4,
162
+ y: 0.09999999999999998,
163
+ },
164
+ {
165
+ pinId: "JP2.7",
166
+ x: 3.4,
167
+ y: 0.3,
168
+ },
169
+ ],
170
+ },
171
+ ],
172
+ directConnections: [
173
+ {
174
+ pinIds: ["JP1.1", "U1.7"],
175
+ netId: "pinheader.JP1 > port.pin1 to .U1 > .pin7",
176
+ },
177
+ {
178
+ pinIds: ["JP1.3", "U1.5"],
179
+ netId: "pinheader.JP1 > port.pin3 to .U1 > .pin5",
180
+ },
181
+ {
182
+ pinIds: ["JP1.4", "U1.4"],
183
+ netId: "pinheader.JP1 > port.pin4 to .U1 > .pin4",
184
+ },
185
+ {
186
+ pinIds: ["JP1.5", "U1.3"],
187
+ netId: "pinheader.JP1 > port.pin5 to .U1 > .pin3",
188
+ },
189
+ {
190
+ pinIds: ["JP1.6", "U1.2"],
191
+ netId: "pinheader.JP1 > port.pin6 to .U1 > .pin2",
192
+ },
193
+ {
194
+ pinIds: ["JP2.3", "U1.10"],
195
+ netId: "pinheader.JP2 > port.pin3 to .U1 > .pin10",
196
+ },
197
+ {
198
+ pinIds: ["JP2.4", "U1.11"],
199
+ netId: "pinheader.JP2 > port.pin4 to .U1 > .pin11",
200
+ },
201
+ {
202
+ pinIds: ["JP2.5", "U1.12"],
203
+ netId: "pinheader.JP2 > port.pin5 to .U1 > .pin12",
204
+ },
205
+ {
206
+ pinIds: ["JP2.6", "U1.13"],
207
+ netId: "pinheader.JP2 > port.pin6 to .U1 > .pin13",
208
+ },
209
+ ],
210
+ netConnections: [
211
+ {
212
+ netId: "V3_3",
213
+ pinIds: ["U1.1", "JP1.2"],
214
+ netLabelWidth: 0.4,
215
+ },
216
+ {
217
+ netId: "GND",
218
+ pinIds: ["U1.7", "JP1.1", "JP2.1"],
219
+ netLabelWidth: 0.3,
220
+ },
221
+ {
222
+ netId: "V5",
223
+ pinIds: ["U1.14", "JP2.2"],
224
+ netLabelWidth: 0.2,
225
+ },
226
+ ],
227
+ availableNetLabelOrientations: {
228
+ V3_3: ["y+"],
229
+ V5: ["y+"],
230
+ GND: ["y-"],
231
+ },
232
+ maxMspPairDistance: 5,
233
+ }
234
+
235
+ test("example01", () => {
236
+ const solver = new SchematicTracePipelineSolver(inputProblem)
237
+
238
+ solver.solve()
239
+
240
+ expect(solver).toMatchSolverSnapshot(import.meta.path)
241
+ })