@tscircuit/core 0.0.583 → 0.0.584

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.
Files changed (2) hide show
  1. package/dist/index.js +10 -9
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -8063,13 +8063,9 @@ import {
8063
8063
  } from "calculate-packing";
8064
8064
  import { length } from "circuit-json";
8065
8065
  import { transformPCBElements as transformPCBElements2 } from "@tscircuit/circuit-json-util";
8066
- import { translate as translate6 } from "transformation-matrix";
8066
+ import { translate as translate6, rotate as rotate2, compose as compose4 } from "transformation-matrix";
8067
8067
  import Debug6 from "debug";
8068
8068
  var debug5 = Debug6("Group_doInitialPcbLayoutPack");
8069
- var sub = (a, b) => ({
8070
- x: a.x - b.x,
8071
- y: a.y - b.y
8072
- });
8073
8069
  var Group_doInitialPcbLayoutPack = (group) => {
8074
8070
  const { db } = group.root;
8075
8071
  const { _parsedProps: props } = group;
@@ -8093,15 +8089,20 @@ var Group_doInitialPcbLayoutPack = (group) => {
8093
8089
  global.debugGraphics?.push(graphics);
8094
8090
  }
8095
8091
  for (const packedComponent of packOutput.components) {
8096
- const { center, componentId, pads, ccwRotationOffset } = packedComponent;
8092
+ const { center, componentId, ccwRotationOffset } = packedComponent;
8097
8093
  const component = db.pcb_component.get(componentId);
8098
8094
  if (!component) continue;
8099
- const delta = sub(center, component.center);
8095
+ const originalCenter = component.center;
8096
+ const transformMatrix = compose4(
8097
+ translate6(center.x, center.y),
8098
+ rotate2(ccwRotationOffset || 0),
8099
+ translate6(-originalCenter.x, -originalCenter.y)
8100
+ );
8100
8101
  transformPCBElements2(
8101
8102
  subtreeCircuitJson.filter(
8102
8103
  (elm) => "pcb_component_id" in elm && elm.pcb_component_id === componentId
8103
8104
  ),
8104
- translate6(delta.x, delta.y)
8105
+ transformMatrix
8105
8106
  );
8106
8107
  }
8107
8108
  };
@@ -11139,7 +11140,7 @@ import { identity as identity5 } from "transformation-matrix";
11139
11140
  var package_default = {
11140
11141
  name: "@tscircuit/core",
11141
11142
  type: "module",
11142
- version: "0.0.582",
11143
+ version: "0.0.583",
11143
11144
  types: "dist/index.d.ts",
11144
11145
  main: "dist/index.js",
11145
11146
  module: "dist/index.js",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.583",
4
+ "version": "0.0.584",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",