@tscircuit/core 0.0.621 → 0.0.623

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 +18 -7
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -7491,7 +7491,8 @@ var getSimpleRouteJsonFromCircuitJson = ({
7491
7491
  ...db.pcb_smtpad.list(),
7492
7492
  ...db.pcb_plated_hole.list(),
7493
7493
  ...db.pcb_hole.list(),
7494
- ...db.pcb_via.list()
7494
+ ...db.pcb_via.list(),
7495
+ ...db.pcb_cutout.list()
7495
7496
  // getObstaclesFromSoup is old and doesn't support diagonal traces
7496
7497
  // ...db.pcb_trace.list(),
7497
7498
  ].filter(
@@ -7964,7 +7965,7 @@ function rotateDirection(direction, degrees) {
7964
7965
  const newIndex = (currentIndex + steps) % 4;
7965
7966
  return directions[newIndex < 0 ? newIndex + 4 : newIndex];
7966
7967
  }
7967
- function convertTreeToInputProblem(tree, db) {
7968
+ function convertTreeToInputProblem(tree, db, group) {
7968
7969
  const problem = {
7969
7970
  chipMap: {},
7970
7971
  chipPinMap: {},
@@ -7983,15 +7984,24 @@ function convertTreeToInputProblem(tree, db) {
7983
7984
  source_component_id: child.sourceComponent.source_component_id
7984
7985
  });
7985
7986
  if (!schematicComponent) return;
7987
+ const component = group.children.find(
7988
+ (groupChild) => groupChild.source_component_id === child.sourceComponent?.source_component_id
7989
+ );
7990
+ let availableRotations = [0, 90, 180, 270];
7991
+ if (component?._parsedProps?.schOrientation) {
7992
+ availableRotations = [0];
7993
+ }
7994
+ if (component?._parsedProps?.schRotation !== void 0) {
7995
+ availableRotations = [0];
7996
+ }
7986
7997
  problem.chipMap[chipId] = {
7987
7998
  chipId,
7988
7999
  pins: [],
7989
8000
  size: {
7990
8001
  x: schematicComponent.size?.width || 1,
7991
8002
  y: schematicComponent.size?.height || 1
7992
- }
7993
- // TODO determine availableRotations based on the component._parsedProps.schOrientation and component._parsedProps.schRotation (if explicitly defined)
7994
- // availableRotations: [0, 90, 180, 270]
8003
+ },
8004
+ availableRotations
7995
8005
  };
7996
8006
  const ports = db.schematic_port.list({
7997
8007
  schematic_component_id: schematicComponent.schematic_component_id
@@ -8098,8 +8108,9 @@ function Group_doInitialSchematicLayoutMatchPack(group) {
8098
8108
  const tree = getCircuitJsonTree(db.toArray(), {
8099
8109
  source_group_id: group.source_group_id
8100
8110
  });
8111
+ if (tree.childNodes.length <= 1) return;
8101
8112
  debug5("Converting circuit tree to InputProblem...");
8102
- const inputProblem = convertTreeToInputProblem(tree, db);
8113
+ const inputProblem = convertTreeToInputProblem(tree, db, group);
8103
8114
  debug5("InputProblem:", JSON.stringify(inputProblem, null, 2));
8104
8115
  const solver = new LayoutPipelineSolver(inputProblem);
8105
8116
  debug5("Starting LayoutPipelineSolver...");
@@ -12045,7 +12056,7 @@ import { identity as identity5 } from "transformation-matrix";
12045
12056
  var package_default = {
12046
12057
  name: "@tscircuit/core",
12047
12058
  type: "module",
12048
- version: "0.0.620",
12059
+ version: "0.0.622",
12049
12060
  types: "dist/index.d.ts",
12050
12061
  main: "dist/index.js",
12051
12062
  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.621",
4
+ "version": "0.0.623",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",