@tscircuit/schematic-trace-solver 0.0.183 → 0.0.184

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 (103) hide show
  1. package/dist/index.js +231 -20
  2. package/lib/solvers/SameNetJunctionAlignmentSolver/alignSameNetJunctions.ts +30 -12
  3. package/lib/solvers/SameNetJunctionAlignmentSolver/collapseRedundantSharedEndpointStubs.ts +267 -0
  4. package/lib/solvers/SameNetJunctionAlignmentSolver/collapseSameNetCycles.ts +1 -1
  5. package/lib/solvers/SameNetJunctionAlignmentSolver/getSharedPin.ts +13 -0
  6. package/package.json +1 -1
  7. package/tests/bug-reports/bug-report-20260706T213649Z/__snapshots__/bug-report-20260706T213649Z.snap.svg +2 -2
  8. package/tests/bug-reports/bug-report-20260706T220324Z/__snapshots__/bug-report-20260706T220324Z.snap.svg +2 -2
  9. package/tests/bug-reports/bug-report-20260707T020342Z/__snapshots__/bug-report-20260707T020342Z.snap.svg +2 -2
  10. package/tests/bug-reports/bug-report-20260707T020342Z/bug-report-20260707T020342Z.test.ts +10 -0
  11. package/tests/bug-reports/bug-report-20260707T092615Z/__snapshots__/bug-report-20260707T092615Z.snap.svg +2 -2
  12. package/tests/bug-reports/bug-report-20260707T134549Z/__snapshots__/bug-report-20260707T134549Z.snap.svg +2 -2
  13. package/tests/bug-reports/bug-report-20260707T140410Z/__snapshots__/bug-report-20260707T140410Z.snap.svg +2 -2
  14. package/tests/bug-reports/bug-report-20260707T141025Z/__snapshots__/bug-report-20260707T141025Z.snap.svg +2 -2
  15. package/tests/bug-reports/bug-report-20260707T141421Z/__snapshots__/bug-report-20260707T141421Z.snap.svg +2 -2
  16. package/tests/bug-reports/bug-report-20260707T230831Z/__snapshots__/bug-report-20260707T230831Z.snap.svg +2 -2
  17. package/tests/bug-reports/bug-report-20260708T095725Z/__snapshots__/bug-report-20260708T095725Z.snap.svg +2 -2
  18. package/tests/bug-reports/bug-report-20260716T144856Z/__snapshots__/bug-report-20260716T144856Z.snap.svg +2 -2
  19. package/tests/bug-reports/bug-report-20260717T022934Z/__snapshots__/bug-report-20260717T022934Z.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-20260724T175257Z/__snapshots__/bug-report-20260724T175257Z.snap.svg +2 -2
  23. package/tests/bug-reports/bug-report-20260728T144234Z/__snapshots__/bug-report-20260728T144234Z.snap.svg +2 -2
  24. package/tests/bug-reports/bug-report-20260728T144234Z/bug-report-20260728T144234Z.test.ts +2 -0
  25. package/tests/bug-reports/bug-report-20260730T061837Z/__snapshots__/bug-report-20260730T061837Z.snap.svg +2 -2
  26. package/tests/bug-reports/bug-report-20260730T061837Z/bug-report-20260730T061837Z.test.ts +1 -1
  27. package/tests/bug-reports/bug-report-20260731T052229Z/__snapshots__/bug-report-20260731T052229Z.snap.svg +2 -2
  28. package/tests/bug-reports/bug-report-20260804T171919Z/__snapshots__/bug-report-20260804T171919Z.snap.svg +2 -2
  29. package/tests/bug-reports/bug-report-20260804T225912Z/__snapshots__/bug-report-20260804T225912Z.snap.svg +2 -2
  30. package/tests/bug-reports/bug-report-20260805T061316Z/__snapshots__/bug-report-20260805T061316Z.snap.svg +2 -2
  31. package/tests/bug-reports/bug-report-20260806T061548Z/__snapshots__/bug-report-20260806T061548Z.snap.svg +2 -2
  32. package/tests/bug-reports/bug-report-20260815T073240Z/__snapshots__/bug-report-20260815T073240Z.snap.svg +2 -2
  33. package/tests/bug-reports/bug-report-20260819T091818Z/__snapshots__/bug-report-20260819T091818Z.snap.svg +2 -2
  34. package/tests/bug-reports/bug-report-20260825T045913Z/__snapshots__/bug-report-20260825T045913Z.snap.svg +2 -2
  35. package/tests/bug-reports/bug-report-20260825T103621Z/__snapshots__/bug-report-20260825T103621Z.snap.svg +2 -2
  36. package/tests/bug-reports/bug-report-20260826T072956Z/__snapshots__/bug-report-20260826T072956Z.snap.svg +2 -2
  37. package/tests/bug-reports/bug-report-20260901T055358Z/__snapshots__/bug-report-20260901T055358Z.snap.svg +2 -2
  38. package/tests/bug-reports/bug-report-20260901T064117Z/__snapshots__/bug-report-20260901T064117Z.snap.svg +2 -2
  39. package/tests/bug-reports/bug-report-20260901T134241Z/__snapshots__/bug-report-20260901T134241Z.snap.svg +2 -2
  40. package/tests/bug-reports/bug-report-20260902T092425Z/__snapshots__/bug-report-20260902T092425Z.snap.svg +2 -2
  41. package/tests/examples/__snapshots__/example02.snap.svg +2 -2
  42. package/tests/examples/__snapshots__/example13.snap.svg +2 -2
  43. package/tests/examples/__snapshots__/example14.snap.svg +2 -2
  44. package/tests/examples/__snapshots__/example15.snap.svg +2 -2
  45. package/tests/examples/__snapshots__/example18.snap.svg +2 -2
  46. package/tests/examples/__snapshots__/example19.snap.svg +2 -2
  47. package/tests/examples/__snapshots__/example21.snap.svg +2 -2
  48. package/tests/examples/__snapshots__/example27.snap.svg +2 -2
  49. package/tests/examples/__snapshots__/example29.snap.svg +2 -2
  50. package/tests/examples/__snapshots__/example42.snap.svg +2 -2
  51. package/tests/examples/__snapshots__/example45.snap.svg +2 -2
  52. package/tests/examples/__snapshots__/example46.snap.svg +2 -2
  53. package/tests/examples/__snapshots__/example47.snap.svg +2 -2
  54. package/tests/examples/__snapshots__/example51.snap.svg +2 -2
  55. package/tests/repros/__snapshots__/board-1273-trace-overlap-cycle.snap.svg +2 -2
  56. package/tests/repros/__snapshots__/board-15984-same-net-junction.snap.svg +2 -2
  57. package/tests/repros/__snapshots__/board1096-usb-label-overlap-iteration.snap.svg +2 -2
  58. package/tests/repros/__snapshots__/bugreport-001-gnd-overlap.snap.svg +2 -2
  59. package/tests/repros/__snapshots__/netlabel-connector-through-rail-label.snap.svg +2 -2
  60. package/tests/repros/__snapshots__/repro-battery-management-bq24073.snap.svg +2 -2
  61. package/tests/repros/__snapshots__/repro-bc107a-common-emitter-routing.snap.svg +2 -2
  62. package/tests/repros/__snapshots__/repro-bluetooth-controller-ground-decoupling-groups.snap.svg +2 -2
  63. package/tests/repros/__snapshots__/repro-board-589-regulator-section.snap.svg +2 -2
  64. package/tests/repros/__snapshots__/repro-board-648-esp12f-section.snap.svg +2 -2
  65. package/tests/repros/__snapshots__/repro-board-8090-power-section.snap.svg +2 -2
  66. package/tests/repros/__snapshots__/repro-bq24074-battery-charger.snap.svg +2 -2
  67. package/tests/repros/__snapshots__/repro-bq25895-cross-net-trace-overlap.snap.svg +2 -2
  68. package/tests/repros/__snapshots__/repro-bq40z60-current-sense.snap.svg +2 -2
  69. package/tests/repros/__snapshots__/repro-cc2340r5.snap.svg +2 -2
  70. package/tests/repros/__snapshots__/repro-core-ground-inline-label-fallback.snap.svg +2 -2
  71. package/tests/repros/__snapshots__/repro-esp12f-section.snap.svg +508 -0
  72. package/tests/repros/__snapshots__/repro-example35-minimize-trace-crossing.snap.svg +2 -2
  73. package/tests/repros/__snapshots__/repro-hdc2080-ground-label-alignment.snap.svg +2 -2
  74. package/tests/repros/__snapshots__/repro-hdc3020-ground-label-alignment.snap.svg +2 -2
  75. package/tests/repros/__snapshots__/repro-hub-usb-sheet.snap.svg +2 -2
  76. package/tests/repros/__snapshots__/repro-ina237-current-monitor.snap.svg +2 -2
  77. package/tests/repros/__snapshots__/repro-isolated-rs485-isow7841.snap.svg +2 -2
  78. package/tests/repros/__snapshots__/repro-mspm0l1306-capacitor-symmetry.snap.svg +2 -2
  79. package/tests/repros/__snapshots__/repro-pga300-c6-trace-alignment.snap.svg +2 -2
  80. package/tests/repros/__snapshots__/repro-pga300-redundant-ground-traces.snap.svg +2 -2
  81. package/tests/repros/__snapshots__/repro-pmp11282-isolated-dcdc.snap.svg +18 -18
  82. package/tests/repros/__snapshots__/repro-power-group-rail-labels.snap.svg +2 -2
  83. package/tests/repros/__snapshots__/repro-powerbank-3v-system-power.snap.svg +2 -2
  84. package/tests/repros/__snapshots__/repro-rectifier-trace-overlap.snap.svg +2 -2
  85. package/tests/repros/__snapshots__/repro-rp2040-gamepad-trace-alignment.snap.svg +2 -2
  86. package/tests/repros/__snapshots__/repro-rp2040-usb-cc2-ground-overlap.snap.svg +2 -2
  87. package/tests/repros/__snapshots__/repro-smartwatch-power-sheet.snap.svg +2 -2
  88. package/tests/repros/__snapshots__/repro-ti-power-output-section.snap.svg +2 -2
  89. package/tests/repros/__snapshots__/repro-tida-01389-hbridge.snap.svg +2 -2
  90. package/tests/repros/__snapshots__/repro-tida00553-j4-cell-divider.snap.svg +2 -2
  91. package/tests/repros/__snapshots__/repro-tida010076-j4-ground-bus.snap.svg +2 -2
  92. package/tests/repros/__snapshots__/repro-tida010076-page02.snap.svg +2 -2
  93. package/tests/repros/__snapshots__/repro-tmp1075-ground-label-overlap.snap.svg +2 -2
  94. package/tests/repros/__snapshots__/repro-tps61222-trace-intersection.snap.svg +2 -2
  95. package/tests/repros/__snapshots__/repro-trellis-core-gnd-net-label-overlap.snap.svg +2 -2
  96. package/tests/repros/__snapshots__/repro-type-c-vbus-led-ground-label.snap.svg +2 -2
  97. package/tests/repros/__snapshots__/repro-usb-power-vbus-label-detour.snap.svg +2 -2
  98. package/tests/repros/__snapshots__/repro130-bq27441-fuel-gauge-trace-through-c1.snap.svg +2 -2
  99. package/tests/repros/__snapshots__/repro161-power-section-autolayout.snap.svg +2 -2
  100. package/tests/repros/__snapshots__/repro48-555-timer-vcc-rail-label.snap.svg +2 -2
  101. package/tests/repros/assets/repro-esp12f-status-section.input.json +1394 -0
  102. package/tests/repros/repro-esp12f-section.test.ts +12 -0
  103. package/tests/solvers/SameNetJunctionAlignmentSolver/collapse-redundant-shared-endpoint-stubs.test.ts +101 -0
@@ -0,0 +1,13 @@
1
+ import type { SolvedTracePath } from "lib/solvers/SchematicTraceLinesSolver/SchematicTraceLinesSolver"
2
+ import type { InputPin } from "lib/types/InputProblem"
3
+
4
+ export const getSharedPin = ({
5
+ donorTrace,
6
+ branchTrace,
7
+ }: {
8
+ donorTrace: SolvedTracePath
9
+ branchTrace: SolvedTracePath
10
+ }): (InputPin & { chipId: string }) | null => {
11
+ const branchPinIds = new Set(branchTrace.pins.map((pin) => pin.pinId))
12
+ return donorTrace.pins.find((pin) => branchPinIds.has(pin.pinId)) ?? null
13
+ }
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "url": "https://github.com/tscircuit/schematic-trace-solver.git"
6
6
  },
7
7
  "main": "dist/index.js",
8
- "version": "0.0.183",
8
+ "version": "0.0.184",
9
9
  "type": "module",
10
10
  "scripts": {
11
11
  "start": "cosmos",