@tscircuit/core 0.0.2292 → 0.0.2293

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 +95 -76
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -114681,6 +114681,12 @@ function* expandedSignalSites({
114681
114681
  );
114682
114682
  if (!Number.isFinite(pitch)) continue;
114683
114683
  const surfaceLimit = Math.min(2, 2.5 * pitch);
114684
+ const pitchSteps = Math.max(
114685
+ 2,
114686
+ 2 * Math.ceil(pitch / Math.max(0.01, input.minTraceWidth / 2) / 2)
114687
+ );
114688
+ const surfaceStep = Math.max(0.01, pitch / pitchSteps);
114689
+ const surfaceRadius = Math.ceil(surfaceLimit / surfaceStep) * surfaceStep;
114684
114690
  const candidates = [];
114685
114691
  for (let ix2 = -5; ix2 <= 5; ix2++)
114686
114692
  for (let iy2 = -5; iy2 <= 5; iy2++) {
@@ -114729,86 +114735,99 @@ function* expandedSignalSites({
114729
114735
  fixed
114730
114736
  )
114731
114737
  );
114732
- for (const [index2, point52] of candidates.entries()) {
114733
- if (index2 === gridCandidateCount && ends[end].length) break;
114734
- if (viaScenes.some((scene2) => !scene2.visible(point52, point52))) continue;
114735
- if (existingVias.some(
114736
- (via) => distance15(via, point52) < hole / 2 + (via.via_hole_diameter ?? input.minViaHoleDiameter ?? 0.15) / 2 + holeClearance - 1e-8
114737
- ))
114738
- continue;
114739
- const local = {
114740
- ...connection,
114741
- pointsToConnect: [pad, { ...point52, layer: pad.layer }]
114742
- };
114743
- const scene = new VectorScene(input, local, width, fixed);
114744
- const search = new GridVisibilitySearch(
114745
- scene,
114746
- pad,
114747
- point52,
114748
- [],
114749
- 0,
114750
- void 0,
114751
- {
114752
- checkReachability: true,
114753
- allTerminalAttachments: true,
114754
- maxLength: surfaceLimit,
114755
- paretoLength: true
114756
- }
114757
- );
114758
- try {
114759
- let steps = 0;
114760
- while (!search.solved && !search.failed && steps++ < 4e3) {
114761
- search.step();
114762
- yield;
114763
- }
114764
- if (!search.solved) continue;
114765
- let top = reduceOrdinaryTurns(search.result, scene).map((p2) => ({
114766
- ...p2,
114767
- route_type: "wire",
114768
- layer: pad.layer,
114769
- width
114770
- }));
114771
- const topTrace = {
114772
- type: "pcb_trace",
114773
- pcb_trace_id: `expanded_surface_${connection.name}_${end}`,
114774
- connection_name: connection.name,
114775
- route: top
114776
- };
114777
- top = chamferOrdinaryCorners(
114778
- { ...input, connections: [local] },
114779
- [topTrace],
114780
- fixed
114781
- )[0].route;
114782
- if (!scene.pathVisible(top) || length(top) > surfaceLimit + 1e-8 || !routeAnglesAreConventional([{ ...topTrace, route: top }]) || !tuningPathIsSelfClear(
114783
- top,
114784
- width + (input.minTraceToPadEdgeClearance ?? input.defaultObstacleMargin ?? 0.075)
114738
+ for (const alignSurfaceGrid of [false, true]) {
114739
+ if (alignSurfaceGrid && ends[end].length) break;
114740
+ const surfaceGrid = alignSurfaceGrid ? {
114741
+ step: surfaceStep,
114742
+ bounds: {
114743
+ minX: pad.x - surfaceRadius,
114744
+ maxX: pad.x + surfaceRadius,
114745
+ minY: pad.y - surfaceRadius,
114746
+ maxY: pad.y + surfaceRadius
114747
+ }
114748
+ } : {};
114749
+ for (const [index2, point52] of candidates.entries()) {
114750
+ if (index2 === gridCandidateCount && ends[end].length) break;
114751
+ if (viaScenes.some((scene2) => !scene2.visible(point52, point52))) continue;
114752
+ if (existingVias.some(
114753
+ (via) => distance15(via, point52) < hole / 2 + (via.via_hole_diameter ?? input.minViaHoleDiameter ?? 0.15) / 2 + holeClearance - 1e-8
114785
114754
  ))
114786
114755
  continue;
114787
- const via = {
114788
- x: point52.x,
114789
- y: point52.y,
114790
- route_type: "via",
114791
- from_layer: pad.layer,
114792
- to_layer: targetLayer2,
114793
- layers: physical,
114794
- via_diameter: diameter,
114795
- via_hole_diameter: hole
114756
+ const local = {
114757
+ ...connection,
114758
+ pointsToConnect: [pad, { ...point52, layer: pad.layer }]
114796
114759
  };
114797
- ends[end].push({
114798
- point: point52,
114799
- length: length(top),
114800
- escape: {
114760
+ const scene = new VectorScene(input, local, width, fixed);
114761
+ const search = new GridVisibilitySearch(
114762
+ scene,
114763
+ pad,
114764
+ point52,
114765
+ [],
114766
+ 0,
114767
+ void 0,
114768
+ {
114769
+ ...surfaceGrid,
114770
+ checkReachability: true,
114771
+ allTerminalAttachments: true,
114772
+ maxLength: surfaceLimit,
114773
+ paretoLength: true
114774
+ }
114775
+ );
114776
+ try {
114777
+ let steps = 0;
114778
+ while (!search.solved && !search.failed && steps++ < 4e3) {
114779
+ search.step();
114780
+ yield;
114781
+ }
114782
+ if (!search.solved) continue;
114783
+ let top = reduceOrdinaryTurns(search.result, scene).map((p2) => ({
114784
+ ...p2,
114785
+ route_type: "wire",
114786
+ layer: pad.layer,
114787
+ width
114788
+ }));
114789
+ const topTrace = {
114801
114790
  type: "pcb_trace",
114802
- pcb_trace_id: `expanded_dogbone_${connection.name}_${end}_${ends[end].length}`,
114791
+ pcb_trace_id: `expanded_surface_${connection.name}_${end}`,
114803
114792
  connection_name: connection.name,
114804
- source_trace_id: connection.source_trace_id ?? connection.name,
114805
- route: [...top, via, { ...point52, route_type: "wire", width }]
114806
- }
114807
- });
114808
- } finally {
114809
- search.cancel();
114793
+ route: top
114794
+ };
114795
+ top = chamferOrdinaryCorners(
114796
+ { ...input, connections: [local] },
114797
+ [topTrace],
114798
+ fixed
114799
+ )[0].route;
114800
+ if (!scene.pathVisible(top) || length(top) > surfaceLimit + 1e-8 || !routeAnglesAreConventional([{ ...topTrace, route: top }]) || !tuningPathIsSelfClear(
114801
+ top,
114802
+ width + (input.minTraceToPadEdgeClearance ?? input.defaultObstacleMargin ?? 0.075)
114803
+ ))
114804
+ continue;
114805
+ const via = {
114806
+ x: point52.x,
114807
+ y: point52.y,
114808
+ route_type: "via",
114809
+ from_layer: pad.layer,
114810
+ to_layer: targetLayer2,
114811
+ layers: physical,
114812
+ via_diameter: diameter,
114813
+ via_hole_diameter: hole
114814
+ };
114815
+ ends[end].push({
114816
+ point: point52,
114817
+ length: length(top),
114818
+ escape: {
114819
+ type: "pcb_trace",
114820
+ pcb_trace_id: `expanded_dogbone_${connection.name}_${end}_${ends[end].length}`,
114821
+ connection_name: connection.name,
114822
+ source_trace_id: connection.source_trace_id ?? connection.name,
114823
+ route: [...top, via, { ...point52, route_type: "wire", width }]
114824
+ }
114825
+ });
114826
+ } finally {
114827
+ search.cancel();
114828
+ }
114829
+ yield;
114810
114830
  }
114811
- yield;
114812
114831
  }
114813
114832
  }
114814
114833
  return ends;
@@ -158580,7 +158599,7 @@ var RoutingPhasePreparationError = class extends Error {
158580
158599
  var package_default = {
158581
158600
  name: "@tscircuit/core",
158582
158601
  type: "module",
158583
- version: "0.0.2291",
158602
+ version: "0.0.2292",
158584
158603
  types: "dist/index.d.ts",
158585
158604
  main: "dist/index.js",
158586
158605
  module: "dist/index.js",
@@ -158618,7 +158637,7 @@ var package_default = {
158618
158637
  "@tsci/tscircuit.ti": "github:tscircuit/ti#57e314be4b2b06bc546d4def7453e619604d1157",
158619
158638
  "@tscircuit/alphabet": "0.0.25",
158620
158639
  "@tscircuit/bga-fanout-solver": "github:tscircuit/bga-fanout-solver#247c835cb8d69b65e53891dcf869731079415b39",
158621
- "@tscircuit/bus-lanes-solver": "https://jscdn.tscircuit.com/@tscircuit/bus-lanes-solver/0.0.47.tgz",
158640
+ "@tscircuit/bus-lanes-solver": "https://jscdn.tscircuit.com/@tscircuit/bus-lanes-solver/0.0.48.tgz",
158622
158641
  "@tscircuit/cableprinter": "^0.0.6",
158623
158642
  "@tscircuit/capacity-autorouter": "^0.0.1051",
158624
158643
  "@tscircuit/checks": "^0.0.268",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.2292",
4
+ "version": "0.0.2293",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
@@ -39,7 +39,7 @@
39
39
  "@tsci/tscircuit.ti": "github:tscircuit/ti#57e314be4b2b06bc546d4def7453e619604d1157",
40
40
  "@tscircuit/alphabet": "0.0.25",
41
41
  "@tscircuit/bga-fanout-solver": "github:tscircuit/bga-fanout-solver#247c835cb8d69b65e53891dcf869731079415b39",
42
- "@tscircuit/bus-lanes-solver": "https://jscdn.tscircuit.com/@tscircuit/bus-lanes-solver/0.0.47.tgz",
42
+ "@tscircuit/bus-lanes-solver": "https://jscdn.tscircuit.com/@tscircuit/bus-lanes-solver/0.0.48.tgz",
43
43
  "@tscircuit/cableprinter": "^0.0.6",
44
44
  "@tscircuit/capacity-autorouter": "^0.0.1051",
45
45
  "@tscircuit/checks": "^0.0.268",