@tscircuit/schematic-trace-solver 0.0.159 → 0.0.161
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 +43 -9
- package/dist/index.js +807 -115
- package/lib/solvers/AvailableNetOrientationSolver/AvailableNetOrientationSolver.ts +210 -6
- package/lib/solvers/InlineNetLabelSolver/InlineNetLabelSolver.ts +536 -94
- package/lib/solvers/InlineNetLabelSolver/pushAnchoredNetLabelsAwayFromInlineLabels.ts +9 -7
- package/lib/solvers/InlineNetLabelSolver/pushInlineTerminalLabelsAwayFromAnchoredLabels.ts +295 -0
- package/lib/solvers/NetLabelPlacementSolver/NetLabelPlacementSolver.ts +7 -35
- package/lib/solvers/SchematicTraceLinesSolver/getTraceConnectedPinComponents.ts +60 -0
- package/lib/solvers/TraceCleanupSolver/sameNetRailAlignment/getFixedLabelCoordinate.ts +44 -13
- package/lib/types/InputProblem.ts +5 -4
- package/package.json +1 -1
- package/tests/bug-reports/bug-report-20260706T220324Z/__snapshots__/bug-report-20260706T220324Z.snap.svg +1 -1
- package/tests/bug-reports/bug-report-20260728T144234Z/__snapshots__/bug-report-20260728T144234Z.snap.svg +1 -1
- package/tests/bug-reports/bug-report-20260728T225606Z/__snapshots__/bug-report-20260728T225606Z.snap.svg +79 -79
- package/tests/bug-reports/bug-report-20260730T061837Z/__snapshots__/bug-report-20260730T061837Z.snap.svg +85 -85
- package/tests/bug-reports/bug-report-20260731T052229Z/__snapshots__/bug-report-20260731T052229Z.snap.svg +1 -1
- package/tests/bug-reports/bug-report-20260804T095800Z/__snapshots__/bug-report-20260804T095800Z.snap.svg +163 -163
- package/tests/bug-reports/bug-report-20260804T171919Z/__snapshots__/bug-report-20260804T171919Z.snap.svg +547 -547
- package/tests/bug-reports/bug-report-20260804T225912Z/__snapshots__/bug-report-20260804T225912Z.snap.svg +13 -13
- package/tests/bug-reports/bug-report-20260805T061316Z/__snapshots__/bug-report-20260805T061316Z.snap.svg +267 -267
- package/tests/bug-reports/bug-report-20260806T061548Z/__snapshots__/bug-report-20260806T061548Z.snap.svg +267 -267
- package/tests/bug-reports/bug-report-20260806T093501Z/__snapshots__/bug-report-20260806T093501Z.snap.svg +109 -109
- package/tests/bug-reports/bug-report-20260811T075142Z/__snapshots__/bug-report-20260811T075142Z.snap.svg +1 -1
- package/tests/bug-reports/bug-report-20260815T073240Z/__snapshots__/bug-report-20260815T073240Z.snap.svg +49 -49
- package/tests/bug-reports/bug-report-20260819T091818Z/__snapshots__/bug-report-20260819T091818Z.snap.svg +1 -1
- package/tests/bug-reports/bug-report-20260825T045913Z/__snapshots__/bug-report-20260825T045913Z.snap.svg +103 -103
- package/tests/bug-reports/bug-report-20260825T103621Z/__snapshots__/bug-report-20260825T103621Z.snap.svg +103 -103
- package/tests/bug-reports/bug-report-20260826T072956Z/__snapshots__/bug-report-20260826T072956Z.snap.svg +600 -792
- package/tests/bug-reports/bug-report-20260826T072956Z/bug-report-20260826T072956Z.test.ts +66 -1
- package/tests/examples/__snapshots__/example51.snap.svg +568 -568
- package/tests/fixtures/convertSolverOutputToCircuitJson.test.ts +16 -1
- package/tests/fixtures/convertSolverOutputToCircuitJson.ts +23 -12
- package/tests/repros/__snapshots__/board-1273-trace-overlap-cycle.snap.svg +736 -736
- package/tests/repros/__snapshots__/board-15984-same-net-junction.snap.svg +79 -79
- package/tests/repros/__snapshots__/board1096-usb-label-overlap-iteration.snap.svg +127 -127
- package/tests/repros/__snapshots__/repro-bluetooth-controller-ground-decoupling-groups.snap.svg +106 -0
- package/tests/repros/__snapshots__/repro-board-589-regulator-section.snap.svg +31 -31
- package/tests/repros/__snapshots__/repro-board-648-esp12f-section.snap.svg +121 -121
- package/tests/repros/__snapshots__/repro-bq25895-cross-net-trace-overlap.snap.svg +43 -43
- package/tests/repros/__snapshots__/repro-core-555-power-cross-net-overlap.snap.svg +19 -19
- package/tests/repros/__snapshots__/repro-core-ground-inline-label-fallback.snap.svg +277 -0
- package/tests/repros/__snapshots__/repro-core-subcircuit-missing-ground.snap.svg +19 -19
- package/tests/repros/__snapshots__/repro-core-tb67s579ftg-inline-label-routing.snap.svg +7 -7
- package/tests/repros/__snapshots__/repro-dc-power-isolated-routing.snap.svg +37 -37
- package/tests/repros/__snapshots__/repro-hdc2080-ground-label-alignment.snap.svg +137 -0
- package/tests/repros/__snapshots__/repro-nrf52810-clock-routing.snap.svg +61 -61
- package/tests/repros/__snapshots__/repro-pga300-redundant-ground-traces.snap.svg +115 -115
- package/tests/repros/__snapshots__/repro-pmp11282-isolated-dcdc.snap.svg +743 -743
- package/tests/repros/__snapshots__/repro-rp2040-usb-cc2-ground-overlap.snap.svg +43 -43
- package/tests/repros/__snapshots__/repro-ti-power-output-section.snap.svg +1 -1
- package/tests/repros/__snapshots__/repro-tida010076-j4-ground-bus.snap.svg +17 -17
- package/tests/repros/__snapshots__/repro-tida010076-page02.snap.svg +1131 -1131
- package/tests/repros/__snapshots__/repro-type-c-16pin-self-connection.snap.svg +7 -7
- package/tests/repros/__snapshots__/repro-type-c-16pin-to-resistor.snap.svg +7 -7
- package/tests/repros/__snapshots__/repro-usb-power-vbus-label-detour.snap.svg +666 -666
- package/tests/repros/__snapshots__/repro161-power-section-autolayout.snap.svg +73 -73
- package/tests/repros/__snapshots__/repro48-555-timer-vcc-rail-label.snap.svg +73 -73
- package/tests/repros/assets/repro-bluetooth-controller-ground-decoupling-groups.input.json +214 -0
- package/tests/repros/assets/repro-core-ground-inline-label-fallback.input.json +863 -0
- package/tests/repros/repro-bluetooth-controller-ground-decoupling-groups.test.ts +18 -0
- package/tests/repros/repro-core-ground-inline-label-fallback.test.ts +34 -0
- package/tests/repros/repro-hdc2080-ground-label-alignment.test.ts +239 -0
- package/tests/repros/repro-tida010076-j4-ground-bus.test.ts +14 -10
- package/tests/repros/repro-tida010076-page02.test.ts +2 -2
- package/tests/repros/repro-usb-power-vbus-label-detour.test.ts +14 -0
- package/tests/solvers/InlineNetLabelSolver/__snapshots__/inline-net-label02.snap.svg +1 -1
- package/tests/solvers/InlineNetLabelSolver/multi-pin-connected-components.test.ts +252 -0
- package/tests/solvers/InlineNetLabelSolver/opposite-side-placement.test.ts +71 -0
- package/tests/solvers/InlineNetLabelSolver/push-anchored-net-labels-away.test.ts +8 -2
- package/tests/solvers/InlineNetLabelSolver/push-inline-terminal-labels-away.test.ts +91 -0
- package/tests/solvers/InlineNetLabelSolver/two-pin-terminal-stubs-atomic.test.ts +7 -1
package/dist/index.d.ts
CHANGED
|
@@ -152,10 +152,11 @@ interface InputNetConnection {
|
|
|
152
152
|
anchoredNetLabelWidth?: number;
|
|
153
153
|
netLabelHeight?: number;
|
|
154
154
|
/**
|
|
155
|
-
* When true, a named
|
|
156
|
-
*
|
|
157
|
-
*
|
|
158
|
-
*
|
|
155
|
+
* When true, a named net may use inline labels. Each routed connected
|
|
156
|
+
* component gets a label along its representative trace, while each
|
|
157
|
+
* disconnected endpoint gets an outward inline-label stub. Conversion is
|
|
158
|
+
* atomic for the whole net so inline and anchored representations are not
|
|
159
|
+
* mixed when any label cannot be placed.
|
|
159
160
|
*/
|
|
160
161
|
allowInlineNetLabel?: boolean;
|
|
161
162
|
/** Extent of the inline text along the generated trace stub. */
|
|
@@ -905,6 +906,9 @@ declare class AvailableNetOrientationSolver extends BaseSolver {
|
|
|
905
906
|
private shouldCheckTraceClearanceForLabel;
|
|
906
907
|
private hasRoutedLabelOnSameNet;
|
|
907
908
|
private isOutwardHorizontalFallback;
|
|
909
|
+
private canPlaceVerticalLabelOnHostRail;
|
|
910
|
+
private getTextBlockedMultiPinRailTraces;
|
|
911
|
+
private findValidNearbyRailCandidate;
|
|
908
912
|
private hasPortOnlyLabelOnSameNet;
|
|
909
913
|
private hasOppositeVerticalRailOnSameChipSide;
|
|
910
914
|
private getSingleChipSideForNetConnection;
|
|
@@ -1282,11 +1286,16 @@ interface InlineNetLabelOutput {
|
|
|
1282
1286
|
netLabelPlacements: NetLabelPlacement[];
|
|
1283
1287
|
inlineNetLabelPlacements: InlineNetLabelPlacement[];
|
|
1284
1288
|
}
|
|
1285
|
-
type
|
|
1289
|
+
type QueuedInlineConnection = {
|
|
1290
|
+
kind: "direct_connection";
|
|
1291
|
+
connection: InputDirectConnection;
|
|
1292
|
+
} | {
|
|
1293
|
+
kind: "net_connection";
|
|
1294
|
+
connection: InputNetConnection;
|
|
1295
|
+
};
|
|
1286
1296
|
/**
|
|
1287
1297
|
* Places "inline net labels" - net names drawn alongside the trace they belong
|
|
1288
|
-
* to - for
|
|
1289
|
-
* `allowInlineNetLabel`.
|
|
1298
|
+
* to - for connections that opted in via `allowInlineNetLabel`.
|
|
1290
1299
|
*
|
|
1291
1300
|
* Any regular (anchored) net label placement for the same net is dropped, so a
|
|
1292
1301
|
* net is never labeled twice.
|
|
@@ -1296,14 +1305,38 @@ declare class InlineNetLabelSolver extends BaseSolver {
|
|
|
1296
1305
|
traces: SolvedTracePath[];
|
|
1297
1306
|
inputNetLabelPlacements: NetLabelPlacement[];
|
|
1298
1307
|
inlineNetLabelPlacements: InlineNetLabelPlacement[];
|
|
1299
|
-
/** Eligible
|
|
1300
|
-
queuedConnections:
|
|
1308
|
+
/** Eligible connections still waiting to be processed. */
|
|
1309
|
+
queuedConnections: QueuedInlineConnection[];
|
|
1301
1310
|
private tracesByPinPairKey;
|
|
1311
|
+
private globalConnMap;
|
|
1312
|
+
private supersededTraceIdsByGlobalConnNetId;
|
|
1302
1313
|
private hasAlignedPortOnlyStubs;
|
|
1303
1314
|
private postProcessedOutput?;
|
|
1304
1315
|
constructor(input: InlineNetLabelSolverInput);
|
|
1305
1316
|
getConstructorParams(): [InlineNetLabelSolverInput];
|
|
1306
1317
|
_step(): void;
|
|
1318
|
+
/**
|
|
1319
|
+
* Plans all opted-in multi-pin nets together. Short routed components can
|
|
1320
|
+
* mutually block the outward endpoint stubs that replace them, so tentative
|
|
1321
|
+
* replacements are ignored as obstacles only while their owning net still
|
|
1322
|
+
* converts successfully. Failed conversions retain both their traces and
|
|
1323
|
+
* their conventional labels, and the remaining conversions are retried.
|
|
1324
|
+
*/
|
|
1325
|
+
private computeNetConnectionInlineConversions;
|
|
1326
|
+
/**
|
|
1327
|
+
* Splits an input net into the connected components created by its solved
|
|
1328
|
+
* traces. This intentionally does not depend on anchored-label placement:
|
|
1329
|
+
* a group whose anchored label failed still has the same routing topology.
|
|
1330
|
+
*/
|
|
1331
|
+
private getNetConnectionComponents;
|
|
1332
|
+
private getGlobalConnNetId;
|
|
1333
|
+
/**
|
|
1334
|
+
* Converts every conventional label representation for an opted-in named
|
|
1335
|
+
* net. Routed connected components become labels on their representative
|
|
1336
|
+
* trace; disconnected pins become outward terminal stubs. The conversion is
|
|
1337
|
+
* atomic so one blocked candidate cannot leave mixed label styles on a net.
|
|
1338
|
+
*/
|
|
1339
|
+
private computeNetConnectionInlinePlacements;
|
|
1307
1340
|
/**
|
|
1308
1341
|
* Converts one conventional endpoint placement into an inline label on a
|
|
1309
1342
|
* generated outward stub. The stub follows the pin's true facing direction;
|
|
@@ -1330,6 +1363,7 @@ declare class InlineNetLabelSolver extends BaseSolver {
|
|
|
1330
1363
|
*/
|
|
1331
1364
|
private getSupersededNetLabelKeys;
|
|
1332
1365
|
private getOutputTraces;
|
|
1366
|
+
private getInlineGlobalsOverlappingAnchoredLabels;
|
|
1333
1367
|
private buildPostProcessedOutput;
|
|
1334
1368
|
getOutput(): {
|
|
1335
1369
|
traces: SolvedTracePath[];
|