@tscircuit/schematic-trace-solver 0.0.105 → 0.0.106
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 +133 -80
- package/lib/solvers/TraceCleanupSolver/minimizeTurnsWithFilteredLabels.ts +78 -27
- package/lib/solvers/TraceCleanupSolver/sameNetRailAlignment/geometry.ts +40 -20
- package/package.json +1 -1
- package/tests/examples/__snapshots__/example13.snap.svg +3 -3
- package/tests/examples/__snapshots__/example29.snap.svg +23 -23
- package/tests/examples/example19.test.ts +4 -0
- package/tests/repros/__snapshots__/repro-example35-minimize-trace-crossing.snap.svg +256 -0
- package/tests/repros/assets/repro-example35-minimize-trace-crossing.input.json +1561 -0
- package/tests/repros/repro-example35-minimize-trace-crossing.test.ts +22 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { expect, test } from "bun:test"
|
|
2
|
+
import { SchematicTracePipelineSolver } from "lib/solvers/SchematicTracePipelineSolver/SchematicTracePipelineSolver"
|
|
3
|
+
import inputProblem from "./assets/repro-example35-minimize-trace-crossing.input.json"
|
|
4
|
+
import "tests/fixtures/matcher"
|
|
5
|
+
|
|
6
|
+
test("example35 keeps capacitor-chain zig-zags aligned with same-net branches", () => {
|
|
7
|
+
const solver = new SchematicTracePipelineSolver(inputProblem as any)
|
|
8
|
+
|
|
9
|
+
solver.solve()
|
|
10
|
+
|
|
11
|
+
const trace = solver
|
|
12
|
+
.netLabelTraceCollisionSolver!.getOutput()
|
|
13
|
+
.traces.find((candidate) => candidate.mspPairId === "C5.1-C4.2")
|
|
14
|
+
|
|
15
|
+
expect(trace?.tracePath).toEqual([
|
|
16
|
+
{ x: -4, y: -2.6199999999999997 },
|
|
17
|
+
{ x: -4, y: -1.9999999999999996 },
|
|
18
|
+
{ x: -3, y: -1.9999999999999996 },
|
|
19
|
+
{ x: -3, y: -1.38 },
|
|
20
|
+
])
|
|
21
|
+
expect(solver).toMatchSolverSnapshot(import.meta.path)
|
|
22
|
+
})
|