@tscircuit/matchpack 0.0.2 → 0.0.3

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
@@ -47,6 +47,7 @@ type Chip = {
47
47
  chipId: ChipId;
48
48
  pins: PinId[];
49
49
  size: Point;
50
+ availableRotations?: Array<0 | 90 | 180 | 270>;
50
51
  };
51
52
  type Group = {
52
53
  groupId: GroupId;
package/dist/index.js CHANGED
@@ -20891,9 +20891,26 @@ var PartitionPackingSolver = class extends BaseSolver {
20891
20891
  });
20892
20892
  }
20893
20893
  }
20894
+ let availableRotationDegrees = [
20895
+ 0,
20896
+ 90,
20897
+ 180,
20898
+ 270
20899
+ ];
20900
+ for (const chipId of group.chipIds) {
20901
+ const chip = this.laidOutPartitions[group.partitionIndex].chipMap[chipId];
20902
+ const chipRotations = chip.availableRotations || [0, 90, 180, 270];
20903
+ availableRotationDegrees = availableRotationDegrees.filter(
20904
+ (rotation2) => chipRotations.includes(rotation2)
20905
+ );
20906
+ }
20907
+ if (availableRotationDegrees.length === 0) {
20908
+ availableRotationDegrees = [0];
20909
+ }
20894
20910
  return {
20895
20911
  componentId: `partition_${group.partitionIndex}`,
20896
- pads
20912
+ pads,
20913
+ availableRotationDegrees
20897
20914
  };
20898
20915
  });
20899
20916
  return {
@@ -21184,7 +21201,8 @@ var SinglePinRangeLayoutSolver = class extends BaseSolver {
21184
21201
  });
21185
21202
  return {
21186
21203
  componentId: chipId,
21187
- pads
21204
+ pads,
21205
+ availableRotationDegrees: chip.availableRotations || [0, 90, 180, 270]
21188
21206
  };
21189
21207
  });
21190
21208
  if (components.length === 0) {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@tscircuit/matchpack",
3
3
  "main": "dist/index.js",
4
4
  "type": "module",
5
- "version": "0.0.2",
5
+ "version": "0.0.3",
6
6
  "files": [
7
7
  "dist"
8
8
  ],