@tscircuit/core 0.0.1352 → 0.0.1354

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 +30 -20
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -20385,16 +20385,33 @@ var insertNetLabelsForPortsMissingTrace = ({
20385
20385
  const dx = existingNetLabelForCurrentSourceConnection.anchor_position.x - schPort.center.x;
20386
20386
  const dy = existingNetLabelForCurrentSourceConnection.anchor_position.y - schPort.center.y;
20387
20387
  const labelIsNearPort = dx * dx + dy * dy < NEAR_EXISTING_NET_LABEL_DISTANCE * NEAR_EXISTING_NET_LABEL_DISTANCE;
20388
- if (labelIsNearPort && isGndNet) {
20389
- db.schematic_net_label.update(
20390
- existingNetLabelForCurrentSourceConnection.schematic_net_label_id,
20391
- {
20392
- text,
20393
- anchor_position: schPort.center,
20394
- center,
20395
- anchor_side: side
20396
- }
20397
- );
20388
+ if (labelIsNearPort) {
20389
+ if (isGndNet) {
20390
+ db.schematic_net_label.update(
20391
+ existingNetLabelForCurrentSourceConnection.schematic_net_label_id,
20392
+ {
20393
+ text,
20394
+ anchor_position: schPort.center,
20395
+ center,
20396
+ anchor_side: side
20397
+ }
20398
+ );
20399
+ } else if (!isPowerNet && existingNetLabelForCurrentSourceConnection.text === text) {
20400
+ const anchor_side = existingNetLabelForCurrentSourceConnection.anchor_side ?? side;
20401
+ db.schematic_net_label.update(
20402
+ existingNetLabelForCurrentSourceConnection.schematic_net_label_id,
20403
+ {
20404
+ text,
20405
+ anchor_position: schPort.center,
20406
+ center: computeSchematicNetLabelCenter({
20407
+ anchor_position: schPort.center,
20408
+ anchor_side,
20409
+ text
20410
+ }),
20411
+ anchor_side
20412
+ }
20413
+ );
20414
+ }
20398
20415
  continue;
20399
20416
  }
20400
20417
  const existingAtPort = db.schematic_net_label.list().some((nl) => {
@@ -24197,7 +24214,7 @@ import { identity as identity5 } from "transformation-matrix";
24197
24214
  var package_default = {
24198
24215
  name: "@tscircuit/core",
24199
24216
  type: "module",
24200
- version: "0.0.1351",
24217
+ version: "0.0.1353",
24201
24218
  types: "dist/index.d.ts",
24202
24219
  main: "dist/index.js",
24203
24220
  module: "dist/index.js",
@@ -24234,7 +24251,7 @@ var package_default = {
24234
24251
  "@tscircuit/checks": "0.0.138",
24235
24252
  "@tscircuit/circuit-json-util": "^0.0.96",
24236
24253
  "@tscircuit/common": "^0.0.20",
24237
- "@tscircuit/copper-pour-solver": "^0.0.29",
24254
+ "@tscircuit/copper-pour-solver": "^0.0.34",
24238
24255
  "@tscircuit/footprinter": "^0.0.357",
24239
24256
  "@tscircuit/image-utils": "^0.0.8",
24240
24257
  "@tscircuit/infer-cable-insertion-point": "^0.0.2",
@@ -28948,7 +28965,6 @@ import {
28948
28965
  convertCircuitJsonToInputProblem,
28949
28966
  initializeManifoldGeometry
28950
28967
  } from "@tscircuit/copper-pour-solver";
28951
- import { getFullConnectivityMapFromCircuitJson as getFullConnectivityMapFromCircuitJson4 } from "circuit-json-to-connectivity-map";
28952
28968
 
28953
28969
  // lib/components/primitive-components/CopperPour/utils/mark-trace-segments-inside-copper-pour.ts
28954
28970
  var EPSILON = 1e-9;
@@ -29101,16 +29117,10 @@ var CopperPour = class extends PrimitiveComponent2 {
29101
29117
  }
29102
29118
  const subcircuit = this.getSubcircuit();
29103
29119
  const circuitJson = db.toArray();
29104
- const sourceNet = circuitJson.find(
29105
- (elm) => elm.type === "source_net" && elm.name === net.name
29106
- );
29107
- const connectivityMap = getFullConnectivityMapFromCircuitJson4(circuitJson);
29108
- const connectedNetId = sourceNet?.source_net_id ?? net.source_net_id;
29109
- const pourConnectivityKey = (connectedNetId ? connectivityMap.getNetConnectedToId(connectedNetId) : void 0) || sourceNet?.subcircuit_connectivity_map_key || "";
29110
29120
  const clearance = props.clearance ?? 0.2;
29111
29121
  const inputProblem = convertCircuitJsonToInputProblem(circuitJson, {
29112
29122
  layer: props.layer,
29113
- pour_connectivity_key: pourConnectivityKey,
29123
+ source_net_id: net.source_net_id,
29114
29124
  pad_margin: props.padMargin ?? clearance,
29115
29125
  trace_margin: props.traceMargin ?? clearance,
29116
29126
  board_edge_margin: props.boardEdgeMargin ?? clearance,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.1352",
4
+ "version": "0.0.1354",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
@@ -38,7 +38,7 @@
38
38
  "@tscircuit/checks": "0.0.138",
39
39
  "@tscircuit/circuit-json-util": "^0.0.96",
40
40
  "@tscircuit/common": "^0.0.20",
41
- "@tscircuit/copper-pour-solver": "^0.0.29",
41
+ "@tscircuit/copper-pour-solver": "^0.0.34",
42
42
  "@tscircuit/footprinter": "^0.0.357",
43
43
  "@tscircuit/image-utils": "^0.0.8",
44
44
  "@tscircuit/infer-cable-insertion-point": "^0.0.2",