@tscircuit/capacity-autorouter 0.0.149 → 0.0.151
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.d.ts +71 -11
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -4,6 +4,16 @@ import { Polygon } from '@tscircuit/math-utils';
|
|
|
4
4
|
import { ConnectivityMap } from 'circuit-json-to-connectivity-map';
|
|
5
5
|
|
|
6
6
|
type TraceId = string;
|
|
7
|
+
type NetId = string;
|
|
8
|
+
type PointId = string;
|
|
9
|
+
type OffBoardConnectionId = string;
|
|
10
|
+
type ConnectionPoint = {
|
|
11
|
+
x: number;
|
|
12
|
+
y: number;
|
|
13
|
+
layer: string;
|
|
14
|
+
pointId?: PointId;
|
|
15
|
+
pcb_port_id?: string;
|
|
16
|
+
};
|
|
7
17
|
interface SimpleRouteJson {
|
|
8
18
|
layerCount: number;
|
|
9
19
|
minTraceWidth: number;
|
|
@@ -32,22 +42,18 @@ interface Obstacle {
|
|
|
32
42
|
};
|
|
33
43
|
width: number;
|
|
34
44
|
height: number;
|
|
35
|
-
connectedTo: TraceId
|
|
45
|
+
connectedTo: Array<TraceId | NetId>;
|
|
36
46
|
netIsAssignable?: boolean;
|
|
37
|
-
offBoardConnectsTo?:
|
|
47
|
+
offBoardConnectsTo?: Array<OffBoardConnectionId>;
|
|
38
48
|
}
|
|
39
49
|
interface SimpleRouteConnection {
|
|
40
50
|
name: string;
|
|
51
|
+
isOffBoard?: boolean;
|
|
41
52
|
netConnectionName?: string;
|
|
42
53
|
nominalTraceWidth?: number;
|
|
43
|
-
pointsToConnect:
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
layer: string;
|
|
47
|
-
pointId?: string;
|
|
48
|
-
pcb_port_id?: string;
|
|
49
|
-
}>;
|
|
50
|
-
externallyConnectedPointIds?: string[][];
|
|
54
|
+
pointsToConnect: ConnectionPoint[];
|
|
55
|
+
/** @deprecated DO NOT USE **/
|
|
56
|
+
externallyConnectedPointIds?: PointId[][];
|
|
51
57
|
}
|
|
52
58
|
interface SimplifiedPcbTrace {
|
|
53
59
|
type: "pcb_trace";
|
|
@@ -1984,6 +1990,60 @@ declare class UselessViaRemovalSolver extends BaseSolver {
|
|
|
1984
1990
|
visualize(): GraphicsObject;
|
|
1985
1991
|
}
|
|
1986
1992
|
|
|
1993
|
+
/**
|
|
1994
|
+
* A Disjoint Set Union (DSU) or Union-Find data structure.
|
|
1995
|
+
* It tracks a collection of disjoint sets and can efficiently merge them.
|
|
1996
|
+
*/
|
|
1997
|
+
declare class DSU {
|
|
1998
|
+
private parent;
|
|
1999
|
+
/**
|
|
2000
|
+
* Creates a new DSU instance.
|
|
2001
|
+
* Each ID is initially in its own set.
|
|
2002
|
+
*/
|
|
2003
|
+
constructor(ids: string[]);
|
|
2004
|
+
/**
|
|
2005
|
+
* Finds the representative of the set containing the given ID.
|
|
2006
|
+
* Uses path compression.
|
|
2007
|
+
*/
|
|
2008
|
+
find(id: string): string;
|
|
2009
|
+
/**
|
|
2010
|
+
* Merges the sets containing the two given IDs.
|
|
2011
|
+
*/
|
|
2012
|
+
union(id1: string, id2: string): void;
|
|
2013
|
+
/**
|
|
2014
|
+
* Gets all IDs in the same set as the given ID.
|
|
2015
|
+
*/
|
|
2016
|
+
getGroup(id: string): string[];
|
|
2017
|
+
}
|
|
2018
|
+
|
|
2019
|
+
/**
|
|
2020
|
+
* Extends the base NetToPointPairsSolver with an optimization that utilizes
|
|
2021
|
+
* off-board connections to find shorter routing paths.
|
|
2022
|
+
*
|
|
2023
|
+
* This solver preprocesses all connections to identify points that are
|
|
2024
|
+
* electrically connected off-board (via the `isOffBoard` flag). It builds
|
|
2025
|
+
* "equivalence groups" of these points using a Disjoint Set Union (DSU)
|
|
2026
|
+
* data structure.
|
|
2027
|
+
*
|
|
2028
|
+
* When the solver processes an on-board connection or a segment from a
|
|
2029
|
+
* Minimum Spanning Tree (MST), it checks if either of the connection's
|
|
2030
|
+
* endpoints has an off-board equivalent. If so, it calculates the distance
|
|
2031
|
+
* to all possible substitutes and chooses the pair that results in the
|
|
2032
|
+
* shortest path, potentially rerouting the connection to a more optimal
|
|
2033
|
+
* equivalent point.
|
|
2034
|
+
*/
|
|
2035
|
+
declare class NetToPointPairsSolver2_OffBoardConnection extends NetToPointPairsSolver {
|
|
2036
|
+
ogSrj: SimpleRouteJson;
|
|
2037
|
+
colorMap: Record<string, string>;
|
|
2038
|
+
connectionPointDsu: DSU;
|
|
2039
|
+
connectionPointMap: Map<string, ConnectionPoint>;
|
|
2040
|
+
constructor(ogSrj: SimpleRouteJson, colorMap?: Record<string, string>);
|
|
2041
|
+
_findBestConnectionPointsFromDisjointSets(sourcePoint: ConnectionPoint, targetPoint: ConnectionPoint): {
|
|
2042
|
+
pointsToConnect: [ConnectionPoint, ConnectionPoint];
|
|
2043
|
+
};
|
|
2044
|
+
_step(): void;
|
|
2045
|
+
}
|
|
2046
|
+
|
|
1987
2047
|
interface CapacityMeshSolverOptions$1 {
|
|
1988
2048
|
capacityDepth?: number;
|
|
1989
2049
|
targetMinCapacity?: number;
|
|
@@ -2029,7 +2089,7 @@ declare class AutoroutingPipelineSolver extends BaseSolver {
|
|
|
2029
2089
|
capacityNodes: CapacityMeshNode[] | null;
|
|
2030
2090
|
capacityEdges: CapacityMeshEdge[] | null;
|
|
2031
2091
|
cacheProvider: CacheProvider | null;
|
|
2032
|
-
pipelineDef: (PipelineStep$1<typeof
|
|
2092
|
+
pipelineDef: (PipelineStep$1<typeof NetToPointPairsSolver2_OffBoardConnection> | PipelineStep$1<typeof CapacityMeshNodeSolver2_NodeUnderObstacle> | PipelineStep$1<typeof SingleLayerNodeMergerSolver> | PipelineStep$1<typeof StrawSolver> | PipelineStep$1<typeof CapacityMeshEdgeSolver2_NodeTreeOptimization> | PipelineStep$1<typeof DeadEndSolver> | PipelineStep$1<typeof CapacityPathingGreedySolver> | PipelineStep$1<typeof CapacityPathingMultiSectionSolver> | PipelineStep$1<typeof CapacityEdgeToPortSegmentSolver> | PipelineStep$1<typeof CapacitySegmentToPointSolver> | PipelineStep$1<typeof UnravelMultiSectionSolver> | PipelineStep$1<typeof HighDensitySolver> | PipelineStep$1<typeof MultipleHighDensityRouteStitchSolver> | PipelineStep$1<typeof UselessViaRemovalSolver> | PipelineStep$1<typeof MultiSimplifiedPathSolver>)[];
|
|
2033
2093
|
constructor(srj: SimpleRouteJson, opts?: CapacityMeshSolverOptions$1);
|
|
2034
2094
|
currentPipelineStepIndex: number;
|
|
2035
2095
|
_step(): void;
|