@tscircuit/core 0.0.1998 → 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.
- package/dist/index.js +27 -9
- package/package.json +1 -1
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 (
|
|
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:
|
|
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.
|
|
64034
|
+
version: "0.0.1998",
|
|
64018
64035
|
types: "dist/index.d.ts",
|
|
64019
64036
|
main: "dist/index.js",
|
|
64020
64037
|
module: "dist/index.js",
|
|
@@ -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
|