@tscircuit/schematic-trace-solver 0.0.168 → 0.0.169

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 (20) hide show
  1. package/dist/index.js +77 -1
  2. package/lib/solvers/NetLabelToTraceSolver/NetLabelToTraceSolver.ts +2 -2
  3. package/lib/solvers/NetLabelTraceRecovery/doesTraceRecoveryPathConflict.ts +112 -0
  4. package/package.json +1 -1
  5. package/tests/bug-reports/bug-report-20260706T213649Z/__snapshots__/bug-report-20260706T213649Z.snap.svg +60 -222
  6. package/tests/bug-reports/bug-report-20260707T141025Z/__snapshots__/bug-report-20260707T141025Z.snap.svg +46 -64
  7. package/tests/bug-reports/bug-report-20260707T141421Z/__snapshots__/bug-report-20260707T141421Z.snap.svg +7 -25
  8. package/tests/bug-reports/bug-report-20260708T095725Z/__snapshots__/bug-report-20260708T095725Z.snap.svg +68 -104
  9. package/tests/examples/__snapshots__/example35.snap.svg +5 -23
  10. package/tests/examples/__snapshots__/example36.snap.svg +27 -45
  11. package/tests/examples/__snapshots__/example37.snap.svg +7 -25
  12. package/tests/examples/__snapshots__/example51.snap.svg +47 -83
  13. package/tests/repros/__snapshots__/board1096-usb-label-overlap-iteration.snap.svg +5 -23
  14. package/tests/repros/__snapshots__/repro-bc107a-common-emitter-routing.snap.svg +141 -0
  15. package/tests/repros/__snapshots__/repro-dc-power-isolated-routing.snap.svg +6 -24
  16. package/tests/repros/__snapshots__/repro-powerbank-3v-system-power.snap.svg +255 -0
  17. package/tests/repros/assets/repro-bc107a-common-emitter-routing.input.json +687 -0
  18. package/tests/repros/assets/repro-powerbank-3v-system-power.input.json +1772 -0
  19. package/tests/repros/repro-bc107a-common-emitter-routing.test.ts +16 -0
  20. package/tests/repros/repro-powerbank-3v-system-power.test.ts +17 -0
