@tscircuit/core 0.0.915 → 0.0.917

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.d.ts CHANGED
@@ -149,6 +149,7 @@ type Obstacle = {
149
149
  height: number;
150
150
  connectedTo: string[];
151
151
  netIsAssignable?: boolean;
152
+ offBoardConnectsTo?: string[];
152
153
  };
153
154
  interface SimpleRouteConnection {
154
155
  name: string;
package/dist/index.js CHANGED
@@ -10020,6 +10020,52 @@ var getSimpleRouteJsonFromCircuitJson = ({
10020
10020
  );
10021
10021
  obstacle.connectedTo.push(...additionalIds);
10022
10022
  }
10023
+ const internalConnections = db.source_component_internal_connection.list();
10024
+ const sourcePortIdToInternalConnectionId = /* @__PURE__ */ new Map();
10025
+ for (const ic of internalConnections) {
10026
+ for (const sourcePortId of ic.source_port_ids) {
10027
+ sourcePortIdToInternalConnectionId.set(
10028
+ sourcePortId,
10029
+ ic.source_component_internal_connection_id
10030
+ );
10031
+ }
10032
+ }
10033
+ const pcbElementIdToSourcePortId = /* @__PURE__ */ new Map();
10034
+ for (const pcbPort of db.pcb_port.list()) {
10035
+ if (pcbPort.source_port_id) {
10036
+ const smtpad = db.pcb_smtpad.getWhere({
10037
+ pcb_port_id: pcbPort.pcb_port_id
10038
+ });
10039
+ if (smtpad) {
10040
+ pcbElementIdToSourcePortId.set(
10041
+ smtpad.pcb_smtpad_id,
10042
+ pcbPort.source_port_id
10043
+ );
10044
+ }
10045
+ const platedHole = db.pcb_plated_hole.getWhere({
10046
+ pcb_port_id: pcbPort.pcb_port_id
10047
+ });
10048
+ if (platedHole) {
10049
+ pcbElementIdToSourcePortId.set(
10050
+ platedHole.pcb_plated_hole_id,
10051
+ pcbPort.source_port_id
10052
+ );
10053
+ }
10054
+ }
10055
+ }
10056
+ for (const obstacle of obstacles) {
10057
+ for (const connectedId of obstacle.connectedTo) {
10058
+ const sourcePortId = pcbElementIdToSourcePortId.get(connectedId);
10059
+ if (sourcePortId) {
10060
+ const internalConnectionId = sourcePortIdToInternalConnectionId.get(sourcePortId);
10061
+ if (internalConnectionId) {
10062
+ obstacle.offBoardConnectsTo = [internalConnectionId];
10063
+ obstacle.netIsAssignable = true;
10064
+ break;
10065
+ }
10066
+ }
10067
+ }
10068
+ }
10023
10069
  const allPoints = obstacles.flatMap((o) => [
10024
10070
  {
10025
10071
  x: o.center.x - o.width / 2,
@@ -13902,6 +13948,7 @@ var Group6 = class extends NormalComponent3 {
13902
13948
  debug11(`[${this.getString()}] starting local autorouting`);
13903
13949
  const autorouterConfig = this._getAutorouterConfig();
13904
13950
  const isLaserPrefabPreset = this._isLaserPrefabAutorouter(autorouterConfig);
13951
+ const isSingleLayerBoard = this._getSubcircuitLayerCount() === 1;
13905
13952
  const { simpleRouteJson } = getSimpleRouteJsonFromCircuitJson({
13906
13953
  db,
13907
13954
  minTraceWidth: this.props.autorouter?.minTraceWidth ?? 0.15,
@@ -13934,7 +13981,7 @@ var Group6 = class extends NormalComponent3 {
13934
13981
  // Optional configuration parameters
13935
13982
  capacityDepth: this.props.autorouter?.capacityDepth,
13936
13983
  targetMinCapacity: this.props.autorouter?.targetMinCapacity,
13937
- useAssignableViaSolver: isLaserPrefabPreset
13984
+ useAssignableViaSolver: isLaserPrefabPreset || isSingleLayerBoard
13938
13985
  });
13939
13986
  }
13940
13987
  const routingPromise = new Promise(
@@ -16365,6 +16412,9 @@ var Interconnect = class extends NormalComponent3 {
16365
16412
  if (sourcePortIds.length >= 2) {
16366
16413
  db.source_component_internal_connection.insert({
16367
16414
  source_component_id: this.source_component_id,
16415
+ // @ts-expect-error uncomment when circuit-json includes subcircuit_id
16416
+ // in the source_component_internal_connection schema
16417
+ subcircuit_id: this.getSubcircuit()?.subcircuit_id,
16368
16418
  source_port_ids: sourcePortIds
16369
16419
  });
16370
16420
  }
@@ -19199,7 +19249,7 @@ import { identity as identity5 } from "transformation-matrix";
19199
19249
  var package_default = {
19200
19250
  name: "@tscircuit/core",
19201
19251
  type: "module",
19202
- version: "0.0.914",
19252
+ version: "0.0.916",
19203
19253
  types: "dist/index.d.ts",
19204
19254
  main: "dist/index.js",
19205
19255
  module: "dist/index.js",
@@ -19259,7 +19309,7 @@ var package_default = {
19259
19309
  "chokidar-cli": "^3.0.0",
19260
19310
  "circuit-json": "^0.0.328",
19261
19311
  "circuit-json-to-bpc": "^0.0.13",
19262
- "circuit-json-to-connectivity-map": "^0.0.22",
19312
+ "circuit-json-to-connectivity-map": "^0.0.23",
19263
19313
  "circuit-json-to-gltf": "^0.0.31",
19264
19314
  "circuit-json-to-simple-3d": "^0.0.9",
19265
19315
  "circuit-json-to-spice": "^0.0.30",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.915",
4
+ "version": "0.0.917",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
@@ -61,7 +61,7 @@
61
61
  "chokidar-cli": "^3.0.0",
62
62
  "circuit-json": "^0.0.328",
63
63
  "circuit-json-to-bpc": "^0.0.13",
64
- "circuit-json-to-connectivity-map": "^0.0.22",
64
+ "circuit-json-to-connectivity-map": "^0.0.23",
65
65
  "circuit-json-to-gltf": "^0.0.31",
66
66
  "circuit-json-to-simple-3d": "^0.0.9",
67
67
  "circuit-json-to-spice": "^0.0.30",