@tscircuit/core 0.0.1001 → 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 +22 -9
  2. package/package.json +3 -3
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", {
@@ -19946,7 +19958,8 @@ var Potentiometer = class extends NormalComponent3 {
19946
19958
  max_resistance: props.maxResistance,
19947
19959
  pin_variant: pinVariant,
19948
19960
  are_pins_interchangeable: pinVariant === "two_pin",
19949
- display_name: props.displayName
19961
+ display_name: props.displayName,
19962
+ display_max_resistance: this._getSchematicSymbolDisplayValue()
19950
19963
  });
19951
19964
  this.source_component_id = source_component.source_component_id;
19952
19965
  }
@@ -21592,7 +21605,7 @@ import { identity as identity5 } from "transformation-matrix";
21592
21605
  var package_default = {
21593
21606
  name: "@tscircuit/core",
21594
21607
  type: "module",
21595
- version: "0.0.1000",
21608
+ version: "0.0.1002",
21596
21609
  types: "dist/index.d.ts",
21597
21610
  main: "dist/index.js",
21598
21611
  module: "dist/index.js",
@@ -21627,7 +21640,7 @@ var package_default = {
21627
21640
  "@tscircuit/checks": "^0.0.87",
21628
21641
  "@tscircuit/circuit-json-util": "^0.0.77",
21629
21642
  "@tscircuit/common": "^0.0.20",
21630
- "@tscircuit/copper-pour-solver": "^0.0.14",
21643
+ "@tscircuit/copper-pour-solver": "^0.0.20",
21631
21644
  "@tscircuit/footprinter": "^0.0.288",
21632
21645
  "@tscircuit/infgrid-ijump-astar": "^0.0.35",
21633
21646
  "@tscircuit/log-soup": "^1.0.2",
@@ -21648,7 +21661,7 @@ var package_default = {
21648
21661
  "bun-match-svg": "0.0.12",
21649
21662
  "calculate-elbow": "^0.0.12",
21650
21663
  "chokidar-cli": "^3.0.0",
21651
- "circuit-json": "^0.0.371",
21664
+ "circuit-json": "^0.0.372",
21652
21665
  "circuit-json-to-bpc": "^0.0.13",
21653
21666
  "circuit-json-to-connectivity-map": "^0.0.23",
21654
21667
  "circuit-json-to-gltf": "^0.0.62",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.1001",
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",
@@ -57,7 +57,7 @@
57
57
  "bun-match-svg": "0.0.12",
58
58
  "calculate-elbow": "^0.0.12",
59
59
  "chokidar-cli": "^3.0.0",
60
- "circuit-json": "^0.0.371",
60
+ "circuit-json": "^0.0.372",
61
61
  "circuit-json-to-bpc": "^0.0.13",
62
62
  "circuit-json-to-connectivity-map": "^0.0.23",
63
63
  "circuit-json-to-gltf": "^0.0.62",