@tscircuit/core 0.0.1931 → 0.0.1933
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 +42 -5
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -56605,7 +56605,7 @@ var applyPackOutput = (group, packOutput, clusterMap, initialPackOutput) => {
|
|
|
56605
56605
|
|
|
56606
56606
|
// lib/components/primitive-components/Group/Group_doInitialPcbLayoutPack/getPackInputsByPcbLayer.ts
|
|
56607
56607
|
var normalizeLayer = (layer) => (layer ?? "top").toLowerCase();
|
|
56608
|
-
var
|
|
56608
|
+
var getPackComponentPcbLayer = (component, db) => {
|
|
56609
56609
|
const layers = /* @__PURE__ */ new Set();
|
|
56610
56610
|
const directPcbComponent = db.pcb_component.get(component.componentId);
|
|
56611
56611
|
if (directPcbComponent) {
|
|
@@ -56623,7 +56623,7 @@ var getComponentLayer = (component, db) => {
|
|
|
56623
56623
|
var getPackInputsByPcbLayer = (packInput, db) => {
|
|
56624
56624
|
const componentsByLayer = /* @__PURE__ */ new Map();
|
|
56625
56625
|
for (const component of packInput.components) {
|
|
56626
|
-
const layer =
|
|
56626
|
+
const layer = getPackComponentPcbLayer(component, db);
|
|
56627
56627
|
if (!layer) return [packInput];
|
|
56628
56628
|
const components = componentsByLayer.get(layer) ?? [];
|
|
56629
56629
|
components.push(component);
|
|
@@ -56681,6 +56681,30 @@ var getCollisionObstacleForStaticComponent = (component) => {
|
|
|
56681
56681
|
height: maxY - minY
|
|
56682
56682
|
};
|
|
56683
56683
|
};
|
|
56684
|
+
var getCrossLayerPadObstacles = ({
|
|
56685
|
+
components,
|
|
56686
|
+
targetLayer: targetLayer2,
|
|
56687
|
+
db
|
|
56688
|
+
}) => components.flatMap(
|
|
56689
|
+
(component) => component.pads.flatMap((pad) => {
|
|
56690
|
+
const platedHole = db.pcb_plated_hole.get(pad.padId);
|
|
56691
|
+
const via = db.pcb_via.get(pad.padId);
|
|
56692
|
+
const layers = platedHole?.layers ?? via?.layers;
|
|
56693
|
+
if (!layers?.includes(targetLayer2)) return [];
|
|
56694
|
+
const absoluteCenter = pad.absoluteCenter ?? (component.center ? {
|
|
56695
|
+
x: component.center.x + pad.offset.x,
|
|
56696
|
+
y: component.center.y + pad.offset.y
|
|
56697
|
+
} : pad.offset);
|
|
56698
|
+
return [
|
|
56699
|
+
{
|
|
56700
|
+
obstacleId: `cross_layer_${targetLayer2}_${pad.padId}`,
|
|
56701
|
+
absoluteCenter,
|
|
56702
|
+
width: pad.size.x,
|
|
56703
|
+
height: pad.size.y
|
|
56704
|
+
}
|
|
56705
|
+
];
|
|
56706
|
+
})
|
|
56707
|
+
);
|
|
56684
56708
|
var Group_doInitialPcbLayoutPack = (group) => {
|
|
56685
56709
|
const { db } = group.root;
|
|
56686
56710
|
const { _parsedProps: props } = group;
|
|
@@ -56815,6 +56839,10 @@ var Group_doInitialPcbLayoutPack = (group) => {
|
|
|
56815
56839
|
};
|
|
56816
56840
|
try {
|
|
56817
56841
|
for (const layerPackInput of packInputs) {
|
|
56842
|
+
const targetLayer2 = getPackComponentPcbLayer(
|
|
56843
|
+
layerPackInput.components[0],
|
|
56844
|
+
db
|
|
56845
|
+
);
|
|
56818
56846
|
const componentIdsForLayer = new Set(
|
|
56819
56847
|
layerPackInput.components.map((component) => component.componentId)
|
|
56820
56848
|
);
|
|
@@ -56872,6 +56900,14 @@ var Group_doInitialPcbLayoutPack = (group) => {
|
|
|
56872
56900
|
}
|
|
56873
56901
|
})
|
|
56874
56902
|
);
|
|
56903
|
+
const crossLayerPadObstacles = targetLayer2 ? getCrossLayerPadObstacles({
|
|
56904
|
+
components: Array.from(
|
|
56905
|
+
networkReferenceSources.values(),
|
|
56906
|
+
({ component }) => component
|
|
56907
|
+
),
|
|
56908
|
+
targetLayer: targetLayer2,
|
|
56909
|
+
db
|
|
56910
|
+
}) : [];
|
|
56875
56911
|
const solverInput = {
|
|
56876
56912
|
...layerPackInput,
|
|
56877
56913
|
weightedConnections: layerPackInput.weightedConnections?.filter(
|
|
@@ -56880,7 +56916,8 @@ var Group_doInitialPcbLayoutPack = (group) => {
|
|
|
56880
56916
|
obstacles: [
|
|
56881
56917
|
...layerPackInput.obstacles ?? [],
|
|
56882
56918
|
...staticLayerObstacles,
|
|
56883
|
-
...fallbackCrossLayerObstacles
|
|
56919
|
+
...fallbackCrossLayerObstacles,
|
|
56920
|
+
...crossLayerPadObstacles
|
|
56884
56921
|
],
|
|
56885
56922
|
components: [
|
|
56886
56923
|
...networkReferenceComponents,
|
|
@@ -63317,7 +63354,7 @@ function Group_getRoutingPhasePlans(group) {
|
|
|
63317
63354
|
var package_default = {
|
|
63318
63355
|
name: "@tscircuit/core",
|
|
63319
63356
|
type: "module",
|
|
63320
|
-
version: "0.0.
|
|
63357
|
+
version: "0.0.1932",
|
|
63321
63358
|
types: "dist/index.d.ts",
|
|
63322
63359
|
main: "dist/index.js",
|
|
63323
63360
|
module: "dist/index.js",
|
|
@@ -63353,7 +63390,7 @@ var package_default = {
|
|
|
63353
63390
|
"@tscircuit/bga-fanout-solver": "github:tscircuit/bga-fanout-solver#247c835cb8d69b65e53891dcf869731079415b39",
|
|
63354
63391
|
"@tscircuit/bus-lanes-solver": "github:tscircuit/bus-lanes-solver#0bc8d071241b18a3e7465a878881abe4998f6384",
|
|
63355
63392
|
"@tscircuit/capacity-autorouter": "^0.0.900",
|
|
63356
|
-
"@tscircuit/checks": "^0.0.
|
|
63393
|
+
"@tscircuit/checks": "^0.0.199",
|
|
63357
63394
|
"@tscircuit/circuit-json-util": "^0.0.114",
|
|
63358
63395
|
"@tscircuit/common": "^0.0.20",
|
|
63359
63396
|
"@tscircuit/copper-pour-solver": "^0.0.54",
|
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.1933",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/index.js",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"@tscircuit/bga-fanout-solver": "github:tscircuit/bga-fanout-solver#247c835cb8d69b65e53891dcf869731079415b39",
|
|
38
38
|
"@tscircuit/bus-lanes-solver": "github:tscircuit/bus-lanes-solver#0bc8d071241b18a3e7465a878881abe4998f6384",
|
|
39
39
|
"@tscircuit/capacity-autorouter": "^0.0.900",
|
|
40
|
-
"@tscircuit/checks": "^0.0.
|
|
40
|
+
"@tscircuit/checks": "^0.0.199",
|
|
41
41
|
"@tscircuit/circuit-json-util": "^0.0.114",
|
|
42
42
|
"@tscircuit/common": "^0.0.20",
|
|
43
43
|
"@tscircuit/copper-pour-solver": "^0.0.54",
|