@tscircuit/core 0.0.1134 → 0.0.1136

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
@@ -12,7 +12,7 @@ import { symbols, SchSymbol, BaseSymbolName } from 'schematic-symbols';
12
12
  import { CircuitJsonUtilObjects } from '@tscircuit/circuit-json-util';
13
13
  import { Matrix } from 'transformation-matrix';
14
14
  import { PackSolver2 } from 'calculate-packing';
15
- import { AutoroutingPipelineSolver, AssignableAutoroutingPipeline2, AssignableAutoroutingPipeline3, AutoroutingPipeline1_OriginalUnravel, AutoroutingPipelineSolver3_HgPortPointPathing } from '@tscircuit/capacity-autorouter';
15
+ import { AutoroutingPipelineSolver, AssignableAutoroutingPipeline2, AssignableAutoroutingPipeline3, AutoroutingPipeline1_OriginalUnravel, AutoroutingPipelineSolver3_HgPortPointPathing, AutoroutingPipelineSolver5 } from '@tscircuit/capacity-autorouter';
16
16
  import { CopperPourPipelineSolver } from '@tscircuit/copper-pour-solver';
17
17
  import { ConnectivityMap } from 'circuit-json-to-connectivity-map';
18
18
  import { GraphicsObject } from 'graphics-debug';
@@ -25,6 +25,7 @@ declare const SOLVERS: {
25
25
  AutoroutingPipeline1_OriginalUnravel: typeof AutoroutingPipeline1_OriginalUnravel;
26
26
  AutoroutingPipelineSolver3_HgPortPointPathing: typeof AutoroutingPipelineSolver3_HgPortPointPathing;
27
27
  AutoroutingPipelineSolver4: typeof AutoroutingPipelineSolver;
28
+ AutoroutingPipelineSolver5: typeof AutoroutingPipelineSolver5;
28
29
  CopperPourPipelineSolver: typeof CopperPourPipelineSolver;
29
30
  };
30
31
  type SolverName = keyof typeof SOLVERS;
@@ -2619,7 +2620,7 @@ declare class Board extends Group<typeof boardProps> implements BoardI, Subcircu
2619
2620
  pcbRouteCache: zod.ZodOptional<zod.ZodType<_tscircuit_props.PcbRouteCache, zod.ZodTypeDef, _tscircuit_props.PcbRouteCache>>;
2620
2621
  autorouter: zod.ZodOptional<zod.ZodType<_tscircuit_props.AutorouterProp, zod.ZodTypeDef, _tscircuit_props.AutorouterProp>>;
2621
2622
  autorouterEffortLevel: zod.ZodOptional<zod.ZodEnum<["1x", "2x", "5x", "10x", "100x"]>>;
2622
- autorouterVersion: zod.ZodOptional<zod.ZodEnum<["v1", "v2", "v3", "v4", "latest"]>>;
2623
+ autorouterVersion: zod.ZodOptional<zod.ZodEnum<["v1", "v2", "v3", "v4", "v5", "latest"]>>;
2623
2624
  square: zod.ZodOptional<zod.ZodBoolean>;
2624
2625
  emptyArea: zod.ZodOptional<zod.ZodString>;
2625
2626
  filledArea: zod.ZodOptional<zod.ZodString>;
@@ -2963,7 +2964,7 @@ declare class Board extends Group<typeof boardProps> implements BoardI, Subcircu
2963
2964
  pcbRouteCache?: _tscircuit_props.PcbRouteCache | undefined;
2964
2965
  autorouter?: _tscircuit_props.AutorouterProp | undefined;
2965
2966
  autorouterEffortLevel?: "2x" | "1x" | "5x" | "10x" | "100x" | undefined;
2966
- autorouterVersion?: "v1" | "v2" | "v3" | "v4" | "latest" | undefined;
2967
+ autorouterVersion?: "v1" | "v2" | "v3" | "v4" | "v5" | "latest" | undefined;
2967
2968
  square?: boolean | undefined;
2968
2969
  emptyArea?: string | undefined;
2969
2970
  filledArea?: string | undefined;
@@ -3290,7 +3291,7 @@ declare class Board extends Group<typeof boardProps> implements BoardI, Subcircu
3290
3291
  pcbRouteCache?: _tscircuit_props.PcbRouteCache | undefined;
3291
3292
  autorouter?: _tscircuit_props.AutorouterProp | undefined;
3292
3293
  autorouterEffortLevel?: "2x" | "1x" | "5x" | "10x" | "100x" | undefined;
3293
- autorouterVersion?: "v1" | "v2" | "v3" | "v4" | "latest" | undefined;
3294
+ autorouterVersion?: "v1" | "v2" | "v3" | "v4" | "v5" | "latest" | undefined;
3294
3295
  square?: boolean | undefined;
3295
3296
  emptyArea?: string | undefined;
3296
3297
  filledArea?: string | undefined;
