calculate-packing 0.0.28 → 0.0.29

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
@@ -171,6 +171,7 @@ declare class PhasedPackSolver extends BaseSolver {
171
171
 
172
172
  declare const convertCircuitJsonToPackOutput: (circuitJson: CircuitJson, opts?: {
173
173
  source_group_id?: string;
174
+ shouldAddInnerObstacles?: boolean;
174
175
  }) => PackOutput;
175
176
 
176
177
  declare const getGraphicsFromPackOutput: (packOutput: PackOutput) => GraphicsObject;
package/dist/index.js CHANGED
@@ -1557,7 +1557,7 @@ var extractPadInfos = (pcbComponent, db, getNetworkId) => {
1557
1557
  };
1558
1558
 
1559
1559
  // lib/plumbing/convertCircuitJsonToPackOutput.ts
1560
- var buildPackedComponent = (pcbComponents, componentId, db, getNetworkId) => {
1560
+ var buildPackedComponent = (pcbComponents, componentId, db, getNetworkId, shouldAddInnerObstacles) => {
1561
1561
  const padInfos = pcbComponents.flatMap(
1562
1562
  (pc) => extractPadInfos(pc, db, getNetworkId)
1563
1563
  );
@@ -1583,6 +1583,17 @@ var buildPackedComponent = (pcbComponents, componentId, db, getNetworkId) => {
1583
1583
  y: p.absoluteCenter.y - center.y
1584
1584
  }
1585
1585
  }));
1586
+ if (shouldAddInnerObstacles) {
1587
+ const innerPad = {
1588
+ padId: `${componentId}-inner`,
1589
+ networkId: `${componentId}-inner`,
1590
+ type: "rect",
1591
+ size: { x: maxX - minX, y: maxY - minY },
1592
+ absoluteCenter: center,
1593
+ offset: { x: 0, y: 0 }
1594
+ };
1595
+ pads.push(innerPad);
1596
+ }
1586
1597
  return {
1587
1598
  componentId,
1588
1599
  center,
@@ -1633,7 +1644,8 @@ var convertCircuitJsonToPackOutput = (circuitJson, opts = {}) => {
1633
1644
  [pcbComponent],
1634
1645
  pcbComponent.pcb_component_id,
1635
1646
  db,
1636
- getNetworkId
1647
+ getNetworkId,
1648
+ opts.shouldAddInnerObstacles
1637
1649
  )
1638
1650
  );
1639
1651
  } else if (node.nodeType === "group") {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "calculate-packing",
3
3
  "main": "dist/index.js",
4
4
  "type": "module",
5
- "version": "0.0.28",
5
+ "version": "0.0.29",
6
6
  "description": "Calculate a packing layout with support for different strategy configurations",
7
7
  "scripts": {
8
8
  "start": "cosmos",
@@ -19,7 +19,7 @@
19
19
  "@biomejs/biome": "^2.1.1",
20
20
  "@flatten-js/core": "^1.6.2",
21
21
  "@react-hook/resize-observer": "^2.0.2",
22
- "@tscircuit/circuit-json-util": "^0.0.57",
22
+ "@tscircuit/circuit-json-util": "^0.0.66",
23
23
  "@tscircuit/footprinter": "^0.0.203",
24
24
  "@tscircuit/math-utils": "^0.0.19",
25
25
  "@types/bun": "latest",