@tscircuit/core 0.0.652 → 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.
Files changed (2) hide show
  1. package/dist/index.js +33 -66
  2. 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 Debug9 from "debug";
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 Debug8 from "debug";
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
- return;
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);
@@ -10131,41 +10140,6 @@ function applyNetLabelPlacements(args) {
10131
10140
 
10132
10141
  // lib/components/primitive-components/Group/Group_doInitialSchematicTraceRender/insertNetLabelsForTracesExcludedFromRouting.ts
10133
10142
  import "@tscircuit/schematic-trace-solver";
10134
- function insertNetLabelsForTracesExcludedFromRouting(args) {
10135
- const {
10136
- group,
10137
- displayLabelTraces,
10138
- pinIdToSchematicPortId,
10139
- schematicPortIdsWithPreExistingNetLabels
10140
- } = args;
10141
- const { db } = group.root;
10142
- for (const trace of displayLabelTraces) {
10143
- const label = trace._parsedProps?.schDisplayLabel;
10144
- if (!label) continue;
10145
- try {
10146
- const res = trace._findConnectedPorts?.();
10147
- if (!res?.allPortsFound || !res.ports || res.ports.length < 1) continue;
10148
- const ports = res.ports.slice(0, 2);
10149
- for (const port of ports) {
10150
- const anchor_position = port._getGlobalSchematicPositionAfterLayout();
10151
- const side = getEnteringEdgeFromDirection(port.facingDirection || "right") || "right";
10152
- const center = computeSchematicNetLabelCenter({
10153
- anchor_position,
10154
- anchor_side: side,
10155
- text: label
10156
- });
10157
- db.schematic_net_label.insert({
10158
- text: label,
10159
- anchor_position,
10160
- center,
10161
- anchor_side: side,
10162
- ...trace.source_trace_id ? { source_trace_id: trace.source_trace_id } : {}
10163
- });
10164
- }
10165
- } catch {
10166
- }
10167
- }
10168
- }
10169
10143
 
10170
10144
  // lib/components/primitive-components/Group/Group_doInitialSchematicTraceRender/insertNetLabelsForPortsMissingTrace.ts
10171
10145
  var insertNetLabelsForPortsMissingTrace = ({
@@ -10251,7 +10225,7 @@ var getSchematicPortIdsWithRoutedTraces = ({
10251
10225
  };
10252
10226
 
10253
10227
  // lib/components/primitive-components/Group/Group_doInitialSchematicTraceRender/Group_doInitialSchematicTraceRender.ts
10254
- var debug7 = Debug8("Group_doInitialSchematicTraceRender");
10228
+ var debug8 = Debug9("Group_doInitialSchematicTraceRender");
10255
10229
  var Group_doInitialSchematicTraceRender = (group) => {
10256
10230
  if (!group.root?._featureMspSchematicTraceRouting) return;
10257
10231
  if (!group.isSubcircuit) return;
@@ -10268,7 +10242,7 @@ var Group_doInitialSchematicTraceRender = (group) => {
10268
10242
  userNetIdToSck
10269
10243
  } = createSchematicTraceSolverInputProblem(group);
10270
10244
  const schematicPortIdsWithPreExistingNetLabels = getSchematicPortIdsWithAssignedNetLabels(group);
10271
- if (debug7.enabled) {
10245
+ if (debug8.enabled) {
10272
10246
  globalThis.debugOutputs?.add(
10273
10247
  "group-trace-render-input-problem",
10274
10248
  JSON.stringify(inputProblem, null, 2)
@@ -10306,13 +10280,6 @@ var Group_doInitialSchematicTraceRender = (group) => {
10306
10280
  pinIdToSchematicPortId,
10307
10281
  schematicPortIdsWithPreExistingNetLabels
10308
10282
  });
10309
- insertNetLabelsForTracesExcludedFromRouting({
10310
- group,
10311
- solver,
10312
- displayLabelTraces,
10313
- pinIdToSchematicPortId,
10314
- schematicPortIdsWithPreExistingNetLabels
10315
- });
10316
10283
  };
10317
10284
 
10318
10285
  // lib/components/primitive-components/Group/Group.ts
@@ -10480,20 +10447,20 @@ var Group6 = class extends NormalComponent {
10480
10447
  return false;
10481
10448
  }
10482
10449
  _hasTracesToRoute() {
10483
- const debug8 = Debug9("tscircuit:core:_hasTracesToRoute");
10450
+ const debug9 = Debug10("tscircuit:core:_hasTracesToRoute");
10484
10451
  const traces = this.selectAll("trace");
10485
- debug8(`[${this.getString()}] has ${traces.length} traces to route`);
10452
+ debug9(`[${this.getString()}] has ${traces.length} traces to route`);
10486
10453
  return traces.length > 0;
10487
10454
  }
10488
10455
  async _runEffectMakeHttpAutoroutingRequest() {
10489
10456
  const { db } = this.root;
10490
- const debug8 = Debug9("tscircuit:core:_runEffectMakeHttpAutoroutingRequest");
10457
+ const debug9 = Debug10("tscircuit:core:_runEffectMakeHttpAutoroutingRequest");
10491
10458
  const props = this._parsedProps;
10492
10459
  const autorouterConfig = this._getAutorouterConfig();
10493
10460
  const serverUrl = autorouterConfig.serverUrl;
10494
10461
  const serverMode = autorouterConfig.serverMode;
10495
10462
  const fetchWithDebug = (url, options) => {
10496
- debug8("fetching", url);
10463
+ debug9("fetching", url);
10497
10464
  if (options.headers) {
10498
10465
  options.headers["Tscircuit-Core-Version"] = this.root?.getCoreVersion();
10499
10466
  }
@@ -10609,15 +10576,15 @@ var Group6 = class extends NormalComponent {
10609
10576
  async _runLocalAutorouting() {
10610
10577
  const { db } = this.root;
10611
10578
  const props = this._parsedProps;
10612
- const debug8 = Debug9("tscircuit:core:_runLocalAutorouting");
10613
- debug8(`[${this.getString()}] starting local autorouting`);
10579
+ const debug9 = Debug10("tscircuit:core:_runLocalAutorouting");
10580
+ debug9(`[${this.getString()}] starting local autorouting`);
10614
10581
  const autorouterConfig = this._getAutorouterConfig();
10615
10582
  const { simpleRouteJson } = getSimpleRouteJsonFromCircuitJson({
10616
10583
  db,
10617
10584
  minTraceWidth: this.props.autorouter?.minTraceWidth ?? 0.15,
10618
10585
  subcircuit_id: this.subcircuit_id
10619
10586
  });
10620
- if (debug8.enabled) {
10587
+ if (debug9.enabled) {
10621
10588
  const graphicsObject = convertSrjToGraphicsObject(
10622
10589
  simpleRouteJson
10623
10590
  );
@@ -10642,11 +10609,11 @@ var Group6 = class extends NormalComponent {
10642
10609
  const routingPromise = new Promise(
10643
10610
  (resolve, reject) => {
10644
10611
  autorouter.on("complete", (event) => {
10645
- debug8(`[${this.getString()}] local autorouting complete`);
10612
+ debug9(`[${this.getString()}] local autorouting complete`);
10646
10613
  resolve(event.traces);
10647
10614
  });
10648
10615
  autorouter.on("error", (event) => {
10649
- debug8(
10616
+ debug9(
10650
10617
  `[${this.getString()}] local autorouting error: ${event.error.message}`
10651
10618
  );
10652
10619
  reject(event.error);
@@ -10703,18 +10670,18 @@ var Group6 = class extends NormalComponent {
10703
10670
  }
10704
10671
  }
10705
10672
  doInitialPcbTraceRender() {
10706
- const debug8 = Debug9("tscircuit:core:doInitialPcbTraceRender");
10673
+ const debug9 = Debug10("tscircuit:core:doInitialPcbTraceRender");
10707
10674
  if (!this.isSubcircuit) return;
10708
10675
  if (this.root?.pcbDisabled) return;
10709
10676
  if (this.getInheritedProperty("routingDisabled")) return;
10710
10677
  if (this._shouldUseTraceByTraceRouting()) return;
10711
10678
  if (!this._areChildSubcircuitsRouted()) {
10712
- debug8(
10679
+ debug9(
10713
10680
  `[${this.getString()}] child subcircuits are not routed, skipping async autorouting until subcircuits routed`
10714
10681
  );
10715
10682
  return;
10716
10683
  }
10717
- debug8(
10684
+ debug9(
10718
10685
  `[${this.getString()}] no child subcircuits to wait for, initiating async routing`
10719
10686
  );
10720
10687
  if (!this._hasTracesToRoute()) return;
@@ -10724,12 +10691,12 @@ var Group6 = class extends NormalComponent {
10724
10691
  Group_doInitialSchematicTraceRender(this);
10725
10692
  }
10726
10693
  updatePcbTraceRender() {
10727
- const debug8 = Debug9("tscircuit:core:updatePcbTraceRender");
10728
- debug8(`[${this.getString()}] updating...`);
10694
+ const debug9 = Debug10("tscircuit:core:updatePcbTraceRender");
10695
+ debug9(`[${this.getString()}] updating...`);
10729
10696
  if (!this.isSubcircuit) return;
10730
10697
  if (this._shouldRouteAsync() && this._hasTracesToRoute() && !this._hasStartedAsyncAutorouting) {
10731
10698
  if (this._areChildSubcircuitsRouted()) {
10732
- debug8(
10699
+ debug9(
10733
10700
  `[${this.getString()}] child subcircuits are now routed, starting async autorouting`
10734
10701
  );
10735
10702
  this._startAsyncAutorouting();
@@ -10740,14 +10707,14 @@ var Group6 = class extends NormalComponent {
10740
10707
  if (this._shouldUseTraceByTraceRouting()) return;
10741
10708
  const { db } = this.root;
10742
10709
  if (this._asyncAutoroutingResult.output_simple_route_json) {
10743
- debug8(
10710
+ debug9(
10744
10711
  `[${this.getString()}] updating PCB traces from simple route json (${this._asyncAutoroutingResult.output_simple_route_json.traces?.length} traces)`
10745
10712
  );
10746
10713
  this._updatePcbTraceRenderFromSimpleRouteJson();
10747
10714
  return;
10748
10715
  }
10749
10716
  if (this._asyncAutoroutingResult.output_pcb_traces) {
10750
- debug8(
10717
+ debug9(
10751
10718
  `[${this.getString()}] updating PCB traces from ${this._asyncAutoroutingResult.output_pcb_traces.length} traces`
10752
10719
  );
10753
10720
  this._updatePcbTraceRenderFromPcbTraces();
@@ -13754,7 +13721,7 @@ import { identity as identity5 } from "transformation-matrix";
13754
13721
  var package_default = {
13755
13722
  name: "@tscircuit/core",
13756
13723
  type: "module",
13757
- version: "0.0.651",
13724
+ version: "0.0.653",
13758
13725
  types: "dist/index.d.ts",
13759
13726
  main: "dist/index.js",
13760
13727
  module: "dist/index.js",
@@ -13796,7 +13763,7 @@ var package_default = {
13796
13763
  "@tscircuit/props": "^0.0.287",
13797
13764
  "@tscircuit/schematic-autolayout": "^0.0.6",
13798
13765
  "@tscircuit/schematic-match-adapt": "^0.0.16",
13799
- "@tscircuit/schematic-trace-solver": "^0.0.17",
13766
+ "@tscircuit/schematic-trace-solver": "^0.0.22",
13800
13767
  "@tscircuit/simple-3d-svg": "^0.0.38",
13801
13768
  "@types/bun": "^1.2.16",
13802
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.652",
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.17",
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",