@tscircuit/core 0.0.2291 → 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.
- package/dist/index.js +99 -78
- package/package.json +6 -4
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 [
|
|
114733
|
-
if (
|
|
114734
|
-
|
|
114735
|
-
|
|
114736
|
-
|
|
114737
|
-
|
|
114738
|
-
|
|
114739
|
-
|
|
114740
|
-
|
|
114741
|
-
|
|
114742
|
-
};
|
|
114743
|
-
const
|
|
114744
|
-
|
|
114745
|
-
|
|
114746
|
-
|
|
114747
|
-
|
|
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
|
|
114788
|
-
|
|
114789
|
-
|
|
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
|
-
|
|
114798
|
-
|
|
114799
|
-
|
|
114800
|
-
|
|
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: `
|
|
114791
|
+
pcb_trace_id: `expanded_surface_${connection.name}_${end}`,
|
|
114803
114792
|
connection_name: connection.name,
|
|
114804
|
-
|
|
114805
|
-
|
|
114806
|
-
|
|
114807
|
-
|
|
114808
|
-
|
|
114809
|
-
|
|
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.
|
|
158602
|
+
version: "0.0.2292",
|
|
158584
158603
|
types: "dist/index.d.ts",
|
|
158585
158604
|
main: "dist/index.js",
|
|
158586
158605
|
module: "dist/index.js",
|
|
@@ -158607,7 +158626,8 @@ var package_default = {
|
|
|
158607
158626
|
"build:benchmarking": "bun build --experimental-html ./benchmarking/website/index.html --outdir ./benchmarking-dist",
|
|
158608
158627
|
"build:benchmarking:watch": `chokidar "./{benchmarking,lib}/**/*.{ts,tsx}" -c 'bun build --experimental-html ./benchmarking/website/index.html --outdir ./benchmarking-dist'`,
|
|
158609
158628
|
"start:benchmarking": 'concurrently "bun run build:benchmarking:watch" "live-server ./benchmarking-dist"',
|
|
158610
|
-
"generate-test-plan": "bun run scripts/generate-test-plan.ts"
|
|
158629
|
+
"generate-test-plan": "bun run scripts/generate-test-plan.ts",
|
|
158630
|
+
"benchmark:ddr": "bun scripts/benchmark-ddr/run.ts"
|
|
158611
158631
|
},
|
|
158612
158632
|
devDependencies: {
|
|
158613
158633
|
"@tscircuit/cad-collision-checking": "https://jscdn.tscircuit.com/@tscircuit/cad-collision-checking/0.0.6.tgz",
|
|
@@ -158617,7 +158637,7 @@ var package_default = {
|
|
|
158617
158637
|
"@tsci/tscircuit.ti": "github:tscircuit/ti#57e314be4b2b06bc546d4def7453e619604d1157",
|
|
158618
158638
|
"@tscircuit/alphabet": "0.0.25",
|
|
158619
158639
|
"@tscircuit/bga-fanout-solver": "github:tscircuit/bga-fanout-solver#247c835cb8d69b65e53891dcf869731079415b39",
|
|
158620
|
-
"@tscircuit/bus-lanes-solver": "https://jscdn.tscircuit.com/@tscircuit/bus-lanes-solver/0.0.
|
|
158640
|
+
"@tscircuit/bus-lanes-solver": "https://jscdn.tscircuit.com/@tscircuit/bus-lanes-solver/0.0.48.tgz",
|
|
158621
158641
|
"@tscircuit/cableprinter": "^0.0.6",
|
|
158622
158642
|
"@tscircuit/capacity-autorouter": "^0.0.1051",
|
|
158623
158643
|
"@tscircuit/checks": "^0.0.268",
|
|
@@ -158700,7 +158720,8 @@ var package_default = {
|
|
|
158700
158720
|
"circuit-json-to-tscircuit": "^0.0.50",
|
|
158701
158721
|
"dsn-converter": "^0.0.90",
|
|
158702
158722
|
easyeda: "^0.0.389",
|
|
158703
|
-
"circuit-json-to-pnp-csv": "^0.0.20"
|
|
158723
|
+
"circuit-json-to-pnp-csv": "^0.0.20",
|
|
158724
|
+
"@tscircuit/core-ddr-benchmark": "github:ShiboSoftwareDev/core-ddr-benchmark#9a7f3b9ff4e37b5d11c8572b75c5b83339a97168"
|
|
158704
158725
|
},
|
|
158705
158726
|
peerDependencies: {
|
|
158706
158727
|
"@tscircuit/capacity-autorouter": "*",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tscircuit/core",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.2293",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/index.js",
|
|
@@ -28,7 +28,8 @@
|
|
|
28
28
|
"build:benchmarking": "bun build --experimental-html ./benchmarking/website/index.html --outdir ./benchmarking-dist",
|
|
29
29
|
"build:benchmarking:watch": "chokidar \"./{benchmarking,lib}/**/*.{ts,tsx}\" -c 'bun build --experimental-html ./benchmarking/website/index.html --outdir ./benchmarking-dist'",
|
|
30
30
|
"start:benchmarking": "concurrently \"bun run build:benchmarking:watch\" \"live-server ./benchmarking-dist\"",
|
|
31
|
-
"generate-test-plan": "bun run scripts/generate-test-plan.ts"
|
|
31
|
+
"generate-test-plan": "bun run scripts/generate-test-plan.ts",
|
|
32
|
+
"benchmark:ddr": "bun scripts/benchmark-ddr/run.ts"
|
|
32
33
|
},
|
|
33
34
|
"devDependencies": {
|
|
34
35
|
"@tscircuit/cad-collision-checking": "https://jscdn.tscircuit.com/@tscircuit/cad-collision-checking/0.0.6.tgz",
|
|
@@ -38,7 +39,7 @@
|
|
|
38
39
|
"@tsci/tscircuit.ti": "github:tscircuit/ti#57e314be4b2b06bc546d4def7453e619604d1157",
|
|
39
40
|
"@tscircuit/alphabet": "0.0.25",
|
|
40
41
|
"@tscircuit/bga-fanout-solver": "github:tscircuit/bga-fanout-solver#247c835cb8d69b65e53891dcf869731079415b39",
|
|
41
|
-
"@tscircuit/bus-lanes-solver": "https://jscdn.tscircuit.com/@tscircuit/bus-lanes-solver/0.0.
|
|
42
|
+
"@tscircuit/bus-lanes-solver": "https://jscdn.tscircuit.com/@tscircuit/bus-lanes-solver/0.0.48.tgz",
|
|
42
43
|
"@tscircuit/cableprinter": "^0.0.6",
|
|
43
44
|
"@tscircuit/capacity-autorouter": "^0.0.1051",
|
|
44
45
|
"@tscircuit/checks": "^0.0.268",
|
|
@@ -121,7 +122,8 @@
|
|
|
121
122
|
"circuit-json-to-tscircuit": "^0.0.50",
|
|
122
123
|
"dsn-converter": "^0.0.90",
|
|
123
124
|
"easyeda": "^0.0.389",
|
|
124
|
-
"circuit-json-to-pnp-csv": "^0.0.20"
|
|
125
|
+
"circuit-json-to-pnp-csv": "^0.0.20",
|
|
126
|
+
"@tscircuit/core-ddr-benchmark": "github:ShiboSoftwareDev/core-ddr-benchmark#9a7f3b9ff4e37b5d11c8572b75c5b83339a97168"
|
|
125
127
|
},
|
|
126
128
|
"peerDependencies": {
|
|
127
129
|
"@tscircuit/capacity-autorouter": "*",
|