@tscircuit/core 0.0.1997 → 0.0.1999

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 +28 -10
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -54311,6 +54311,16 @@ var expandSrjBoundsToIncludeConnectionPoints = (input) => {
54311
54311
  return expandedBounds;
54312
54312
  };
54313
54313
 
54314
+ // lib/utils/autorouting/get-srj-outline-for-routing-bounds.ts
54315
+ import { Box as Box2 } from "@flatten-js/core";
54316
+ var getSrjOutlineForRoutingBounds = ({ bounds, outline }, routingBounds) => {
54317
+ if (outline) return outline;
54318
+ if (bounds.minX === routingBounds.minX && bounds.maxX === routingBounds.maxX && bounds.minY === routingBounds.minY && bounds.maxY === routingBounds.maxY) {
54319
+ return void 0;
54320
+ }
54321
+ return new Box2(bounds.minX, bounds.minY, bounds.maxX, bounds.maxY).toPoints().map(({ x, y }) => ({ x, y }));
54322
+ };
54323
+
54314
54324
  // lib/utils/autorouting/getBusesForSimpleRouteJson.ts
54315
54325
  var getBusSrjConnectionNamesOrThrow = ({
54316
54326
  srjConnections,
@@ -55023,6 +55033,12 @@ var getSimpleRouteJsonFromCircuitJson = ({
55023
55033
  y: o.center.y + o.height / 2
55024
55034
  }
55025
55035
  ]).concat(board?.outline ?? []);
55036
+ const boardBounds = board && !board.outline ? {
55037
+ minX: board.center.x - board.width / 2,
55038
+ maxX: board.center.x + board.width / 2,
55039
+ minY: board.center.y - board.height / 2,
55040
+ maxY: board.center.y + board.height / 2
55041
+ } : void 0;
55026
55042
  let bounds;
55027
55043
  const useGroupBoundsAsSrjBounds = !!(pcbGroup?.width && pcbGroup.height && subcircuit_id && !subcircuitIsBoard);
55028
55044
  if (useGroupBoundsAsSrjBounds) {
@@ -55032,13 +55048,8 @@ var getSimpleRouteJsonFromCircuitJson = ({
55032
55048
  minY: pcbGroup.center.y - pcbGroup.height / 2,
55033
55049
  maxY: pcbGroup.center.y + pcbGroup.height / 2
55034
55050
  };
55035
- } else if (board && !board.outline) {
55036
- bounds = {
55037
- minX: board.center.x - board.width / 2,
55038
- maxX: board.center.x + board.width / 2,
55039
- minY: board.center.y - board.height / 2,
55040
- maxY: board.center.y + board.height / 2
55041
- };
55051
+ } else if (boardBounds) {
55052
+ bounds = boardBounds;
55042
55053
  } else {
55043
55054
  bounds = {
55044
55055
  minX: Math.min(...allPoints.map((p) => p.x)) - 1,
@@ -55415,7 +55426,13 @@ var getSimpleRouteJsonFromCircuitJson = ({
55415
55426
  minPadEdgeToPadEdgeClearance: resolvedMinPadEdgeToPadEdgeClearance,
55416
55427
  minBoardEdgeClearance: resolvedMinBoardEdgeClearance,
55417
55428
  nominalTraceWidth,
55418
- outline: board?.outline?.map((point6) => ({ ...point6 }))
55429
+ outline: getSrjOutlineForRoutingBounds(
55430
+ {
55431
+ bounds: boardBounds ?? bounds,
55432
+ outline: board?.outline?.map((point6) => ({ ...point6 }))
55433
+ },
55434
+ bounds
55435
+ )
55419
55436
  },
55420
55437
  connMap: sharedConnMap
55421
55438
  };
@@ -64014,7 +64031,7 @@ function Group_getRoutingPhasePlans(group) {
64014
64031
  var package_default = {
64015
64032
  name: "@tscircuit/core",
64016
64033
  type: "module",
64017
- version: "0.0.1996",
64034
+ version: "0.0.1998",
64018
64035
  types: "dist/index.d.ts",
64019
64036
  main: "dist/index.js",
64020
64037
  module: "dist/index.js",
@@ -64071,7 +64088,7 @@ var package_default = {
64071
64088
  "@tscircuit/ngspice-spice-engine": "^0.0.20",
64072
64089
  "@tscircuit/props": "^0.0.666",
64073
64090
  "@tscircuit/schematic-match-adapt": "^0.0.18",
64074
- "@tscircuit/schematic-trace-solver": "^0.0.211",
64091
+ "@tscircuit/schematic-trace-solver": "^0.0.212",
64075
64092
  "@tscircuit/solver-utils": "^0.0.16",
64076
64093
  "@tscircuit/soup-util": "^0.0.41",
64077
64094
  "@tscircuit/via-stitch-solver": "github:tscircuit/via-stitch-solver#64f2ac7781b795bdc0d74ba411988e60767fa653",
@@ -64322,6 +64339,7 @@ function Group_filterSimpleRouteJsonForPhase(simpleRouteJson, phasePlan) {
64322
64339
  return {
64323
64340
  ...simpleRouteJson,
64324
64341
  bounds,
64342
+ outline: getSrjOutlineForRoutingBounds(simpleRouteJson, bounds),
64325
64343
  connections,
64326
64344
  differentialPairs: differentialPairs.length > 0 ? differentialPairs : void 0,
64327
64345
  buses: buses.length > 0 ? buses : void 0
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.1997",
4
+ "version": "0.0.1999",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
@@ -58,7 +58,7 @@
58
58
  "@tscircuit/ngspice-spice-engine": "^0.0.20",
59
59
  "@tscircuit/props": "^0.0.666",
60
60
  "@tscircuit/schematic-match-adapt": "^0.0.18",
61
- "@tscircuit/schematic-trace-solver": "^0.0.211",
61
+ "@tscircuit/schematic-trace-solver": "^0.0.212",
62
62
  "@tscircuit/solver-utils": "^0.0.16",
63
63
  "@tscircuit/soup-util": "^0.0.41",
64
64
  "@tscircuit/via-stitch-solver": "github:tscircuit/via-stitch-solver#64f2ac7781b795bdc0d74ba411988e60767fa653",