@@ -0,0 +1,687 @@
1
+ {
2
+ "chips": [
3
+ {
4
+ "chipId": "V1",
5
+ "center": {
6
+ "x": -3.6426361625000006,
7
+ "y": -2.04
8
+ },
9
+ "width": 1.7541830249999997,
10
+ "height": 1.08,
11
+ "pins": [
12
+ {
13
+ "pinId": "schematic_port_0",
14
+ "displayName": "terminal1",
15
+ "x": -4.205,
16
+ "y": -1.5,
17
+ "_facingDirection": "y+"
18
+ },
19
+ {
20
+ "pinId": "schematic_port_1",
21
+ "displayName": "terminal2",
22
+ "x": -4.195,
23
+ "y": -2.58,
24
+ "_facingDirection": "y-"
25
+ }
26
+ ]
27
+ },
28
+ {
29
+ "chipId": "C1",
30
+ "center": {
31
+ "x": -2.9,
32
+ "y": -1
33
+ },
34
+ "width": 0.5999999999999996,
35
+ "height": 0.8399999999999999,
36
+ "pins": [
37
+ {
38
+ "pinId": "schematic_port_2",
39
+ "displayName": "pos",
40
+ "x": -3.1999999999999997,
41
+ "y": -1,
42
+ "_facingDirection": "x-"
43
+ },
44
+ {
45
+ "pinId": "schematic_port_3",
46
+ "displayName": "neg",
47
+ "x": -2.6,
48
+ "y": -1,
49
+ "_facingDirection": "x+"
50
+ }
51
+ ]
52
+ },
53
+ {
54
+ "chipId": "R2",
55
+ "center": {
56
+ "x": -1.2850000000000001,
57
+ "y": 0.4
58
+ },
59
+ "width": 1.3299999999999998,
60
+ "height": 0.6,
61
+ "pins": [
62
+ {
63
+ "pinId": "schematic_port_4",
64
+ "displayName": "anode",
65
+ "x": -1.5,
66
+ "y": 0.7
67
+ },
68
+ {
69
+ "pinId": "schematic_port_5",
70
+ "displayName": "cathode",
71
+ "x": -1.5,
72
+ "y": 0.10000000000000003
73
+ }
74
+ ]
75
+ },
76
+ {
77
+ "chipId": "R1",
78
+ "center": {
79
+ "x": -1.405,
80
+ "y": -2.4
81
+ },
82
+ "width": 1.0899999999999999,
83
+ "height": 0.5999999999999996,
84
+ "pins": [
85
+ {
86
+ "pinId": "schematic_port_6",
87
+ "displayName": "anode",
88
+ "x": -1.5,
89
+ "y": -2.1,
90
+ "_facingDirection": "y+"
91
+ },
92
+ {
93
+ "pinId": "schematic_port_7",
94
+ "displayName": "cathode",
95
+ "x": -1.5,
96
+ "y": -2.6999999999999997,
97
+ "_facingDirection": "y-"
98
+ }
99
+ ]
100
+ },
101
+ {
102
+ "chipId": "Q1",
103
+ "center": {
104
+ "x": -0.3025,
105
+ "y": -0.9752723250000003
106
+ },
107
+ "width": 1.435,
108
+ "height": 1.1494553499999995,
109
+ "pins": [
110
+ {
111
+ "pinId": "schematic_port_8",
112
+ "displayName": "collector",
113
+ "x": 0.29,
114
+ "y": -0.4005446500000005,
115
+ "_facingDirection": "y+"
116
+ },
117
+ {
118
+ "pinId": "schematic_port_9",
119
+ "displayName": "emitter",
120
+ "x": 0.29,
121
+ "y": -1.55,
122
+ "_facingDirection": "y-"
123
+ },
124
+ {
125
+ "pinId": "schematic_port_10",
126
+ "displayName": "base",
127
+ "x": -1.02,
128
+ "y": -1,
129
+ "_facingDirection": "x-"
130
+ }
131
+ ]
132
+ },
133
+ {
134
+ "chipId": "R3",
135
+ "center": {
136
+ "x": 0.32499999999999996,
137
+ "y": 0.4
138
+ },
139
+ "width": 0.97,
140
+ "height": 0.6,
141
+ "pins": [
142
+ {
143
+ "pinId": "schematic_port_11",
144
+ "displayName": "anode",
145
+ "x": 0.29,
146
+ "y": 0.7
147
+ },
148
+ {
149
+ "pinId": "schematic_port_12",
150
+ "displayName": "cathode",
151
+ "x": 0.29,
152
+ "y": 0.10000000000000003
153
+ }
154
+ ]
155
+ },
156
+ {
157
+ "chipId": "C2",
158
+ "center": {
159
+ "x": 1.3,
160
+ "y": -0.44999999999999996
161
+ },
162
+ "width": 0.6000000000000001,
163
+ "height": 0.8399999999999999,
164
+ "pins": [
165
+ {
166
+ "pinId": "schematic_port_13",
167
+ "displayName": "pos",
168
+ "x": 1,
169
+ "y": -0.45,
170
+ "_facingDirection": "x-"
171
+ },
172
+ {
173
+ "pinId": "schematic_port_14",
174
+ "displayName": "neg",
175
+ "x": 1.6,
176
+ "y": -0.45,
177
+ "_facingDirection": "x+"
178
+ }
179
+ ]
180
+ },
181
+ {
182
+ "chipId": "R4",
183
+ "center": {
184
+ "x": 2.8949999999999996,
185
+ "y": -2
186
+ },
187
+ "width": 1.0900000000000003,
188
+ "height": 0.6000000000000001,
189
+ "pins": [
190
+ {
191
+ "pinId": "schematic_port_15",
192
+ "displayName": "anode",
193
+ "x": 2.8,
194
+ "y": -1.7
195
+ },
196
+ {
197
+ "pinId": "schematic_port_16",
198
+ "displayName": "cathode",
199
+ "x": 2.8,
200
+ "y": -2.3
201
+ }
202
+ ]
203
+ },
204
+ {
205
+ "chipId": "V2",
206
+ "center": {
207
+ "x": 4.6973638375,
208
+ "y": 0
209
+ },
210
+ "width": 1.034183024999999,
211
+ "height": 1.08,
212
+ "pins": [
213
+ {
214
+ "pinId": "schematic_port_17",
215
+ "displayName": "terminal1",
216
+ "x": 4.495,
217
+ "y": 0.54,
218
+ "_facingDirection": "y+"
219
+ },
220
+ {
221
+ "pinId": "schematic_port_18",
222
+ "displayName": "terminal2",
223
+ "x": 4.505,
224
+ "y": -0.54,
225
+ "_facingDirection": "y-"
226
+ }
227
+ ]
228
+ }
229
+ ],
230
+ "directConnections": [
231
+ {
232
+ "netId": ".V1 > .pin1 to .C1 > .pin1",
233
+ "pinIds": [
234
+ "schematic_port_0",
235
+ "schematic_port_2"
236
+ ]
237
+ },
238
+ {
239
+ "netId": ".C1 > .pin2 to .Q1 > .base",
240
+ "pinIds": [
241
+ "schematic_port_3",
242
+ "schematic_port_10"
243
+ ]
244
+ },
245
+ {
246
+ "netId": ".R2 > .pin2 to .Q1 > .base",
247
+ "pinIds": [
248
+ "schematic_port_5",
249
+ "schematic_port_10"
250
+ ]
251
+ },
252
+ {
253
+ "netId": ".R1 > .pin1 to .Q1 > .base",
254
+ "pinIds": [
255
+ "schematic_port_6",
256
+ "schematic_port_10"
257
+ ]
258
+ },
259
+ {
260
+ "netId": ".Q1 > .collector to .R3 > .pin2",
261
+ "pinIds": [
262
+ "schematic_port_8",
263
+ "schematic_port_12"
264
+ ]
265
+ },
266
+ {
267
+ "netId": ".Q1 > .collector to .C2 > .pin1",
268
+ "pinIds": [
269
+ "schematic_port_8",
270
+ "schematic_port_13"
271
+ ]
272
+ },
273
+ {
274
+ "netId": ".C2 > .pin2 to .R4 > .pin1",
275
+ "pinIds": [
276
+ "schematic_port_14",
277
+ "schematic_port_15"
278
+ ]
279
+ }
280
+ ],
281
+ "netConnections": [
282
+ {
283
+ "netId": "GND",
284
+ "isGround": true,
285
+ "netLabelWidth": 0.42,
286
+ "netLabelHeight": 0.48,
287
+ "pinIds": [
288
+ "schematic_port_1",
289
+ "schematic_port_7",
290
+ "schematic_port_9",
291
+ "schematic_port_16",
292
+ "schematic_port_18"
293
+ ]
294
+ },
295
+ {
296
+ "netId": "VCC",
297
+ "isGround": false,
298
+ "netLabelWidth": 0.42,
299
+ "netLabelHeight": 0.48,
300
+ "pinIds": [
301
+ "schematic_port_4",
302
+ "schematic_port_11",
303
+ "schematic_port_17"
304
+ ]
305
+ }
306
+ ],
307
+ "textBoxes": [],
308
+ "availableNetLabelOrientations": {
309
+ "GND": [
310
+ "y-"
311
+ ],
312
+ "VCC": [
313
+ "y+"
314
+ ]
315
+ },
316
+ "maxMspPairDistance": 2.4,
317
+ "_chipObstacleSpatialIndex": {
318
+ "chips": [
319
+ {
320
+ "chipId": "V1",
321
+ "center": {
322
+ "x": -3.6426361625000006,
323
+ "y": -2.04
324
+ },
325
+ "width": 1.7541830249999997,
326
+ "height": 1.08,
327
+ "pins": [
328
+ {
329
+ "pinId": "schematic_port_0",
330
+ "displayName": "terminal1",
331
+ "x": -4.205,
332
+ "y": -1.5,
333
+ "_facingDirection": "y+"
334
+ },
335
+ {
336
+ "pinId": "schematic_port_1",
337
+ "displayName": "terminal2",
338
+ "x": -4.195,
339
+ "y": -2.58,
340
+ "_facingDirection": "y-"
341
+ }
342
+ ],
343
+ "bounds": {
344
+ "minX": -4.519727675,
345
+ "maxX": -2.7655446500000007,
346
+ "minY": -2.58,
347
+ "maxY": -1.5
348
+ },
349
+ "spatialIndexId": 0
350
+ },
351
+ {
352
+ "chipId": "C1",
353
+ "center": {
354
+ "x": -2.9,
355
+ "y": -1
356
+ },
357
+ "width": 0.5999999999999996,
358
+ "height": 0.8399999999999999,
359
+ "pins": [
360
+ {
361
+ "pinId": "schematic_port_2",
362
+ "displayName": "pos",
363
+ "x": -3.1999999999999997,
364
+ "y": -1,
365
+ "_facingDirection": "x-"
366
+ },
367
+ {
368
+ "pinId": "schematic_port_3",
369
+ "displayName": "neg",
370
+ "x": -2.6,
371
+ "y": -1,
372
+ "_facingDirection": "x+"
373
+ }
374
+ ],
375
+ "bounds": {
376
+ "minX": -3.1999999999999997,
377
+ "maxX": -2.6,
378
+ "minY": -1.42,
379
+ "maxY": -0.5800000000000001
380
+ },
381
+ "spatialIndexId": 1
382
+ },
383
+ {
384
+ "chipId": "R2",
385
+ "center": {
386
+ "x": -1.2850000000000001,
387
+ "y": 0.4
388
+ },
389
+ "width": 1.3299999999999998,
390
+ "height": 0.6,
391
+ "pins": [
392
+ {
393
+ "pinId": "schematic_port_4",
394
+ "displayName": "anode",
395
+ "x": -1.5,
396
+ "y": 0.7
397
+ },
398
+ {
399
+ "pinId": "schematic_port_5",
400
+ "displayName": "cathode",
401
+ "x": -1.5,
402
+ "y": 0.10000000000000003
403
+ }
404
+ ],
405
+ "bounds": {
406
+ "minX": -1.9500000000000002,
407
+ "maxX": -0.6200000000000002,
408
+ "minY": 0.10000000000000003,
409
+ "maxY": 0.7
410
+ },
411
+ "spatialIndexId": 2
412
+ },
413
+ {
414
+ "chipId": "R1",
415
+ "center": {
416
+ "x": -1.405,
417
+ "y": -2.4
418
+ },
419
+ "width": 1.0899999999999999,
420
+ "height": 0.5999999999999996,
421
+ "pins": [
422
+ {
423
+ "pinId": "schematic_port_6",
424
+ "displayName": "anode",
425
+ "x": -1.5,
426
+ "y": -2.1,
427
+ "_facingDirection": "y+"
428
+ },
429
+ {
430
+ "pinId": "schematic_port_7",
431
+ "displayName": "cathode",
432
+ "x": -1.5,
433
+ "y": -2.6999999999999997,
434
+ "_facingDirection": "y-"
435
+ }
436
+ ],
437
+ "bounds": {
438
+ "minX": -1.95,
439
+ "maxX": -0.8600000000000001,
440
+ "minY": -2.6999999999999997,
441
+ "maxY": -2.1
442
+ },
443
+ "spatialIndexId": 3
444
+ },
445
+ {
446
+ "chipId": "Q1",
447
+ "center": {
448
+ "x": -0.3025,
449
+ "y": -0.9752723250000003
450
+ },
451
+ "width": 1.435,
452
+ "height": 1.1494553499999995,
453
+ "pins": [
454
+ {
455
+ "pinId": "schematic_port_8",
456
+ "displayName": "collector",
457
+ "x": 0.29,
458
+ "y": -0.4005446500000005,
459
+ "_facingDirection": "y+"
460
+ },
461
+ {
462
+ "pinId": "schematic_port_9",
463
+ "displayName": "emitter",
464
+ "x": 0.29,
465
+ "y": -1.55,
466
+ "_facingDirection": "y-"
467
+ },
468
+ {
469
+ "pinId": "schematic_port_10",
470
+ "displayName": "base",
471
+ "x": -1.02,
472
+ "y": -1,
473
+ "_facingDirection": "x-"
474
+ }
475
+ ],
476
+ "bounds": {
477
+ "minX": -1.02,
478
+ "maxX": 0.41500000000000004,
479
+ "minY": -1.55,
480
+ "maxY": -0.4005446500000005
481
+ },
482
+ "spatialIndexId": 4
483
+ },
484
+ {
485
+ "chipId": "R3",
486
+ "center": {
487
+ "x": 0.32499999999999996,
488
+ "y": 0.4
489
+ },
490
+ "width": 0.97,
491
+ "height": 0.6,
492
+ "pins": [
493
+ {
494
+ "pinId": "schematic_port_11",
495
+ "displayName": "anode",
496
+ "x": 0.29,
497
+ "y": 0.7
498
+ },
499
+ {
500
+ "pinId": "schematic_port_12",
501
+ "displayName": "cathode",
502
+ "x": 0.29,
503
+ "y": 0.10000000000000003
504
+ }
505
+ ],
506
+ "bounds": {
507
+ "minX": -0.16000000000000003,
508
+ "maxX": 0.8099999999999999,
509
+ "minY": 0.10000000000000003,
510
+ "maxY": 0.7
511
+ },
512
+ "spatialIndexId": 5
513
+ },
514
+ {
515
+ "chipId": "C2",
516
+ "center": {
517
+ "x": 1.3,
518
+ "y": -0.44999999999999996
519
+ },
520
+ "width": 0.6000000000000001,
521
+ "height": 0.8399999999999999,
522
+ "pins": [
523
+ {
524
+ "pinId": "schematic_port_13",
525
+ "displayName": "pos",
526
+ "x": 1,
527
+ "y": -0.45,
528
+ "_facingDirection": "x-"
529
+ },
530
+ {
531
+ "pinId": "schematic_port_14",
532
+ "displayName": "neg",
533
+ "x": 1.6,
534
+ "y": -0.45,
535
+ "_facingDirection": "x+"
536
+ }
537
+ ],
538
+ "bounds": {
539
+ "minX": 1,
540
+ "maxX": 1.6,
541
+ "minY": -0.8699999999999999,
542
+ "maxY": -0.030000000000000027
543
+ },
544
+ "spatialIndexId": 6
545
+ },
546
+ {
547
+ "chipId": "R4",
548
+ "center": {
549
+ "x": 2.8949999999999996,
550
+ "y": -2
551
+ },
552
+ "width": 1.0900000000000003,
553
+ "height": 0.6000000000000001,
554
+ "pins": [
555
+ {
556
+ "pinId": "schematic_port_15",
557
+ "displayName": "anode",
558
+ "x": 2.8,
559
+ "y": -1.7
560
+ },
561
+ {
562
+ "pinId": "schematic_port_16",
563
+ "displayName": "cathode",
564
+ "x": 2.8,
565
+ "y": -2.3
566
+ }
567
+ ],
568
+ "bounds": {
569
+ "minX": 2.3499999999999996,
570
+ "maxX": 3.4399999999999995,
571
+ "minY": -2.3,
572
+ "maxY": -1.7
573
+ },
574
+ "spatialIndexId": 7
575
+ },
576
+ {
577
+ "chipId": "V2",
578
+ "center": {
579
+ "x": 4.6973638375,
580
+ "y": 0
581
+ },
582
+ "width": 1.034183024999999,
583
+ "height": 1.08,
584
+ "pins": [
585
+ {
586
+ "pinId": "schematic_port_17",
587
+ "displayName": "terminal1",
588
+ "x": 4.495,
589
+ "y": 0.54,
590
+ "_facingDirection": "y+"
591
+ },
592
+ {
593
+ "pinId": "schematic_port_18",
594
+ "displayName": "terminal2",
595
+ "x": 4.505,
596
+ "y": -0.54,
597
+ "_facingDirection": "y-"
598
+ }
599
+ ],
600
+ "bounds": {
601
+ "minX": 4.180272325000001,
602
+ "maxX": 5.21445535,
603
+ "minY": -0.54,
604
+ "maxY": 0.54
605
+ },
606
+ "spatialIndexId": 8
607
+ }
608
+ ],
609
+ "spatialIndex": {
610
+ "numItems": 9,
611
+ "nodeSize": 16,
612
+ "byteOffset": 0,
613
+ "_levelBounds": [
614
+ 36,
615
+ 40
616
+ ],
617
+ "data": {},
618
+ "_boxes": {
619
+ "0": -4.519727675,
620
+ "1": -2.58,
621
+ "2": -2.7655446500000007,
622
+ "3": -1.5,
623
+ "4": -3.1999999999999997,
624
+ "5": -1.42,
625
+ "6": -2.6,
626
+ "7": -0.5800000000000001,
627
+ "8": -1.9500000000000002,
628
+ "9": 0.10000000000000003,
629
+ "10": -0.6200000000000002,
630
+ "11": 0.7,
631
+ "12": -1.95,
632
+ "13": -2.6999999999999997,
633
+ "14": -0.8600000000000001,
634
+ "15": -2.1,
635
+ "16": -1.02,
636
+ "17": -1.55,
637
+ "18": 0.41500000000000004,
638
+ "19": -0.4005446500000005,
639
+ "20": -0.16000000000000003,
640
+ "21": 0.10000000000000003,
641
+ "22": 0.8099999999999999,
642
+ "23": 0.7,
643
+ "24": 1,
644
+ "25": -0.8699999999999999,
645
+ "26": 1.6,
646
+ "27": -0.030000000000000027,
647
+ "28": 2.3499999999999996,
648
+ "29": -2.3,
649
+ "30": 3.4399999999999995,
650
+ "31": -1.7,
651
+ "32": 4.180272325000001,
652
+ "33": -0.54,
653
+ "34": 5.21445535,
654
+ "35": 0.54,
655
+ "36": -4.519727675,
656
+ "37": -2.6999999999999997,
657
+ "38": 5.21445535,
658
+ "39": 0.7
659
+ },
660
+ "_indices": {
661
+ "0": 0,
662
+ "1": 1,
663
+ "2": 2,
664
+ "3": 3,
665
+ "4": 4,
666
+ "5": 5,
667
+ "6": 6,
668
+ "7": 7,
669
+ "8": 8,
670
+ "9": 0
671
+ },
672
+ "_pos": 40,
673
+ "minX": -4.519727675,
674
+ "minY": -2.6999999999999997,
675
+ "maxX": 5.21445535,
676
+ "maxY": 0.7,
677
+ "_queue": {
678
+ "ids": [],
679
+ "values": [],
680
+ "capacity": null,
681
+ "length": 0
682
+ }
683
+ },
684
+ "spatialIndexIdToChip": {}
685
+ },
686
+ "_hideRatsNet": false
687
+ }