@tscircuit/schematic-trace-solver 0.0.113 → 0.0.115

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 +7 -8
  2. package/dist/index.js +101 -7
  3. package/lib/solvers/LongDistancePairSolver/LongDistancePairSolver.ts +55 -1
  4. package/lib/solvers/MspConnectionPairSolver/MspConnectionPairSolver.ts +13 -4
  5. package/lib/solvers/MspConnectionPairSolver/isLabeledPeripheralConnection.ts +44 -0
  6. package/lib/solvers/SchematicTraceLinesSolver/SchematicTraceSingleLineSolver2/SchematicTraceSingleLineSolver2.ts +9 -9
  7. package/lib/solvers/SchematicTraceLinesSolver/SchematicTraceSingleLineSolver2/rect.ts +25 -9
  8. package/lib/solvers/SchematicTracePipelineSolver/SchematicTracePipelineSolver.ts +2 -0
  9. package/package.json +2 -2
  10. package/site/bug-reports/bug-report-20260728T144234Z.page.tsx +4 -0
  11. package/site/bug-reports/bug-report-20260728T225606Z.page.tsx +4 -0
  12. package/tests/bug-reports/bug-report-20260721T221026Z/__snapshots__/bug-report-20260721T221026Z.snap.svg +1 -1
  13. package/tests/bug-reports/bug-report-20260728T144234Z/__snapshots__/bug-report-20260728T144234Z.snap.svg +108 -0
  14. package/tests/bug-reports/bug-report-20260728T144234Z/bug-report-20260728T144234Z.json +518 -0
  15. package/tests/bug-reports/bug-report-20260728T144234Z/bug-report-20260728T144234Z.test.ts +12 -0
  16. package/tests/bug-reports/bug-report-20260728T225606Z/__snapshots__/bug-report-20260728T225606Z.snap.svg +131 -0
  17. package/tests/bug-reports/bug-report-20260728T225606Z/bug-report-20260728T225606Z.json +1127 -0
  18. package/tests/bug-reports/bug-report-20260728T225606Z/bug-report-20260728T225606Z.test.ts +35 -0
  19. package/tests/repros/__snapshots__/repro-type-c-16pin-self-connection.snap.svg +54 -0
  20. package/tests/repros/__snapshots__/repro-type-c-16pin-to-resistor.snap.svg +56 -0
  21. package/tests/repros/__snapshots__/repro48-555-timer-vcc-rail-label.snap.svg +87 -0
  22. package/tests/repros/assets/repro48-555-timer-vcc-rail-label.input.json +276 -0
  23. package/tests/repros/repro-type-c-16pin-self-connection.test.ts +97 -0
  24. package/tests/repros/repro-type-c-16pin-to-resistor.test.ts +120 -0
  25. package/tests/repros/repro48-555-timer-vcc-rail-label.test.ts +23 -0
  26. package/tests/solvers/SchematicTraceSingleLineSolver2/text-box-obstacle-gap.test.ts +43 -0
