@tscircuit/schematic-trace-solver 0.0.121 → 0.0.123
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.d.ts +10 -3
- package/dist/index.js +247 -31
- package/lib/solvers/RailNetLabelCornerPlacementSolver/RailNetLabelCornerPlacementSolver.ts +223 -21
- package/lib/solvers/RailNetLabelCornerPlacementSolver/types.ts +3 -3
- package/lib/solvers/SameNetJunctionAlignmentSolver/alignSameNetJunctions.ts +50 -5
- package/lib/solvers/SameNetJunctionAlignmentSolver/pathIntersectsAnyNetLabel.ts +29 -0
- package/lib/solvers/SchematicTracePipelineSolver/SchematicTracePipelineSolver.ts +34 -9
- package/package.json +1 -1
- package/site/bug-reports/bug-report-20260804T095800Z.page.tsx +4 -0
- package/site/bug-reports/bug-report-20260804T171919Z.page.tsx +4 -0
- package/site/bug-reports/bug-report-20260804T225912Z.page.tsx +4 -0
- package/tests/bug-reports/bug-report-20260706T213649Z/__snapshots__/bug-report-20260706T213649Z.snap.svg +4 -4
- package/tests/bug-reports/bug-report-20260706T220324Z/__snapshots__/bug-report-20260706T220324Z.snap.svg +5 -5
- package/tests/bug-reports/bug-report-20260717T042845Z/__snapshots__/bug-report-20260717T042845Z.snap.svg +12 -12
- package/tests/bug-reports/bug-report-20260721T221026Z/__snapshots__/bug-report-20260721T221026Z.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-20260804T095800Z/__snapshots__/bug-report-20260804T095800Z.snap.svg +135 -0
- package/tests/bug-reports/bug-report-20260804T095800Z/bug-report-20260804T095800Z.json +634 -0
- package/tests/bug-reports/bug-report-20260804T095800Z/bug-report-20260804T095800Z.test.ts +12 -0
- package/tests/bug-reports/bug-report-20260804T171919Z/__snapshots__/bug-report-20260804T171919Z.snap.svg +355 -0
- package/tests/bug-reports/bug-report-20260804T171919Z/bug-report-20260804T171919Z.json +1775 -0
- package/tests/bug-reports/bug-report-20260804T171919Z/bug-report-20260804T171919Z.test.ts +12 -0
- package/tests/bug-reports/bug-report-20260804T225912Z/__snapshots__/bug-report-20260804T225912Z.snap.svg +60 -0
- package/tests/bug-reports/bug-report-20260804T225912Z/bug-report-20260804T225912Z.json +148 -0
- package/tests/bug-reports/bug-report-20260804T225912Z/bug-report-20260804T225912Z.test.ts +12 -0
- package/tests/examples/__snapshots__/example12.snap.svg +2 -2
- package/tests/examples/__snapshots__/example13.snap.svg +4 -4
- package/tests/examples/__snapshots__/example14.snap.svg +36 -36
- package/tests/examples/__snapshots__/example31.snap.svg +6 -6
- package/tests/examples/__snapshots__/example43.snap.svg +2 -2
- package/tests/examples/__snapshots__/example44.snap.svg +2 -2
- package/tests/repros/__snapshots__/board-15984-same-net-junction.snap.svg +2 -2
- package/tests/repros/__snapshots__/bugreport-001-gnd-overlap.snap.svg +26 -26
- package/tests/repros/__snapshots__/netlabel-connector-through-rail-label.snap.svg +2 -2
- package/tests/repros/__snapshots__/repro-atmega328p-fault-pullup.snap.svg +2 -2
- package/tests/repros/__snapshots__/repro-atmega328p-missing-gnd-netlabel.snap.svg +2 -2
- package/tests/repros/__snapshots__/repro-bq25895-cross-net-trace-overlap.snap.svg +2 -2
- package/tests/repros/__snapshots__/repro-missing-trace-netlabel.snap.svg +18 -18
- package/tests/repros/__snapshots__/repro-netlabel-overlap-trace.snap.svg +3 -3
- package/tests/repros/__snapshots__/repro-nrf52810-clock-routing.snap.svg +82 -0
- package/tests/repros/__snapshots__/repro161-power-section-autolayout.snap.svg +112 -0
- package/tests/repros/assets/repro-nrf52810-clock-routing.input.json +234 -0
- package/tests/repros/assets/repro161-power-section-autolayout.input.json +578 -0
- package/tests/repros/repro-bq25895-cross-net-trace-overlap.test.ts +13 -0
- package/tests/repros/repro-missing-trace-netlabel.test.ts +12 -0
- package/tests/repros/repro-netlabel-overlap-trace.test.ts +38 -0
- package/tests/repros/repro-nrf52810-clock-routing.test.ts +28 -0
- package/tests/repros/repro161-power-section-autolayout.test.ts +34 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { expect, test } from "bun:test"
|
|
2
|
+
import { SchematicTracePipelineSolver } from "lib/solvers/SchematicTracePipelineSolver/SchematicTracePipelineSolver"
|
|
3
|
+
import type { InputProblem } from "lib/types/InputProblem"
|
|
4
|
+
import "tests/fixtures/matcher"
|
|
5
|
+
import inputProblemJson from "./assets/repro161-power-section-autolayout.input.json"
|
|
6
|
+
|
|
7
|
+
const EXPECTED_V3V3_RAIL_Y = -3.105
|
|
8
|
+
|
|
9
|
+
// Captured from @tscircuit/core repro161 after schematic auto-layout.
|
|
10
|
+
test("core repro161 power section trace routing", () => {
|
|
11
|
+
const inputProblem: InputProblem = JSON.parse(
|
|
12
|
+
JSON.stringify(inputProblemJson),
|
|
13
|
+
)
|
|
14
|
+
const solver = new SchematicTracePipelineSolver(inputProblem)
|
|
15
|
+
|
|
16
|
+
solver.solve()
|
|
17
|
+
|
|
18
|
+
const v3v3Traces = solver.sameNetJunctionAlignmentSolver!.outputTraces.filter(
|
|
19
|
+
(trace) => trace.userNetId === "V3V3",
|
|
20
|
+
)
|
|
21
|
+
const horizontalRailYs = v3v3Traces.flatMap((trace) =>
|
|
22
|
+
trace.tracePath.flatMap((point, index) => {
|
|
23
|
+
const nextPoint = trace.tracePath[index + 1]
|
|
24
|
+
if (!nextPoint || point.y !== nextPoint.y) return []
|
|
25
|
+
return [point.y]
|
|
26
|
+
}),
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
expect(horizontalRailYs).toHaveLength(3)
|
|
30
|
+
for (const railY of horizontalRailYs) {
|
|
31
|
+
expect(railY).toBeCloseTo(EXPECTED_V3V3_RAIL_Y)
|
|
32
|
+
}
|
|
33
|
+
expect(solver).toMatchSolverSnapshot(import.meta.path)
|
|
34
|
+
})
|