@tscircuit/schematic-trace-solver 0.0.174 → 0.0.176

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 (63) hide show
  1. package/dist/index.d.ts +5 -0
  2. package/dist/index.js +759 -91
  3. package/lib/solvers/AvailableNetOrientationSolver/AvailableNetOrientationSolver.ts +5 -1
  4. package/lib/solvers/InlineNetLabelSolver/InlineNetLabelSolver.ts +16 -1
  5. package/lib/solvers/InlineNetLabelSolver/restoreReroutesAroundSupersededLabels.ts +174 -0
  6. package/lib/solvers/NetLabelToTraceSolver/NetLabelToTraceSolver.ts +2 -30
  7. package/lib/solvers/SameNetJunctionAlignmentSolver/SameNetJunctionAlignmentSolver.ts +2 -0
  8. package/lib/solvers/SameNetJunctionAlignmentSolver/alignSameNetJunctions.ts +748 -15
  9. package/lib/solvers/SameNetJunctionAlignmentSolver/findNearestSharedPinExitRail.ts +140 -0
  10. package/lib/solvers/SchematicTracePipelineSolver/SchematicTracePipelineSolver.ts +12 -5
  11. package/lib/utils/doesPathCoincideWithTraces.ts +17 -4
  12. package/lib/utils/pathIntersectsRenderedLabel.ts +33 -0
  13. package/package.json +1 -1
  14. package/site/bug-reports/bug-report-20260901T055358Z.page.tsx +4 -0
  15. package/site/bug-reports/bug-report-20260901T064117Z.page.tsx +4 -0
  16. package/site/bug-reports/bug-report-20260901T134241Z.page.tsx +4 -0
  17. package/tests/bug-reports/bug-report-20260707T134549Z/__snapshots__/bug-report-20260707T134549Z.snap.svg +2 -2
  18. package/tests/bug-reports/bug-report-20260707T134549Z/bug-report-20260707T134549Z.test.ts +9 -0
  19. package/tests/bug-reports/bug-report-20260707T230831Z/__snapshots__/bug-report-20260707T230831Z.snap.svg +2 -2
  20. package/tests/bug-reports/bug-report-20260717T042845Z/__snapshots__/bug-report-20260717T042845Z.snap.svg +2 -2
  21. package/tests/bug-reports/bug-report-20260721T221026Z/__snapshots__/bug-report-20260721T221026Z.snap.svg +2 -2
  22. package/tests/bug-reports/bug-report-20260730T061837Z/__snapshots__/bug-report-20260730T061837Z.snap.svg +2 -2
  23. package/tests/bug-reports/bug-report-20260730T061837Z/bug-report-20260730T061837Z.test.ts +8 -4
  24. package/tests/bug-reports/bug-report-20260804T171919Z/__snapshots__/bug-report-20260804T171919Z.snap.svg +2 -2
  25. package/tests/bug-reports/bug-report-20260805T061316Z/__snapshots__/bug-report-20260805T061316Z.snap.svg +2 -2
  26. package/tests/bug-reports/bug-report-20260806T061548Z/__snapshots__/bug-report-20260806T061548Z.snap.svg +2 -2
  27. package/tests/bug-reports/bug-report-20260825T045913Z/__snapshots__/bug-report-20260825T045913Z.snap.svg +2 -2
  28. package/tests/bug-reports/bug-report-20260826T072956Z/__snapshots__/bug-report-20260826T072956Z.snap.svg +6 -6
  29. package/tests/bug-reports/bug-report-20260901T055358Z/__snapshots__/bug-report-20260901T055358Z.snap.svg +676 -0
  30. package/tests/bug-reports/bug-report-20260901T055358Z/bug-report-20260901T055358Z.json +2467 -0
  31. package/tests/bug-reports/bug-report-20260901T055358Z/bug-report-20260901T055358Z.test.ts +59 -0
  32. package/tests/bug-reports/bug-report-20260901T064117Z/__snapshots__/bug-report-20260901T064117Z.snap.svg +134 -0
  33. package/tests/bug-reports/bug-report-20260901T064117Z/bug-report-20260901T064117Z.json +215 -0
  34. package/tests/bug-reports/bug-report-20260901T064117Z/bug-report-20260901T064117Z.test.ts +12 -0
  35. package/tests/bug-reports/bug-report-20260901T134241Z/__snapshots__/bug-report-20260901T134241Z.snap.svg +115 -0
  36. package/tests/bug-reports/bug-report-20260901T134241Z/bug-report-20260901T134241Z.json +359 -0
  37. package/tests/bug-reports/bug-report-20260901T134241Z/bug-report-20260901T134241Z.test.ts +60 -0
  38. package/tests/examples/__snapshots__/example51.snap.svg +2 -2
  39. package/tests/repros/__snapshots__/board-1273-trace-overlap-cycle.snap.svg +10 -10
  40. package/tests/repros/__snapshots__/board1096-usb-label-overlap-iteration.snap.svg +2 -2
  41. package/tests/repros/__snapshots__/repro-bq25895-cross-net-trace-overlap.snap.svg +2 -2
  42. package/tests/repros/__snapshots__/repro-core-ground-inline-label-fallback.snap.svg +10 -10
  43. package/tests/repros/__snapshots__/repro-example35-minimize-trace-crossing.snap.svg +2 -2
  44. package/tests/repros/__snapshots__/repro-isolated-rs485-isow7841.snap.svg +18 -18
  45. package/tests/repros/__snapshots__/repro-pga300-redundant-ground-traces.snap.svg +18 -18
  46. package/tests/repros/__snapshots__/repro-pmp11282-isolated-dcdc.snap.svg +10 -10
  47. package/tests/repros/__snapshots__/repro-powerbank-3v-system-power.snap.svg +2 -2
  48. package/tests/repros/__snapshots__/repro-ti-power-output-section.snap.svg +2 -2
  49. package/tests/repros/__snapshots__/repro-tida-01389-hbridge.snap.svg +2 -2
  50. package/tests/repros/__snapshots__/repro-tida010076-page02.snap.svg +2 -2
  51. package/tests/repros/__snapshots__/repro-trellis-core-gnd-net-label-overlap.snap.svg +134 -0
  52. package/tests/repros/__snapshots__/repro-wireless-mouse-charger-section.snap.svg +164 -0
  53. package/tests/repros/__snapshots__/repro161-power-section-autolayout.snap.svg +2 -2
  54. package/tests/repros/__snapshots__/repro48-555-timer-vcc-rail-label.snap.svg +2 -2
  55. package/tests/repros/assets/repro-trellis-core-gnd-net-label-overlap.input.json +178 -0
  56. package/tests/repros/assets/repro-wireless-mouse-charger-section.input.json +591 -0
  57. package/tests/repros/repro-isolated-rs485-isow7841.test.ts +4 -1
  58. package/tests/repros/repro-powerbank-3v-system-power.test.ts +24 -0
  59. package/tests/repros/repro-tida-01389-hbridge.test.ts +24 -0
  60. package/tests/repros/repro-trellis-core-gnd-net-label-overlap.test.ts +73 -0
  61. package/tests/repros/repro-wireless-mouse-charger-section.test.ts +16 -0
  62. package/tests/solvers/InlineNetLabelSolver/restore-reroutes-around-superseded-labels.test.ts +186 -0
  63. package/tests/solvers/SameNetJunctionAlignmentSolver/parallel-load-rails.test.ts +1 -0