@@ -0,0 +1,518 @@
1
+ {
2
+ "chips": [
3
+ {
4
+ "chipId": "schematic_component_0",
5
+ "center": {
6
+ "x": 0,
7
+ "y": 0
8
+ },
9
+ "width": 2.5,
10
+ "height": 4,
11
+ "pins": [
12
+ {
13
+ "pinId": "schematic_port_0",
14
+ "x": 1.25,
15
+ "y": -1.2000000000000002
16
+ },
17
+ {
18
+ "pinId": "schematic_port_1",
19
+ "x": 1.25,
20
+ "y": 1.4000000000000001
21
+ },
22
+ {
23
+ "pinId": "schematic_port_2",
24
+ "x": 1.25,
25
+ "y": 0.8499999999999999
26
+ },
27
+ {
28
+ "pinId": "schematic_port_3",
29
+ "x": 1.25,
30
+ "y": 0.2999999999999998
31
+ },
32
+ {
33
+ "pinId": "schematic_port_4",
34
+ "x": 1.25,
35
+ "y": -0.10000000000000009
36
+ },
37
+ {
38
+ "pinId": "schematic_port_5",
39
+ "x": 1.25,
40
+ "y": -0.6500000000000001
41
+ },
42
+ {
43
+ "pinId": "schematic_port_6",
44
+ "x": 1.25,
45
+ "y": -0.8500000000000001
46
+ },
47
+ {
48
+ "pinId": "schematic_port_7",
49
+ "x": 1.25,
50
+ "y": -0.30000000000000004
51
+ },
52
+ {
53
+ "pinId": "schematic_port_8",
54
+ "x": 1.25,
55
+ "y": 0.09999999999999987
56
+ },
57
+ {
58
+ "pinId": "schematic_port_9",
59
+ "x": 1.25,
60
+ "y": 0.6499999999999997
61
+ },
62
+ {
63
+ "pinId": "schematic_port_10",
64
+ "x": 1.25,
65
+ "y": 1.2
66
+ },
67
+ {
68
+ "pinId": "schematic_port_11",
69
+ "x": 1.25,
70
+ "y": -1.4000000000000001
71
+ },
72
+ {
73
+ "pinId": "schematic_port_12",
74
+ "x": -0.37500000000000006,
75
+ "y": -2
76
+ },
77
+ {
78
+ "pinId": "schematic_port_13",
79
+ "x": -0.17500000000000004,
80
+ "y": -2
81
+ },
82
+ {
83
+ "pinId": "schematic_port_14",
84
+ "x": 0.024999999999999967,
85
+ "y": -2
86
+ },
87
+ {
88
+ "pinId": "schematic_port_15",
89
+ "x": 0.22500000000000003,
90
+ "y": -2
91
+ }
92
+ ],
93
+ "sectionId": "Power Input & 3V3 Regulator"
94
+ },
95
+ {
96
+ "chipId": "schematic_component_1",
97
+ "center": {
98
+ "x": 2.98,
99
+ "y": 1.5149999999999992
100
+ },
101
+ "width": 1.04,
102
+ "height": 0.6799999999999999,
103
+ "pins": [
104
+ {
105
+ "pinId": "schematic_port_16",
106
+ "x": 2.46,
107
+ "y": 1.4449999999999992,
108
+ "_facingDirection": "x-"
109
+ },
110
+ {
111
+ "pinId": "schematic_port_17",
112
+ "x": 3.5,
113
+ "y": 1.4449999999999992,
114
+ "_facingDirection": "x+"
115
+ }
116
+ ],
117
+ "sectionId": "Power Input & 3V3 Regulator"
118
+ },
119
+ {
120
+ "chipId": "schematic_component_2",
121
+ "center": {
122
+ "x": 2.88,
123
+ "y": -0.650000000000001
124
+ },
125
+ "width": 0.8399999999999999,
126
+ "height": 1.1000000000000003,
127
+ "pins": [
128
+ {
129
+ "pinId": "schematic_port_18",
130
+ "x": 3.1799999999999997,
131
+ "y": -0.10000000000000087
132
+ },
133
+ {
134
+ "pinId": "schematic_port_19",
135
+ "x": 3.19,
136
+ "y": -1.200000000000001
137
+ },
138
+ {
139
+ "pinId": "schematic_port_20",
140
+ "x": 2.46,
141
+ "y": -0.7500000000000009
142
+ }
143
+ ],
144
+ "sectionId": "Power Input & 3V3 Regulator"
145
+ },
146
+ {
147
+ "chipId": "schematic_component_3",
148
+ "center": {
149
+ "x": 5.057499999999999,
150
+ "y": -0.40000000000000085
151
+ },
152
+ "width": 1.085,
153
+ "height": 0.6,
154
+ "pins": [
155
+ {
156
+ "pinId": "schematic_port_21",
157
+ "x": 4.84,
158
+ "y": -0.10000000000000087,
159
+ "_facingDirection": "y+"
160
+ },
161
+ {
162
+ "pinId": "schematic_port_22",
163
+ "x": 4.84,
164
+ "y": -0.7000000000000008,
165
+ "_facingDirection": "y-"
166
+ }
167
+ ],
168
+ "sectionId": "Power Input & 3V3 Regulator"
169
+ },
170
+ {
171
+ "chipId": "schematic_component_4",
172
+ "center": {
173
+ "x": 2.65,
174
+ "y": -3.205000000000001
175
+ },
176
+ "width": 2,
177
+ "height": 0.7999999999999998,
178
+ "pins": [
179
+ {
180
+ "pinId": "schematic_port_23",
181
+ "x": 1.65,
182
+ "y": -3.005000000000001
183
+ },
184
+ {
185
+ "pinId": "schematic_port_24",
186
+ "x": 1.65,
187
+ "y": -3.205000000000001
188
+ },
189
+ {
190
+ "pinId": "schematic_port_25",
191
+ "x": 1.65,
192
+ "y": -3.405000000000001
193
+ },
194
+ {
195
+ "pinId": "schematic_port_26",
196
+ "x": 3.65,
197
+ "y": -3.305000000000001
198
+ },
199
+ {
200
+ "pinId": "schematic_port_27",
201
+ "x": 3.65,
202
+ "y": -3.105000000000001
203
+ }
204
+ ],
205
+ "sectionId": "Power Input & 3V3 Regulator"
206
+ },
207
+ {
208
+ "chipId": "schematic_component_5",
209
+ "center": {
210
+ "x": 5.26,
211
+ "y": 1.409999999999999
212
+ },
213
+ "width": 0.9200000000000008,
214
+ "height": 0.7599999999999998,
215
+ "pins": [
216
+ {
217
+ "pinId": "schematic_port_28",
218
+ "x": 5.125,
219
+ "y": 1.789999999999999,
220
+ "_facingDirection": "y+"
221
+ },
222
+ {
223
+ "pinId": "schematic_port_29",
224
+ "x": 5.125,
225
+ "y": 1.0299999999999991,
226
+ "_facingDirection": "y-"
227
+ }
228
+ ],
229
+ "sectionId": "Power Input & 3V3 Regulator"
230
+ },
231
+ {
232
+ "chipId": "schematic_component_6",
233
+ "center": {
234
+ "x": 4.914999999999999,
235
+ "y": -3.605000000000001
236
+ },
237
+ "width": 1.04,
238
+ "height": 0.7600000000000007,
239
+ "pins": [
240
+ {
241
+ "pinId": "schematic_port_30",
242
+ "x": 4.72,
243
+ "y": -3.2250000000000005,
244
+ "_facingDirection": "y+"
245
+ },
246
+ {
247
+ "pinId": "schematic_port_31",
248
+ "x": 4.72,
249
+ "y": -3.985000000000001,
250
+ "_facingDirection": "y-"
251
+ }
252
+ ],
253
+ "sectionId": "Power Input & 3V3 Regulator"
254
+ },
255
+ {
256
+ "chipId": "schematic_component_7",
257
+ "center": {
258
+ "x": -2.3099999999999996,
259
+ "y": -3.505000000000001
260
+ },
261
+ "width": 1.4499999999999997,
262
+ "height": 0.7799999999999994,
263
+ "pins": [
264
+ {
265
+ "pinId": "schematic_port_32",
266
+ "x": -2.4849999999999994,
267
+ "y": -3.8950000000000005,
268
+ "_facingDirection": "y-"
269
+ },
270
+ {
271
+ "pinId": "schematic_port_33",
272
+ "x": -2.4849999999999994,
273
+ "y": -3.115000000000001,
274
+ "_facingDirection": "y+"
275
+ }
276
+ ],
277
+ "sectionId": "Power Input & 3V3 Regulator"
278
+ },
279
+ {
280
+ "chipId": "schematic_component_8",
281
+ "center": {
282
+ "x": -3.7199999999999998,
283
+ "y": -3.505000000000001
284
+ },
285
+ "width": 0.9200000000000004,
286
+ "height": 0.7600000000000007,
287
+ "pins": [
288
+ {
289
+ "pinId": "schematic_port_34",
290
+ "x": -3.8549999999999995,
291
+ "y": -3.1250000000000004,
292
+ "_facingDirection": "y+"
293
+ },
294
+ {
295
+ "pinId": "schematic_port_35",
296
+ "x": -3.8549999999999995,
297
+ "y": -3.885000000000001,
298
+ "_facingDirection": "y-"
299
+ }
300
+ ],
301
+ "sectionId": "Power Input & 3V3 Regulator"
302
+ },
303
+ {
304
+ "chipId": "schematic_component_9",
305
+ "center": {
306
+ "x": 0.032500000000000334,
307
+ "y": -5.044999999999999
308
+ },
309
+ "width": 1.0050000000000001,
310
+ "height": 1.1300000000000008,
311
+ "pins": [
312
+ {
313
+ "pinId": "schematic_port_36",
314
+ "x": -0.14499999999999957,
315
+ "y": -4.479999999999999,
316
+ "_facingDirection": "y+"
317
+ },
318
+ {
319
+ "pinId": "schematic_port_37",
320
+ "x": -0.1449999999999998,
321
+ "y": -5.609999999999999,
322
+ "_facingDirection": "y-"
323
+ }
324
+ ],
325
+ "sectionId": "Power Input & 3V3 Regulator"
326
+ },
327
+ {
328
+ "chipId": "schematic_component_10",
329
+ "center": {
330
+ "x": 0.012500000000000316,
331
+ "y": -3.504999999999999
332
+ },
333
+ "width": 0.9650000000000001,
334
+ "height": 0.5999999999999996,
335
+ "pins": [
336
+ {
337
+ "pinId": "schematic_port_38",
338
+ "x": -0.14499999999999963,
339
+ "y": -3.204999999999999,
340
+ "_facingDirection": "y+"
341
+ },
342
+ {
343
+ "pinId": "schematic_port_39",
344
+ "x": -0.14499999999999974,
345
+ "y": -3.804999999999999,
346
+ "_facingDirection": "y-"
347
+ }
348
+ ],
349
+ "sectionId": "Power Input & 3V3 Regulator"
350
+ }
351
+ ],
352
+ "directConnections": [
353
+ {
354
+ "netId": ".U3 > .BYP to .C2 > .pin1",
355
+ "pinIds": [
356
+ "schematic_port_26",
357
+ "schematic_port_30"
358
+ ]
359
+ },
360
+ {
361
+ "netId": ".R1 > .pin2 to .LED1 > .anode",
362
+ "pinIds": [
363
+ "schematic_port_39",
364
+ "schematic_port_36"
365
+ ]
366
+ }
367
+ ],
368
+ "netConnections": [
369
+ {
370
+ "netId": "GND",
371
+ "netLabelWidth": 0.42,
372
+ "netLabelHeight": 0.48,
373
+ "pinIds": [
374
+ "schematic_port_0",
375
+ "schematic_port_11",
376
+ "schematic_port_12",
377
+ "schematic_port_13",
378
+ "schematic_port_14",
379
+ "schematic_port_15",
380
+ "schematic_port_22",
381
+ "schematic_port_24",
382
+ "schematic_port_29",
383
+ "schematic_port_31",
384
+ "schematic_port_32",
385
+ "schematic_port_35",
386
+ "schematic_port_37"
387
+ ]
388
+ },
389
+ {
390
+ "netId": "V5",
391
+ "netLabelWidth": 0.42,
392
+ "netLabelHeight": 0.36,
393
+ "pinIds": [
394
+ "schematic_port_1",
395
+ "schematic_port_10",
396
+ "schematic_port_16",
397
+ "schematic_port_20",
398
+ "schematic_port_21"
399
+ ]
400
+ },
401
+ {
402
+ "netId": "DP",
403
+ "netLabelWidth": 0.36,
404
+ "pinIds": [
405
+ "schematic_port_3",
406
+ "schematic_port_8"
407
+ ]
408
+ },
409
+ {
410
+ "netId": "DM",
411
+ "netLabelWidth": 0.36,
412
+ "pinIds": [
413
+ "schematic_port_4",
414
+ "schematic_port_7"
415
+ ]
416
+ },
417
+ {
418
+ "netId": "VBUS",
419
+ "netLabelWidth": 0.42,
420
+ "netLabelHeight": 0.6,
421
+ "pinIds": [
422
+ "schematic_port_17",
423
+ "schematic_port_19",
424
+ "schematic_port_23",
425
+ "schematic_port_28"
426
+ ]
427
+ },
428
+ {
429
+ "netId": "BATT",
430
+ "netLabelWidth": 0.6,
431
+ "pinIds": [
432
+ "schematic_port_18"
433
+ ]
434
+ },
435
+ {
436
+ "netId": "LDO_EN",
437
+ "netLabelWidth": 0.84,
438
+ "pinIds": [
439
+ "schematic_port_25"
440
+ ]
441
+ },
442
+ {
443
+ "netId": "V3V3",
444
+ "netLabelWidth": 0.42,
445
+ "netLabelHeight": 0.6,
446
+ "pinIds": [
447
+ "schematic_port_27",
448
+ "schematic_port_33",
449
+ "schematic_port_34",
450
+ "schematic_port_38"
451
+ ]
452
+ }
453
+ ],
454
+ "textBoxes": [
455
+ {
456
+ "chipId": "schematic_component_0",
457
+ "center": {
458
+ "x": 1.07,
459
+ "y": 1.7149999999999999
460
+ },
461
+ "width": 0.3599999999999999,
462
+ "height": 0.24999999999999978,
463
+ "text": "J1"
464
+ },
465
+ {
466
+ "chipId": "schematic_component_4",
467
+ "center": {
468
+ "x": 3.07,
469
+ "y": -3.735000000000001
470
+ },
471
+ "width": 2.04,
472
+ "height": 0.17999999999999972,
473
+ "text": "MIC5219_3_3YM5_TR"
474
+ },
475
+ {
476
+ "chipId": "schematic_component_4",
477
+ "center": {
478
+ "x": 2.17,
479
+ "y": -2.6900000000000013
480
+ },
481
+ "width": 0.3600000000000003,
482
+ "height": 0.24999999999999956,
483
+ "text": "U3"
484
+ }
485
+ ],
486
+ "availableNetLabelOrientations": {
487
+ "V5": [
488
+ "y+"
489
+ ],
490
+ "GND": [
491
+ "y-"
492
+ ],
493
+ "DP": [
494
+ "x-",
495
+ "x+"
496
+ ],
497
+ "DM": [
498
+ "x-",
499
+ "x+"
500
+ ],
501
+ "VBUS": [
502
+ "y+"
503
+ ],
504
+ "BATT": [
505
+ "x-",
506
+ "x+"
507
+ ],
508
+ "LDO_EN": [
509
+ "x-",
510
+ "x+"
511
+ ],
512
+ "V3V3": [
513
+ "y+"
514
+ ]
515
+ },
516
+ "maxMspPairDistance": 8,
517
+ "_hideRatsNet": false
518
+ }
@@ -0,0 +1,12 @@
1
+ import { expect, test } from "bun:test"
2
+ import { SchematicTracePipelineSolver } from "lib/solvers/SchematicTracePipelineSolver/SchematicTracePipelineSolver"
3
+ import inputProblem from "./bug-report-20260728T144234Z.json"
4
+ import "tests/fixtures/matcher"
5
+
6
+ test("bug-report-20260728T144234Z", () => {
7
+ const solver = new SchematicTracePipelineSolver(inputProblem as any)
8
+
9
+ solver.solve()
10
+
11
+ expect(solver).toMatchSolverSnapshot(import.meta.path)
12
+ })