@tscircuit/schematic-trace-solver 0.0.175 → 0.0.176
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 +3 -0
- package/dist/index.js +564 -17
- package/lib/solvers/AvailableNetOrientationSolver/AvailableNetOrientationSolver.ts +5 -1
- package/lib/solvers/SameNetJunctionAlignmentSolver/SameNetJunctionAlignmentSolver.ts +2 -0
- package/lib/solvers/SameNetJunctionAlignmentSolver/alignSameNetJunctions.ts +748 -15
- package/lib/solvers/SameNetJunctionAlignmentSolver/findNearestSharedPinExitRail.ts +140 -0
- package/lib/solvers/SchematicTracePipelineSolver/SchematicTracePipelineSolver.ts +3 -5
- package/package.json +1 -1
- package/tests/bug-reports/bug-report-20260707T134549Z/__snapshots__/bug-report-20260707T134549Z.snap.svg +2 -2
- package/tests/bug-reports/bug-report-20260707T134549Z/bug-report-20260707T134549Z.test.ts +9 -0
- package/tests/bug-reports/bug-report-20260707T230831Z/__snapshots__/bug-report-20260707T230831Z.snap.svg +2 -2
- package/tests/bug-reports/bug-report-20260717T042845Z/__snapshots__/bug-report-20260717T042845Z.snap.svg +2 -2
- package/tests/bug-reports/bug-report-20260721T221026Z/__snapshots__/bug-report-20260721T221026Z.snap.svg +2 -2
- package/tests/bug-reports/bug-report-20260730T061837Z/__snapshots__/bug-report-20260730T061837Z.snap.svg +2 -2
- package/tests/bug-reports/bug-report-20260730T061837Z/bug-report-20260730T061837Z.test.ts +8 -4
- package/tests/bug-reports/bug-report-20260804T171919Z/__snapshots__/bug-report-20260804T171919Z.snap.svg +2 -2
- package/tests/bug-reports/bug-report-20260805T061316Z/__snapshots__/bug-report-20260805T061316Z.snap.svg +2 -2
- package/tests/bug-reports/bug-report-20260806T061548Z/__snapshots__/bug-report-20260806T061548Z.snap.svg +2 -2
- package/tests/bug-reports/bug-report-20260825T045913Z/__snapshots__/bug-report-20260825T045913Z.snap.svg +2 -2
- package/tests/bug-reports/bug-report-20260826T072956Z/__snapshots__/bug-report-20260826T072956Z.snap.svg +6 -6
- package/tests/bug-reports/bug-report-20260901T134241Z/__snapshots__/bug-report-20260901T134241Z.snap.svg +7 -7
- package/tests/bug-reports/bug-report-20260901T134241Z/bug-report-20260901T134241Z.test.ts +48 -0
- package/tests/examples/__snapshots__/example51.snap.svg +2 -2
- package/tests/repros/__snapshots__/board-1273-trace-overlap-cycle.snap.svg +10 -10
- package/tests/repros/__snapshots__/board1096-usb-label-overlap-iteration.snap.svg +2 -2
- package/tests/repros/__snapshots__/repro-bq25895-cross-net-trace-overlap.snap.svg +2 -2
- package/tests/repros/__snapshots__/repro-core-ground-inline-label-fallback.snap.svg +10 -10
- package/tests/repros/__snapshots__/repro-example35-minimize-trace-crossing.snap.svg +2 -2
- package/tests/repros/__snapshots__/repro-isolated-rs485-isow7841.snap.svg +18 -18
- package/tests/repros/__snapshots__/repro-pga300-redundant-ground-traces.snap.svg +18 -18
- package/tests/repros/__snapshots__/repro-pmp11282-isolated-dcdc.snap.svg +10 -10
- package/tests/repros/__snapshots__/repro-powerbank-3v-system-power.snap.svg +2 -2
- package/tests/repros/__snapshots__/repro-ti-power-output-section.snap.svg +2 -2
- package/tests/repros/__snapshots__/repro-tida-01389-hbridge.snap.svg +2 -2
- package/tests/repros/__snapshots__/repro-tida010076-page02.snap.svg +2 -2
- package/tests/repros/__snapshots__/repro161-power-section-autolayout.snap.svg +2 -2
- package/tests/repros/__snapshots__/repro48-555-timer-vcc-rail-label.snap.svg +2 -2
- package/tests/repros/repro-isolated-rs485-isow7841.test.ts +4 -1
- package/tests/repros/repro-powerbank-3v-system-power.test.ts +24 -0
- package/tests/repros/repro-tida-01389-hbridge.test.ts +24 -0
- package/tests/solvers/SameNetJunctionAlignmentSolver/parallel-load-rails.test.ts +1 -0
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
getRectBounds,
|
|
10
10
|
} from "lib/solvers/NetLabelPlacementSolver/SingleNetLabelPlacementSolver/geometry"
|
|
11
11
|
import { tracePathContainsPoint } from "lib/solvers/RailNetLabelCornerPlacementSolver/geometry"
|
|
12
|
+
import type { MspConnectionPairId } from "lib/solvers/MspConnectionPairSolver/MspConnectionPairSolver"
|
|
12
13
|
import type { SolvedTracePath } from "lib/solvers/SchematicTraceLinesSolver/SchematicTraceLinesSolver"
|
|
13
14
|
import type {
|
|
14
15
|
ChipId,
|
|
@@ -60,6 +61,8 @@ export class AvailableNetOrientationSolver extends BaseSolver {
|
|
|
60
61
|
inputProblem: InputProblem
|
|
61
62
|
traces: SolvedTracePath[]
|
|
62
63
|
netLabelPlacements: NetLabelPlacement[]
|
|
64
|
+
/** Exact provenance for connector traces created by this solver. */
|
|
65
|
+
readonly netLabelConnectorTraceIds = new Set<MspConnectionPairId>()
|
|
63
66
|
|
|
64
67
|
outputNetLabelPlacements: NetLabelPlacement[]
|
|
65
68
|
queuedLabelIndices: number[] = []
|
|
@@ -374,6 +377,7 @@ export class AvailableNetOrientationSolver extends BaseSolver {
|
|
|
374
377
|
|
|
375
378
|
this.traces.push(connectorTrace)
|
|
376
379
|
this.traceMap[mspPairId] = connectorTrace
|
|
380
|
+
this.netLabelConnectorTraceIds.add(mspPairId)
|
|
377
381
|
}
|
|
378
382
|
|
|
379
383
|
private finish() {
|
|
@@ -829,7 +833,7 @@ export class AvailableNetOrientationSolver extends BaseSolver {
|
|
|
829
833
|
foundConnectedTrace = false
|
|
830
834
|
for (const trace of Object.values(this.traceMap)) {
|
|
831
835
|
if (connectedTraceIds.has(trace.mspPairId)) continue
|
|
832
|
-
if (trace.mspPairId
|
|
836
|
+
if (this.netLabelConnectorTraceIds.has(trace.mspPairId)) continue
|
|
833
837
|
if (trace.globalConnNetId !== label.globalConnNetId) continue
|
|
834
838
|
if (!trace.pinIds.some((pinId) => connectedPinIds.has(pinId)))
|
|
835
839
|
continue
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { GraphicsObject, Rect } from "graphics-debug"
|
|
2
2
|
import { BaseSolver } from "lib/solvers/BaseSolver/BaseSolver"
|
|
3
3
|
import type { NetLabelPlacement } from "lib/solvers/NetLabelPlacementSolver/NetLabelPlacementSolver"
|
|
4
|
+
import type { MspConnectionPairId } from "lib/solvers/MspConnectionPairSolver/MspConnectionPairSolver"
|
|
4
5
|
import type { SolvedTracePath } from "lib/solvers/SchematicTraceLinesSolver/SchematicTraceLinesSolver"
|
|
5
6
|
import { visualizeInputProblem } from "lib/solvers/SchematicTracePipelineSolver/visualizeInputProblem"
|
|
6
7
|
import type { InputProblem } from "lib/types/InputProblem"
|
|
@@ -13,6 +14,7 @@ interface SameNetJunctionAlignmentSolverInput {
|
|
|
13
14
|
inputProblem: InputProblem
|
|
14
15
|
traces: SolvedTracePath[]
|
|
15
16
|
netLabelPlacements: NetLabelPlacement[]
|
|
17
|
+
netLabelConnectorTraceIds: ReadonlySet<MspConnectionPairId>
|
|
16
18
|
}
|
|
17
19
|
|
|
18
20
|
/** Turns separate same-net load traces into one shared rail with short junction branches. */
|