@tscircuit/capacity-autorouter 0.0.156 → 0.0.158
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 +254 -166
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import * as graphics_debug from 'graphics-debug';
|
|
2
2
|
import { GraphicsObject, Rect, Circle, Line, Point as Point$3 } from 'graphics-debug';
|
|
3
|
-
import { Polygon } from '@tscircuit/math-utils';
|
|
4
3
|
import { ConnectivityMap } from 'circuit-json-to-connectivity-map';
|
|
4
|
+
import { RectDiffSolver } from '@tscircuit/rectdiff';
|
|
5
|
+
import { Polygon } from '@tscircuit/math-utils';
|
|
5
6
|
|
|
6
7
|
type TraceId = string;
|
|
7
8
|
type NetId = string;
|
|
@@ -93,12 +94,16 @@ interface CapacityMeshNode {
|
|
|
93
94
|
_targetConnectionName?: string;
|
|
94
95
|
_strawNode?: boolean;
|
|
95
96
|
_strawParentCapacityMeshNodeId?: CapacityMeshNodeId;
|
|
97
|
+
_isVirtualOffboard?: boolean;
|
|
98
|
+
_offboardNetName?: string;
|
|
96
99
|
_adjacentNodeIds?: CapacityMeshNodeId[];
|
|
97
100
|
_parent?: CapacityMeshNode;
|
|
98
101
|
}
|
|
99
102
|
interface CapacityMeshEdge {
|
|
100
103
|
capacityMeshEdgeId: string;
|
|
101
104
|
nodeIds: [CapacityMeshNodeId, CapacityMeshNodeId];
|
|
105
|
+
isOffboardEdge?: boolean;
|
|
106
|
+
offboardNetName?: string;
|
|
102
107
|
}
|
|
103
108
|
|
|
104
109
|
type CapacityPathId = string;
|
|
@@ -106,6 +111,10 @@ interface CapacityPath {
|
|
|
106
111
|
capacityPathId: CapacityPathId;
|
|
107
112
|
connectionName: string;
|
|
108
113
|
nodeIds: CapacityMeshNodeId[];
|
|
114
|
+
/** True if this path was created by splitting at an offboard edge */
|
|
115
|
+
isFragmentedPath?: boolean;
|
|
116
|
+
/** MST pair connection name before fragmentation */
|
|
117
|
+
mstPairConnectionName?: string;
|
|
109
118
|
}
|
|
110
119
|
|
|
111
120
|
declare class BaseSolver {
|
|
@@ -157,168 +166,6 @@ declare class CapacityMeshEdgeSolver extends BaseSolver {
|
|
|
157
166
|
visualize(): GraphicsObject;
|
|
158
167
|
}
|
|
159
168
|
|
|
160
|
-
/**
|
|
161
|
-
* ObstacleTree wraps different spatial index implementations:
|
|
162
|
-
* - 'native': original spatial-hash grid
|
|
163
|
-
* - 'rbush': dynamic R-tree via rbush
|
|
164
|
-
* - 'flatbush': static index via flatbush
|
|
165
|
-
*/
|
|
166
|
-
declare class ObstacleSpatialHashIndex {
|
|
167
|
-
private idx;
|
|
168
|
-
private storage;
|
|
169
|
-
constructor(implementation?: "native" | "rbush" | "flatbush", obstacles?: Obstacle[]);
|
|
170
|
-
insert(o: Obstacle): void;
|
|
171
|
-
search(bbox: {
|
|
172
|
-
minX: number;
|
|
173
|
-
minY: number;
|
|
174
|
-
maxX: number;
|
|
175
|
-
maxY: number;
|
|
176
|
-
}): Obstacle[];
|
|
177
|
-
searchArea(centerX: number, centerY: number, width: number, height: number): Obstacle[];
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
interface Target$1 {
|
|
181
|
-
x: number;
|
|
182
|
-
y: number;
|
|
183
|
-
bounds: {
|
|
184
|
-
minX: number;
|
|
185
|
-
minY: number;
|
|
186
|
-
maxX: number;
|
|
187
|
-
maxY: number;
|
|
188
|
-
};
|
|
189
|
-
connectionName: string;
|
|
190
|
-
availableZ: number[];
|
|
191
|
-
}
|
|
192
|
-
type BucketCoordinate = `${number}x${number}`;
|
|
193
|
-
declare class TargetTree {
|
|
194
|
-
targets: Target$1[];
|
|
195
|
-
buckets: Map<BucketCoordinate, [Target$1, number][]>;
|
|
196
|
-
CELL_SIZE: number;
|
|
197
|
-
constructor(targets: Target$1[]);
|
|
198
|
-
getBucketKey(x: number, y: number): BucketCoordinate;
|
|
199
|
-
getTargetsInArea(centerX: number, centerY: number, width: number, height: number): Target$1[];
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
interface CapacityMeshNodeSolverOptions$2 {
|
|
203
|
-
capacityDepth?: number;
|
|
204
|
-
}
|
|
205
|
-
interface Target {
|
|
206
|
-
x: number;
|
|
207
|
-
y: number;
|
|
208
|
-
bounds: {
|
|
209
|
-
minX: number;
|
|
210
|
-
minY: number;
|
|
211
|
-
maxX: number;
|
|
212
|
-
maxY: number;
|
|
213
|
-
};
|
|
214
|
-
connectionName: string;
|
|
215
|
-
availableZ: number[];
|
|
216
|
-
}
|
|
217
|
-
declare class CapacityMeshNodeSolver extends BaseSolver {
|
|
218
|
-
srj: SimpleRouteJson;
|
|
219
|
-
opts: CapacityMeshNodeSolverOptions$2;
|
|
220
|
-
unfinishedNodes: CapacityMeshNode[];
|
|
221
|
-
finishedNodes: CapacityMeshNode[];
|
|
222
|
-
nodeToXYOverlappingObstaclesMap: Map<CapacityMeshNodeId, Obstacle[]>;
|
|
223
|
-
layerCount: number;
|
|
224
|
-
protected outlinePolygon?: Polygon;
|
|
225
|
-
MAX_DEPTH: number;
|
|
226
|
-
targets: Target[];
|
|
227
|
-
targetTree: TargetTree;
|
|
228
|
-
obstacleTree: ObstacleSpatialHashIndex;
|
|
229
|
-
constructor(srj: SimpleRouteJson, opts?: CapacityMeshNodeSolverOptions$2);
|
|
230
|
-
computeTargets(): Target[];
|
|
231
|
-
protected getNodeBounds(node: CapacityMeshNode): {
|
|
232
|
-
minX: number;
|
|
233
|
-
maxX: number;
|
|
234
|
-
minY: number;
|
|
235
|
-
maxY: number;
|
|
236
|
-
};
|
|
237
|
-
protected getNodeRect(node: CapacityMeshNode): {
|
|
238
|
-
center: {
|
|
239
|
-
x: number;
|
|
240
|
-
y: number;
|
|
241
|
-
};
|
|
242
|
-
width: number;
|
|
243
|
-
height: number;
|
|
244
|
-
};
|
|
245
|
-
_nextNodeCounter: number;
|
|
246
|
-
getNextNodeId(): string;
|
|
247
|
-
getCapacityFromDepth(depth: number): number;
|
|
248
|
-
getTargetIfNodeContainsTarget(node: CapacityMeshNode): Target | null;
|
|
249
|
-
getXYOverlappingObstacles(node: CapacityMeshNode): Obstacle[];
|
|
250
|
-
getXYZOverlappingObstacles(node: CapacityMeshNode): Obstacle[];
|
|
251
|
-
/**
|
|
252
|
-
* Checks if the given mesh node overlaps with any obstacle.
|
|
253
|
-
* We treat both obstacles and nodes as axis‐aligned rectangles.
|
|
254
|
-
*/
|
|
255
|
-
doesNodeOverlapObstacle(node: CapacityMeshNode): boolean;
|
|
256
|
-
/**
|
|
257
|
-
* Checks if the entire node is contained within any obstacle.
|
|
258
|
-
*/
|
|
259
|
-
isNodeCompletelyInsideObstacle(node: CapacityMeshNode): boolean;
|
|
260
|
-
getChildNodes(parent: CapacityMeshNode): CapacityMeshNode[];
|
|
261
|
-
shouldNodeBeXYSubdivided(node: CapacityMeshNode): boolean;
|
|
262
|
-
_step(): void;
|
|
263
|
-
/**
|
|
264
|
-
* Creates a GraphicsObject to visualize the mesh, its nodes, obstacles, and connection points.
|
|
265
|
-
*
|
|
266
|
-
* - Mesh nodes are rendered as rectangles.
|
|
267
|
-
* - Nodes that have an obstacle intersection are outlined in red.
|
|
268
|
-
* - Other nodes are outlined in green.
|
|
269
|
-
* - Lines are drawn from a node to its parent.
|
|
270
|
-
* - Obstacles are drawn as semi-transparent red rectangles.
|
|
271
|
-
* - Points for each connection’s pointsToConnect are drawn in a unique color.
|
|
272
|
-
*/
|
|
273
|
-
visualize(): GraphicsObject;
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
interface CapacityMeshNodeSolverOptions$1 {
|
|
277
|
-
capacityDepth?: number;
|
|
278
|
-
}
|
|
279
|
-
declare class CapacityMeshNodeSolver2_NodeUnderObstacle extends CapacityMeshNodeSolver {
|
|
280
|
-
srj: SimpleRouteJson;
|
|
281
|
-
opts: CapacityMeshNodeSolverOptions$1;
|
|
282
|
-
VIA_DIAMETER: number;
|
|
283
|
-
OBSTACLE_MARGIN: number;
|
|
284
|
-
/**
|
|
285
|
-
* The threshold for the percentage of a single-layer node that must be
|
|
286
|
-
* covered by obstacles to be considered "under an obstacle"
|
|
287
|
-
*/
|
|
288
|
-
OVERLAP_THRESHOLD_FOR_SINGLE_LAYER_NODES: number;
|
|
289
|
-
constructor(srj: SimpleRouteJson, opts?: CapacityMeshNodeSolverOptions$1);
|
|
290
|
-
isNodeCompletelyOutsideBounds(node: CapacityMeshNode): boolean;
|
|
291
|
-
isNodePartiallyOutsideBounds(node: CapacityMeshNode): boolean;
|
|
292
|
-
/**
|
|
293
|
-
* Calculate the percentage of node area covered by obstacles
|
|
294
|
-
*/
|
|
295
|
-
getObstacleCoveragePercentage(node: CapacityMeshNode): number;
|
|
296
|
-
/**
|
|
297
|
-
* Check if a single-layer node should be filtered due to obstacle coverage
|
|
298
|
-
*/
|
|
299
|
-
shouldFilterSingleLayerNodeForObstacle(node: CapacityMeshNode): boolean;
|
|
300
|
-
/**
|
|
301
|
-
* Check if a node should be filtered due to obstacles.
|
|
302
|
-
* Single-layer nodes: filtered only if >20% covered
|
|
303
|
-
* Multi-layer nodes: filtered if any overlap
|
|
304
|
-
*/
|
|
305
|
-
shouldFilterNodeForObstacle(node: CapacityMeshNode): boolean;
|
|
306
|
-
createChildNodeAtPosition(parent: CapacityMeshNode, opts: {
|
|
307
|
-
center: {
|
|
308
|
-
x: number;
|
|
309
|
-
y: number;
|
|
310
|
-
};
|
|
311
|
-
width: number;
|
|
312
|
-
height: number;
|
|
313
|
-
availableZ: number[];
|
|
314
|
-
_depth?: number;
|
|
315
|
-
}): CapacityMeshNode;
|
|
316
|
-
getZSubdivisionChildNodes(node: CapacityMeshNode): CapacityMeshNode[];
|
|
317
|
-
getChildNodes(parent: CapacityMeshNode): CapacityMeshNode[];
|
|
318
|
-
shouldNodeBeXYSubdivided(node: CapacityMeshNode): boolean;
|
|
319
|
-
_step(): void;
|
|
320
|
-
}
|
|
321
|
-
|
|
322
169
|
interface NodePortSegment {
|
|
323
170
|
capacityMeshNodeId: string;
|
|
324
171
|
nodePortSegmentId?: string;
|
|
@@ -1880,6 +1727,26 @@ declare class DeadEndSolver extends BaseSolver {
|
|
|
1880
1727
|
visualize(): GraphicsObject;
|
|
1881
1728
|
}
|
|
1882
1729
|
|
|
1730
|
+
/**
|
|
1731
|
+
* ObstacleTree wraps different spatial index implementations:
|
|
1732
|
+
* - 'native': original spatial-hash grid
|
|
1733
|
+
* - 'rbush': dynamic R-tree via rbush
|
|
1734
|
+
* - 'flatbush': static index via flatbush
|
|
1735
|
+
*/
|
|
1736
|
+
declare class ObstacleSpatialHashIndex {
|
|
1737
|
+
private idx;
|
|
1738
|
+
private storage;
|
|
1739
|
+
constructor(implementation?: "native" | "rbush" | "flatbush", obstacles?: Obstacle[]);
|
|
1740
|
+
insert(o: Obstacle): void;
|
|
1741
|
+
search(bbox: {
|
|
1742
|
+
minX: number;
|
|
1743
|
+
minY: number;
|
|
1744
|
+
maxX: number;
|
|
1745
|
+
maxY: number;
|
|
1746
|
+
}): Obstacle[];
|
|
1747
|
+
searchArea(centerX: number, centerY: number, width: number, height: number): Obstacle[];
|
|
1748
|
+
}
|
|
1749
|
+
|
|
1883
1750
|
interface Point {
|
|
1884
1751
|
x: number;
|
|
1885
1752
|
y: number;
|
|
@@ -2105,7 +1972,7 @@ declare class AutoroutingPipelineSolver extends BaseSolver {
|
|
|
2105
1972
|
srj: SimpleRouteJson;
|
|
2106
1973
|
opts: CapacityMeshSolverOptions$1;
|
|
2107
1974
|
netToPointPairsSolver?: NetToPointPairsSolver;
|
|
2108
|
-
nodeSolver?:
|
|
1975
|
+
nodeSolver?: RectDiffSolver;
|
|
2109
1976
|
nodeTargetMerger?: CapacityNodeTargetMerger;
|
|
2110
1977
|
edgeSolver?: CapacityMeshEdgeSolver;
|
|
2111
1978
|
initialPathingSolver?: CapacityPathingGreedySolver;
|
|
@@ -2136,7 +2003,7 @@ declare class AutoroutingPipelineSolver extends BaseSolver {
|
|
|
2136
2003
|
capacityNodes: CapacityMeshNode[] | null;
|
|
2137
2004
|
capacityEdges: CapacityMeshEdge[] | null;
|
|
2138
2005
|
cacheProvider: CacheProvider | null;
|
|
2139
|
-
pipelineDef: (PipelineStep$1<typeof NetToPointPairsSolver2_OffBoardConnection> | PipelineStep$1<typeof
|
|
2006
|
+
pipelineDef: (PipelineStep$1<typeof NetToPointPairsSolver2_OffBoardConnection> | PipelineStep$1<typeof RectDiffSolver> | 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> | PipelineStep$1<typeof SameNetViaMergerSolver>)[];
|
|
2140
2007
|
constructor(srj: SimpleRouteJson, opts?: CapacityMeshSolverOptions$1);
|
|
2141
2008
|
currentPipelineStepIndex: number;
|
|
2142
2009
|
_step(): void;
|
|
@@ -2297,6 +2164,148 @@ declare function getGlobalLocalStorageCache(): LocalStorageCache;
|
|
|
2297
2164
|
declare function getGlobalInMemoryCache(): InMemoryCache;
|
|
2298
2165
|
declare function setupGlobalCaches(): void;
|
|
2299
2166
|
|
|
2167
|
+
interface Target$1 {
|
|
2168
|
+
x: number;
|
|
2169
|
+
y: number;
|
|
2170
|
+
bounds: {
|
|
2171
|
+
minX: number;
|
|
2172
|
+
minY: number;
|
|
2173
|
+
maxX: number;
|
|
2174
|
+
maxY: number;
|
|
2175
|
+
};
|
|
2176
|
+
connectionName: string;
|
|
2177
|
+
availableZ: number[];
|
|
2178
|
+
}
|
|
2179
|
+
type BucketCoordinate = `${number}x${number}`;
|
|
2180
|
+
declare class TargetTree {
|
|
2181
|
+
targets: Target$1[];
|
|
2182
|
+
buckets: Map<BucketCoordinate, [Target$1, number][]>;
|
|
2183
|
+
CELL_SIZE: number;
|
|
2184
|
+
constructor(targets: Target$1[]);
|
|
2185
|
+
getBucketKey(x: number, y: number): BucketCoordinate;
|
|
2186
|
+
getTargetsInArea(centerX: number, centerY: number, width: number, height: number): Target$1[];
|
|
2187
|
+
}
|
|
2188
|
+
|
|
2189
|
+
interface CapacityMeshNodeSolverOptions$2 {
|
|
2190
|
+
capacityDepth?: number;
|
|
2191
|
+
}
|
|
2192
|
+
interface Target {
|
|
2193
|
+
x: number;
|
|
2194
|
+
y: number;
|
|
2195
|
+
bounds: {
|
|
2196
|
+
minX: number;
|
|
2197
|
+
minY: number;
|
|
2198
|
+
maxX: number;
|
|
2199
|
+
maxY: number;
|
|
2200
|
+
};
|
|
2201
|
+
connectionName: string;
|
|
2202
|
+
availableZ: number[];
|
|
2203
|
+
}
|
|
2204
|
+
declare class CapacityMeshNodeSolver extends BaseSolver {
|
|
2205
|
+
srj: SimpleRouteJson;
|
|
2206
|
+
opts: CapacityMeshNodeSolverOptions$2;
|
|
2207
|
+
unfinishedNodes: CapacityMeshNode[];
|
|
2208
|
+
finishedNodes: CapacityMeshNode[];
|
|
2209
|
+
nodeToXYOverlappingObstaclesMap: Map<CapacityMeshNodeId, Obstacle[]>;
|
|
2210
|
+
layerCount: number;
|
|
2211
|
+
protected outlinePolygon?: Polygon;
|
|
2212
|
+
MAX_DEPTH: number;
|
|
2213
|
+
targets: Target[];
|
|
2214
|
+
targetTree: TargetTree;
|
|
2215
|
+
obstacleTree: ObstacleSpatialHashIndex;
|
|
2216
|
+
constructor(srj: SimpleRouteJson, opts?: CapacityMeshNodeSolverOptions$2);
|
|
2217
|
+
computeTargets(): Target[];
|
|
2218
|
+
protected getNodeBounds(node: CapacityMeshNode): {
|
|
2219
|
+
minX: number;
|
|
2220
|
+
maxX: number;
|
|
2221
|
+
minY: number;
|
|
2222
|
+
maxY: number;
|
|
2223
|
+
};
|
|
2224
|
+
protected getNodeRect(node: CapacityMeshNode): {
|
|
2225
|
+
center: {
|
|
2226
|
+
x: number;
|
|
2227
|
+
y: number;
|
|
2228
|
+
};
|
|
2229
|
+
width: number;
|
|
2230
|
+
height: number;
|
|
2231
|
+
};
|
|
2232
|
+
_nextNodeCounter: number;
|
|
2233
|
+
getNextNodeId(): string;
|
|
2234
|
+
getCapacityFromDepth(depth: number): number;
|
|
2235
|
+
getTargetIfNodeContainsTarget(node: CapacityMeshNode): Target | null;
|
|
2236
|
+
getXYOverlappingObstacles(node: CapacityMeshNode): Obstacle[];
|
|
2237
|
+
getXYZOverlappingObstacles(node: CapacityMeshNode): Obstacle[];
|
|
2238
|
+
/**
|
|
2239
|
+
* Checks if the given mesh node overlaps with any obstacle.
|
|
2240
|
+
* We treat both obstacles and nodes as axis‐aligned rectangles.
|
|
2241
|
+
*/
|
|
2242
|
+
doesNodeOverlapObstacle(node: CapacityMeshNode): boolean;
|
|
2243
|
+
/**
|
|
2244
|
+
* Checks if the entire node is contained within any obstacle.
|
|
2245
|
+
*/
|
|
2246
|
+
isNodeCompletelyInsideObstacle(node: CapacityMeshNode): boolean;
|
|
2247
|
+
getChildNodes(parent: CapacityMeshNode): CapacityMeshNode[];
|
|
2248
|
+
shouldNodeBeXYSubdivided(node: CapacityMeshNode): boolean;
|
|
2249
|
+
_step(): void;
|
|
2250
|
+
/**
|
|
2251
|
+
* Creates a GraphicsObject to visualize the mesh, its nodes, obstacles, and connection points.
|
|
2252
|
+
*
|
|
2253
|
+
* - Mesh nodes are rendered as rectangles.
|
|
2254
|
+
* - Nodes that have an obstacle intersection are outlined in red.
|
|
2255
|
+
* - Other nodes are outlined in green.
|
|
2256
|
+
* - Lines are drawn from a node to its parent.
|
|
2257
|
+
* - Obstacles are drawn as semi-transparent red rectangles.
|
|
2258
|
+
* - Points for each connection’s pointsToConnect are drawn in a unique color.
|
|
2259
|
+
*/
|
|
2260
|
+
visualize(): GraphicsObject;
|
|
2261
|
+
}
|
|
2262
|
+
|
|
2263
|
+
interface CapacityMeshNodeSolverOptions$1 {
|
|
2264
|
+
capacityDepth?: number;
|
|
2265
|
+
}
|
|
2266
|
+
declare class CapacityMeshNodeSolver2_NodeUnderObstacle extends CapacityMeshNodeSolver {
|
|
2267
|
+
srj: SimpleRouteJson;
|
|
2268
|
+
opts: CapacityMeshNodeSolverOptions$1;
|
|
2269
|
+
VIA_DIAMETER: number;
|
|
2270
|
+
OBSTACLE_MARGIN: number;
|
|
2271
|
+
/**
|
|
2272
|
+
* The threshold for the percentage of a single-layer node that must be
|
|
2273
|
+
* covered by obstacles to be considered "under an obstacle"
|
|
2274
|
+
*/
|
|
2275
|
+
OVERLAP_THRESHOLD_FOR_SINGLE_LAYER_NODES: number;
|
|
2276
|
+
constructor(srj: SimpleRouteJson, opts?: CapacityMeshNodeSolverOptions$1);
|
|
2277
|
+
isNodeCompletelyOutsideBounds(node: CapacityMeshNode): boolean;
|
|
2278
|
+
isNodePartiallyOutsideBounds(node: CapacityMeshNode): boolean;
|
|
2279
|
+
/**
|
|
2280
|
+
* Calculate the percentage of node area covered by obstacles
|
|
2281
|
+
*/
|
|
2282
|
+
getObstacleCoveragePercentage(node: CapacityMeshNode): number;
|
|
2283
|
+
/**
|
|
2284
|
+
* Check if a single-layer node should be filtered due to obstacle coverage
|
|
2285
|
+
*/
|
|
2286
|
+
shouldFilterSingleLayerNodeForObstacle(node: CapacityMeshNode): boolean;
|
|
2287
|
+
/**
|
|
2288
|
+
* Check if a node should be filtered due to obstacles.
|
|
2289
|
+
* Single-layer nodes: filtered only if >20% covered
|
|
2290
|
+
* Multi-layer nodes: filtered if any overlap
|
|
2291
|
+
*/
|
|
2292
|
+
shouldFilterNodeForObstacle(node: CapacityMeshNode): boolean;
|
|
2293
|
+
createChildNodeAtPosition(parent: CapacityMeshNode, opts: {
|
|
2294
|
+
center: {
|
|
2295
|
+
x: number;
|
|
2296
|
+
y: number;
|
|
2297
|
+
};
|
|
2298
|
+
width: number;
|
|
2299
|
+
height: number;
|
|
2300
|
+
availableZ: number[];
|
|
2301
|
+
_depth?: number;
|
|
2302
|
+
}): CapacityMeshNode;
|
|
2303
|
+
getZSubdivisionChildNodes(node: CapacityMeshNode): CapacityMeshNode[];
|
|
2304
|
+
getChildNodes(parent: CapacityMeshNode): CapacityMeshNode[];
|
|
2305
|
+
shouldNodeBeXYSubdivided(node: CapacityMeshNode): boolean;
|
|
2306
|
+
_step(): void;
|
|
2307
|
+
}
|
|
2308
|
+
|
|
2300
2309
|
interface CapacityMeshNodeSolverOptions {
|
|
2301
2310
|
capacityDepth?: number;
|
|
2302
2311
|
}
|
|
@@ -2488,6 +2497,83 @@ declare class HyperAssignableViaCapacityPathingSolver extends HyperParameterSupe
|
|
|
2488
2497
|
generateSolver(hyperParameters: HyperParameterOverrides): AssignableViaCapacityPathingSolver_DirectiveSubOptimal;
|
|
2489
2498
|
}
|
|
2490
2499
|
|
|
2500
|
+
/**
|
|
2501
|
+
* Creates offboard edges between assignable via obstacles that share
|
|
2502
|
+
* the same `offBoardConnectsTo` net name. These obstacles represent off-board
|
|
2503
|
+
* connection points (like edge connectors) that are logically connected
|
|
2504
|
+
* through external wiring.
|
|
2505
|
+
*
|
|
2506
|
+
* The solver finds all capacity nodes with `_assignedViaObstacle.offBoardConnectsTo`,
|
|
2507
|
+
* groups them by net name, and creates zero-cost offboard edges between
|
|
2508
|
+
* matching nodes. This allows the pathing solver to route through these virtual
|
|
2509
|
+
* connections as if the obstacles were directly connected.
|
|
2510
|
+
*/
|
|
2511
|
+
declare class OffboardCapacityNodeSolver extends BaseSolver {
|
|
2512
|
+
capacityNodes: CapacityMeshNode[];
|
|
2513
|
+
capacityEdges: CapacityMeshEdge[];
|
|
2514
|
+
enhancedEdges: CapacityMeshEdge[];
|
|
2515
|
+
private animationState;
|
|
2516
|
+
private assignableNodes;
|
|
2517
|
+
private shownNodes;
|
|
2518
|
+
private pendingEdges;
|
|
2519
|
+
private createdEdges;
|
|
2520
|
+
private nextEdgeId;
|
|
2521
|
+
private nodeMap;
|
|
2522
|
+
constructor(solverParams: {
|
|
2523
|
+
capacityNodes: CapacityMeshNode[];
|
|
2524
|
+
capacityEdges: CapacityMeshEdge[];
|
|
2525
|
+
});
|
|
2526
|
+
private initializeAssignableNodes;
|
|
2527
|
+
private initializePendingEdges;
|
|
2528
|
+
_step(): void;
|
|
2529
|
+
private createOffboardEdge;
|
|
2530
|
+
visualize(): GraphicsObject;
|
|
2531
|
+
getVirtualOffboardNodes(): CapacityMeshNode[];
|
|
2532
|
+
getOffboardEdges(): CapacityMeshEdge[];
|
|
2533
|
+
}
|
|
2534
|
+
|
|
2535
|
+
/**
|
|
2536
|
+
* Splits capacity paths at offboard edges into separate fragments.
|
|
2537
|
+
* When a path crosses an offboard edge (created by OffboardCapacityNodeSolver),
|
|
2538
|
+
* this solver breaks it into independent path segments.
|
|
2539
|
+
*
|
|
2540
|
+
* Each fragment becomes a separate connection with its own `connectionName`
|
|
2541
|
+
* (e.g., `AD_NET_frag_0`, `AD_NET_frag_1`). The solver also creates new
|
|
2542
|
+
* `SimpleRouteConnection` entries with appropriate `pointsToConnect` - the
|
|
2543
|
+
* original pad location plus a synthetic point at the offboard node.
|
|
2544
|
+
*
|
|
2545
|
+
* This enables downstream solvers to route each fragment independently,
|
|
2546
|
+
* treating them as separate traces that terminate at off-board connection points.
|
|
2547
|
+
*/
|
|
2548
|
+
declare class OffboardPathFragmentSolver extends BaseSolver {
|
|
2549
|
+
private inputPaths;
|
|
2550
|
+
private capacityEdges;
|
|
2551
|
+
private originalConnections;
|
|
2552
|
+
fragmentedPaths: CapacityPath[];
|
|
2553
|
+
fragmentedConnections: SimpleRouteConnection[];
|
|
2554
|
+
fragmentedOriginalConnectionNames: Set<string>;
|
|
2555
|
+
private nextFragmentId;
|
|
2556
|
+
private animationState;
|
|
2557
|
+
private currentPath;
|
|
2558
|
+
private currentFragments;
|
|
2559
|
+
private currentFragmentIndex;
|
|
2560
|
+
private nodeMap;
|
|
2561
|
+
constructor({ capacityPaths, capacityEdges, capacityNodes, connections, }: {
|
|
2562
|
+
capacityPaths: CapacityPath[];
|
|
2563
|
+
capacityEdges: CapacityMeshEdge[];
|
|
2564
|
+
capacityNodes: CapacityMeshNode[];
|
|
2565
|
+
connections: SimpleRouteConnection[];
|
|
2566
|
+
});
|
|
2567
|
+
_step(): void;
|
|
2568
|
+
private createFragmentConnections;
|
|
2569
|
+
private splitPath;
|
|
2570
|
+
getFragmentedPaths(): CapacityPath[];
|
|
2571
|
+
getFragmentedConnections(): SimpleRouteConnection[];
|
|
2572
|
+
getFragmentedOriginalConnectionNames(): Set<string>;
|
|
2573
|
+
visualize(): GraphicsObject;
|
|
2574
|
+
private drawPath;
|
|
2575
|
+
}
|
|
2576
|
+
|
|
2491
2577
|
interface CapacityMeshSolverOptions {
|
|
2492
2578
|
capacityDepth?: number;
|
|
2493
2579
|
targetMinCapacity?: number;
|
|
@@ -2519,6 +2605,8 @@ declare class AssignableViaAutoroutingPipelineSolver extends BaseSolver {
|
|
|
2519
2605
|
highDensityStitchSolver?: MultipleHighDensityRouteStitchSolver;
|
|
2520
2606
|
singleLayerNodeMerger?: SingleLayerNodeMergerSolver_OnlyMergeTargets;
|
|
2521
2607
|
mergeAssignableViaNodes?: AssignableViaNodeMergerSolver;
|
|
2608
|
+
offboardCapacityNodeSolver?: OffboardCapacityNodeSolver;
|
|
2609
|
+
offboardPathFragmentSolver?: OffboardPathFragmentSolver;
|
|
2522
2610
|
strawSolver?: StrawSolver;
|
|
2523
2611
|
deadEndSolver?: DeadEndSolver;
|
|
2524
2612
|
uselessViaRemovalSolver1?: UselessViaRemovalSolver;
|
|
@@ -2534,7 +2622,7 @@ declare class AssignableViaAutoroutingPipelineSolver extends BaseSolver {
|
|
|
2534
2622
|
capacityNodes: CapacityMeshNode[] | null;
|
|
2535
2623
|
capacityEdges: CapacityMeshEdge[] | null;
|
|
2536
2624
|
cacheProvider: CacheProvider | null;
|
|
2537
|
-
pipelineDef: (PipelineStep<typeof NetToPointPairsSolver> | PipelineStep<typeof CapacityMeshNodeSolver_OnlyTraverseLayersInAssignableObstacles> | PipelineStep<typeof AssignableViaNodeMergerSolver> | PipelineStep<typeof SingleLayerNodeMergerSolver_OnlyMergeTargets> | PipelineStep<typeof CapacityMeshEdgeSolver2_NodeTreeOptimization> | PipelineStep<typeof DeadEndSolver> | PipelineStep<typeof HyperAssignableViaCapacityPathingSolver> | PipelineStep<typeof CapacityEdgeToPortSegmentSolver> | PipelineStep<typeof CapacitySegmentToPointSolver> | PipelineStep<typeof UnravelMultiSectionSolver> | PipelineStep<typeof HighDensitySolver> | PipelineStep<typeof MultipleHighDensityRouteStitchSolver> | PipelineStep<typeof UselessViaRemovalSolver> | PipelineStep<typeof MultiSimplifiedPathSolver>)[];
|
|
2625
|
+
pipelineDef: (PipelineStep<typeof NetToPointPairsSolver> | PipelineStep<typeof CapacityMeshNodeSolver_OnlyTraverseLayersInAssignableObstacles> | PipelineStep<typeof AssignableViaNodeMergerSolver> | PipelineStep<typeof SingleLayerNodeMergerSolver_OnlyMergeTargets> | PipelineStep<typeof CapacityMeshEdgeSolver2_NodeTreeOptimization> | PipelineStep<typeof OffboardCapacityNodeSolver> | PipelineStep<typeof DeadEndSolver> | PipelineStep<typeof HyperAssignableViaCapacityPathingSolver> | PipelineStep<typeof OffboardPathFragmentSolver> | PipelineStep<typeof CapacityEdgeToPortSegmentSolver> | PipelineStep<typeof CapacitySegmentToPointSolver> | PipelineStep<typeof UnravelMultiSectionSolver> | PipelineStep<typeof HighDensitySolver> | PipelineStep<typeof MultipleHighDensityRouteStitchSolver> | PipelineStep<typeof UselessViaRemovalSolver> | PipelineStep<typeof MultiSimplifiedPathSolver>)[];
|
|
2538
2626
|
constructor(srj: SimpleRouteJson, opts?: CapacityMeshSolverOptions);
|
|
2539
2627
|
currentPipelineStepIndex: number;
|
|
2540
2628
|
_step(): void;
|