@tscircuit/schematic-trace-solver 0.0.104 → 0.0.105
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 +1 -1
- package/lib/solvers/TraceCleanupSolver/minimizeTurnsWithFilteredLabels.ts +7 -3
- package/package.json +1 -1
- package/site/bug-reports/bug-report-20260721T221026Z.page.tsx +4 -0
- package/tests/bug-reports/bug-report-20260721T221026Z/__snapshots__/bug-report-20260721T221026Z.snap.svg +345 -0
- package/tests/bug-reports/bug-report-20260721T221026Z/bug-report-20260721T221026Z.json +1750 -0
- package/tests/bug-reports/bug-report-20260721T221026Z/bug-report-20260721T221026Z.test.ts +12 -0
- package/tests/examples/__snapshots__/example13.snap.svg +3 -3
- package/tests/examples/__snapshots__/example19.snap.svg +3 -3
- package/tests/examples/__snapshots__/example29.snap.svg +23 -23
- package/tests/repros/__snapshots__/bugreport-001-gnd-overlap.snap.svg +1 -1
- package/tests/repros/__snapshots__/repro-core-subcircuit-missing-ground.snap.svg +56 -0
- package/tests/repros/__snapshots__/repro-vcc-pin1-detour.snap.svg +47 -0
- package/tests/repros/assets/repro-core-subcircuit-missing-ground.input.json +103 -0
- package/tests/repros/repro-core-subcircuit-missing-ground.test.ts +14 -0
- package/tests/repros/repro-vcc-pin1-detour.test.ts +166 -0
package/dist/index.js
CHANGED
|
@@ -4790,7 +4790,7 @@ var minimizeTurnsWithFilteredLabels = ({
|
|
|
4790
4790
|
throw new Error(`Target trace ${targetMspConnectionPairId} not found`);
|
|
4791
4791
|
}
|
|
4792
4792
|
const obstacleTraces = traces.filter(
|
|
4793
|
-
(t) => t.mspPairId !== targetMspConnectionPairId
|
|
4793
|
+
(t) => t.mspPairId !== targetMspConnectionPairId && t.globalConnNetId !== targetTrace.globalConnNetId
|
|
4794
4794
|
);
|
|
4795
4795
|
const TRACE_WIDTH = 0.01;
|
|
4796
4796
|
const traceObstacles = obstacleTraces.flatMap(
|
|
@@ -5,8 +5,8 @@ import { getObstacleRects } from "lib/solvers/SchematicTraceLinesSolver/Schemati
|
|
|
5
5
|
import type { NetLabelPlacement } from "../NetLabelPlacementSolver/NetLabelPlacementSolver"
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
-
* Minimizes the turns of a target trace while considering
|
|
9
|
-
* This function first identifies the target trace and separates
|
|
8
|
+
* Minimizes the turns of a target trace while considering different-net traces and labels as obstacles.
|
|
9
|
+
* This function first identifies the target trace and separates traces from other nets, which are then treated as obstacles.
|
|
10
10
|
* It also filters out labels that belong to the target trace's net, so they don't act as obstacles.
|
|
11
11
|
* The function then combines static obstacles (from the input problem) with the other traces and filtered labels to create a comprehensive set of obstacles.
|
|
12
12
|
* Finally, it uses a turn minimization algorithm to find a new path for the target trace that avoids these combined obstacles.
|
|
@@ -33,8 +33,12 @@ export const minimizeTurnsWithFilteredLabels = ({
|
|
|
33
33
|
throw new Error(`Target trace ${targetMspConnectionPairId} not found`)
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
+
// Same-net traces are valid connection targets: letting the candidate path
|
|
37
|
+
// coincide with them removes unnecessary detours and forms clean junctions.
|
|
36
38
|
const obstacleTraces = traces.filter(
|
|
37
|
-
(t) =>
|
|
39
|
+
(t) =>
|
|
40
|
+
t.mspPairId !== targetMspConnectionPairId &&
|
|
41
|
+
t.globalConnNetId !== targetTrace.globalConnNetId,
|
|
38
42
|
)
|
|
39
43
|
|
|
40
44
|
const TRACE_WIDTH = 0.01
|
package/package.json
CHANGED