@tscircuit/core 0.0.653 → 0.0.654
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 +33 -24
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -7211,7 +7211,7 @@ var CapacityMeshAutorouter = class {
|
|
|
7211
7211
|
|
|
7212
7212
|
// lib/components/primitive-components/Group/Group.ts
|
|
7213
7213
|
import "circuit-json";
|
|
7214
|
-
import
|
|
7214
|
+
import Debug10 from "debug";
|
|
7215
7215
|
import "zod";
|
|
7216
7216
|
|
|
7217
7217
|
// lib/components/primitive-components/TraceHint.ts
|
|
@@ -9489,7 +9489,7 @@ import { convertSrjToGraphicsObject } from "@tscircuit/capacity-autorouter";
|
|
|
9489
9489
|
|
|
9490
9490
|
// lib/components/primitive-components/Group/Group_doInitialSchematicTraceRender/Group_doInitialSchematicTraceRender.ts
|
|
9491
9491
|
import { SchematicTracePipelineSolver as SchematicTracePipelineSolver4 } from "@tscircuit/schematic-trace-solver";
|
|
9492
|
-
import
|
|
9492
|
+
import Debug9 from "debug";
|
|
9493
9493
|
|
|
9494
9494
|
// lib/components/primitive-components/Group/Group_doInitialSchematicTraceRender/createSchematicTraceSolverInputProblem.ts
|
|
9495
9495
|
import "@tscircuit/schematic-trace-solver";
|
|
@@ -10061,6 +10061,8 @@ var getNetNameFromPorts = (ports) => {
|
|
|
10061
10061
|
};
|
|
10062
10062
|
|
|
10063
10063
|
// lib/components/primitive-components/Group/Group_doInitialSchematicTraceRender/applyNetLabelPlacements.ts
|
|
10064
|
+
import Debug8 from "debug";
|
|
10065
|
+
var debug7 = Debug8("Group_doInitialSchematicTraceRender");
|
|
10064
10066
|
function applyNetLabelPlacements(args) {
|
|
10065
10067
|
const {
|
|
10066
10068
|
group,
|
|
@@ -10078,6 +10080,7 @@ function applyNetLabelPlacements(args) {
|
|
|
10078
10080
|
const netLabelPlacements = solver.netLabelPlacementSolver?.netLabelPlacements ?? [];
|
|
10079
10081
|
const globalConnMap = solver.mspConnectionPairSolver.globalConnMap;
|
|
10080
10082
|
for (const placement of netLabelPlacements) {
|
|
10083
|
+
debug7(`processing placement: ${placement.netId}`);
|
|
10081
10084
|
const placementUserNetId = globalConnMap.getIdsConnectedToNet(placement.globalConnNetId).find((id) => userNetIdToSck.get(id));
|
|
10082
10085
|
const placementSck = userNetIdToSck.get(placementUserNetId);
|
|
10083
10086
|
const anchor_position = placement.anchorPoint;
|
|
@@ -10090,6 +10093,9 @@ function applyNetLabelPlacements(args) {
|
|
|
10090
10093
|
if (schPortIds.some(
|
|
10091
10094
|
(schPortId) => schematicPortIdsWithPreExistingNetLabels.has(schPortId)
|
|
10092
10095
|
)) {
|
|
10096
|
+
debug7(
|
|
10097
|
+
`skipping net label placement for "${placement.netId}" REASON:schematic port has pre-existing net label`
|
|
10098
|
+
);
|
|
10093
10099
|
continue;
|
|
10094
10100
|
}
|
|
10095
10101
|
if (sourceNet) {
|
|
@@ -10106,11 +10112,14 @@ function applyNetLabelPlacements(args) {
|
|
|
10106
10112
|
anchor_side,
|
|
10107
10113
|
...sourceNet?.source_net_id ? { source_net_id: sourceNet.source_net_id } : {}
|
|
10108
10114
|
});
|
|
10109
|
-
|
|
10115
|
+
continue;
|
|
10110
10116
|
}
|
|
10111
10117
|
if (schPortIds.some(
|
|
10112
10118
|
(schPortId) => schematicPortIdsWithRoutedTraces.has(schPortId)
|
|
10113
10119
|
)) {
|
|
10120
|
+
debug7(
|
|
10121
|
+
`skipping net label placement for "${placement.netId}" REASON:schematic port has routed traces`
|
|
10122
|
+
);
|
|
10114
10123
|
continue;
|
|
10115
10124
|
}
|
|
10116
10125
|
const ports = group.selectAll("port").filter((p) => p._getSubcircuitConnectivityKey() === placementSck);
|
|
@@ -10216,7 +10225,7 @@ var getSchematicPortIdsWithRoutedTraces = ({
|
|
|
10216
10225
|
};
|
|
10217
10226
|
|
|
10218
10227
|
// lib/components/primitive-components/Group/Group_doInitialSchematicTraceRender/Group_doInitialSchematicTraceRender.ts
|
|
10219
|
-
var
|
|
10228
|
+
var debug8 = Debug9("Group_doInitialSchematicTraceRender");
|
|
10220
10229
|
var Group_doInitialSchematicTraceRender = (group) => {
|
|
10221
10230
|
if (!group.root?._featureMspSchematicTraceRouting) return;
|
|
10222
10231
|
if (!group.isSubcircuit) return;
|
|
@@ -10233,7 +10242,7 @@ var Group_doInitialSchematicTraceRender = (group) => {
|
|
|
10233
10242
|
userNetIdToSck
|
|
10234
10243
|
} = createSchematicTraceSolverInputProblem(group);
|
|
10235
10244
|
const schematicPortIdsWithPreExistingNetLabels = getSchematicPortIdsWithAssignedNetLabels(group);
|
|
10236
|
-
if (
|
|
10245
|
+
if (debug8.enabled) {
|
|
10237
10246
|
globalThis.debugOutputs?.add(
|
|
10238
10247
|
"group-trace-render-input-problem",
|
|
10239
10248
|
JSON.stringify(inputProblem, null, 2)
|
|
@@ -10438,20 +10447,20 @@ var Group6 = class extends NormalComponent {
|
|
|
10438
10447
|
return false;
|
|
10439
10448
|
}
|
|
10440
10449
|
_hasTracesToRoute() {
|
|
10441
|
-
const
|
|
10450
|
+
const debug9 = Debug10("tscircuit:core:_hasTracesToRoute");
|
|
10442
10451
|
const traces = this.selectAll("trace");
|
|
10443
|
-
|
|
10452
|
+
debug9(`[${this.getString()}] has ${traces.length} traces to route`);
|
|
10444
10453
|
return traces.length > 0;
|
|
10445
10454
|
}
|
|
10446
10455
|
async _runEffectMakeHttpAutoroutingRequest() {
|
|
10447
10456
|
const { db } = this.root;
|
|
10448
|
-
const
|
|
10457
|
+
const debug9 = Debug10("tscircuit:core:_runEffectMakeHttpAutoroutingRequest");
|
|
10449
10458
|
const props = this._parsedProps;
|
|
10450
10459
|
const autorouterConfig = this._getAutorouterConfig();
|
|
10451
10460
|
const serverUrl = autorouterConfig.serverUrl;
|
|
10452
10461
|
const serverMode = autorouterConfig.serverMode;
|
|
10453
10462
|
const fetchWithDebug = (url, options) => {
|
|
10454
|
-
|
|
10463
|
+
debug9("fetching", url);
|
|
10455
10464
|
if (options.headers) {
|
|
10456
10465
|
options.headers["Tscircuit-Core-Version"] = this.root?.getCoreVersion();
|
|
10457
10466
|
}
|
|
@@ -10567,15 +10576,15 @@ var Group6 = class extends NormalComponent {
|
|
|
10567
10576
|
async _runLocalAutorouting() {
|
|
10568
10577
|
const { db } = this.root;
|
|
10569
10578
|
const props = this._parsedProps;
|
|
10570
|
-
const
|
|
10571
|
-
|
|
10579
|
+
const debug9 = Debug10("tscircuit:core:_runLocalAutorouting");
|
|
10580
|
+
debug9(`[${this.getString()}] starting local autorouting`);
|
|
10572
10581
|
const autorouterConfig = this._getAutorouterConfig();
|
|
10573
10582
|
const { simpleRouteJson } = getSimpleRouteJsonFromCircuitJson({
|
|
10574
10583
|
db,
|
|
10575
10584
|
minTraceWidth: this.props.autorouter?.minTraceWidth ?? 0.15,
|
|
10576
10585
|
subcircuit_id: this.subcircuit_id
|
|
10577
10586
|
});
|
|
10578
|
-
if (
|
|
10587
|
+
if (debug9.enabled) {
|
|
10579
10588
|
const graphicsObject = convertSrjToGraphicsObject(
|
|
10580
10589
|
simpleRouteJson
|
|
10581
10590
|
);
|
|
@@ -10600,11 +10609,11 @@ var Group6 = class extends NormalComponent {
|
|
|
10600
10609
|
const routingPromise = new Promise(
|
|
10601
10610
|
(resolve, reject) => {
|
|
10602
10611
|
autorouter.on("complete", (event) => {
|
|
10603
|
-
|
|
10612
|
+
debug9(`[${this.getString()}] local autorouting complete`);
|
|
10604
10613
|
resolve(event.traces);
|
|
10605
10614
|
});
|
|
10606
10615
|
autorouter.on("error", (event) => {
|
|
10607
|
-
|
|
10616
|
+
debug9(
|
|
10608
10617
|
`[${this.getString()}] local autorouting error: ${event.error.message}`
|
|
10609
10618
|
);
|
|
10610
10619
|
reject(event.error);
|
|
@@ -10661,18 +10670,18 @@ var Group6 = class extends NormalComponent {
|
|
|
10661
10670
|
}
|
|
10662
10671
|
}
|
|
10663
10672
|
doInitialPcbTraceRender() {
|
|
10664
|
-
const
|
|
10673
|
+
const debug9 = Debug10("tscircuit:core:doInitialPcbTraceRender");
|
|
10665
10674
|
if (!this.isSubcircuit) return;
|
|
10666
10675
|
if (this.root?.pcbDisabled) return;
|
|
10667
10676
|
if (this.getInheritedProperty("routingDisabled")) return;
|
|
10668
10677
|
if (this._shouldUseTraceByTraceRouting()) return;
|
|
10669
10678
|
if (!this._areChildSubcircuitsRouted()) {
|
|
10670
|
-
|
|
10679
|
+
debug9(
|
|
10671
10680
|
`[${this.getString()}] child subcircuits are not routed, skipping async autorouting until subcircuits routed`
|
|
10672
10681
|
);
|
|
10673
10682
|
return;
|
|
10674
10683
|
}
|
|
10675
|
-
|
|
10684
|
+
debug9(
|
|
10676
10685
|
`[${this.getString()}] no child subcircuits to wait for, initiating async routing`
|
|
10677
10686
|
);
|
|
10678
10687
|
if (!this._hasTracesToRoute()) return;
|
|
@@ -10682,12 +10691,12 @@ var Group6 = class extends NormalComponent {
|
|
|
10682
10691
|
Group_doInitialSchematicTraceRender(this);
|
|
10683
10692
|
}
|
|
10684
10693
|
updatePcbTraceRender() {
|
|
10685
|
-
const
|
|
10686
|
-
|
|
10694
|
+
const debug9 = Debug10("tscircuit:core:updatePcbTraceRender");
|
|
10695
|
+
debug9(`[${this.getString()}] updating...`);
|
|
10687
10696
|
if (!this.isSubcircuit) return;
|
|
10688
10697
|
if (this._shouldRouteAsync() && this._hasTracesToRoute() && !this._hasStartedAsyncAutorouting) {
|
|
10689
10698
|
if (this._areChildSubcircuitsRouted()) {
|
|
10690
|
-
|
|
10699
|
+
debug9(
|
|
10691
10700
|
`[${this.getString()}] child subcircuits are now routed, starting async autorouting`
|
|
10692
10701
|
);
|
|
10693
10702
|
this._startAsyncAutorouting();
|
|
@@ -10698,14 +10707,14 @@ var Group6 = class extends NormalComponent {
|
|
|
10698
10707
|
if (this._shouldUseTraceByTraceRouting()) return;
|
|
10699
10708
|
const { db } = this.root;
|
|
10700
10709
|
if (this._asyncAutoroutingResult.output_simple_route_json) {
|
|
10701
|
-
|
|
10710
|
+
debug9(
|
|
10702
10711
|
`[${this.getString()}] updating PCB traces from simple route json (${this._asyncAutoroutingResult.output_simple_route_json.traces?.length} traces)`
|
|
10703
10712
|
);
|
|
10704
10713
|
this._updatePcbTraceRenderFromSimpleRouteJson();
|
|
10705
10714
|
return;
|
|
10706
10715
|
}
|
|
10707
10716
|
if (this._asyncAutoroutingResult.output_pcb_traces) {
|
|
10708
|
-
|
|
10717
|
+
debug9(
|
|
10709
10718
|
`[${this.getString()}] updating PCB traces from ${this._asyncAutoroutingResult.output_pcb_traces.length} traces`
|
|
10710
10719
|
);
|
|
10711
10720
|
this._updatePcbTraceRenderFromPcbTraces();
|
|
@@ -13712,7 +13721,7 @@ import { identity as identity5 } from "transformation-matrix";
|
|
|
13712
13721
|
var package_default = {
|
|
13713
13722
|
name: "@tscircuit/core",
|
|
13714
13723
|
type: "module",
|
|
13715
|
-
version: "0.0.
|
|
13724
|
+
version: "0.0.653",
|
|
13716
13725
|
types: "dist/index.d.ts",
|
|
13717
13726
|
main: "dist/index.js",
|
|
13718
13727
|
module: "dist/index.js",
|
|
@@ -13754,7 +13763,7 @@ var package_default = {
|
|
|
13754
13763
|
"@tscircuit/props": "^0.0.287",
|
|
13755
13764
|
"@tscircuit/schematic-autolayout": "^0.0.6",
|
|
13756
13765
|
"@tscircuit/schematic-match-adapt": "^0.0.16",
|
|
13757
|
-
"@tscircuit/schematic-trace-solver": "^0.0.
|
|
13766
|
+
"@tscircuit/schematic-trace-solver": "^0.0.22",
|
|
13758
13767
|
"@tscircuit/simple-3d-svg": "^0.0.38",
|
|
13759
13768
|
"@types/bun": "^1.2.16",
|
|
13760
13769
|
"@types/debug": "^4.1.12",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tscircuit/core",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.654",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/index.js",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"@tscircuit/props": "^0.0.287",
|
|
44
44
|
"@tscircuit/schematic-autolayout": "^0.0.6",
|
|
45
45
|
"@tscircuit/schematic-match-adapt": "^0.0.16",
|
|
46
|
-
"@tscircuit/schematic-trace-solver": "^0.0.
|
|
46
|
+
"@tscircuit/schematic-trace-solver": "^0.0.22",
|
|
47
47
|
"@tscircuit/simple-3d-svg": "^0.0.38",
|
|
48
48
|
"@types/bun": "^1.2.16",
|
|
49
49
|
"@types/debug": "^4.1.12",
|