@@ -4129,7 +4130,7 @@ declare class MountedBoard extends Subcircuit implements BoardI {
4129
4130
  pcbRouteCache: zod.ZodOptional<zod.ZodType<_tscircuit_props.PcbRouteCache, zod.ZodTypeDef, _tscircuit_props.PcbRouteCache>>;
4130
4131
  autorouter: zod.ZodOptional<zod.ZodType<_tscircuit_props.AutorouterProp, zod.ZodTypeDef, _tscircuit_props.AutorouterProp>>;
4131
4132
  autorouterEffortLevel: zod.ZodOptional<zod.ZodEnum<["1x", "2x", "5x", "10x", "100x"]>>;
4132
- autorouterVersion: zod.ZodOptional<zod.ZodEnum<["v1", "v2", "v3", "v4", "latest"]>>;
4133
+ autorouterVersion: zod.ZodOptional<zod.ZodEnum<["v1", "v2", "v3", "v4", "v5", "latest"]>>;
4133
4134
  square: zod.ZodOptional<zod.ZodBoolean>;
4134
4135
  emptyArea: zod.ZodOptional<zod.ZodString>;
4135
4136
  filledArea: zod.ZodOptional<zod.ZodString>;
@@ -4589,7 +4590,7 @@ declare class MountedBoard extends Subcircuit implements BoardI {
4589
4590
  pcbRouteCache?: _tscircuit_props.PcbRouteCache | undefined;
4590
4591
  autorouter?: _tscircuit_props.AutorouterProp | undefined;
4591
4592
  autorouterEffortLevel?: "2x" | "1x" | "5x" | "10x" | "100x" | undefined;
4592
- autorouterVersion?: "v1" | "v2" | "v3" | "v4" | "latest" | undefined;
4593
+ autorouterVersion?: "v1" | "v2" | "v3" | "v4" | "v5" | "latest" | undefined;
4593
4594
  square?: boolean | undefined;
4594
4595
  emptyArea?: string | undefined;
4595
4596
  filledArea?: string | undefined;
@@ -4939,7 +4940,7 @@ declare class MountedBoard extends Subcircuit implements BoardI {
4939
4940
  pcbRouteCache?: _tscircuit_props.PcbRouteCache | undefined;
4940
4941
  autorouter?: _tscircuit_props.AutorouterProp | undefined;
4941
4942
  autorouterEffortLevel?: "2x" | "1x" | "5x" | "10x" | "100x" | undefined;
4942
- autorouterVersion?: "v1" | "v2" | "v3" | "v4" | "latest" | undefined;
4943
+ autorouterVersion?: "v1" | "v2" | "v3" | "v4" | "v5" | "latest" | undefined;
4943
4944
  square?: boolean | undefined;
4944
4945
  emptyArea?: string | undefined;
4945
4946
  filledArea?: string | undefined;
package/dist/index.js CHANGED
@@ -10540,13 +10540,17 @@ var NormalComponent3 = class extends PrimitiveComponent2 {
10540
10540
  const portsFromFootprint = this.getPortsFromFootprint(opts);
10541
10541
  const existingPorts = this._getAllPortsFromChildren();
10542
10542
  for (const port of portsFromFootprint) {
10543
- const alreadyInPortsToCreate = portsToCreate.some(
10543
+ const matchingPort = existingPorts.find(
10544
10544
  (p) => p.isMatchingAnyOf(port.getNameAndAliases())
10545
- );
10546
- const alreadyInExistingPorts = existingPorts.some(
10545
+ ) ?? portsToCreate.find(
10547
10546
  (p) => p.isMatchingAnyOf(port.getNameAndAliases())
10548
10547
  );
10549
- if (!alreadyInPortsToCreate && !alreadyInExistingPorts) {
10548
+ if (matchingPort) {
10549
+ const mergedAliases = port.getNameAndAliases().filter(
10550
+ (alias) => !matchingPort.getNameAndAliases().includes(alias)
10551
+ );
10552
+ matchingPort.externallyAddedAliases.push(...mergedAliases);
10553
+ } else {
10550
10554
  portsToCreate.push(port);
10551
10555
  }
10552
10556
  }
@@ -10677,16 +10681,20 @@ var NormalComponent3 = class extends PrimitiveComponent2 {
10677
10681
  */
10678
10682
  doInitialSourceParentAttachment() {
10679
10683
  const { db } = this.root;
10680
- const internallyConnectedPorts = this._getInternallyConnectedPins();
10681
- for (const ports of internallyConnectedPorts) {
10682
- const sourcePortIds = ports.map((port) => port.source_port_id).filter((id) => id !== null);
10683
- if (sourcePortIds.length >= 2) {
10684
- db.source_component_internal_connection.insert({
10685
- source_component_id: this.source_component_id,
10686
- subcircuit_id: this.getSubcircuit()?.subcircuit_id,
10687
- source_port_ids: sourcePortIds
10688
- });
10689
- }
10684
+ const internallyConnectedSourcePortIds = this._getInternallyConnectedPins().map(
10685
+ (ports) => ports.map((port) => port.source_port_id).filter((id) => id !== null)
10686
+ ).filter((sourcePortIds) => sourcePortIds.length >= 2);
10687
+ if (this.source_component_id && internallyConnectedSourcePortIds.length > 0) {
10688
+ db.source_component.update(this.source_component_id, {
10689
+ internally_connected_source_port_ids: internallyConnectedSourcePortIds
10690
+ });
10691
+ }
10692
+ for (const sourcePortIds of internallyConnectedSourcePortIds) {
10693
+ db.source_component_internal_connection.insert({
10694
+ source_component_id: this.source_component_id,
10695
+ subcircuit_id: this.getSubcircuit()?.subcircuit_id,
10696
+ source_port_ids: sourcePortIds
10697
+ });
10690
10698
  }
10691
10699
  }
10692
10700
  /**
@@ -11160,10 +11168,10 @@ var NormalComponent3 = class extends PrimitiveComponent2 {
11160
11168
  );
11161
11169
  if (filteredPortHints.length === 0) continue;
11162
11170
  let portHintsList = filteredPortHints;
11163
- const hasPinPrefix = portHintsList.some(
11164
- (hint) => hint.startsWith("pin")
11171
+ const hasPinIdentifier = portHintsList.some(
11172
+ (hint) => hint.startsWith("pin") || /^(?:pin)?\d+$/.test(hint)
11165
11173
  );
11166
- if (!hasPinPrefix) {
11174
+ if (!hasPinIdentifier) {
11167
11175
  portHintsList = [...portHintsList, `pin${pinNumber}`];
11168
11176
  }
11169
11177
  pinNumber++;
@@ -12283,7 +12291,8 @@ import {
12283
12291
  AutoroutingPipeline1_OriginalUnravel,
12284
12292
  AssignableAutoroutingPipeline3,
12285
12293
  AutoroutingPipelineSolver3_HgPortPointPathing,
12286
- AutoroutingPipelineSolver4
12294
+ AutoroutingPipelineSolver4,
12295
+ AutoroutingPipelineSolver5
12287
12296
  } from "@tscircuit/capacity-autorouter";
12288
12297
  import { CopperPourPipelineSolver } from "@tscircuit/copper-pour-solver";
12289
12298
  var SOLVERS = {
@@ -12294,6 +12303,7 @@ var SOLVERS = {
12294
12303
  AutoroutingPipeline1_OriginalUnravel,
12295
12304
  AutoroutingPipelineSolver3_HgPortPointPathing,
12296
12305
  AutoroutingPipelineSolver4,
12306
+ AutoroutingPipelineSolver5,
12297
12307
  CopperPourPipelineSolver
12298
12308
  };
12299
12309
 
@@ -12329,6 +12339,8 @@ var TscircuitAutorouter = class {
12329
12339
  solverName = "AutoroutingPipelineSolver3_HgPortPointPathing";
12330
12340
  } else if (autorouterVersion2 === "v4" || autorouterVersion2 === "latest") {
12331
12341
  solverName = "AutoroutingPipelineSolver4";
12342
+ } else if (autorouterVersion2 === "v5") {
12343
+ solverName = "AutoroutingPipelineSolver5";
12332
12344
  } else if (useAutoJumperSolver) {
12333
12345
  solverName = "AssignableAutoroutingPipeline3";
12334
12346
  } else if (useAssignableSolver) {
@@ -18726,7 +18738,7 @@ import { identity as identity5 } from "transformation-matrix";
18726
18738
  var package_default = {
18727
18739
  name: "@tscircuit/core",
18728
18740
  type: "module",
18729
- version: "0.0.1125",
18741
+ version: "0.0.1135",
18730
18742
  types: "dist/index.d.ts",
18731
18743
  main: "dist/index.js",
18732
18744
  module: "dist/index.js",
@@ -18771,7 +18783,7 @@ var package_default = {
18771
18783
  "@tscircuit/math-utils": "^0.0.36",
18772
18784
  "@tscircuit/miniflex": "^0.0.4",
18773
18785
  "@tscircuit/ngspice-spice-engine": "^0.0.8",
18774
- "@tscircuit/props": "^0.0.501",
18786
+ "@tscircuit/props": "^0.0.502",
18775
18787
  "@tscircuit/schematic-match-adapt": "^0.0.16",
18776
18788
  "@tscircuit/schematic-trace-solver": "^v0.0.45",
18777
18789
  "@tscircuit/solver-utils": "^0.0.3",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.1134",
4
+ "version": "0.0.1136",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
@@ -46,7 +46,7 @@
46
46
  "@tscircuit/math-utils": "^0.0.36",
47
47
  "@tscircuit/miniflex": "^0.0.4",
48
48
  "@tscircuit/ngspice-spice-engine": "^0.0.8",
49
- "@tscircuit/props": "^0.0.501",
49
+ "@tscircuit/props": "^0.0.502",
50
50
  "@tscircuit/schematic-match-adapt": "^0.0.16",
51
51
  "@tscircuit/schematic-trace-solver": "^v0.0.45",
52
52
  "@tscircuit/solver-utils": "^0.0.3",