@tscircuit/core 0.0.1495 → 0.0.1497

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 -15
  2. package/package.json +2 -1
package/dist/index.js CHANGED
@@ -18783,7 +18783,7 @@ var isDescendantGroup = (db, groupId, ancestorId) => {
18783
18783
  if (!group || !group.parent_source_group_id) return false;
18784
18784
  return isDescendantGroup(db, group.parent_source_group_id, ancestorId);
18785
18785
  };
18786
- var applyPackOutput = (group, packOutput, clusterMap) => {
18786
+ var applyPackOutput = (group, packOutput, clusterMap, initialPackOutput) => {
18787
18787
  const { db } = group.root;
18788
18788
  for (const packedComponent of packOutput.components) {
18789
18789
  const { center, componentId, ccwRotationOffset, ccwRotationDegrees } = packedComponent;
@@ -18858,7 +18858,10 @@ var applyPackOutput = (group, packOutput, clusterMap) => {
18858
18858
  }
18859
18859
  const pcbGroup = db.pcb_group.list().find((g) => g.source_group_id === componentId);
18860
18860
  if (!pcbGroup) continue;
18861
- const originalCenter = pcbGroup.center;
18861
+ const initialPackedComponent = initialPackOutput.components.find(
18862
+ (component) => component.componentId === componentId
18863
+ );
18864
+ const originalCenter = initialPackedComponent?.center ?? pcbGroup.center;
18862
18865
  const rotationDegrees = ccwRotationDegrees ?? ccwRotationOffset ?? 0;
18863
18866
  const transformMatrix = compose6(
18864
18867
  group._computePcbGlobalTransformBeforeLayout(),
@@ -19001,18 +19004,20 @@ var Group_doInitialPcbLayoutPack = (group) => {
19001
19004
  maxY: heightMm / 2
19002
19005
  };
19003
19006
  }
19007
+ const initialPackOutput = convertCircuitJsonToPackOutput(
19008
+ filteredCircuitJson,
19009
+ {
19010
+ source_group_id: group.source_group_id,
19011
+ // shouldAddInnerObstacles: true,
19012
+ chipMarginsMap,
19013
+ staticPcbComponentIds: Array.from(staticPcbComponentIds)
19014
+ }
19015
+ );
19004
19016
  const packInput = {
19005
- ...convertPackOutputToPackInput(
19006
- convertCircuitJsonToPackOutput(filteredCircuitJson, {
19007
- source_group_id: group.source_group_id,
19008
- // shouldAddInnerObstacles: true,
19009
- chipMarginsMap,
19010
- staticPcbComponentIds: Array.from(staticPcbComponentIds)
19011
- })
19012
- ),
19013
- // @ts-expect-error we're missing some pack order strategies
19014
- orderStrategy: packOrderStrategy ?? "largest_to_smallest",
19015
- placementStrategy: packPlacementStrategy ?? "minimum_sum_squared_distance_to_network",
19017
+ ...convertPackOutputToPackInput(initialPackOutput),
19018
+ // @ts-expect-error calculate-packing is missing some supported strategies
19019
+ packOrderStrategy: packOrderStrategy ?? "largest_to_smallest",
19020
+ packPlacementStrategy: packPlacementStrategy ?? "minimum_sum_squared_distance_to_network",
19016
19021
  minGap: gapMm,
19017
19022
  bounds
19018
19023
  };
@@ -19058,7 +19063,7 @@ var Group_doInitialPcbLayoutPack = (group) => {
19058
19063
  graphics.title = `packOutput-${group.name}`;
19059
19064
  global.debugGraphics?.push(graphics);
19060
19065
  }
19061
- applyPackOutput(group, packOutput, clusterMap);
19066
+ applyPackOutput(group, packOutput, clusterMap, initialPackOutput);
19062
19067
  group.root?.emit("packing:end", {
19063
19068
  subcircuit_id: group.subcircuit_id,
19064
19069
  componentDisplayName: group.getString()
@@ -23395,7 +23400,7 @@ function Group_getRoutingPhasePlans(group) {
23395
23400
  var package_default = {
23396
23401
  name: "@tscircuit/core",
23397
23402
  type: "module",
23398
- version: "0.0.1494",
23403
+ version: "0.0.1496",
23399
23404
  types: "dist/index.d.ts",
23400
23405
  main: "dist/index.js",
23401
23406
  module: "dist/index.js",
@@ -23426,6 +23431,7 @@ var package_default = {
23426
23431
  devDependencies: {
23427
23432
  "@biomejs/biome": "^1.8.3",
23428
23433
  "@resvg/resvg-js": "^2.6.2",
23434
+ "@tsci/tscircuit.ti": "github:tscircuit/ti#57e314be4b2b06bc546d4def7453e619604d1157",
23429
23435
  "@tscircuit/alphabet": "0.0.25",
23430
23436
  "@tscircuit/breakout-point-solver": "github:tscircuit/breakout-point-solver#bac9629",
23431
23437
  "@tscircuit/capacity-autorouter": "^0.0.710",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.1495",
4
+ "version": "0.0.1497",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
@@ -32,6 +32,7 @@
32
32
  "devDependencies": {
33
33
  "@biomejs/biome": "^1.8.3",
34
34
  "@resvg/resvg-js": "^2.6.2",
35
+ "@tsci/tscircuit.ti": "github:tscircuit/ti#57e314be4b2b06bc546d4def7453e619604d1157",
35
36
  "@tscircuit/alphabet": "0.0.25",
36
37
  "@tscircuit/breakout-point-solver": "github:tscircuit/breakout-point-solver#bac9629",
37
38
  "@tscircuit/capacity-autorouter": "^0.0.710",