@tscircuit/core 0.0.1932 → 0.0.1934
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 +44 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -13856,7 +13856,8 @@ var analyzeSupplierPartOrientation = async ({
|
|
|
13856
13856
|
return analysis;
|
|
13857
13857
|
};
|
|
13858
13858
|
var NormalComponent_doInitialPartOrientationAnalysis = (component) => {
|
|
13859
|
-
if (!component.root
|
|
13859
|
+
if (!component.root) return;
|
|
13860
|
+
if (component.root.platform?.enablePartOrientationAnalysis === false) return;
|
|
13860
13861
|
if (component.root.pcbDisabled || component.props.doNotPlace) return;
|
|
13861
13862
|
if (!component.pcb_component_id) return;
|
|
13862
13863
|
const { db } = component.root;
|
|
@@ -13868,6 +13869,7 @@ var NormalComponent_doInitialPartOrientationAnalysis = (component) => {
|
|
|
13868
13869
|
pcb_component_id: component.pcb_component_id
|
|
13869
13870
|
})
|
|
13870
13871
|
];
|
|
13872
|
+
if (pcbElements.length === 0) return;
|
|
13871
13873
|
const localPin1Location = getExplicitPcbPin1Location(component.resolveFootprint()) ?? analyzePcbPin1Location(
|
|
13872
13874
|
getUnrotatedLocalPcbElements({
|
|
13873
13875
|
component,
|
|
@@ -56605,7 +56607,7 @@ var applyPackOutput = (group, packOutput, clusterMap, initialPackOutput) => {
|
|
|
56605
56607
|
|
|
56606
56608
|
// lib/components/primitive-components/Group/Group_doInitialPcbLayoutPack/getPackInputsByPcbLayer.ts
|
|
56607
56609
|
var normalizeLayer = (layer) => (layer ?? "top").toLowerCase();
|
|
56608
|
-
var
|
|
56610
|
+
var getPackComponentPcbLayer = (component, db) => {
|
|
56609
56611
|
const layers = /* @__PURE__ */ new Set();
|
|
56610
56612
|
const directPcbComponent = db.pcb_component.get(component.componentId);
|
|
56611
56613
|
if (directPcbComponent) {
|
|
@@ -56623,7 +56625,7 @@ var getComponentLayer = (component, db) => {
|
|
|
56623
56625
|
var getPackInputsByPcbLayer = (packInput, db) => {
|
|
56624
56626
|
const componentsByLayer = /* @__PURE__ */ new Map();
|
|
56625
56627
|
for (const component of packInput.components) {
|
|
56626
|
-
const layer =
|
|
56628
|
+
const layer = getPackComponentPcbLayer(component, db);
|
|
56627
56629
|
if (!layer) return [packInput];
|
|
56628
56630
|
const components = componentsByLayer.get(layer) ?? [];
|
|
56629
56631
|
components.push(component);
|
|
@@ -56681,6 +56683,30 @@ var getCollisionObstacleForStaticComponent = (component) => {
|
|
|
56681
56683
|
height: maxY - minY
|
|
56682
56684
|
};
|
|
56683
56685
|
};
|
|
56686
|
+
var getCrossLayerPadObstacles = ({
|
|
56687
|
+
components,
|
|
56688
|
+
targetLayer: targetLayer2,
|
|
56689
|
+
db
|
|
56690
|
+
}) => components.flatMap(
|
|
56691
|
+
(component) => component.pads.flatMap((pad) => {
|
|
56692
|
+
const platedHole = db.pcb_plated_hole.get(pad.padId);
|
|
56693
|
+
const via = db.pcb_via.get(pad.padId);
|
|
56694
|
+
const layers = platedHole?.layers ?? via?.layers;
|
|
56695
|
+
if (!layers?.includes(targetLayer2)) return [];
|
|
56696
|
+
const absoluteCenter = pad.absoluteCenter ?? (component.center ? {
|
|
56697
|
+
x: component.center.x + pad.offset.x,
|
|
56698
|
+
y: component.center.y + pad.offset.y
|
|
56699
|
+
} : pad.offset);
|
|
56700
|
+
return [
|
|
56701
|
+
{
|
|
56702
|
+
obstacleId: `cross_layer_${targetLayer2}_${pad.padId}`,
|
|
56703
|
+
absoluteCenter,
|
|
56704
|
+
width: pad.size.x,
|
|
56705
|
+
height: pad.size.y
|
|
56706
|
+
}
|
|
56707
|
+
];
|
|
56708
|
+
})
|
|
56709
|
+
);
|
|
56684
56710
|
var Group_doInitialPcbLayoutPack = (group) => {
|
|
56685
56711
|
const { db } = group.root;
|
|
56686
56712
|
const { _parsedProps: props } = group;
|
|
@@ -56815,6 +56841,10 @@ var Group_doInitialPcbLayoutPack = (group) => {
|
|
|
56815
56841
|
};
|
|
56816
56842
|
try {
|
|
56817
56843
|
for (const layerPackInput of packInputs) {
|
|
56844
|
+
const targetLayer2 = getPackComponentPcbLayer(
|
|
56845
|
+
layerPackInput.components[0],
|
|
56846
|
+
db
|
|
56847
|
+
);
|
|
56818
56848
|
const componentIdsForLayer = new Set(
|
|
56819
56849
|
layerPackInput.components.map((component) => component.componentId)
|
|
56820
56850
|
);
|
|
@@ -56872,6 +56902,14 @@ var Group_doInitialPcbLayoutPack = (group) => {
|
|
|
56872
56902
|
}
|
|
56873
56903
|
})
|
|
56874
56904
|
);
|
|
56905
|
+
const crossLayerPadObstacles = targetLayer2 ? getCrossLayerPadObstacles({
|
|
56906
|
+
components: Array.from(
|
|
56907
|
+
networkReferenceSources.values(),
|
|
56908
|
+
({ component }) => component
|
|
56909
|
+
),
|
|
56910
|
+
targetLayer: targetLayer2,
|
|
56911
|
+
db
|
|
56912
|
+
}) : [];
|
|
56875
56913
|
const solverInput = {
|
|
56876
56914
|
...layerPackInput,
|
|
56877
56915
|
weightedConnections: layerPackInput.weightedConnections?.filter(
|
|
@@ -56880,7 +56918,8 @@ var Group_doInitialPcbLayoutPack = (group) => {
|
|
|
56880
56918
|
obstacles: [
|
|
56881
56919
|
...layerPackInput.obstacles ?? [],
|
|
56882
56920
|
...staticLayerObstacles,
|
|
56883
|
-
...fallbackCrossLayerObstacles
|
|
56921
|
+
...fallbackCrossLayerObstacles,
|
|
56922
|
+
...crossLayerPadObstacles
|
|
56884
56923
|
],
|
|
56885
56924
|
components: [
|
|
56886
56925
|
...networkReferenceComponents,
|
|
@@ -63317,7 +63356,7 @@ function Group_getRoutingPhasePlans(group) {
|
|
|
63317
63356
|
var package_default = {
|
|
63318
63357
|
name: "@tscircuit/core",
|
|
63319
63358
|
type: "module",
|
|
63320
|
-
version: "0.0.
|
|
63359
|
+
version: "0.0.1933",
|
|
63321
63360
|
types: "dist/index.d.ts",
|
|
63322
63361
|
main: "dist/index.js",
|
|
63323
63362
|
module: "dist/index.js",
|