@tscircuit/core 0.0.592 → 0.0.593

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 +21 -10
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -8092,7 +8092,7 @@ function getPresetAutoroutingConfig(autorouterConfig) {
8092
8092
  }
8093
8093
 
8094
8094
  // lib/components/primitive-components/Group/Group_doInitialPcbLayoutPack.ts
8095
- import "@tscircuit/circuit-json-util";
8095
+ import { buildSubtree as buildSubtree2 } from "@tscircuit/circuit-json-util";
8096
8096
  import {
8097
8097
  pack,
8098
8098
  convertCircuitJsonToPackOutput,
@@ -8130,20 +8130,31 @@ var Group_doInitialPcbLayoutPack = (group) => {
8130
8130
  for (const packedComponent of packOutput.components) {
8131
8131
  const { center, componentId, ccwRotationOffset } = packedComponent;
8132
8132
  const pcbComponent = db.pcb_component.get(componentId);
8133
- if (!pcbComponent) continue;
8134
- const originalCenter = pcbComponent.center;
8133
+ if (pcbComponent) {
8134
+ const originalCenter2 = pcbComponent.center;
8135
+ const transformMatrix2 = compose4(
8136
+ group._computePcbGlobalTransformBeforeLayout(),
8137
+ translate6(center.x, center.y),
8138
+ rotate2(ccwRotationOffset || 0),
8139
+ translate6(-originalCenter2.x, -originalCenter2.y)
8140
+ );
8141
+ const related = db.toArray().filter(
8142
+ (elm) => "pcb_component_id" in elm && elm.pcb_component_id === componentId
8143
+ );
8144
+ transformPCBElements2(related, transformMatrix2);
8145
+ continue;
8146
+ }
8147
+ const pcbGroup = db.pcb_group.list().find((g) => g.source_group_id === componentId);
8148
+ if (!pcbGroup) continue;
8149
+ const originalCenter = pcbGroup.center;
8135
8150
  const transformMatrix = compose4(
8136
8151
  group._computePcbGlobalTransformBeforeLayout(),
8137
8152
  translate6(center.x, center.y),
8138
8153
  rotate2(ccwRotationOffset || 0),
8139
8154
  translate6(-originalCenter.x, -originalCenter.y)
8140
8155
  );
8141
- transformPCBElements2(
8142
- db.toArray().filter(
8143
- (elm) => "pcb_component_id" in elm && elm.pcb_component_id === componentId
8144
- ),
8145
- transformMatrix
8146
- );
8156
+ const subtree = buildSubtree2(db.toArray(), { source_group_id: componentId });
8157
+ transformPCBElements2(subtree, transformMatrix);
8147
8158
  }
8148
8159
  };
8149
8160
 
@@ -11212,7 +11223,7 @@ import { identity as identity5 } from "transformation-matrix";
11212
11223
  var package_default = {
11213
11224
  name: "@tscircuit/core",
11214
11225
  type: "module",
11215
- version: "0.0.591",
11226
+ version: "0.0.592",
11216
11227
  types: "dist/index.d.ts",
11217
11228
  main: "dist/index.js",
11218
11229
  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.592",
4
+ "version": "0.0.593",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",