@tscircuit/schematic-trace-solver 0.0.191 → 0.0.192
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 +9 -6
- package/lib/solvers/SameNetJunctionAlignmentSolver/collapseRedundantSharedEndpointStubs.ts +12 -6
- package/package.json +1 -1
- package/tests/bug-reports/bug-report-20260721T221026Z/__snapshots__/bug-report-20260721T221026Z.snap.svg +2 -2
- package/tests/bug-reports/bug-report-20260724T175257Z/__snapshots__/bug-report-20260724T175257Z.snap.svg +2 -2
- package/tests/bug-reports/bug-report-20260728T144234Z/__snapshots__/bug-report-20260728T144234Z.snap.svg +2 -2
- package/tests/bug-reports/bug-report-20260804T171919Z/__snapshots__/bug-report-20260804T171919Z.snap.svg +2 -2
- package/tests/bug-reports/bug-report-20260815T073240Z/__snapshots__/bug-report-20260815T073240Z.snap.svg +2 -2
- package/tests/bug-reports/bug-report-20260901T055358Z/__snapshots__/bug-report-20260901T055358Z.snap.svg +2 -2
- package/tests/bug-reports/bug-report-20260907T083336Z/__snapshots__/bug-report-20260907T083336Z.snap.svg +2 -2
- package/tests/examples/__snapshots__/example13.snap.svg +2 -2
- package/tests/examples/__snapshots__/example15.snap.svg +2 -2
- package/tests/examples/__snapshots__/example51.snap.svg +2 -2
- package/tests/repros/__snapshots__/board-1273-trace-overlap-cycle.snap.svg +2 -2
- package/tests/repros/__snapshots__/board-15984-same-net-junction.snap.svg +2 -2
- package/tests/repros/__snapshots__/repro-bq25895-cross-net-trace-overlap.snap.svg +2 -2
- package/tests/repros/__snapshots__/repro-cc2340r5.snap.svg +2 -2
- package/tests/repros/__snapshots__/repro-esp12f-section.snap.svg +2 -2
- package/tests/repros/__snapshots__/repro-example35-minimize-trace-crossing.snap.svg +2 -2
- package/tests/repros/__snapshots__/repro-hub-usb-sheet.snap.svg +2 -2
- package/tests/repros/__snapshots__/repro-isolated-rs485-isow7841.snap.svg +2 -2
- package/tests/repros/__snapshots__/repro-pga300-redundant-ground-traces.snap.svg +2 -2
- package/tests/repros/__snapshots__/repro-pmp11282-isolated-dcdc.snap.svg +2 -2
- package/tests/repros/__snapshots__/repro-powerbank-3v-system-power.snap.svg +2 -2
- package/tests/repros/__snapshots__/repro-repeated-power-rail-junctions.snap.svg +2 -2
- package/tests/repros/__snapshots__/repro-rp2040-gamepad-trace-alignment.snap.svg +2 -2
- package/tests/repros/__snapshots__/repro-tida00553-j4-cell-divider.snap.svg +2 -2
- package/tests/repros/__snapshots__/repro-tida010076-page02.snap.svg +2 -2
- package/tests/repros/__snapshots__/repro-type-c-vbus-led-ground-label.snap.svg +2 -2
- package/tests/repros/__snapshots__/repro-usb-power-vbus-label-detour.snap.svg +2 -2
- package/tests/repros/__snapshots__/repro130-bq27441-fuel-gauge-trace-through-c1.snap.svg +2 -2
- package/tests/repros/__snapshots__/repro161-power-section-autolayout.snap.svg +2 -2
- package/tests/solvers/SameNetJunctionAlignmentSolver/collapse-redundant-shared-endpoint-stubs.test.ts +45 -0
|
@@ -99,3 +99,48 @@ test("collapses a shared stub and partial rail overlap", () => {
|
|
|
99
99
|
{ x: -1, y: -1 },
|
|
100
100
|
])
|
|
101
101
|
})
|
|
102
|
+
|
|
103
|
+
test("collapses every duplicate stub at a shared same-net endpoint", () => {
|
|
104
|
+
const traces = [
|
|
105
|
+
createTrace({
|
|
106
|
+
mspPairId: "outer-shared",
|
|
107
|
+
pinIds: ["outer", "shared"],
|
|
108
|
+
tracePath: [
|
|
109
|
+
{ x: 2, y: 3 },
|
|
110
|
+
{ x: 0, y: 3 },
|
|
111
|
+
{ x: 0, y: 0 },
|
|
112
|
+
],
|
|
113
|
+
}),
|
|
114
|
+
createTrace({
|
|
115
|
+
mspPairId: "inner-shared",
|
|
116
|
+
pinIds: ["inner", "shared"],
|
|
117
|
+
tracePath: [
|
|
118
|
+
{ x: 2, y: 1 },
|
|
119
|
+
{ x: 0, y: 1 },
|
|
120
|
+
{ x: 0, y: 0 },
|
|
121
|
+
],
|
|
122
|
+
}),
|
|
123
|
+
createTrace({
|
|
124
|
+
mspPairId: "middle-shared",
|
|
125
|
+
pinIds: ["middle", "shared"],
|
|
126
|
+
tracePath: [
|
|
127
|
+
{ x: 2, y: 2 },
|
|
128
|
+
{ x: 0, y: 2 },
|
|
129
|
+
{ x: 0, y: 0 },
|
|
130
|
+
],
|
|
131
|
+
}),
|
|
132
|
+
]
|
|
133
|
+
|
|
134
|
+
const result = collapseRedundantSharedEndpointStubs({
|
|
135
|
+
traces,
|
|
136
|
+
netLabelPlacements: [],
|
|
137
|
+
netLabelConnectorTraceIds: new Set<MspConnectionPairId>(),
|
|
138
|
+
multiPinNetPinIds: new Set(["shared"]),
|
|
139
|
+
})
|
|
140
|
+
|
|
141
|
+
expect(
|
|
142
|
+
result.filter((trace) =>
|
|
143
|
+
trace.tracePath.some((point) => point.x === 0 && point.y === 0),
|
|
144
|
+
),
|
|
145
|
+
).toHaveLength(1)
|
|
146
|
+
})
|