calculate-packing 0.0.17 → 0.0.18

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
@@ -36,8 +36,10 @@ interface PackedComponent extends InputComponent {
36
36
  x: number;
37
37
  y: number;
38
38
  };
39
- /** Rotation in degrees (counterclockwise) */
39
+ /** @deprecated Rotation in degrees (counterclockwise) */
40
40
  ccwRotationOffset: number;
41
+ /** Rotation in degrees (counterclockwise) - output field */
42
+ ccwRotationDegrees?: number;
41
43
  pads: OutputPad[];
42
44
  }
43
45
  interface PackInput {
package/dist/index.js CHANGED
@@ -1318,7 +1318,10 @@ var PhasedPackSolver = class extends BaseSolver {
1318
1318
  return [this.packInput];
1319
1319
  }
1320
1320
  getResult() {
1321
- return this.packedComponents;
1321
+ return this.packedComponents.map((component) => ({
1322
+ ...component,
1323
+ ccwRotationDegrees: component.ccwRotationOffset
1324
+ }));
1322
1325
  }
1323
1326
  /* ---------- small helpers ------------------------------------------------ */
1324
1327
  getCandidateAngles(c) {
@@ -1339,7 +1342,7 @@ var pack = (input) => {
1339
1342
  solver.solve();
1340
1343
  return {
1341
1344
  ...input,
1342
- components: solver.packedComponents
1345
+ components: solver.getResult()
1343
1346
  };
1344
1347
  };
1345
1348
 
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.17",
5
+ "version": "0.0.18",
6
6
  "description": "Calculate a packing layout with support for different strategy configurations",
7
7
  "scripts": {
8
8
  "start": "cosmos",