@tscircuit/core 0.0.1002 → 0.0.1003

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 +19 -7
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -19589,6 +19589,12 @@ var Via = class extends PrimitiveComponent2 {
19589
19589
  net_is_assignable: this._parsedProps.netIsAssignable ?? void 0
19590
19590
  });
19591
19591
  this.pcb_via_id = pcb_via.pcb_via_id;
19592
+ const connected = this._getConnectedNetOrTrace();
19593
+ if (connected && "source_net_id" in connected && connected.source_net_id) {
19594
+ db.pcb_via.update(this.pcb_via_id, {
19595
+ pcb_trace_id: connected.source_net_id
19596
+ });
19597
+ }
19592
19598
  }
19593
19599
  };
19594
19600
 
@@ -19598,6 +19604,7 @@ import {
19598
19604
  CopperPourPipelineSolver as CopperPourPipelineSolver2,
19599
19605
  convertCircuitJsonToInputProblem
19600
19606
  } from "@tscircuit/copper-pour-solver";
19607
+ import { getFullConnectivityMapFromCircuitJson as getFullConnectivityMapFromCircuitJson4 } from "circuit-json-to-connectivity-map";
19601
19608
  var CopperPour = class extends PrimitiveComponent2 {
19602
19609
  isPcbPrimitive = true;
19603
19610
  get config() {
@@ -19624,17 +19631,22 @@ var CopperPour = class extends PrimitiveComponent2 {
19624
19631
  return;
19625
19632
  }
19626
19633
  const subcircuit = this.getSubcircuit();
19627
- const sourceNet = db.toArray().filter(
19634
+ const circuitJson = db.toArray();
19635
+ const sourceNet = circuitJson.find(
19628
19636
  (elm) => elm.type === "source_net" && elm.name === net.name
19629
- )[0] || "";
19637
+ );
19638
+ const connectivityMap = getFullConnectivityMapFromCircuitJson4(circuitJson);
19639
+ const connectedNetId = sourceNet?.source_net_id ?? net.source_net_id;
19640
+ const pourConnectivityKey = (connectedNetId ? connectivityMap.getNetConnectedToId(connectedNetId) : void 0) || sourceNet?.subcircuit_connectivity_map_key || "";
19630
19641
  const clearance = props.clearance ?? 0.2;
19631
- const inputProblem = convertCircuitJsonToInputProblem(db.toArray(), {
19642
+ const inputProblem = convertCircuitJsonToInputProblem(circuitJson, {
19632
19643
  layer: props.layer,
19633
- pour_connectivity_key: sourceNet.subcircuit_connectivity_map_key || "",
19644
+ pour_connectivity_key: pourConnectivityKey,
19634
19645
  pad_margin: props.padMargin ?? clearance,
19635
19646
  trace_margin: props.traceMargin ?? clearance,
19636
19647
  board_edge_margin: props.boardEdgeMargin ?? clearance,
19637
- cutout_margin: props.cutoutMargin ?? clearance
19648
+ cutout_margin: props.cutoutMargin ?? clearance,
19649
+ outline: props.outline
19638
19650
  });
19639
19651
  const solver = new CopperPourPipelineSolver2(inputProblem);
19640
19652
  this.root.emit("solver:started", {
@@ -21593,7 +21605,7 @@ import { identity as identity5 } from "transformation-matrix";
21593
21605
  var package_default = {
21594
21606
  name: "@tscircuit/core",
21595
21607
  type: "module",
21596
- version: "0.0.1001",
21608
+ version: "0.0.1002",
21597
21609
  types: "dist/index.d.ts",
21598
21610
  main: "dist/index.js",
21599
21611
  module: "dist/index.js",
@@ -21628,7 +21640,7 @@ var package_default = {
21628
21640
  "@tscircuit/checks": "^0.0.87",
21629
21641
  "@tscircuit/circuit-json-util": "^0.0.77",
21630
21642
  "@tscircuit/common": "^0.0.20",
21631
- "@tscircuit/copper-pour-solver": "^0.0.14",
21643
+ "@tscircuit/copper-pour-solver": "^0.0.20",
21632
21644
  "@tscircuit/footprinter": "^0.0.288",
21633
21645
  "@tscircuit/infgrid-ijump-astar": "^0.0.35",
21634
21646
  "@tscircuit/log-soup": "^1.0.2",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.1002",
4
+ "version": "0.0.1003",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
@@ -36,7 +36,7 @@
36
36
  "@tscircuit/checks": "^0.0.87",
37
37
  "@tscircuit/circuit-json-util": "^0.0.77",
38
38
  "@tscircuit/common": "^0.0.20",
39
- "@tscircuit/copper-pour-solver": "^0.0.14",
39
+ "@tscircuit/copper-pour-solver": "^0.0.20",
40
40
  "@tscircuit/footprinter": "^0.0.288",
41
41
  "@tscircuit/infgrid-ijump-astar": "^0.0.35",
42
42
  "@tscircuit/log-soup": "^1.0.2",