@@ -0,0 +1,591 @@
1
+ {
2
+ "chips": [
3
+ {
4
+ "chipId": "schematic_component_0",
5
+ "center": {
6
+ "x": -39,
7
+ "y": 0
8
+ },
9
+ "width": 2.760000000000005,
10
+ "height": 0.6,
11
+ "pins": [
12
+ {
13
+ "pinId": "schematic_port_0",
14
+ "displayName": "STAT",
15
+ "x": -37.62,
16
+ "y": -0.1
17
+ },
18
+ {
19
+ "pinId": "schematic_port_1",
20
+ "displayName": "VSS",
21
+ "x": -40.38,
22
+ "y": 0
23
+ },
24
+ {
25
+ "pinId": "schematic_port_2",
26
+ "displayName": "VBAT",
27
+ "x": -37.62,
28
+ "y": 0.1
29
+ },
30
+ {
31
+ "pinId": "schematic_port_3",
32
+ "displayName": "VDD",
33
+ "x": -40.38,
34
+ "y": 0.2
35
+ },
36
+ {
37
+ "pinId": "schematic_port_4",
38
+ "displayName": "PROG",
39
+ "x": -40.38,
40
+ "y": -0.2
41
+ }
42
+ ],
43
+ "sectionId": "UsbCharging"
44
+ },
45
+ {
46
+ "chipId": "schematic_component_1",
47
+ "center": {
48
+ "x": -39,
49
+ "y": -4
50
+ },
51
+ "width": 1.5600000000000023,
52
+ "height": 0.6800000000000002,
53
+ "pins": [
54
+ {
55
+ "pinId": "schematic_port_5",
56
+ "displayName": "anode",
57
+ "x": -39.78,
58
+ "y": -4,
59
+ "_facingDirection": "x-"
60
+ },
61
+ {
62
+ "pinId": "schematic_port_6",
63
+ "displayName": "cathode",
64
+ "x": -38.22,
65
+ "y": -4,
66
+ "_facingDirection": "x+"
67
+ }
68
+ ],
69
+ "sectionId": "UsbCharging"
70
+ },
71
+ {
72
+ "chipId": "schematic_component_2",
73
+ "center": {
74
+ "x": -33.447500000000005,
75
+ "y": -3
76
+ },
77
+ "width": 2.0050000000000026,
78
+ "height": 0.7600000000000007,
79
+ "pins": [
80
+ {
81
+ "pinId": "schematic_port_7",
82
+ "displayName": "1",
83
+ "x": -34,
84
+ "y": -2.6199999999999997,
85
+ "_facingDirection": "y+"
86
+ },
87
+ {
88
+ "pinId": "schematic_port_8",
89
+ "displayName": "2",
90
+ "x": -34,
91
+ "y": -3.3800000000000003,
92
+ "_facingDirection": "y-"
93
+ }
94
+ ],
95
+ "sectionId": "UsbCharging"
96
+ },
97
+ {
98
+ "chipId": "schematic_component_3",
99
+ "center": {
100
+ "x": -35.04,
101
+ "y": 3
102
+ },
103
+ "width": 1.4399999999999977,
104
+ "height": 0.6800000000000006,
105
+ "pins": [
106
+ {
107
+ "pinId": "schematic_port_9",
108
+ "displayName": "anode",
109
+ "x": -35.76,
110
+ "y": 3,
111
+ "_facingDirection": "x-"
112
+ },
113
+ {
114
+ "pinId": "schematic_port_10",
115
+ "displayName": "cathode",
116
+ "x": -34.32,
117
+ "y": 3,
118
+ "_facingDirection": "x+"
119
+ }
120
+ ],
121
+ "sectionId": "UsbCharging"
122
+ },
123
+ {
124
+ "chipId": "schematic_component_4",
125
+ "center": {
126
+ "x": -28.96,
127
+ "y": 3
128
+ },
129
+ "width": 1.2000000000000028,
130
+ "height": 1.1800000000000006,
131
+ "pins": [
132
+ {
133
+ "pinId": "schematic_port_11",
134
+ "displayName": "anode",
135
+ "x": -29.560000000000002,
136
+ "y": 3,
137
+ "_facingDirection": "x-"
138
+ },
139
+ {
140
+ "pinId": "schematic_port_12",
141
+ "displayName": "cathode",
142
+ "x": -28.36,
143
+ "y": 3,
144
+ "_facingDirection": "x+"
145
+ }
146
+ ],
147
+ "sectionId": "UsbCharging"
148
+ },
149
+ {
150
+ "chipId": "schematic_component_5",
151
+ "center": {
152
+ "x": -27,
153
+ "y": 0
154
+ },
155
+ "width": 2,
156
+ "height": 0.6,
157
+ "pins": [
158
+ {
159
+ "pinId": "schematic_port_13",
160
+ "displayName": "1",
161
+ "x": -28,
162
+ "y": 0.1
163
+ },
164
+ {
165
+ "pinId": "schematic_port_14",
166
+ "displayName": "2",
167
+ "x": -28,
168
+ "y": -0.1
169
+ },
170
+ {
171
+ "pinId": "schematic_port_15",
172
+ "displayName": "3",
173
+ "x": -26,
174
+ "y": -0.1
175
+ },
176
+ {
177
+ "pinId": "schematic_port_16",
178
+ "displayName": "4",
179
+ "x": -26,
180
+ "y": 0.1
181
+ }
182
+ ],
183
+ "sectionId": "BatteryPower"
184
+ }
185
+ ],
186
+ "directConnections": [
187
+ {
188
+ "netId": ".U_CHARGER > .PROG to .R_CHARGE_PROG > .pin1",
189
+ "netLabelWidth": 1.8,
190
+ "pinIds": [
191
+ "schematic_port_4",
192
+ "schematic_port_5"
193
+ ]
194
+ },
195
+ {
196
+ "netId": ".R_CHARGE_LED > .pin2 to .LED_CHARGE > .anode",
197
+ "netLabelWidth": 1.92,
198
+ "pinIds": [
199
+ "schematic_port_10",
200
+ "schematic_port_11"
201
+ ]
202
+ },
203
+ {
204
+ "netId": ".LED_CHARGE > .cathode to .U_CHARGER > .STAT",
205
+ "netLabelWidth": 1.8,
206
+ "pinIds": [
207
+ "schematic_port_12",
208
+ "schematic_port_0"
209
+ ]
210
+ }
211
+ ],
212
+ "netConnections": [
213
+ {
214
+ "netId": "GND",
215
+ "isGround": true,
216
+ "netLabelWidth": 0.42,
217
+ "netLabelHeight": 0.48,
218
+ "pinIds": [
219
+ "schematic_port_1",
220
+ "schematic_port_6",
221
+ "schematic_port_8",
222
+ "schematic_port_14"
223
+ ]
224
+ },
225
+ {
226
+ "netId": "VBAT",
227
+ "isGround": false,
228
+ "netLabelWidth": 0.42,
229
+ "netLabelHeight": 0.6,
230
+ "pinIds": [
231
+ "schematic_port_2",
232
+ "schematic_port_7",
233
+ "schematic_port_13"
234
+ ]
235
+ },
236
+ {
237
+ "netId": "VBUS_USB",
238
+ "isGround": false,
239
+ "netLabelWidth": 0.42,
240
+ "netLabelHeight": 1.08,
241
+ "pinIds": [
242
+ "schematic_port_3",
243
+ "schematic_port_9"
244
+ ]
245
+ }
246
+ ],
247
+ "textBoxes": [
248
+ {
249
+ "chipId": "schematic_component_0",
250
+ "center": {
251
+ "x": -38.959999999999994,
252
+ "y": -0.43
253
+ },
254
+ "width": 2.039999999999999,
255
+ "height": 0.18000000000000005,
256
+ "text": "MCP73831T-2ACI/OT"
257
+ },
258
+ {
259
+ "chipId": "schematic_component_0",
260
+ "center": {
261
+ "x": -39.44,
262
+ "y": 0.41500000000000004
263
+ },
264
+ "width": 1.2000000000000028,
265
+ "height": 0.25000000000000006,
266
+ "text": "U_CHARGER"
267
+ },
268
+ {
269
+ "chipId": "schematic_component_5",
270
+ "center": {
271
+ "x": -26.340000000000003,
272
+ "y": -0.43
273
+ },
274
+ "width": 2.5199999999999996,
275
+ "height": 0.18000000000000005,
276
+ "text": "S2B-PH-SM4-TB(LF)(SN)"
277
+ },
278
+ {
279
+ "chipId": "schematic_component_5",
280
+ "center": {
281
+ "x": -26.700000000000003,
282
+ "y": 0.41500000000000004
283
+ },
284
+ "width": 1.9199999999999982,
285
+ "height": 0.25000000000000006,
286
+ "text": "J_BAT_PROTECTED"
287
+ }
288
+ ],
289
+ "availableNetLabelOrientations": {
290
+ "VBUS_USB": [
291
+ "y+"
292
+ ],
293
+ "GND": [
294
+ "y-"
295
+ ],
296
+ "VBAT": [
297
+ "y+"
298
+ ]
299
+ },
300
+ "maxMspPairDistance": 2.4,
301
+ "_chipObstacleSpatialIndex": {
302
+ "chips": [
303
+ {
304
+ "chipId": "schematic_component_0",
305
+ "center": {
306
+ "x": -39,
307
+ "y": 0
308
+ },
309
+ "width": 2.760000000000005,
310
+ "height": 0.6,
311
+ "pins": [
312
+ {
313
+ "pinId": "schematic_port_0",
314
+ "displayName": "STAT",
315
+ "x": -37.62,
316
+ "y": -0.1
317
+ },
318
+ {
319
+ "pinId": "schematic_port_1",
320
+ "displayName": "VSS",
321
+ "x": -40.38,
322
+ "y": 0
323
+ },
324
+ {
325
+ "pinId": "schematic_port_2",
326
+ "displayName": "VBAT",
327
+ "x": -37.62,
328
+ "y": 0.1
329
+ },
330
+ {
331
+ "pinId": "schematic_port_3",
332
+ "displayName": "VDD",
333
+ "x": -40.38,
334
+ "y": 0.2
335
+ },
336
+ {
337
+ "pinId": "schematic_port_4",
338
+ "displayName": "PROG",
339
+ "x": -40.38,
340
+ "y": -0.2
341
+ }
342
+ ],
343
+ "sectionId": "UsbCharging",
344
+ "bounds": {
345
+ "minX": -40.38,
346
+ "maxX": -37.62,
347
+ "minY": -0.3,
348
+ "maxY": 0.3
349
+ },
350
+ "spatialIndexId": 0
351
+ },
352
+ {
353
+ "chipId": "schematic_component_1",
354
+ "center": {
355
+ "x": -39,
356
+ "y": -4
357
+ },
358
+ "width": 1.5600000000000023,
359
+ "height": 0.6800000000000002,
360
+ "pins": [
361
+ {
362
+ "pinId": "schematic_port_5",
363
+ "displayName": "anode",
364
+ "x": -39.78,
365
+ "y": -4,
366
+ "_facingDirection": "x-"
367
+ },
368
+ {
369
+ "pinId": "schematic_port_6",
370
+ "displayName": "cathode",
371
+ "x": -38.22,
372
+ "y": -4,
373
+ "_facingDirection": "x+"
374
+ }
375
+ ],
376
+ "sectionId": "UsbCharging",
377
+ "bounds": {
378
+ "minX": -39.78,
379
+ "maxX": -38.22,
380
+ "minY": -4.34,
381
+ "maxY": -3.66
382
+ },
383
+ "spatialIndexId": 1
384
+ },
385
+ {
386
+ "chipId": "schematic_component_2",
387
+ "center": {
388
+ "x": -33.447500000000005,
389
+ "y": -3
390
+ },
391
+ "width": 2.0050000000000026,
392
+ "height": 0.7600000000000007,
393
+ "pins": [
394
+ {
395
+ "pinId": "schematic_port_7",
396
+ "displayName": "1",
397
+ "x": -34,
398
+ "y": -2.6199999999999997,
399
+ "_facingDirection": "y+"
400
+ },
401
+ {
402
+ "pinId": "schematic_port_8",
403
+ "displayName": "2",
404
+ "x": -34,
405
+ "y": -3.3800000000000003,
406
+ "_facingDirection": "y-"
407
+ }
408
+ ],
409
+ "sectionId": "UsbCharging",
410
+ "bounds": {
411
+ "minX": -34.45,
412
+ "maxX": -32.44500000000001,
413
+ "minY": -3.3800000000000003,
414
+ "maxY": -2.6199999999999997
415
+ },
416
+ "spatialIndexId": 2
417
+ },
418
+ {
419
+ "chipId": "schematic_component_3",
420
+ "center": {
421
+ "x": -35.04,
422
+ "y": 3
423
+ },
424
+ "width": 1.4399999999999977,
425
+ "height": 0.6800000000000006,
426
+ "pins": [
427
+ {
428
+ "pinId": "schematic_port_9",
429
+ "displayName": "anode",
430
+ "x": -35.76,
431
+ "y": 3,
432
+ "_facingDirection": "x-"
433
+ },
434
+ {
435
+ "pinId": "schematic_port_10",
436
+ "displayName": "cathode",
437
+ "x": -34.32,
438
+ "y": 3,
439
+ "_facingDirection": "x+"
440
+ }
441
+ ],
442
+ "sectionId": "UsbCharging",
443
+ "bounds": {
444
+ "minX": -35.76,
445
+ "maxX": -34.32,
446
+ "minY": 2.6599999999999997,
447
+ "maxY": 3.3400000000000003
448
+ },
449
+ "spatialIndexId": 3
450
+ },
451
+ {
452
+ "chipId": "schematic_component_4",
453
+ "center": {
454
+ "x": -28.96,
455
+ "y": 3
456
+ },
457
+ "width": 1.2000000000000028,
458
+ "height": 1.1800000000000006,
459
+ "pins": [
460
+ {
461
+ "pinId": "schematic_port_11",
462
+ "displayName": "anode",
463
+ "x": -29.560000000000002,
464
+ "y": 3,
465
+ "_facingDirection": "x-"
466
+ },
467
+ {
468
+ "pinId": "schematic_port_12",
469
+ "displayName": "cathode",
470
+ "x": -28.36,
471
+ "y": 3,
472
+ "_facingDirection": "x+"
473
+ }
474
+ ],
475
+ "sectionId": "UsbCharging",
476
+ "bounds": {
477
+ "minX": -29.560000000000002,
478
+ "maxX": -28.36,
479
+ "minY": 2.4099999999999997,
480
+ "maxY": 3.5900000000000003
481
+ },
482
+ "spatialIndexId": 4
483
+ },
484
+ {
485
+ "chipId": "schematic_component_5",
486
+ "center": {
487
+ "x": -27,
488
+ "y": 0
489
+ },
490
+ "width": 2,
491
+ "height": 0.6,
492
+ "pins": [
493
+ {
494
+ "pinId": "schematic_port_13",
495
+ "displayName": "1",
496
+ "x": -28,
497
+ "y": 0.1
498
+ },
499
+ {
500
+ "pinId": "schematic_port_14",
501
+ "displayName": "2",
502
+ "x": -28,
503
+ "y": -0.1
504
+ },
505
+ {
506
+ "pinId": "schematic_port_15",
507
+ "displayName": "3",
508
+ "x": -26,
509
+ "y": -0.1
510
+ },
511
+ {
512
+ "pinId": "schematic_port_16",
513
+ "displayName": "4",
514
+ "x": -26,
515
+ "y": 0.1
516
+ }
517
+ ],
518
+ "sectionId": "BatteryPower",
519
+ "bounds": {
520
+ "minX": -28,
521
+ "maxX": -26,
522
+ "minY": -0.3,
523
+ "maxY": 0.3
524
+ },
525
+ "spatialIndexId": 5
526
+ }
527
+ ],
528
+ "spatialIndex": {
529
+ "numItems": 6,
530
+ "nodeSize": 16,
531
+ "byteOffset": 0,
532
+ "_levelBounds": [
533
+ 24,
534
+ 28
535
+ ],
536
+ "data": {},
537
+ "_boxes": {
538
+ "0": -40.38,
539
+ "1": -0.3,
540
+ "2": -37.62,
541
+ "3": 0.3,
542
+ "4": -39.78,
543
+ "5": -4.34,
544
+ "6": -38.22,
545
+ "7": -3.66,
546
+ "8": -34.45,
547
+ "9": -3.3800000000000003,
548
+ "10": -32.44500000000001,
549
+ "11": -2.6199999999999997,
550
+ "12": -35.76,
551
+ "13": 2.6599999999999997,
552
+ "14": -34.32,
553
+ "15": 3.3400000000000003,
554
+ "16": -29.560000000000002,
555
+ "17": 2.4099999999999997,
556
+ "18": -28.36,
557
+ "19": 3.5900000000000003,
558
+ "20": -28,
559
+ "21": -0.3,
560
+ "22": -26,
561
+ "23": 0.3,
562
+ "24": -40.38,
563
+ "25": -4.34,
564
+ "26": -26,
565
+ "27": 3.5900000000000003
566
+ },
567
+ "_indices": {
568
+ "0": 0,
569
+ "1": 1,
570
+ "2": 2,
571
+ "3": 3,
572
+ "4": 4,
573
+ "5": 5,
574
+ "6": 0
575
+ },
576
+ "_pos": 28,
577
+ "minX": -40.38,
578
+ "minY": -4.34,
579
+ "maxX": -26,
580
+ "maxY": 3.5900000000000003,
581
+ "_queue": {
582
+ "ids": [],
583
+ "values": [],
584
+ "capacity": null,
585
+ "length": 0
586
+ }
587
+ },
588
+ "spatialIndexIdToChip": {}
589
+ },
590
+ "_hideRatsNet": false
591
+ }
@@ -27,8 +27,11 @@ test("repro isolated RS-485 ISOW7841 schematic traces", () => {
27
27
  0,
28
28
  )
29
29
  expect(solver.sameNetJunctionAlignmentSolver?.stats.collapsedCycleCount).toBe(
30
- 2,
30
+ 1,
31
31
  )
32
+ expect(
33
+ solver.sameNetJunctionAlignmentSolver?.stats.alignedJunctionCount,
34
+ ).toBeGreaterThan(0)
32
35
  const dPLabel =
33
36
  solver.sameNetJunctionAlignmentSolver?.outputNetLabelPlacements.find(
34
37
  (label) => label.netId === "D_P",
@@ -13,5 +13,29 @@ test("repro PowerBank 3 V System Power schematic", () => {
13
13
  )
14
14
  solver.solve()
15
15
 
16
+ const alignedTraces = solver.sameNetJunctionAlignmentSolver!.outputTraces
17
+ const pathFromPin = (traceId: string, pinId: string) => {
18
+ const trace = alignedTraces.find((item) => item.mspPairId === traceId)!
19
+ return trace.pins[0]!.pinId === pinId
20
+ ? trace.tracePath
21
+ : [...trace.tracePath].reverse()
22
+ }
23
+ for (const [sharedPinId, firstTraceId, secondTraceId] of [
24
+ [
25
+ "schematic_port_379",
26
+ "schematic_port_393-schematic_port_379",
27
+ "schematic_port_391-schematic_port_379",
28
+ ],
29
+ [
30
+ "schematic_port_372",
31
+ "schematic_port_372-schematic_port_369",
32
+ "schematic_port_374-schematic_port_372",
33
+ ],
34
+ ]) {
35
+ const firstPath = pathFromPin(firstTraceId, sharedPinId)
36
+ const secondPath = pathFromPin(secondTraceId, sharedPinId)
37
+ expect(firstPath[1]!.y).toBeCloseTo(secondPath[1]!.y, 6)
38
+ }
39
+
16
40
  expect(solver).toMatchSolverSnapshot(import.meta.path)
17
41
  })
@@ -40,5 +40,29 @@ test("repro: enclosing rectangle collapses into two smaller loops", () => {
40
40
  )
41
41
 
42
42
  expect(solver.solved).toBe(true)
43
+ const alignedTraces = solver.sameNetJunctionAlignmentSolver!.outputTraces
44
+ const leftBridge = alignedTraces.find(
45
+ (trace) => trace.mspPairId === "schematic_port_c18_1-schematic_port_c17_1",
46
+ )!
47
+ const leftUpperRail = alignedTraces.find(
48
+ (trace) =>
49
+ trace.mspPairId === "schematic_port_q1b_source-schematic_port_c17_1",
50
+ )!
51
+ const rightBridge = alignedTraces.find(
52
+ (trace) => trace.mspPairId === "schematic_port_c18_2-schematic_port_c17_2",
53
+ )!
54
+ const rightLowerRail = alignedTraces.find(
55
+ (trace) =>
56
+ trace.mspPairId === "schematic_port_q2b_drain-schematic_port_c18_2",
57
+ )!
58
+ expect(leftBridge.tracePath[1]!.x).toBeCloseTo(
59
+ leftUpperRail.tracePath[0]!.x,
60
+ 6,
61
+ )
62
+ expect(rightBridge.tracePath[1]!.x).toBeCloseTo(
63
+ rightLowerRail.tracePath[0]!.x,
64
+ 6,
65
+ )
66
+
43
67
  expect(solver).toMatchSolverSnapshot(import.meta.path)
44
68
  })